Suggested Link Name and actual drive letter

In my driver, the first time a volume is mounted, the suggested link name is picked up and assigned as the drive letter for the volume. However, if I remount the volume latter, it will pick up the same drive letter regardless of the suggested link name. If I clear the corresponding entries under MountedDevices Key, the new drive letter is assigned, but this feels like a hack. Is there anyway to force the drive letter in kernel mode code?

Why do you want the drive letter for the device to change from mount to mount?

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Tuesday, February 03, 2009 11:13 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Suggested Link Name and actual drive letter

In my driver, the first time a volume is mounted, the suggested link name is picked up and assigned as the drive letter for the volume. However, if I remount the volume latter, it will pick up the same drive letter regardless of the suggested link name. If I clear the corresponding entries under MountedDevices Key, the new drive letter is assigned, but this feels like a hack. Is there anyway to force the drive letter in kernel mode code?


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Some users will get pretty confused if the drive letter is not what they expect.

xxxxx@yahoo.com wrote:

Some users will get pretty confused if the drive letter is not what they expect.

How are they going to know what to expect?

Look, here are the facts. Most users are too dumb to know what a drive
letter is, and they don’t NEED to know. When they plug in a mass
storage device, they see it in Explorer and everything’s hunky dory.
Users that are sophisticated enough to use the drive letter won’t have
any trouble using whatever was assigned this time around.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

OK, I’m confused.

One the one hand, it seems to me that the less than skillful user is the
best argument for why it would be nice to always present the same driver
letter, as it’s just less confusing, and all other things being equal,
it appears in the same place in explorer every time, which I think is
how a lot people identify a device. On the other hand, if I recall
correctly, it sounds like what the op wishes to change the drive letter
from mount to mount, which I can’t think of any reason why someone would
prefer.

I have no idea of whether this is a good way to this or not, but Mount
Manager can provide this sort of service, I believe.

mm

Tim Roberts wrote:

xxxxx@yahoo.com wrote:
> Some users will get pretty confused if the drive letter is not what they expect.

How are they going to know what to expect?

Look, here are the facts. Most users are too dumb to know what a drive
letter is, and they don’t NEED to know. When they plug in a mass
storage device, they see it in Explorer and everything’s hunky dory.
Users that are sophisticated enough to use the drive letter won’t have
any trouble using whatever was assigned this time around.

It seems that you always return the same unique id string for your volume in response to IOCTL_MOUNTDEV_QUERY_UNIQUE_ID request. If you want to trick the mount manager, you need to “associate” a unique id string created by your driver to specific drive letter.

For example, you can generate unique ids in the following format:

{GUID}-X, where X - is the desired mount point.

In that case, when you mount your volume and wish to assign a drive letter Z: to it you need to return
{GUID}-Z in response to IOCTL_MOUNTDEV_QUERY_UNIQUE_ID, and specify Z: in response to suggested link IOCTL.

X, Y use the same computer. X likes to see X: and Y Y:. So I remount and reassign the drive letter.

I’ll try to append the drive letter to the unique name. Thanks.