Reading HID Report Descriptors

Dear Team,

I am in a process of reading HID report descriptors from a custom device using functions of SetupAPI.lib

The call to CreateFile always returns error because the Windows default mouse driver opens the device in exclusive mode.

Is there a possibility to mention anywhere in the device side descriptors by which Windows loads only defalut HID driver but not default Mouse driver.

I tried changing the protocol field which is 1 for keyboard and 2 for mouse. Irrespective of my changes in the HID descriptor, mouse driver gets loaded along with HID.

Regards.

You need to change the usage of the device so that it is no longer a mouse. Once you do that, the OS will not treat it as a mouse and you won’t get pointer movement/button clicks for it with in box drivers.

Is all you want to do is retrieve descriptors? Or do you want to read reports from the device? if all you want is descriptors w/out report data, do NOT ask for read access when calling CreateFile and it should work.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Friday, October 26, 2007 4:27 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Reading HID Report Descriptors

Dear Team,

I am in a process of reading HID report descriptors from a custom device using functions of SetupAPI.lib

The call to CreateFile always returns error because the Windows default mouse driver opens the device in exclusive mode.

Is there a possibility to mention anywhere in the device side descriptors by which Windows loads only defalut HID driver but not default Mouse driver.

I tried changing the protocol field which is 1 for keyboard and 2 for mouse. Irrespective of my changes in the HID descriptor, mouse driver gets loaded along with HID.

Regards.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thanks for the pointer. I need to read the report data but not descriptors.

Along with HID descriptor I modified the report descriptor in the device which enabled Windows to identify it as only HID but not specific mouse.

Now the createfile call returns success. But one thing I notices was when I attach any HID device, there will be two entries in the HID class of Device Manager. Is this a common behavior or something different at my side.

I observed the above point not only to my custom device, but also with standard mouse, keyboard devices.

Regards.

Yes, this is expected. Change device manager to show devices by connection and it will become clear why there can be multiple HID entries for each physical HID

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Friday, October 26, 2007 12:20 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Reading HID Report Descriptors

Thanks for the pointer. I need to read the report data but not descriptors.

Along with HID descriptor I modified the report descriptor in the device which enabled Windows to identify it as only HID but not specific mouse.

Now the createfile call returns success. But one thing I notices was when I attach any HID device, there will be two entries in the HID class of Device Manager. Is this a common behavior or something different at my side.

I observed the above point not only to my custom device, but also with standard mouse, keyboard devices.

Regards.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer