WDFREQUEST buffer

How I can modify (resize) the buffer I get in write or read WDFREQUEST through WdfRequestRetrieveInputBuffer?

Rgrds,

You can’t make it bigger nor can you make any changes to the buffer’s size that the caller will see. What you can do is modify the buffer’s starting point and length (decreasing it) with a WDFMEMORY_OFFSET, http://msdn.microsoft.com/en-us/library/windows/hardware/ff548718(v=vs.85).aspx, for async io or using a WDF_MEMORY_DESCRIPTOR for sync io

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Monday, November 28, 2011 11:21 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] WDFREQUEST buffer

How I can modify (resize) the buffer I get in write or read WDFREQUEST through WdfRequestRetrieveInputBuffer?

Rgrds,


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Can I change then the WDFMEMORY I get through WdfRequestRetrieveInputMemory as to build a bigger buffer? BTW, I get the WDFREQUEST object from an upper filter driver, and would like to modify it before it goes to the next driver downstream.

Regrds,

Like I said, you can’t make any changes so that the driver which sent you the request is going to see those changes, the sending driver will only see its buffer. When you send the request downstream, you can replace the WDFMEMORY with your own allocated WDFMEMORY, but growing the caller’s buffer and putting it in your own WDFMEMORY is not possible. Instead of asking vague questions, how about you give the particular problem you are trying to solve in the specific device stack

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Monday, November 28, 2011 11:58 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] WDFREQUEST buffer

Can I change then the WDFMEMORY I get through WdfRequestRetrieveInputMemory as to build a bigger buffer? BTW, I get the WDFREQUEST object from an upper filter driver, and would like to modify it before it goes to the next driver downstream.

Regrds,


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Here is the problem I am trying to solve: for each received WDFREQUEST, I would like to inspect the buffer, and and if smaller than a given size, increase its size to a preset size by appending specific data pattern before sending it downstream.

Ok WDFMEMORY then is probably the way to go, how I can replace the existing WDFMEMORY associated with WDFREQUEST?

OK, what happens when the request is completed back to you with the bigger buffer? Do you need to convey this extra data to the calling driver?

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Monday, November 28, 2011 12:53 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] WDFREQUEST buffer

Here is the problem I am trying to solve: for each received WDFREQUEST, I would like to inspect the buffer, and and if smaller than a given size, increase its size to a preset size by appending specific data pattern before sending it downstream.

Ok WDFMEMORY then is probably the way to go, how I can replace the existing WDFMEMORY associated with WDFREQUEST?


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

No, the driver upstream does not need to know anything about the new bigger buffer

Then all you need to do is allocate a WDFMEMORY with the new expanded size, for a write operation copy the caller’s buffer content into the new buffer, format the request with your WDFMEMORY and adjusted size, and send the request down the stack. For a read operation, you would need to copy back to the caller’s buffer in the completion routine

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Monday, November 28, 2011 4:05 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] WDFREQUEST buffer

No, the driver upstream does not need to know anything about the new bigger buffer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Very clear. Many thanks!