Hi all,

I'm having an issue sending bulk transfers to my Cypress FX2-based 
device.  I'm running Windows 7 x64 with the following code:

int main(int argc, char* argv[]) {
     libusb_device_handle *bh;
     unsigned char outBuf[128];
     struct timeval tv;
     struct libusb_transfer* xfr;
     int rc;
     int transferred = 0;

     tv.tv_sec = 0;
     tv.tv_usec = 0;

     libusb_init(NULL);

     bh = libusb_open_device_with_vid_pid(NULL, 0x165f, 0x0054);

     libusb_claim_interface(bh, 0);

     outBuf[0] = 0x70;
     outBuf[1] = 0x00;
     outBuf[2] = 0x42;
     outBuf[3] = 0x06;
     outBuf[4] = 0xFF;
     outBuf[5] = 0xFF;

     libusb_bulk_transfer(bh, 0x02, outBuf, 6, &transferred, 0);

     return 0;
}

Visual studio shows the error happening here (poll_windows.c:112):

static __inline BOOL cancel_io(int _index)
{
      if ((_index < 0) || (_index >= MAX_FDS)) {
          return FALSE;
      }

      if ( (poll_fd[_index].fd < 0) || (poll_fd[_index].handle ==
INVALID_HANDLE_VALUE)
        || (poll_fd[_index].handle == 0) || (poll_fd[_index].overlapped
== NULL) ) {
          return TRUE;
      }
      if (CancelIoEx_Available) {
--------return (*pCancelIoEx)(poll_fd[_index].handle,
poll_fd[_index].overlapped);-------------
      }
      if (_poll_fd[_index].thread_id == GetCurrentThreadId()) {
          return CancelIo(poll_fd[_index].handle);
      }
      usbi_warn(NULL, "Unable to cancel I/O that was started from another
thread");
      return FALSE;
}

"First-chance exception at 0x77daff7e (ntdll.dll) in an2006cli.exe:
0xC0000008: An invalid handle was specified."

I've run through the creation of the handle in the debugger, and it
looks valid.  This issue is present on libusbx 1.0.9, 1.0.10, 1.0.11, and 
1.0.14.

Tom



------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to