none
Calling function DeviceIOControl() fail in Win7(64bit) OS RRS feed

  • 问题

  • 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);
        }

    2013年9月4日 8:17