Getting Drive Letter from Device name

I have written file system filter driver based on sfilter.
In the IRP_MN_MOUNT_VOLUME i get the device name in the form of
“\Device\CdRom0”. now i want to get the drive letter for this device. how
do i go about. i tried ZwOpenSymbolicLinkObject and
ZwQuerySymbolicLinkObject. But ZwQuerySymbolicLinkObject fails with error
STATUS_OBJECT_TYPE_MISMATCH. Any help would be appreciated.
Thanks…

Check Out the Device Extention structure in FileSpy!

Rtl/IoVolumeDeviceToDosName on the storage device object.

  • Nick Ryan

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@indiatimes.com
Sent: Monday, June 02, 2003 3:34 AM
To: File Systems Developers
Subject: [ntfsd] Getting Drive Letter from Device name

I have written file system filter driver based on sfilter.
In the IRP_MN_MOUNT_VOLUME i get the device name in the form
of “\Device\CdRom0”. now i want to get the drive letter for
this device. how do i go about. i tried
ZwOpenSymbolicLinkObject and ZwQuerySymbolicLinkObject. But
ZwQuerySymbolicLinkObject fails with error
STATUS_OBJECT_TYPE_MISMATCH. Any help would be appreciated. Thanks…


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

Thanks a lot… it did work … :slight_smile:

Rtl/IoVolumeDeviceToDosName on the storage device object.

  • Nick Ryan

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of
> xxxxx@indiatimes.com
> Sent: Monday, June 02, 2003 3:34 AM
> To: File Systems Developers
> Subject: [ntfsd] Getting Drive Letter from Device name
>
>
> I have written file system filter driver based on sfilter.
> In the IRP_MN_MOUNT_VOLUME i get the device name in the form
> of “\Device\CdRom0”. now i want to get the drive letter for
> this device. how do i go about. i tried
> ZwOpenSymbolicLinkObject and ZwQuerySymbolicLinkObject. But
> ZwQuerySymbolicLinkObject fails with error
> STATUS_OBJECT_TYPE_MISMATCH. Any help would be appreciated. Thanks…
>
> —
> You are currently subscribed to ntfsd as: xxxxx@nryan.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

hi, i used this function in create and it works most of the time. however,
the function seems to hang when i plug in a usb harddisk. when is the safe
time to use this function?

Ampsi

----- Original Message -----
From: “Nick Ryan”
To: “File Systems Developers”
Sent: Tuesday, June 03, 2003 01:40
Subject: [ntfsd] RE: Getting Drive Letter from Device name

Rtl/IoVolumeDeviceToDosName on the storage device object.

- Nick Ryan

> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of
> xxxxx@indiatimes.com
> Sent: Monday, June 02, 2003 3:34 AM
> To: File Systems Developers
> Subject: [ntfsd] Getting Drive Letter from Device name
>
>
> I have written file system filter driver based on sfilter.
> In the IRP_MN_MOUNT_VOLUME i get the device name in the form
> of “\Device\CdRom0”. now i want to get the drive letter for
> this device. how do i go about. i tried
> ZwOpenSymbolicLinkObject and ZwQuerySymbolicLinkObject. But
> ZwQuerySymbolicLinkObject fails with error
> STATUS_OBJECT_TYPE_MISMATCH. Any help would be appreciated. Thanks…
>
> —
> You are currently subscribed to ntfsd as: xxxxx@nryan.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>


You are currently subscribed to ntfsd as: xxxxx@pmail.ntu.edu.sg
To unsubscribe send a blank email to xxxxx@lists.osr.com