mirror of
https://github.com/reactos/reactos.git
synced 2024-07-31 00:28:56 +00:00
- If the device to be mounted is an attachee, find the base device object
- Reference the device object being mounted. - If the file system being mounted is an atachee, find its base device object too, and increase the IRP Stack for each attached FSD. - Fix IRP parameters with this new information. svn path=/trunk/; revision=22762
This commit is contained in:
parent
e5811a1b35
commit
320000e093
|
@ -284,8 +284,10 @@ IopMountVolume(IN PDEVICE_OBJECT DeviceObject,
|
||||||
PIO_STACK_LOCATION StackPtr;
|
PIO_STACK_LOCATION StackPtr;
|
||||||
PLIST_ENTRY FsList, ListEntry;
|
PLIST_ENTRY FsList, ListEntry;
|
||||||
PDEVICE_OBJECT DevObject;
|
PDEVICE_OBJECT DevObject;
|
||||||
|
PDEVICE_OBJECT AttachedDeviceObject = DeviceObject;
|
||||||
PDEVICE_OBJECT FileSystemDeviceObject;
|
PDEVICE_OBJECT FileSystemDeviceObject;
|
||||||
LIST_ENTRY LocalList;
|
LIST_ENTRY LocalList;
|
||||||
|
ULONG FsStackOverhead;
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
/* Check if the device isn't already locked */
|
/* Check if the device isn't already locked */
|
||||||
|
@ -332,6 +334,16 @@ 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 */
|
||||||
|
while (AttachedDeviceObject->AttachedDevice)
|
||||||
|
{
|
||||||
|
/* Get the next one */
|
||||||
|
AttachedDeviceObject = AttachedDeviceObject->AttachedDevice;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Reference it */
|
||||||
|
ObReferenceObject(AttachedDeviceObject);
|
||||||
|
|
||||||
/* Now loop the fs list until one of the file systems accepts us */
|
/* Now loop the fs list until one of the file systems accepts us */
|
||||||
Status = STATUS_UNSUCCESSFUL;
|
Status = STATUS_UNSUCCESSFUL;
|
||||||
ListEntry = FsList->Flink;
|
ListEntry = FsList->Flink;
|
||||||
|
@ -342,6 +354,20 @@ IopMountVolume(IN PDEVICE_OBJECT DeviceObject,
|
||||||
DEVICE_OBJECT,
|
DEVICE_OBJECT,
|
||||||
Queue.ListEntry);
|
Queue.ListEntry);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If this file system device is attached to some other device,
|
||||||
|
* then we must make sure to increase the stack size for the IRP.
|
||||||
|
* The default is +1, for the FS device itself.
|
||||||
|
*/
|
||||||
|
FsStackOverhead = 1;
|
||||||
|
while (FileSystemDeviceObject->AttachedDevice)
|
||||||
|
{
|
||||||
|
/* Get the next attached device and increase overhead */
|
||||||
|
FileSystemDeviceObject = FileSystemDeviceObject->
|
||||||
|
AttachedDevice;
|
||||||
|
FsStackOverhead++;
|
||||||
|
}
|
||||||
|
|
||||||
/* If we are not allowed to mount this volume as a raw filesystem volume
|
/* If we are not allowed to mount this volume as a raw filesystem volume
|
||||||
then don't try this */
|
then don't try this */
|
||||||
if (!AllowRawMount && RawFsIsRawFileSystemDeviceObject(FileSystemDeviceObject))
|
if (!AllowRawMount && RawFsIsRawFileSystemDeviceObject(FileSystemDeviceObject))
|
||||||
|
@ -354,8 +380,8 @@ IopMountVolume(IN PDEVICE_OBJECT DeviceObject,
|
||||||
KeClearEvent(&Event);
|
KeClearEvent(&Event);
|
||||||
|
|
||||||
/* Allocate the IRP */
|
/* Allocate the IRP */
|
||||||
Irp = IoAllocateIrp(FileSystemDeviceObject->StackSize +
|
Irp = IoAllocateIrp(AttachedDeviceObject->StackSize +
|
||||||
1,
|
FsStackOverhead,
|
||||||
TRUE);
|
TRUE);
|
||||||
if (!Irp)
|
if (!Irp)
|
||||||
{
|
{
|
||||||
|
@ -378,7 +404,7 @@ IopMountVolume(IN PDEVICE_OBJECT DeviceObject,
|
||||||
StackPtr->Flags = AllowRawMount;
|
StackPtr->Flags = AllowRawMount;
|
||||||
StackPtr->Parameters.MountVolume.Vpb = DeviceObject->Vpb;
|
StackPtr->Parameters.MountVolume.Vpb = DeviceObject->Vpb;
|
||||||
StackPtr->Parameters.MountVolume.DeviceObject =
|
StackPtr->Parameters.MountVolume.DeviceObject =
|
||||||
DeviceObject;
|
AttachedDeviceObject;
|
||||||
|
|
||||||
/* Call the driver */
|
/* Call the driver */
|
||||||
Status = IoCallDriver(FileSystemDeviceObject, Irp);
|
Status = IoCallDriver(FileSystemDeviceObject, Irp);
|
||||||
|
|
Loading…
Reference in a new issue