I am developing a driver with WDF ,and found a strange issue
WDF :
specify the driver buffer method = BUFFER_IO.
In default queue ,dispatch a read callback function : EvtIoRead.
EvtIoRead(IN WDFQUEUE Queue,IN WDFREQUEST Request,IN size_t Length)
{
WdfRequestGetParameters(Request,¶ms);
ntStatus = WdfRequestRetrieveOutputBuffer(Request,Length,&iobuffer,&ulLength);
}
Notice that the Length = 1,and in the params ,the read length = 1 too, that
means that application want to read 1 byte data.
But when I call the WdfRequestRetrieveOutputBuffer , It return ntStatus = STATUS_BUFFER_TOO_SMALL and iobuffer = 0,ulLength = 0.
How could that happened ? some body read 1 byte data with a NULL output buffer?
Microsoft provide a driver doing the same thing . and I wrote a upper filter to intercept the IRP :
[22] Read Length : 0x1, Read Buffer 0x8988DCB8
[22] Passing IPR IRP_MJ_READ IRP: 0x88EE3328
and that is a buffer !
Is WDF and WDM different ? and How can i debug the issue like this ?
Thanks for any advance !