mirror of
https://github.com/winfsp/winfsp.git
synced 2025-04-23 17:03:12 -05:00
sys: FspVolumeTransact: support both METHOD_BUFFERED and METHOD_OUT_DIRECT
This commit is contained in:
parent
678f175713
commit
45a0f97805
@ -510,7 +510,7 @@ NTSTATUS FspVolumeTransact(
|
|||||||
ULONG InputBufferLength = IrpSp->Parameters.FileSystemControl.InputBufferLength;
|
ULONG InputBufferLength = IrpSp->Parameters.FileSystemControl.InputBufferLength;
|
||||||
ULONG OutputBufferLength = IrpSp->Parameters.FileSystemControl.OutputBufferLength;
|
ULONG OutputBufferLength = IrpSp->Parameters.FileSystemControl.OutputBufferLength;
|
||||||
PVOID InputBuffer = Irp->AssociatedIrp.SystemBuffer;
|
PVOID InputBuffer = Irp->AssociatedIrp.SystemBuffer;
|
||||||
PVOID OutputBuffer;
|
PVOID OutputBuffer = 0;
|
||||||
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;
|
||||||
@ -589,30 +589,23 @@ NTSTATUS FspVolumeTransact(
|
|||||||
switch (ControlCode & 3)
|
switch (ControlCode & 3)
|
||||||
{
|
{
|
||||||
case METHOD_OUT_DIRECT:
|
case METHOD_OUT_DIRECT:
|
||||||
if (0 == Irp->MdlAddress)
|
if (0 != Irp->MdlAddress)
|
||||||
{
|
|
||||||
Irp->IoStatus.Information = 0;
|
|
||||||
Result = STATUS_SUCCESS;
|
|
||||||
goto exit;
|
|
||||||
}
|
|
||||||
OutputBuffer = MmGetMdlVirtualAddress(Irp->MdlAddress);
|
OutputBuffer = MmGetMdlVirtualAddress(Irp->MdlAddress);
|
||||||
break;
|
break;
|
||||||
case METHOD_BUFFERED:
|
case METHOD_BUFFERED:
|
||||||
if (0 == OutputBufferLength)
|
if (0 != OutputBufferLength)
|
||||||
{
|
|
||||||
Irp->IoStatus.Information = 0;
|
|
||||||
Result = STATUS_SUCCESS;
|
|
||||||
goto exit;
|
|
||||||
}
|
|
||||||
OutputBuffer = Irp->AssociatedIrp.SystemBuffer;
|
OutputBuffer = Irp->AssociatedIrp.SystemBuffer;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT(0);
|
ASSERT(0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (0 == OutputBuffer)
|
||||||
|
{
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
Result = STATUS_INVALID_PARAMETER;
|
Result = STATUS_SUCCESS;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
ASSERT(0 != OutputBuffer);
|
|
||||||
|
|
||||||
/* wait for an IRP to arrive */
|
/* wait for an IRP to arrive */
|
||||||
KeQuerySystemTime(&Timeout);
|
KeQuerySystemTime(&Timeout);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user