c++ - IOCTL Driver SystemBuffer always NULL -
i have simple struct pass driver. here struct:
typedef struct readstruct { ... } readstruct, *prreadstruct;
here usermode application:
dword dwreturn; readstruct reader{ ... }; writefile(hdriver, (lpcvoid)&reader, sizeof(readstruct), &dwreturn, null);
here driver code, returns null readstruct. doing wrong?
pio_stack_location piostackirp = null; prreadstruct readstruct; piostackirp = iogetcurrentirpstacklocation(irp); dbgprintex(0, 0, "writebufferedio\n"); if (piostackirp) { readstruct = (prreadstruct)irp->associatedirp.systembuffer; if (readstruct) { // place never if (readstruct->readsize) { readmemoutputclient(readstruct); } } }
do_buffered_io flag should set in driverentry in deviceobject->flags.
thanks user @rbmm pointing out.
Comments
Post a Comment