Calling failed when using funciton DeviceIOControl() to send command to a USB device in Win7 OS, GetLastError() return code 87. Code is as below, and this code can running sccessfully in XP OS.
Could anybody explain to me why and how to do in Win7 OS?
BULK_TRANSFER_CONTROL BR;
unsigned long nBytes;
if (hDevice != INVALID_HANDLE_VALUE )
{
BR.pipeNum = 0;
Success = DeviceIoControl (hDevice,
IOCTL_EZUSB_BULK_WRITE,
&BR,
sizeof(BULK_TRANSFER_CONTROL),
buf,
512,
&nBytes,
NULL);
}