tags:

views:

16

answers:

1

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 through 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).

A: 

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

Jake Oshins

related questions