You are here

IOCTL_ADAPT_SEND_NON_EP0_DIRECT (input) how to tell if the pipe was reset and/or aborted?? | Cypress Semiconductor

IOCTL_ADAPT_SEND_NON_EP0_DIRECT (input) how to tell if the pipe was reset and/or aborted??

Summary: 1 Reply, Latest post by Gayathri on 09 Nov 2011 01:37 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
kechen's picture
2 posts


I have some code to get data from an IN endpoint on the USB

if ( false == ::DeviceIoControl(h, IOCTL_ADAPT_SEND_NON_EP0_DIRECT,
                        pXmitBuf, iXmitBufSize,
                        data, size,
                        &dwReturnBytes, (LPOVERLAPPED)NULL) )


  //throw exception


The problem is for the very last transfer, no data is passed back, and I do not want the DeviceIoControl to capture anything. The above code will block until sometthing is captured, but I want it to abandon the last capture. I could successfully do that with the IOCTL_ADAPT_RESET_PARENT_PORT. However, that will NOT result in an excpetion being through, as no error condition is reported.

I tried using IOCTL_ADAPT_ABORT_PIPE to force the above code to throw an exception, however, that does not seems to work. Here is how I implmented the abort function

if (false == ::DeviceIoControl(h, IOCTL_ADAPT_ABORT_PIPE,
                        &Address, sizeof(UCHAR),
                        NULL, 0,
                        &dwBytes, NULL))
                        throw std::exception("LowCyUsbDriver::Reset() - Input pipe IO request cannot be aborted.");

Is there another function I can use to force the IOCTL_ADAPT_SEND_NON_EP0_DIRECT to report an error state?


I really need it to report an error state so I know it has returned from the last capture and nothing should be done about the data that was captured.


Thank you!

gaya's picture
Cypress Employee
578 posts



Marshal.GetLastWin32Error() returns the error code returned by the last unmanaged function that was called. Please have a look at and also the variuos System error codes at:

Please check and let us know whether this proves useful.




Log in to post new comments.