Author: ekohl
Date: Sun Feb 15 23:06:30 2015
New Revision: 66307
URL:
http://svn.reactos.org/svn/reactos?rev=66307&view=rev
Log:
[NTOSKRNL]
NtQueryInformationFile: Implement FileAccessInformation and FileAlignmentInformation cases
according to 'File System Internals' page 485.
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] Sun Feb 15 23:06:30 2015
@@ -1863,6 +1863,9 @@
PVOID NormalContext;
KIRQL OldIrql;
IO_STATUS_BLOCK KernelIosb;
+ BOOLEAN CallDriver = TRUE;
+ PFILE_ACCESS_INFORMATION AccessBuffer;
+ PFILE_ALIGNMENT_INFORMATION AlignmentBuffer;
PAGED_CODE();
IOTRACE(IO_API_DEBUG, "FileHandle: %p\n", FileHandle);
@@ -2043,8 +2046,34 @@
/* Update operation counts */
IopUpdateOperationCount(IopOtherTransfer);
+ /* Fill in file information before calling the driver.
+ See 'File System Internals' page 485.*/
+ if (FileInformationClass == FileAccessInformation)
+ {
+ AccessBuffer = Irp->AssociatedIrp.SystemBuffer;
+ AccessBuffer->AccessFlags = HandleInformation.GrantedAccess;
+ Irp->IoStatus.Information = sizeof(FILE_ACCESS_INFORMATION);
+ CallDriver = FALSE;
+ }
+ else if (FileInformationClass == FileAlignmentInformation)
+ {
+ AlignmentBuffer = Irp->AssociatedIrp.SystemBuffer;
+ AlignmentBuffer->AlignmentRequirement =
DeviceObject->AlignmentRequirement;
+ Irp->IoStatus.Information = sizeof(FILE_ALIGNMENT_INFORMATION);
+ CallDriver = FALSE;
+ }
+
/* Call the Driver */
- Status = IoCallDriver(DeviceObject, Irp);
+ if (CallDriver)
+ {
+ Status = IoCallDriver(DeviceObject, Irp);
+ }
+ else
+ {
+ Status = STATUS_SUCCESS;
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ }
+
if (Status == STATUS_PENDING)
{
/* Check if this was async I/O */