mirror of
https://github.com/reactos/reactos.git
synced 2024-09-15 15:19:37 +00:00
- 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. svn path=/trunk/; revision=22767
This commit is contained in:
parent
130980ccde
commit
fcb77c4c3d
|
@ -1167,6 +1167,41 @@ IoGetRelatedDeviceObject(IN PFILE_OBJECT FileObject)
|
||||||
return DeviceObject;
|
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
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -35,7 +35,8 @@ INIT_FUNCTION
|
||||||
NTAPI
|
NTAPI
|
||||||
IoInitVpbImplementation(VOID)
|
IoInitVpbImplementation(VOID)
|
||||||
{
|
{
|
||||||
KeInitializeSpinLock(&IoVpbLock);
|
/* Just initialize the VPB Lock */
|
||||||
|
KeInitializeSpinLock(&IoVpbLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
@ -348,7 +349,8 @@ IopMountVolume(IN PDEVICE_OBJECT DeviceObject,
|
||||||
/* Initialize the event to wait on */
|
/* Initialize the event to wait on */
|
||||||
KeInitializeEvent(&Event, NotificationEvent, FALSE);
|
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)
|
while (AttachedDeviceObject->AttachedDevice)
|
||||||
{
|
{
|
||||||
/* Get the next one */
|
/* Get the next one */
|
||||||
|
@ -779,48 +781,6 @@ IoUnregisterFileSystem(IN PDEVICE_OBJECT DeviceObject)
|
||||||
KeLeaveCriticalRegion();
|
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
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue