- Slight code cleanup
authorGed Murphy <gedmurphy@reactos.org>
Fri, 8 Jul 2016 13:41:31 +0000 (13:41 +0000)
committerGed Murphy <gedmurphy@reactos.org>
Fri, 8 Jul 2016 13:41:31 +0000 (13:41 +0000)
- Add missing PAGED_CODE (thanks thomas)

svn path=/trunk/; revision=71863

reactos/ntoskrnl/io/iomgr/device.c
reactos/ntoskrnl/io/iomgr/file.c

index 0710c8c..5d7f31e 100644 (file)
@@ -1352,8 +1352,8 @@ IoGetRelatedDeviceObject(IN PFILE_OBJECT FileObject)
                 PFILE_OBJECT_EXTENSION FileObjectExtension;
                 ASSERT(FALSE);
 
-                /* The extension buffer comes directly after the file object */
-                FileObjectExtension = (PFILE_OBJECT_EXTENSION)(FileObject + 1);
+                /* Cast the buffer to something we understand */
+                FileObjectExtension = FileObject->FileObjectExtension;
 
                 /* Check if have a replacement top level device */
                 if (FileObjectExtension->TopDeviceObjectHint)
index 3bb43ff..4344879 100644 (file)
@@ -818,6 +818,7 @@ IopParseDevice(IN PVOID ParseObject,
                 FileObject->Flags |= FO_FILE_OBJECT_HAS_EXTENSION;
 
                 FileObjectExtension = (PFILE_OBJECT_EXTENSION)(FileObject + 1);
+                FileObject->FileObjectExtension = FileObjectExtension;
 
                 /* Add the top level device which we'll send the request to */
                 if (OpenPacket->InternalFlags & IOP_USE_TOP_LEVEL_DEVICE_HINT)
@@ -2669,6 +2670,8 @@ IoCreateFileSpecifyDeviceObjectHint(OUT PHANDLE FileHandle,
 {
     ULONG Flags = 0;
 
+    PAGED_CODE();
+
     /* Check if we were passed a device to send the create request to*/
     if (DeviceObject)
     {