none
这是不是WDM或WDF的Bug? RRS feed

  • 常规讨论

  •   最近做windows下的Usb驱动,参考的例子是WDM下的bulkusb 和WDF下的USBSAMP,USB为bulk传输。我的设备通常运行正常,但是有时会出现TimeOut,当驱动返回STATUS_IO_TIMEOUT时,应用程序得不到任何数据,驱动返回的实际长度为0。还有当我人为的减少设备返回的数据大小,使它小于max transfer size,而我的应用程序的缓冲区的大小为max transfer size,这个时候,每一次传输都会超时,但是此时收不到任何数据,返回数据的长度为0?

    my application pragram set the buffer equal to the driver's MAX_TRANSFER_SIZE,and i modify the wdk's usbsamp driver to my camera device.it is run well usually,but when the request timeout,I can not receive any datas,the transfer size is zero. is it the bug of wdk ,when my request timeout,it can not return the actual read size? for example, when my application buffer size is 65536,and the driver MAX_TRANSFER_SIZE is also 65536 ,I mean I send the io request to the driver ,and the driver don't split the size and build the urb and send to the device. my question is ,when the io request timeout ,is it return any dadas? at the same time ,I reduce the size of the device,such as ,let the device's max transfer size less than MAX_TRANSFER_SIZE,and at this time, every time the io request timeout,and can not get any actual size but zero bytes. so my confuse when the URB request is timeout ,why the transfer size is zero, and in my opinion,when timeout,it may be receive some datas ,and the receive data is less than the transfer size. in my driver,it set the urbFlags |= USBD_SHORT_TRANSFER_OK; is there anybody can tell me why ,and give me some advice?
    2010年8月31日 7:48