In Windows 2000 with Windows XP System adoption is WINDDK to develop Windows drivers, I also have winddk on hand, but after starting from Windows Vista, the general adoption of Microsoft Windows Driver abbreviation (WDK). This time the project is useful to the USB HID, need to use the HID.lib library file, so download the WDK7.1.0 version, the use of HID.LIB, as well as the purpose of USB HID, is to eliminate the PC-side driver writing, directly using the Windows built-in driver , you only need to understand the mechanism of USB HID communication packets. Eliminates the hassle of installing drivers. Of course the lower machine also need to write a USB HID USB device driver. Simply say the enumeration of USB HID:
One, enumerate USB devices
Enumerate the USB hub-> on this controller by enumerating the USB controller to enumerate the various ports of the HUB and obtain the device information.
Enumerate controllers:
" \\\\.\\hcd%d " , hcnum); = CreateFile (hcname, generic_write, file_share_write, NULL, open_existing, 0 , NULL);
The USB host controller on the computer is named HCD1,HCD2. With the controller name, open it with CreateFile. Use DeviceIoControl to get its driver name and the name of the hub to which it is connected. Open the hub with CreateFile and get the connection information. You can then enumerate the ports of the hub to get connected device information.
Ii. enumeration of HID devices
HID devices are standard human-machine interface specifications defined by Microsoft. such as USB mouse, USB game handle and so on. Instead of finding the GUID for a specific device, use the API Hidd_gethidguid (&guidhid) to get the GUID. There is a GUID through API setupdienumdeviceinterfaces to get a device connection. If such a device is connected through Setupdigetdeviceinterfacedetail, it obtains its device path information. Open it with CreateFile and get its basic property information through Hidd_getattributes. Use DeviceIoControl to get more detailed properties.
Attention:
Copy the following header files from Ntddk\inc devioctl.h usbdi.h usbioctl.h usb100.h hidsdi.h hidusage.h hidpi.h copy Hid.lib from ntddk\libchk\i386, add hid.lib setupapi.lib /* in Project setting */
WDK One:
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=11800
WDK II:
http://www.microsoft.com/download/en/confirmation.aspx?displaylang=en&id=11800
Recommendation: http://www.cnblogs.com/roucheng/p/Chromium.html
Driver development tool Microsoft Windows Driver Kit 7.1.0 Download