Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > Read Input Report from HID Device

Reply
Thread Tools Display Modes

Read Input Report from HID Device

 
 
Junior Member
Join Date: Nov 2010
Posts: 2

 
      11-21-2010
I have a small device that enumerates as a standard HID device. I am able to successfully acquired a file handle to the HID device using CreateFile().
However, when I try to read the input report using ReadFile(), I get ERROR_INVALID_USER_BUFFER #1784.
I am wondering if my device descriptor is not exactlly correct and perhaps it can be verified or give me some advice as to what is my problem.
I am not sure also if I should be setting the HID descriptor to BULK or Interrupt and what the SubClass and Protocol values should be. For now I have them set to BULK and zero for the latter settings. Any advice on these would also be helpful.
My PC is running 32Bit Windows XP SP3, and Device Manager successfully enumerates my device as a HID Compliant Device.
Here is my report descriptor.
__align(4) const uint08 ReportDescriptor_POPAddress[16] =
{
0×06, 0×00, 0xFF, //USAGE_PAGE (Generic Deivce)
0×09, 0×01, //USAGE (Vendor Usage)
0xA1, 0×01, //Collection Application
0×09, 0×02, //USAGE (Vendor Usage)
0×75, 0×08, //Report Size (8)
0×95, 0×01, //Report Count (1)
0×81, 0×02, //Input: Data, Variable, Absolute
0xC0 //END_COLLECTION
};
unsigned int numBytes = 0;
unsigned char popdata[32];
popdata[0] = 0;
if (!ReadFile(file, &popdata, 1, &numBytes, NULL))
{
printf(“Error in ReadFile: %x”, GetLastError());
CloseHandle(file);
return 0;
}
I have also set the number of bytes to read to 2 but the ReadFile() never returns.
Any help would be much appreciated.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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
Windbg trouble debugging - target Win7 pro AMD64 Clay Windows Vista Drivers 0 06-29-2010 10:15 PM
No network drive mapping after joining Active Directory ? Patrick Active Directory 29 05-05-2010 12:21 PM
Going Golfing but not with Vista markbyrn Windows Vista Games 15 03-08-2007 10:59 AM
Cannot reuse old Device name in WMDC (Final) mlai ActiveSync 3 03-06-2007 08:15 AM
ActiveSync 4.1 Still does not work... ckelsoe ActiveSync 9 01-06-2006 03:15 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59