none
WdfRequestRetrieveOutputMemory buffer memory size? RRS feed

  • Question

  • Hi.

    You know, to get a (kernel) buffer memory, DDK provides WdfRequestRetrieve_XXX functions.

    And for WdfRequestRetrieveOutputBuffer function, I can control buffer size like this:

    WdfRequestRetrieveOutputBuffer(Request, uReqSize, &pVA, &uAllocSize);


    But for WdfRequestRetrieveOutputMemory function, there is no (matching) input parameter for buffer size:

    WdfRequestRetrieveOutputMemory(Request, &reqMemory);
    pVA = WdfMemoryGetBuffer(reqMemory, &uAllocSize);

    So, how WdfRequestRetrieveOutputMemory function determine memory size ?

    How can I control memory size of reqMemory ?

    Regards,

    Brian.

    Wednesday, September 25, 2013 3:49 PM

Answers

  • You are getting a memory buffer that is being passed to the driver.  You can't control how much is passed what you can do is determing the allocated size and fail the request if it is not large enough, or complete the request with the size of the data you are returning using WdfRequestCompleteWithInformation.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Wednesday, September 25, 2013 3:56 PM

All replies

  • You are getting a memory buffer that is being passed to the driver.  You can't control how much is passed what you can do is determing the allocated size and fail the request if it is not large enough, or complete the request with the size of the data you are returning using WdfRequestCompleteWithInformation.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Wednesday, September 25, 2013 3:56 PM
  • The uReqSize parameter to WdfRequestRetrieveOutputBuffer is kind of what I think you need. It indicates the minimum size required of the buffer, uAllocSize will tell you how big the buffer actually is (in both cases)

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

    Wednesday, September 25, 2013 5:50 PM