: Re: [ntdev] Problem getting data from a USB device

Tim wrote:

>On Tue, May 23, 2006 at 09:31:31PM -0700, Loris Degioanni wrote:
> I use the following code to read data from my USB device. It works
> apparently any problem on Windows XP and Windows 2003, both 32 and 64
> bit. But on Win2k IoCallDriver() consistently fails with code C000000D
> (STATUS_INVALID_PARAMETER).
> Anyone is able to tell me what’s wrong?
> Thanks a lot,
>
> Loris
>
> ------------------------------------------------------------
>
> //
> // Format the URB
> //
> UsbBuildInterruptOrBulkTransferRequest(myurb,
> sizeof(_URB_BULK_OR_INTERRUPT_TRANSFER),
> pdx->bulk_in,
> mybuffer,
> NULL,
> MAX_PACKET_SIZE,
> USBD_TRANSFER_DIRECTION_IN | USBD_SHORT_TRANSFER_OK,
> NULL);

How big is MAX_PACKET_SIZE?

Yes, Tim is right. I have tried if read/write data length is bigger than
4096, you will always get “STATUS_INVALID_PARAMETER” on Win2K. I don’t
know why. I think it is a limit on Win2K maybe.

Best Regards,

Dengwen