Well, if you need raw data from a device, you can find it in the list of USB devices and literally read from it like a file.
Start by getting all the devices:
HDEVINFO hDevInfo = SetupDiGetClassDevs( &HIDWatch::GUID_DEVINTERFACE_HID, 0, 0, DIGCF_DEVICEINTERFACE );
List everything until you find what you are looking for:
SetupDiEnumInterfaceDevice( hDevInfo, NULL, &HIDWatch::GUID_DEVINTERFACE_HID, index++, &InterfaceInfoData )
Get the device part through SetupDiGetInterfaceDeviceDetail ... then open the file descriptor on the device path via CreateFile using GENERIC_READ access ... run DeviceIoControl to get the product line using IOCTL_HID_GET_PRODUCT_STRING . If this is not your device, close the CloseHandle file. If it belongs to you, sit in a loop (preferably in a stream), making a ReadFile , and you will receive raw records from the device.
That should make you ...
source share