Author: cgutman Date: Fri Jun 17 00:57:55 2011 New Revision: 52289
URL: http://svn.reactos.org/svn/reactos?rev=52289&view=rev Log: [NTOSKRNL] - Fix a critical bug in IopDeviceFsIoControl which caused all FSCTL requests sent via NtFsControlFile and ZwFsControlFile to fail
Modified: trunk/reactos/ntoskrnl/io/iomgr/iofunc.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/iofunc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/iofunc.c?... ============================================================================== --- trunk/reactos/ntoskrnl/io/iomgr/iofunc.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/io/iomgr/iofunc.c [iso-8859-1] Fri Jun 17 00:57:55 2011 @@ -370,10 +370,21 @@ 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;