Drive Letters

Hai All,

Is there any function or mechanism to get a driver letter that is
associated with the device object that is hooked by filter dirver.
I want to get the drive letter after I hook to a drive as given in
sfilter.

Any information is helpful,
thanx,
Kedar.

Hi,
I also bother on this problem, but I can not find sofisticated answer.
Its more easy to use DeviceObject pointer instead of use Symbolic names.
There is a functions GetLogicalDriveStrings(DWORD, LPTSTR) and
GetLogicalDrives(), but they are not very appropriate for your case.
Anyway, if you are looking only for valid dos device names, you can
probably obtain list of available drives and then invoke
IoGetDeviceObjectPointer() for each of them and compare to the current
one.
There must be another (undocumented) way to do this, but I don’t know it.
Look how behaves “!object \Device” in WinDebug! It is pretty good (in
Microsoft style :))

There is not support in the kernel for getting DOS drive letters.

The reason for this is that dos drive letters are a “user mode” concept
and can actually be different from one user to the next on the same
machine (especially with terminal server).

If you want to report a drive letter to a user, I recommend you send the
NT Device name (or GUID device name) to a user mode component that runs
in the session of the user you want. You can then use
GetVolumeNameForVolumeMountPoint() and GetVolumePathNamesForVolumeName()
to get the DOS drive letter.

If you want it just for debug purposes, get used to the NT device names.

Neal Christiansen
Microsoft File System Filter Group

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

-----Original Message-----
From: xxxxx@hotmail.com [mailto:xxxxx@hotmail.com]
Sent: Friday, July 12, 2002 04:54 AM
To: File Systems Developers
Subject: [ntfsd] Drive Letters

Hai All,

Is there any function or mechanism to get a driver letter that is
associated with the device object that is hooked by filter dirver.
I want to get the drive letter after I hook to a drive as given in
sfilter.

Any information is helpful,
thanx,
Kedar.


You are currently subscribed to ntfsd as: xxxxx@Windows.Microsoft.com
To unsubscribe send a blank email to %%email.unsub%%

I was a little harsh with my last statement so let me clarify something.

There are a couple of kernel model routines that will return a DOS
device name given a device object. They are:

RtlVolumeDeviceToDosName() - Exists in Windows 2000 and later.
IoVolumeDeviceToDosName() - Exists in Windows XP and later (this one is
faster)

You can use these routines, you just need to be aware that users can
redefine drive letters (even for disk drives) and so it is possible that
these will not return what the current user is actually seeing.

Neal Christiansen
Microsoft File System Filter Group

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

-----Original Message-----
From: Neal Christiansen
Sent: Thursday, July 18, 2002 10:10 AM
To: File Systems Developers
Subject: [ntfsd] RE: Drive Letters

There is not support in the kernel for getting DOS drive letters.

The reason for this is that dos drive letters are a “user mode” concept
and can actually be different from one user to the next on the same
machine (especially with terminal server).

If you want to report a drive letter to a user, I recommend you send the
NT Device name (or GUID device name) to a user mode component that runs
in the session of the user you want. You can then use
GetVolumeNameForVolumeMountPoint() and GetVolumePathNamesForVolumeName()
to get the DOS drive letter.

If you want it just for debug purposes, get used to the NT device names.

Neal Christiansen
Microsoft File System Filter Group

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

-----Original Message-----
From: xxxxx@hotmail.com [mailto:xxxxx@hotmail.com]
Sent: Friday, July 12, 2002 04:54 AM
To: File Systems Developers
Subject: [ntfsd] Drive Letters

Hai All,

Is there any function or mechanism to get a driver letter that is
associated with the device object that is hooked by filter dirver.
I want to get the drive letter after I hook to a drive as given in
sfilter.

Any information is helpful,
thanx,
Kedar.


You are currently subscribed to ntfsd as: xxxxx@Windows.Microsoft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@Windows.Microsoft.com
To unsubscribe send a blank email to %%email.unsub%%

Do these routines correctly resolve volumes without drive letters under
a mount point?

Thanks,

  • Dan.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Neal Christiansen
Sent: Thursday, July 18, 2002 2:06 PM
To: File Systems Developers
Subject: [ntfsd] RE: Drive Letters

I was a little harsh with my last statement so let me clarify something.

There are a couple of kernel model routines that will return a DOS
device name given a device object. They are:

RtlVolumeDeviceToDosName() - Exists in Windows 2000 and later.
IoVolumeDeviceToDosName() - Exists in Windows XP and later (this one is
faster)

You can use these routines, you just need to be aware that users can
redefine drive letters (even for disk drives) and so it is possible that
these will not return what the current user is actually seeing.

Neal Christiansen
Microsoft File System Filter Group

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

-----Original Message-----
From: Neal Christiansen
Sent: Thursday, July 18, 2002 10:10 AM
To: File Systems Developers
Subject: [ntfsd] RE: Drive Letters

There is not support in the kernel for getting DOS drive letters.

The reason for this is that dos drive letters are a “user mode” concept
and can actually be different from one user to the next on the same
machine (especially with terminal server).

If you want to report a drive letter to a user, I recommend you send the
NT Device name (or GUID device name) to a user mode component that runs
in the session of the user you want. You can then use
GetVolumeNameForVolumeMountPoint() and GetVolumePathNamesForVolumeName()
to get the DOS drive letter.

If you want it just for debug purposes, get used to the NT device names.

Neal Christiansen
Microsoft File System Filter Group

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

-----Original Message-----
From: xxxxx@hotmail.com [mailto:xxxxx@hotmail.com]
Sent: Friday, July 12, 2002 04:54 AM
To: File Systems Developers
Subject: [ntfsd] Drive Letters

Hai All,

