I need to transfer data from driver to user-mode.
My user-mode application calls DeviceIoControl with input NULL buffer and
valid output buffer.
My DeviceObject->Flags is set to DO_DIRECT_IO.
DeviceIoControl is called with defined control code.
When I define:
#define MY_IOCTL CTL_CODE(0x8000, 0x801, METHOD_OUT_DIRECT, FILE_READ_DATA)
In my dispatch function I dont see output buffer address which is passed
from user-mode.
There is NULL. But output buffer size is visible.
For example:
ioBuffer = pIrp->AssociatedIrp.SystemBuffer IT IS NULL !
outputBufferLength =
pStackLoc->Parameters.DeviceIoControl.OutputBufferLength IT IS OK !
But when I define:
#define MY_IOCTL CTL_CODE(0x8000, 0x801, 0, 0)
It is OK, I see output buffer address and I can to write it.
Why I can not to use first form CTL_CODE ?
Peter
Thanks !
|