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;
+}
+
/*
* @implemented
*/
NTAPI
IoInitVpbImplementation(VOID)
{
- KeInitializeSpinLock(&IoVpbLock);
+ /* Just initialize the VPB Lock */
+ KeInitializeSpinLock(&IoVpbLock);
}
VOID
/* 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 */
KeLeaveCriticalRegion();
}
-/*
- * @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
*/