Is there any function or mechanism to get a driver letter that is
associated with the device object that is hooked by filter dirver. I
want to get the drive letter after I hook to a drive as given in
sfilter.

Any information is helpful,
thanx,
Kedar.


You are currently subscribed to ntfsd as: xxxxx@Windows.Microsoft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@Windows.Microsoft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@privtek.com
To unsubscribe send a blank email to %%email.unsub%%

What does correctly mean to you in the context of *VolumeDeviceToDosName?

-----Original Message-----
From: Dan Kyler [mailto:xxxxx@privtek.com]
Sent: Thursday, July 18, 2002 3:20 PM
To: File Systems Developers
Subject: [ntfsd] RE: Drive Letters

Do these routines correctly resolve volumes without drive letters under
a mount point?

Thanks,

  • Dan.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Neal Christiansen
Sent: Thursday, July 18, 2002 2:06 PM
To: File Systems Developers
Subject: [ntfsd] RE: Drive Letters

I was a little harsh with my last statement so let me clarify something.

There are a couple of kernel model routines that will return a DOS
device name given a device object. They are:

RtlVolumeDeviceToDosName() - Exists in Windows 2000 and later.
IoVolumeDeviceToDosName() - Exists in Windows XP and later (this one is
faster)

You can use these routines, you just need to be aware that users can
redefine drive letters (even for disk drives) and so it is possible that
these will not return what the current user is actually seeing.

Neal Christiansen
Microsoft File System Filter Group

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

-----Original Message-----
From: Neal Christiansen
Sent: Thursday, July 18, 2002 10:10 AM
To: File Systems Developers
Subject: [ntfsd] RE: Drive Letters

There is not support in the kernel for getting DOS drive letters.

The reason for this is that dos drive letters are a “user mode” concept
and can actually be different from one user to the next on the same
machine (especially with terminal server).

If you want to report a drive letter to a user, I recommend you send the
NT Device name (or GUID device name) to a user mode component that runs
in the session of the user you want. You can then use
GetVolumeNameForVolumeMountPoint() and GetVolumePathNamesForVolumeName()
to get the DOS drive letter.

If you want it just for debug purposes, get used to the NT device names.

Neal Christiansen
Microsoft File System Filter Group

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

-----Original Message-----
From: xxxxx@hotmail.com [mailto:xxxxx@hotmail.com]
Sent: Friday, July 12, 2002 04:54 AM
To: File Systems Developers
Subject: [ntfsd] Drive Letters

Hai All,

Is there any function or mechanism to get a driver letter that is
associated with the device object that is hooked by filter dirver. I
want to get the drive letter after I hook to a drive as given in
sfilter.

Any information is helpful,
thanx,
Kedar.


You are currently subscribed to ntfsd as: xxxxx@Windows.Microsoft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@Windows.Microsoft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@privtek.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@inin.com
To unsubscribe send a blank email to %%email.unsub%%

It would mean returning some DOS path that is usable from user mode.

For example, returning C:\MountPoint1 instead of failing if the volume
mounted at MountPoint1 has no drive letter.

  • Dan.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Fuller, Rob
Sent: Monday, July 22, 2002 1:20 PM
To: File Systems Developers
Subject: [ntfsd] RE: Drive Letters

What does correctly mean to you in the context of
*VolumeDeviceToDosName?

-----Original Message-----
From: Dan Kyler [mailto:xxxxx@privtek.com]
Sent: Thursday, July 18, 2002 3:20 PM
To: File Systems Developers
Subject: [ntfsd] RE: Drive Letters

Do these routines correctly resolve volumes without drive letters under
a mount point?

Thanks,

  • Dan.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Neal Christiansen
Sent: Thursday, July 18, 2002 2:06 PM
To: File Systems Developers
Subject: [ntfsd] RE: Drive Letters

I was a little harsh with my last statement so let me clarify something.

There are a couple of kernel model routines that will return a DOS
device name given a device object. They are:

RtlVolumeDeviceToDosName() - Exists in Windows 2000 and later.
IoVolumeDeviceToDosName() - Exists in Windows XP and later (this one is
faster)

You can use these routines, you just need to be aware that users can
redefine drive letters (even for disk drives) and so it is possible that
these will not return what the current user is actually seeing.

Neal Christiansen
Microsoft File System Filter Group

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

-----Original Message-----
From: Neal Christiansen
Sent: Thursday, July 18, 2002 10:10 AM
To: File Systems Developers
Subject: [ntfsd] RE: Drive Letters

There is not support in the kernel for getting DOS drive letters.

The reason for this is that dos drive letters are a “user mode” concept
and can actually be different from one user to the next on the same
machine (especially with terminal server).

If you want to report a drive letter to a user, I recommend you send the
NT Device name (or GUID device name) to a user mode component that runs
in the session of the user you want. You can then use
GetVolumeNameForVolumeMountPoint() and GetVolumePathNamesForVolumeName()
to get the DOS drive letter.

If you want it just for debug purposes, get used to the NT device names.

Neal Christiansen
Microsoft File System Filter Group

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

-----Original Message-----
From: xxxxx@hotmail.com [mailto:xxxxx@hotmail.com]
Sent: Friday, July 12, 2002 04:54 AM
To: File Systems Developers
Subject: [ntfsd] Drive Letters

Hai All,

Is there any function or mechanism to get a driver letter that is
associated with the device object that is hooked by filter dirver. I
want to get the drive letter after I hook to a drive as given in
sfilter.

Any information is helpful,
thanx,
Kedar.


You are currently subscribed to ntfsd as: xxxxx@Windows.Microsoft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@Windows.Microsoft.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@privtek.com
To unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@inin.com To
unsubscribe send a blank email to %%email.unsub%%


You are currently subscribed to ntfsd as: xxxxx@privtek.com
To unsubscribe send a blank email to %%email.unsub%%