PC Review


Reply
Thread Tools Rating: Thread Rating: 7 votes, 5.00 average.

HID mini or USB function driver?

 
 
Alexander Grau
Guest
Posts: n/a
 
      18th Feb 2007
Hello,

I have some USB HID devices (presenters/laserpointers with buttons) that
I need to read the buttons in a specific application only (to map the
buttons to specific actions defined in that application).

The problem is that some devices pretend to be an HID keyboard (which is
good to use them without drivers) but not really useful in my special
case ...

| my devices
------------------------------------------------------------
mouse keyboard|laserpointer irpresenter
usage page 0x01 0x01 |0x01 0x0c
usage 0x02 0x06 |0x06 0x01

Windows loads kbdhid.sys for them, exclusively opens them and then I
cannot open the device in user mode (CreateFile) to read any Input
Reports from the user application.

Now I have these ideas:

1) Writing a keyboard class filter driver would not work I think, as I
need to filter out the keystrokes for some specific devices and not all
keyboards in general.

2) Reading the irpresenter (see table) in user mode works works, I think
because it has usage page 0x0c (application specific). If I could change
the usage page from 0x01 (keyboard) to 0x0c in the HID Descriptor for
the other devices, I'm sure kbdhid.sys would not exclusively open the
device. What is the easiest to implement this? Replacing the hidusb.sys
minidriver by a custom one?

3) Writing a USB function driver for a specific device might work. The
disadvantage is that I would have to implement all the HID logic there...


Can someone give some recommendations or even support me with a sample
driver that could help me further?

Thank you!
Alexander



 
Reply With Quote
 
 
 
 
Alexander Grau
Guest
Posts: n/a
 
      19th Feb 2007

I solved my problem with an USB device lower filter:

1. Registered my "usbfilgr.sys" as LowerFilters for the device (Enum/USB).
In "DispatchInternalIOCTL" the driver watches for
URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE and
pDescriptorRequest->DescriptorType == 0x22 (Get Report Descriptor) and
in "InternalIOCTLCompletion" it "fixes" the report descriptor like this
to change usage page to "Application specific" (0x0c):

if ((buf[0] == 0x05) && (buf[1] == 0x01) && (buf[2] == 0x09)
&& ((buf[3] == 0x06) || (buf[3] == 0x02)) ){
KdPrint(("fixing...\n"));
buf[0] = 0x05;
buf[1] = 0x0c;
buf[2] = 0x09;
//buf[3] = 0x01;
}

2. Removed corresponding Collection entries for the device (Enum/HID).
After plugging in the device it is no longer recognized as HID keyboard
or mouse.

3. I can use user space functions (CreateFile, ReadFile) to read
InputReports and thereby read the button values.

The solution might not be the most elegant, but it "corrects" the
problem that my devices did behave like HID keyboards/mices...

Cheers,
Alexander

 
Reply With Quote
 
 
 
 
New Member
Join Date: Oct 2011
Posts: 1
 
      31st Oct 2011
Hello, Alexander
I have the same problem
Can you send yuor source code of filter driver to my e-mail? ((E-Mail Removed))
or more simply explained by

You change descriptor of you device?

thanks in advance
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook should have a mini-mode, like Media Player's mini-mode. =?Utf-8?B?Z2xlbg==?= Microsoft Outlook 1 27th Feb 2006 07:16 PM
Skins for Windows Media Center 10, compact mini-mini =?Utf-8?B?amp2?= Windows XP General 0 8th Dec 2004 05:09 AM
USB 1.0 port - HID mouse recognized, but doesn't function jhd Windows XP Help 0 18th Jan 2004 10:32 PM
USB HID error code 38 Micha Windows XP Hardware 8 22nd Nov 2003 02:15 AM
Malfunctioning USB Scanner and the HID Service Nick Windows XP Help 2 17th Oct 2003 08:38 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:04 AM.