Major refactoring: WIP

This commit is contained in:
Bill Zissimopoulos
2015-12-20 16:32:13 -08:00
parent 801970e971
commit 7e4c875d50

View File

@ -375,7 +375,8 @@ static NTSTATUS FspFsctlTransact(
if (0 != InputBufferLength && if (0 != InputBufferLength &&
FSP_FSCTL_DEFAULT_ALIGN_UP(sizeof(FSP_FSCTL_TRANSACT_RSP)) > InputBufferLength) FSP_FSCTL_DEFAULT_ALIGN_UP(sizeof(FSP_FSCTL_TRANSACT_RSP)) > InputBufferLength)
return STATUS_INVALID_PARAMETER; return STATUS_INVALID_PARAMETER;
if (FSP_FSCTL_TRANSACT_REQ_BUFFER_SIZEMIN > OutputBufferLength) if (0 != OutputBufferLength &&
FSP_FSCTL_TRANSACT_REQ_BUFFER_SIZEMIN > OutputBufferLength)
return STATUS_BUFFER_TOO_SMALL; return STATUS_BUFFER_TOO_SMALL;
NTSTATUS Result; NTSTATUS Result;
@ -438,14 +439,15 @@ static NTSTATUS FspFsctlTransact(
Response = NextResponse; Response = NextResponse;
} }
/* try to get a pointer to the output buffer */ /* were we sent an output buffer? */
MdlBuffer = MmGetSystemAddressForMdlSafe(Irp->MdlAddress, NormalPagePriority); if (0 == Irp->MdlAddress)
if (0 == MdlBuffer)
{ {
Irp->IoStatus.Information = 0; Irp->IoStatus.Information = 0;
Result = STATUS_SUCCESS; Result = STATUS_SUCCESS;
goto exit; goto exit;
} }
MdlBuffer = MmGetMdlVirtualAddress(Irp->MdlAddress);
ASSERT(0 != MdlBuffer);
/* wait for an IRP to arrive */ /* wait for an IRP to arrive */
KeQuerySystemTime(&Timeout); KeQuerySystemTime(&Timeout);