<WdfDmaTransactionInitializeUsingRequest > reutrns "STATUS_INSUFFICIENT_RESOURCES

Happy to post my first thread @osronline :slight_smile:

OS: Win Server 2003 sp2, 4G RAM
Framework: KMDF 1.9

I am developing a driver for a PCI Express device.
My DmaEnabler’s maxim Length is set to 512MB, and I created two dma transactions on this enabler, one for read and one for write. Both dma transaction has a profile of ScatterGather64, since my device supports 64 bit addressing.

And I set the maximum scattergather elements to 64K

But when I use WriteFile to test my driver, and I find everything works fine as long as the size of data I write to my device in WriteFile is smaller than 64MB. Once I give a parameter exceeds 64MB, the function WdfDmaTransactionInitializeUsingRequest returns “STATUS_INSUFFICIENT_RESOURCES”.

More info:
1)The data that I want to write to the device are stored in a data buffer allocated by the C++ “new” function which I can guarantee has succeeded.
2)At this time, only the write dma transaction are used. The read dma transaction is in rest.

So, I guess here the resource refers to the dma bounce buffer.

However, based on my knowledge of windows dma mechanism, dma bounce buffer are only allocated when either of the two conditions are true:

  1. if my device don’t support hardware scatter/gather;
  2. if my device can’t support 64-bit addressing while some of the data buffer has an address beyond 4G.

Neither of the two conditions are true in my driver. So anybody knows where the “STATUS_INSUFFICIENT_RESOURCES” comes from?

Any suggestions are appreciated~~

>write to my device in WriteFile is smaller than 64MB. Once I give a parameter exceeds 64MB

I think you’re hitting the MDL length limit. I have doubts Windows supports DO_DIRECT_IO writes of such a size.

–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com