X-Git-Url: http://git.jankratochvil.net/?a=blobdiff_plain;f=ntoskrnl%2Fio%2Fbuildirp.c;h=ff676f9070a184fc5b84d7e6b69127b1a59b4730;hb=refs%2Ftags%2FHEAD-2003050101;hp=f0956900953b0e210c64e4d022134f83efdc8580;hpb=e3ed2d773259cc445c7ff8181ebd934931365328;p=reactos.git diff --git a/ntoskrnl/io/buildirp.c b/ntoskrnl/io/buildirp.c index f095690..ff676f9 100644 --- a/ntoskrnl/io/buildirp.c +++ b/ntoskrnl/io/buildirp.c @@ -260,29 +260,27 @@ IoBuildDeviceIoControlRequest(ULONG IoControlCode, case METHOD_IN_DIRECT: DPRINT("Using METHOD_IN_DIRECT!\n"); - /* build input buffer (control buffer) */ - if (InputBuffer && InputBufferLength) + /* build output buffer (control buffer) */ + if (OutputBuffer && OutputBufferLength) { Irp->AssociatedIrp.SystemBuffer = (PVOID) - ExAllocatePoolWithTag(NonPagedPool,InputBufferLength, + ExAllocatePoolWithTag(NonPagedPool,OutputBufferLength, TAG_SYS_BUF); + if (Irp->AssociatedIrp.SystemBuffer == NULL) { IoFreeIrp(Irp); return(NULL); } - - RtlCopyMemory(Irp->AssociatedIrp.SystemBuffer, - InputBuffer, - InputBufferLength); + Irp->UserBuffer = OutputBuffer; } - /* build output buffer (data transfer buffer) */ - if (OutputBuffer && OutputBufferLength) + /* build input buffer (data transfer buffer) */ + if (InputBuffer && InputBufferLength) { - Irp->MdlAddress = IoAllocateMdl(OutputBuffer, - OutputBufferLength, + Irp->MdlAddress = IoAllocateMdl(InputBuffer, + InputBufferLength, FALSE, FALSE, Irp);