IoVolumeDeviceToDosName in IRP_MN_MOUNT_VOLUME

Hello all,

I am using Sfilter on Win-XP.
In its SfFsControlMountVolume routine (i.e. routine for IRP_MJ_FILE_SYSTEM_CONTROL::IRP_MN_MOUNT_VOLUME) I have done the following

//+ Code
// Get the real device object
storageStackDeviceObject = irpSp->Parameters.MountVolume.Vpb->RealDevice;
if ( storageStackDeviceObject )
{
// Get the MS-DOS path for specified device object
IoVolumeDeviceToDosName(storageStackDeviceObject, &DeviceName) ;
}
//- Code

But the call to IoVolumeDeviceToDosName is not returning.

I am clueless. What may be the problem?

…Mani

Mani,

You can not call this API during mount. In fact you can not make any file system calls while processing a mount operation. The IO Manger holds up all IO on the volume until the mount completes. The IO Manager doesn't know that the mounted has completed until the mount IRP returns back to it.

You need to wait until you see the first "create" operation and query at that time.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided "AS IS" with no warranties, and confers no rights


From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Mani
Sent: Tuesday, September 21, 2004 5:17 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] IoVolumeDeviceToDosName in IRP_MN_MOUNT_VOLUME

Hello all,
?
?
I am using Sfilter on Win-XP.
In?its SfFsControlMountVolume routine (i.e. routine for IRP_MJ_FILE_SYSTEM_CONTROL::IRP_MN_MOUNT_VOLUME) I have done the following
?
//+ Code
// Get the real device object
storageStackDeviceObject = irpSp->Parameters.MountVolume.Vpb->RealDevice;
if ( storageStackDeviceObject )
{
??? // Get the MS-DOS path for specified device object
??? IoVolumeDeviceToDosName(storageStackDeviceObject, &DeviceName) ;
}
//- Code
?
?
But the call to IoVolumeDeviceToDosName is not returning.
?
I am clueless. What may be the problem?
?
?
...Mani

Questions? First check the IFS FAQ at The NT Insider:Windows NT Virtual Memory (Part I)

You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ''
To unsubscribe send a blank email to xxxxx@lists.osr.com

Thanks Neal.

Instead of waiting till the first “create” operation, can I query (call
IoVolumeDeviceToDosName) in the Completion Routine of IRP_MN_MOUNT_VOLUME.

Thanks.
…Mani

“Neal Christiansen” wrote in message
news:xxxxx@ntfsd…
Mani,

You can not call this API during mount. In fact you can not make any file
system calls while processing a mount operation. The IO Manger holds up all
IO on the volume until the mount completes. The IO Manager doesn’t know
that the mounted has completed until the mount IRP returns back to it.

You need to wait until you see the first “create” operation and query at
that time.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no rights
________________________________________
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mani
Sent: Tuesday, September 21, 2004 5:17 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] IoVolumeDeviceToDosName in IRP_MN_MOUNT_VOLUME

Hello all,

I am using Sfilter on Win-XP.
In its SfFsControlMountVolume routine (i.e. routine for
IRP_MJ_FILE_SYSTEM_CONTROL::IRP_MN_MOUNT_VOLUME) I have done the following

//+ Code
// Get the real device object
storageStackDeviceObject = irpSp->Parameters.MountVolume.Vpb->RealDevice;
if ( storageStackDeviceObject )
{
// Get the MS-DOS path for specified device object
IoVolumeDeviceToDosName(storageStackDeviceObject, &DeviceName) ;
}
//- Code

But the call to IoVolumeDeviceToDosName is not returning.

I am clueless. What may be the problem?

…Mani

Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

No - your completion routine is still too early. The IO Manager will
not know that the mount has completed until all the mount IRP’s
processing is finished, which includes the execution of all the
completion routines.

Molly Brown
Microsoft Corporation

This posting is provided “AS IS” with no warranties and confers no
rights.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mani
Sent: Tuesday, September 21, 2004 9:28 PM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] IoVolumeDeviceToDosName in IRP_MN_MOUNT_VOLUME

Thanks Neal.

Instead of waiting till the first “create” operation, can I query (call
IoVolumeDeviceToDosName) in the Completion Routine of
IRP_MN_MOUNT_VOLUME.

Thanks.
…Mani

“Neal Christiansen” wrote in message
news:xxxxx@ntfsd…
Mani,

You can not call this API during mount. In fact you can not make any
file system calls while processing a mount operation. The IO Manger
holds up all IO on the volume until the mount completes. The IO Manager
doesn’t know that the mounted has completed until the mount IRP returns
back to it.

You need to wait until you see the first “create” operation and query at
that time.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no
rights ________________________________________
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mani
Sent: Tuesday, September 21, 2004 5:17 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] IoVolumeDeviceToDosName in IRP_MN_MOUNT_VOLUME

Hello all,

I am using Sfilter on Win-XP.
In its SfFsControlMountVolume routine (i.e. routine for
IRP_MJ_FILE_SYSTEM_CONTROL::IRP_MN_MOUNT_VOLUME) I have done the
following

//+ Code
// Get the real device object
storageStackDeviceObject =
irpSp->Parameters.MountVolume.Vpb->RealDevice;
if ( storageStackDeviceObject )
{
// Get the MS-DOS path for specified device object
IoVolumeDeviceToDosName(storageStackDeviceObject, &DeviceName) ; }
//- Code

But the call to IoVolumeDeviceToDosName is not returning.

I am clueless. What may be the problem?

…Mani

Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Thanks.

So, I will have to attach to the mounted device in the completion routine
(as the sfilter demonstrates) and in the first request of IRP_MJ_CREATE to
the filter object I will have to call IoVolumeDeviceToDosName.
Is it right.

