[NTOSKRNL]

- Fix a critical bug in IopDeviceFsIoControl which caused all FSCTL requests sent via NtFsControlFile and ZwFsControlFile to fail

svn path=/trunk/; revision=52289
This commit is contained in:
Cameron Gutman 2011-06-17 00:57:55 +00:00
parent 7db0732c32
commit 69f2dd5769

View file

@ -370,11 +370,22 @@ IopDeviceFsIoControl(IN HANDLE DeviceHandle,
StackPtr->MajorFunction = IsDevIoCtl ?
IRP_MJ_DEVICE_CONTROL :
IRP_MJ_FILE_SYSTEM_CONTROL;
StackPtr->MinorFunction = 0;
StackPtr->Control = 0;
StackPtr->Flags = 0;
StackPtr->Parameters.DeviceIoControl.Type3InputBuffer = NULL;
/* Check if this is a FS control request */
if (StackPtr->MajorFunction == IRP_MJ_FILE_SYSTEM_CONTROL)
{
/* It is, so we have to set a minor function */
StackPtr->MinorFunction = (Irp->RequestorMode == KernelMode) ? IRP_MN_KERNEL_CALL : IRP_MN_USER_FS_REQUEST;
}
else
{
/* Minor function doesn't matter for regular device control requests */
StackPtr->MinorFunction = 0;
}
/* Set the IOCTL Data */
StackPtr->Parameters.DeviceIoControl.IoControlCode = IoControlCode;
StackPtr->Parameters.DeviceIoControl.InputBufferLength = InputBufferLength;