[ros-diffs] [ion] 22767: - Move IoGetBaseFileSystemDeviceObject to device.c and make it check for FO_DIRECT_DEVICE_OPEN, which it wasn't before (and also code it in a less confusing way like the other IoGetXxxDeviceObject APIs) - Mask out the DO_VERIFY_VOLUME flag when mounting a device.

ion at svn.reactos.org ion at svn.reactos.org
Sun Jul 2 08:28:29 CEST 2006


Author: ion
Date: Sun Jul  2 10:28:29 2006
New Revision: 22767

URL: http://svn.reactos.org/svn/reactos?rev=22767&view=rev
Log:
- Move IoGetBaseFileSystemDeviceObject to device.c and make it check for FO_DIRECT_DEVICE_OPEN, which it wasn't before (and also code it in a less confusing way like the other IoGetXxxDeviceObject APIs)
- Mask out the DO_VERIFY_VOLUME flag when mounting a device.

Modified:
    trunk/reactos/ntoskrnl/io/iomgr/device.c
    trunk/reactos/ntoskrnl/io/iomgr/volume.c

Modified: trunk/reactos/ntoskrnl/io/iomgr/device.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/device.c?rev=22767&r1=22766&r2=22767&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/device.c (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/device.c Sun Jul  2 10:28:29 2006
@@ -1164,6 +1164,41 @@
     }
 
     /* Return the DO we found */
+    return DeviceObject;
+}
+
+/*
+ * @implemented
+ */
+PDEVICE_OBJECT
+NTAPI
+IoGetBaseFileSystemDeviceObject(IN PFILE_OBJECT FileObject)
+{
+    PDEVICE_OBJECT DeviceObject;
+
+    /*
+    * If the FILE_OBJECT's VPB is defined,
+    * get the device from it.
+    */
+    if ((FileObject->Vpb) && (FileObject->Vpb->DeviceObject))
+    {
+        /* Use the VPB's Device Object's */
+        DeviceObject = FileObject->Vpb->DeviceObject;
+    }
+    else if (!(FileObject->Flags & FO_DIRECT_DEVICE_OPEN) &&
+             (FileObject->DeviceObject->Vpb) &&
+             (FileObject->DeviceObject->Vpb->DeviceObject))
+    {
+        /* Use the VPB's File System Object */
+        DeviceObject = FileObject->DeviceObject->Vpb->DeviceObject;
+    }
+    else
+    {
+        /* Use the FO's Device Object */
+        DeviceObject = FileObject->DeviceObject;
+    }
+
+    /* Return the device object we found */
     return DeviceObject;
 }
 

Modified: trunk/reactos/ntoskrnl/io/iomgr/volume.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/volume.c?rev=22767&r1=22766&r2=22767&view=diff
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/volume.c (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/volume.c Sun Jul  2 10:28:29 2006
@@ -35,7 +35,8 @@
 NTAPI
 IoInitVpbImplementation(VOID)
 {
-   KeInitializeSpinLock(&IoVpbLock);
+    /* Just initialize the VPB Lock */
+    KeInitializeSpinLock(&IoVpbLock);
 }
 
 VOID
@@ -348,7 +349,8 @@
         /* Initialize the event to wait on */
         KeInitializeEvent(&Event, NotificationEvent, FALSE);
 
-        /* Get the actual device to mount */
+        /* Remove the verify flag and get the actual device to mount */
+        DeviceObject->Flags &= ~DO_VERIFY_VOLUME;
         while (AttachedDeviceObject->AttachedDevice)
         {
             /* Get the next one */
@@ -782,48 +784,6 @@
 /*
  * @implemented
  */
-PDEVICE_OBJECT
-NTAPI
-IoGetBaseFileSystemDeviceObject(IN PFILE_OBJECT FileObject)
-{
-    PDEVICE_OBJECT DeviceObject = NULL;
-    PVPB Vpb = NULL;
-
-    /*
-    * If the FILE_OBJECT's VPB is defined,
-    * get the device from it.
-    */
-    if (NULL != (Vpb = FileObject->Vpb))
-    {
-        if (NULL != (DeviceObject = Vpb->DeviceObject))
-        {
-            /* Vpb->DeviceObject DEFINED! */
-            return DeviceObject;
-        }
-    }
-
-    /*
-    * If that failed, try the VPB
-    * in the FILE_OBJECT's DeviceObject.
-    */
-    DeviceObject = FileObject->DeviceObject;
-    if (NULL == (Vpb = DeviceObject->Vpb))
-    {
-        /* DeviceObject->Vpb UNDEFINED! */
-        return DeviceObject;
-    }
-
-    /*
-    * If that pointer to the VPB is again
-    * undefined, return directly the
-    * device object from the FILE_OBJECT.
-    */
-    return ((NULL == Vpb->DeviceObject) ? DeviceObject : Vpb->DeviceObject);
-}
-
-/*
- * @implemented
- */
 NTSTATUS
 NTAPI
 IoRegisterFsRegistrationChange(IN PDRIVER_OBJECT DriverObject,




More information about the Ros-diffs mailing list