device name to symbolic link

All:
What’s the best way to get a device’s symbolic link from within a
driver? Example: I have “\device\harddiskvolume1” and I need “C:”. The
point in the code where I need it I have the device object so I have the
device name, … but not the symbolic link. I realize that there
isn’t necessarly a 1-1 relationship between symbolic links and aliases so
that may be an issue. I tried using IoGetDeviceInterfaces but am blue
screening…

Any help is appreciated.

Thanks,

Chuck

Why do you need c:?

-p

-----Original Message-----
From: chuck m [mailto:chuck.monarch@hp.com]
Sent: Monday, March 24, 2003 3:22 PM
To: NT Developers Interest List

All:
What’s the best way to get a device’s symbolic link from within a
driver? Example: I have “\device\harddiskvolume1” and I need “C:”. The
point in the code where I need it I have the device object so I have the
device name, … but not the symbolic link. I realize that there
isn’t necessarly a 1-1 relationship between symbolic links and aliases
so that may be an issue. I tried using IoGetDeviceInterfaces but am blue
screening…

Any help is appreciated.

Thanks,

Chuck


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

Long story and more than you want to know …

Trust me

Thanks,

Chuck

-----Original Message-----
From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
Sent: Monday, March 24, 2003 5:27 PM
To: NT Developers Interest List
Subject: [ntdev] RE: device name to symbolic link

Why do you need c:?

-p

-----Original Message-----
From: chuck m [mailto:chuck.monarch@hp.com]
Sent: Monday, March 24, 2003 3:22 PM
To: NT Developers Interest List

All:
What’s the best way to get a device’s symbolic link from within a
driver? Example: I have “\device\harddiskvolume1” and I need “C:”. The
point in the code where I need it I have the device object so I have the
device name, … but not the symbolic link. I realize that there
isn’t necessarly a 1-1 relationship between symbolic links and aliases
so that may be an issue. I tried using IoGetDeviceInterfaces but am blue
screening…

Any help is appreciated.

Thanks,

Chuck


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


You are currently subscribed to ntdev as: chuck.monarch@hp.com To
unsubscribe send a blank email to xxxxx@lists.osr.com

I always suspected it was more than I wanted (or needed) to know.
However the people here are usually very good at suggesting alternate
solutions to a problem if you let them know what the real problem is.

As for symlinks, there is no information for a given object that tells
you which symbolic links point to it. You’d have to enumerate every
object in the system, check to see if it was a symbolic link and then
see if its target was your object, or a link object which resolved to
your object, or a link object which resolves to a link object which
resolves to your object, etc…

I also get concerned when people start thinking they want drive letters
because it often means they plan to store them away somewhere. This
works only until the administrator changes the drive letters around at
which point your app/tool/driver fails. If the admin is lucky the
driver doesn’t crash the system in the process. Considering that there
are other names avaialble for storage devices which really are
persistent I suggest trying those for storage.

Of course if you’re not storing that information then the suggestion
above is moot. It all comes back to giving the people you’re asking for
help enough information to actually help you

-p

-----Original Message-----
From: Monarch, Chuck [mailto:Chuck.Monarch@hp.com]
Sent: Monday, March 24, 2003 3:40 PM
To: NT Developers Interest List

Long story and more than you want to know …

Trust me

Thanks,

Chuck

-----Original Message-----
From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
Sent: Monday, March 24, 2003 5:27 PM
To: NT Developers Interest List
Subject: [ntdev] RE: device name to symbolic link

Why do you need c:?

-p

-----Original Message-----
From: chuck m [mailto:chuck.monarch@hp.com]
Sent: Monday, March 24, 2003 3:22 PM
To: NT Developers Interest List

All:
What’s the best way to get a device’s symbolic link from within a
driver? Example: I have “\device\harddiskvolume1” and I need “C:”. The
point in the code where I need it I have the device object so I have the
device name, … but not the symbolic link. I realize that there
isn’t necessarly a 1-1 relationship between symbolic links and aliases
so that may be an issue. I tried using IoGetDeviceInterfaces but am blue
screening…

Any help is appreciated.

Thanks,

Chuck


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


You are currently subscribed to ntdev as: chuck.monarch@hp.com To
unsubscribe send a blank email to xxxxx@lists.osr.com


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