DeviceIoControl and USB control transfer RRS feed

  • General discussion

  • Hi,

    I am developing a win32 application that calls DeviceIoControl API with SCSI PASS THROUGH DIRECT (Bulk Transport) to read / write data from a USB Mass Storage Device.

    It seems to work fine with my target hardware when amount of data is small. When large amount of data is transferred, the communication hangs.
    When I read the USB mass storage specification (Bulk Only), I came to an understanding that some kind of endpoint halt condition is encountered because of a phase error. Requirement of reset recovery is specified on such event which is possible through default endpoint 0.

    I can't debug the hardware and if observed through a software USB analyzer, SPTI/SPTD shows only Bulk transfers of data and doesnt attempt automatic reset recovery through default endpoint 0.

    If I am to make those control transfers manually, what control codes should I use for DeviceIOControl?

    If not available, or thinking different way, What driver model should I choose? Should it be UMDF as I'm using a win32 application?

    I'm using Visual Studio 2008 on Windows 7 for development.


    Wednesday, November 5, 2014 9:52 AM

All replies

  • you can't control the endpoints from an app, all you have is a storage interface. I would first capture a usb ETW log to see what is happening. If you were to write a driver to reset (a method of last resort) it would have to be a KMDF lower filter driver below usbstor.sys.  VS2008 is not a supported version of VS for driver development. you need VS2012+Win8 WDK or VS2013+win8.1 wdk for driver development. you will need a second machine to test your driver on

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, November 5, 2014 8:14 PM