My requirement is:
I want to get the drive letter for the newly mounted volume. Can somebody
suggest of alternative design.

PS:
I observed that, with certain Pen Drives (LG), the call to
IoVolumeDeviceToDosName succeeded in
IRP_MN_MOUNT_VOLUME. Why so ?

…Mani

“Molly Brown” wrote in message
news:xxxxx@ntfsd…
No - your completion routine is still too early. The IO Manager will
not know that the mount has completed until all the mount IRP’s
processing is finished, which includes the execution of all the
completion routines.

Molly Brown
Microsoft Corporation

This posting is provided “AS IS” with no warranties and confers no
rights.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mani
Sent: Tuesday, September 21, 2004 9:28 PM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] IoVolumeDeviceToDosName in IRP_MN_MOUNT_VOLUME

Thanks Neal.

Instead of waiting till the first “create” operation, can I query (call
IoVolumeDeviceToDosName) in the Completion Routine of
IRP_MN_MOUNT_VOLUME.

Thanks.
…Mani

“Neal Christiansen” wrote in message
news:xxxxx@ntfsd…
Mani,

You can not call this API during mount. In fact you can not make any
file system calls while processing a mount operation. The IO Manger
holds up all IO on the volume until the mount completes. The IO Manager
doesn’t know that the mounted has completed until the mount IRP returns
back to it.

You need to wait until you see the first “create” operation and query at
that time.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no
rights ________________________________________
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mani
Sent: Tuesday, September 21, 2004 5:17 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] IoVolumeDeviceToDosName in IRP_MN_MOUNT_VOLUME

Hello all,

I am using Sfilter on Win-XP.
In its SfFsControlMountVolume routine (i.e. routine for
IRP_MJ_FILE_SYSTEM_CONTROL::IRP_MN_MOUNT_VOLUME) I have done the
following

//+ Code
// Get the real device object
storageStackDeviceObject =
irpSp->Parameters.MountVolume.Vpb->RealDevice;
if ( storageStackDeviceObject )
{
// Get the MS-DOS path for specified device object
IoVolumeDeviceToDosName(storageStackDeviceObject, &DeviceName) ; }
//- Code

But the call to IoVolumeDeviceToDosName is not returning.

I am clueless. What may be the problem?

…Mani

Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

I am concerned with your comment that you should attach to the mounted
device in the “mount completion routine”. This implies to me that you
have an old version of the IFSKit and thus an old version of sfilter
that you are modeling your code after.

It is technically wrong for sfilter to attach to a volume in the
post-mount callback. This was fixed in the XP and later versions of the
IFSKit. You may want to consider getting a newer version of this code.

I don’t know why the call to IoVolumeDeviceToDosName sometimes works.
Unlucky I guess. It may vary depending on what storage stack device
driver is actually used.

If you don’t want to attach to the volume to get the drive letter you
could queue off a worker thread that calls this API thus allowing the
mount operation to complete. I would recommend that you call
ObReferenceObject on the device object before sending it to the worker
thread and then removing the reference in the worker thread. This will
guarantee it doesn’t disappear before your worker thread can run.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no
rights

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mani
Sent: Wednesday, September 22, 2004 9:09 PM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] IoVolumeDeviceToDosName in IRP_MN_MOUNT_VOLUME

Thanks.

So, I will have to attach to the mounted device in the completion
routine
(as the sfilter demonstrates) and in the first request of IRP_MJ_CREATE
to
the filter object I will have to call IoVolumeDeviceToDosName.
Is it right.

My requirement is:
I want to get the drive letter for the newly mounted volume. Can
somebody
suggest of alternative design.

PS:
I observed that, with certain Pen Drives (LG), the call to
IoVolumeDeviceToDosName succeeded in
IRP_MN_MOUNT_VOLUME. Why so ?

…Mani

“Molly Brown” wrote in message
news:xxxxx@ntfsd…
No - your completion routine is still too early. The IO Manager will
not know that the mount has completed until all the mount IRP’s
processing is finished, which includes the execution of all the
completion routines.

Molly Brown
Microsoft Corporation

This posting is provided “AS IS” with no warranties and confers no
rights.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mani
Sent: Tuesday, September 21, 2004 9:28 PM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] IoVolumeDeviceToDosName in IRP_MN_MOUNT_VOLUME

Thanks Neal.

Instead of waiting till the first “create” operation, can I query (call
IoVolumeDeviceToDosName) in the Completion Routine of
IRP_MN_MOUNT_VOLUME.

Thanks.
…Mani

“Neal Christiansen” wrote in message
news:xxxxx@ntfsd…
Mani,

You can not call this API during mount. In fact you can not make any
file system calls while processing a mount operation. The IO Manger
holds up all IO on the volume until the mount completes. The IO Manager
doesn’t know that the mounted has completed until the mount IRP returns
back to it.

You need to wait until you see the first “create” operation and query at
that time.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no
rights ________________________________________
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mani
Sent: Tuesday, September 21, 2004 5:17 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] IoVolumeDeviceToDosName in IRP_MN_MOUNT_VOLUME

Hello all,

I am using Sfilter on Win-XP.
In its SfFsControlMountVolume routine (i.e. routine for
IRP_MJ_FILE_SYSTEM_CONTROL::IRP_MN_MOUNT_VOLUME) I have done the
following

//+ Code
// Get the real device object
storageStackDeviceObject =
irpSp->Parameters.MountVolume.Vpb->RealDevice;
if ( storageStackDeviceObject )
{
// Get the MS-DOS path for specified device object
IoVolumeDeviceToDosName(storageStackDeviceObject, &DeviceName) ; }
//- Code

But the call to IoVolumeDeviceToDosName is not returning.

I am clueless. What may be the problem?

…Mani

Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com