If you are going to use the Generic Hid, you will have no need for WinUSB or libusb.
I know for a fact that WinUSB will require that you install the device driver on XP (if it is not already there - I have tons on USB stuff on my XP box, and it was not on my box), and although it is a microsoft driver, they seem unwilling to sign it so you will have to either have your user accept "Unsigned Driver" or sign it yourself (at least as best I could figure it).
Also, there are bugs in that document. It did not work and I finally figured out that it was missing a blank [ClassInstall32] section, but it took me quite a while to figure this out. I happened to have the sample device, it was not my own device - after I got the install to work, I left it at that. I did not go any further, as I need to install on XP boxs ( still 90% of all boxes are XP), and did not what to design the msi (at this time) to do this.
I will give you another hint - don't bother looking for winusb.sys, as it is contained in on of the coinstaller dlls and gets spit out during the install. I had supposed "experts" tell me it was right in there in the WDK.
Also, if you do this you will not need anything from the WDK for generic hid:
Code:
// Pointer to functions for exporting//BOOLEAN ( __stdcall *_HidD_FreePreparsedData)( IN PHIDP_PREPARSED_DATA PreparsedData );BOOLEAN (__stdcall* _HidD_GetAttributes) ( IN HANDLE HidDeviceObject, OUT PHIDD_ATTRIBUTES Attributes );void (__stdcall* _HidD_GetHidGuid) ( OUT LPGUID HidGuid );BOOLEAN (__stdcall* _HidD_GetPreparsedData) ( IN HANDLE HidDeviceObject, OUT PHIDP_PREPARSED_DATA * PreparsedData );NTSTATUS (__stdcall* _HidP_GetCaps) ( IN PHIDP_PREPARSED_DATA PreparsedData, OUT PHIDP_CAPS Capabilities );BOOLEAN (__stdcall* _HidD_GetProductString) ( IN HANDLE HidDeviceObject, OUT PVOID Buffer, IN ULONG BufferLength );BOOLEAN (__stdcall* _HidD_GetIndexedString) ( IN HANDLE HidDeviceObject, IN ULONG StringIndex, OUT PVOID Buffer, IN ULONG BufferLength );BOOLEAN (__stdcall* _HidD_GetSerialNumberString) ( IN HANDLE HidDeviceObject, OUT PVOID Buffer, IN ULONG BufferLength );BOOLEAN (__stdcall* _HidD_GetManufacturerString) ( IN HANDLE HidDeviceObject, OUT PVOID Buffer, IN ULONG BufferLength );Then in your initialization code: HMODULE hMod =::LoadLibrary(_T("hid.dll")); // get the functions we need. *((FARPROC*)&_HidD_FreePreparsedData) = ::GetProcAddress(hMod, "HidD_FreePreparsedData"); *((FARPROC*)&_HidD_GetAttributes) = ::GetProcAddress(hMod, "HidD_GetAttributes"); *((FARPROC*)&_HidD_GetHidGuid) = ::GetProcAddress(hMod, "HidD_GetHidGuid"); *((FARPROC*)&_HidD_GetPreparsedData) = ::GetProcAddress(hMod, "HidD_GetPreparsedData"); *((FARPROC*)&_HidP_GetCaps) = ::GetProcAddress(hMod, "HidP_GetCaps"); *((FARPROC*)&_HidD_GetManufacturerString) = ::GetProcAddress(hMod, "HidD_GetManufacturerString"); *((FARPROC*)&_HidD_GetSerialNumberString) = ::GetProcAddress(hMod, "HidD_GetSerialNumberString"); *((FARPROC*)&_HidD_GetProductString) = ::GetProcAddress(hMod, "HidD_GetProductString"); *((FARPROC*)&_HidD_GetIndexedString) = ::GetProcAddress(hMod, "HidD_GetIndexedString");}
To use the function pointers:
_HidD_FreePreparsedData(hpd);