Get target device in IRP_MJ_WRITE

Is it possible to get target device in IRP_MJ_WRITE?
I want to know what is target device when is written data to the device in
IRP_MJ_WRITE… C drive or D drive???

I’m waiting your help…

At the driver level, the only thing you can reliably obtain is the volume
GUID “??\Volume{9523f972-8628-11d8-911b-806d6172696f}” or the
non-persistent device name “\Device\HarddiskVolume1”.

There are routines like IoQueryFileDosDeviceName to convert these to a DOS
device name, but that can be tricky and somewhat user-specific. For
instance, dynamic disks pose nasty problems when using non-persistent device
names. Reparse points and symbolic links add additional complexity.

I’d recommend using the volume GUID in the driver – more reliable.

Ken


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Marcus Oh
Sent: Monday, December 18, 2006 2:07 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Get target device in IRP_MJ_WRITE

Is it possible to get target device in IRP_MJ_WRITE?
I want to know what is target device when is written data to the device in
IRP_MJ_WRITE… C drive or D drive???

I’m waiting your help…

— Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17 You are currently subscribed to
ntfsd as: xxxxx@comcast.net To unsubscribe send a blank email to
xxxxx@lists.osr.com

Thanks for your reply…
I’d tried to get the volume GUID by using IoBuildDeviceIoControlRequest & IOCTL_MOUNTDEV_QUERY_UNIQUE_ID.
But, there’s value of 0 in output buffer.
How can I get the volume GUID correctly???

Marcus

I suspect you’re doing it wrong, but can’t tell with the information you
provide.

I use FltGetVolumeGuidName, which is for a mini-filter, which is what you
should be using unless you have a strong reason not to.

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Wednesday, December 20, 2006 9:30 PM
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] Get target device in IRP_MJ_WRITE

Thanks for your reply…
I’d tried to get the volume GUID by using IoBuildDeviceIoControlRequest &
IOCTL_MOUNTDEV_QUERY_UNIQUE_ID.
But, there’s value of 0 in output buffer.
How can I get the volume GUID correctly???

Marcus


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

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