HELP IRP_MN_MOUNT_VOLUME issues

Hi All,

I need some help with handling IRP_MN_MOUNT_VOLUME.

I hook on \Ntfs and handle all IRP_MJ_FILE_SYSTEM_CONTROL
IRP_MN_MOUNT_VOLUME requests.

I have a function based on FileSpy/Sfilter that does the following.

Create an new device
IoCreateDevice

Save the device object
newDevExt->DiskDeviceObject =
pIrpSp->Parameters.MountVolume.Vpb->RealDevice;

Setup a completion routine and let the irp go through, wait on an event
for the operation to finish.
IoCallDriver

Setup my device extension

vpb = newDevExt->DiskDeviceObject->Vpb;

IoAttachDeviceToDeviceStack( newDeviceObject, vpb->DiskObject );

This works to attach to the volume/disk object but I want to attach to
the filesystem. How can I get the correct device object to attach so I
can see all the file operations that occurs on the filesystem instead of
volume operations???

Thanks A lot,
Jeremy

******************Legal Disclaimer***************************
“This email may contain confidential and privileged material for the
sole use of the intended recipient. Any unauthorized review, use or
distribution by others is strictly prohibited. If you have received
the message in error, please advise the sender by reply email and
delete the message. Thank you.”
****************************************************************

There are two device objects in the Vpb. RealDevice (the device object
for the media) and DeviceObject (the device object for the mounted file
system instance). Use the DeviceObject.

Also, you should use IoAttachDeviceToDeviceStackSafe in order to avoid a
narrow race condition between attachment and calling (which requires
using some additional serialization to avoid otherwise).

Regards,

Tony

Tony Mason

Consulting Partner

OSR Open Systems Resources, Inc.

http://www.osr.com http:</http:>


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jeremy Schwartz
Sent: Wednesday, April 13, 2005 4:06 PM
To: ntfsd redirect
Subject: [ntfsd] HELP IRP_MN_MOUNT_VOLUME issues

Hi All,

I need some help with handling IRP_MN_MOUNT_VOLUME.

I hook on \Ntfs and handle all IRP_MJ_FILE_SYSTEM_CONTROL
IRP_MN_MOUNT_VOLUME requests.

I have a function based on FileSpy/Sfilter that does the following.

Create an new device

IoCreateDevice

Save the device object

newDevExt->DiskDeviceObject =
pIrpSp->Parameters.MountVolume.Vpb->RealDevice;

Setup a completion routine and let the irp go through, wait on an event
for the operation to finish.

IoCallDriver

Setup my device extension

vpb = newDevExt->DiskDeviceObject->Vpb;

IoAttachDeviceToDeviceStack( newDeviceObject, vpb->DiskObject );

This works to attach to the volume/disk object but I want to attach to
the filesystem. How can I get the correct device object to attach so I
can see all the file operations that occurs on the filesystem instead of
volume operations???

Thanks A lot,

Jeremy


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

******************Legal Disclaimer*************************** “This
email may contain confidential and privileged material for the sole use
of the intended recipient. Any unauthorized review, use or distribution
by others is strictly prohibited. If you have received the message in
error, please advise the sender by reply email and delete the message.
Thank you.”
****************************************************************

I will make that both of those changes, thanks a lot!!!

Jeremy

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tony Mason
Sent: Thursday, April 14, 2005 12:56 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] HELP IRP_MN_MOUNT_VOLUME issues

There are two device objects in the Vpb. RealDevice (the device object
for the media) and DeviceObject (the device object for the mounted file
system instance). Use the DeviceObject.

Also, you should use IoAttachDeviceToDeviceStackSafe in order to avoid a
narrow race condition between attachment and calling (which requires
using some additional serialization to avoid otherwise).

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com http:</http:>


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jeremy Schwartz
Sent: Wednesday, April 13, 2005 4:06 PM
To: ntfsd redirect
Subject: [ntfsd] HELP IRP_MN_MOUNT_VOLUME issues

Hi All,

I need some help with handling IRP_MN_MOUNT_VOLUME.

I hook on \Ntfs and handle all IRP_MJ_FILE_SYSTEM_CONTROL
IRP_MN_MOUNT_VOLUME requests.

I have a function based on FileSpy/Sfilter that does the following.

Create an new device
IoCreateDevice

Save the device object
newDevExt->DiskDeviceObject =
pIrpSp->Parameters.MountVolume.Vpb->RealDevice;

Setup a completion routine and let the irp go through, wait on an event
for the operation to finish.
IoCallDriver

Setup my device extension

vpb = newDevExt->DiskDeviceObject->Vpb;

IoAttachDeviceToDeviceStack( newDeviceObject, vpb->DiskObject );

This works to attach to the volume/disk object but I want to attach to
the filesystem. How can I get the correct device object to attach so I
can see all the file operations that occurs on the filesystem instead of
volume operations???

Thanks A lot,
Jeremy


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: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com
******************Legal Disclaimer*************************** “This
email may contain confidential and privileged material for the sole use
of the intended recipient. Any unauthorized review, use or distribution
by others is strictly prohibited. If you have received the message in
error, please advise the sender by reply email and delete the message.
Thank you.”
****************************************************************

******************Legal Disclaimer***************************
“This email may contain confidential and privileged material for the
sole use of the intended recipient. Any unauthorized review, use or
distribution by others is strictly prohibited. If you have received
the message in error, please advise the sender by reply email and
delete the message. Thank you.”
****************************************************************