WDF EvtIoDeviceControl buffer lengths
When handling DeviceIoControl requests in a WDF driver what is the correct way to get the size of the input/output buffer.
It seems to be both passed as a parameter:
VOID
EvtIoDeviceControl(IN WDFQUEUE Queue, IN WDFREQUEST Request,
IN size_t OutputBufferLength,
IN size_t InputBufferLength,
IN ULONG IoControlCode)
But also available thro开发者_如何学JAVAugh WdfRequestRetrieveInputBuffer
which is required in order to gain access to the request buffer.
I am therefore wondering if there is a difference between the InputBufferLength
parameter and the value set by WdfRequestRetrieveInputBuffer
(the Length
parameter).
There is no difference between those two. The guy who designed the interface thought it would be convenient to have the parameter in both places. I've never found that to be the case, myself, but it's there in case you do.
Jake Oshins
精彩评论