Hi.
I’m looking for a supported method to convert kernel device paths to dos
device paths. I’ve looked through the archives and was unable to find
reference to this.
I’m looking for a way to convert paths like:
\Device\HarddiskVolume1\
\SystemRoot\
Into their Dos respective paths, like:
C:\
C:\WINNT
I’m most certain that there’s a function that does this, in fact I think
it’s IoGetDeviceInterfaceAlias, but I’m unsure which GUID’s I would use as
they don’t seem to be directly documented. Possibly a GUID in devguid.h?
Who knows.
Thanks for the help.
Matt Miller
xxxxx@positivenetworks.net
There is no nice and easy way but you can use RtlVolumeDeviceToDosName in
the XP DDK. This takes a device object and gives a dos name. So you can do
something like open a filename, get the fileobject and pass
fileobject->DeviceObject to this API. This will return the drive letter.
Anything beyond that is just appended to the drive letter (this should be
the name in the fileobject->FileName). So if you open systemroot your
fileobject->FileName should contain WINNT.
There are a lot of problems with getting unique names. This is because names
to objects is a many to one mapping.
–
Nar Ganapathy
Windows Core OS group
This posting is provided “AS IS” with no warranties, and confers no rights.
“Matt Miller” wrote in message
news:xxxxx@ntdev…
>
> Hi.
>
> I’m looking for a supported method to convert kernel device paths to dos
> device paths. I’ve looked through the archives and was unable to find
> reference to this.
>
> I’m looking for a way to convert paths like:
>
> \Device\HarddiskVolume1<br>> \SystemRoot<br>>
> Into their Dos respective paths, like:
>
> C:<br>> C:\WINNT
>
> I’m most certain that there’s a function that does this, in fact I think
> it’s IoGetDeviceInterfaceAlias, but I’m unsure which GUID’s I would use as
> they don’t seem to be directly documented. Possibly a GUID in devguid.h?
> Who knows.
>
> Thanks for the help.
> Matt Miller
> xxxxx@positivenetworks.net
>
>
>
I don’t think IoGetDeviceInterfaceAlias will do what you want, at least it
isn’t documented that it will do what you want. Did you try:
NTSTATUS
IoGetDeviceInterfaces(
IN CONST GUID *InterfaceClassGuid,
IN PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL,
IN ULONG Flags,
OUT PWSTR *SymbolicLinkList
);
-----Original Message-----
From: Matt Miller [mailto:xxxxx@positivenetworks.net]
Sent: Wednesday, July 03, 2002 1:25 PM
To: NT Developers Interest List
Subject: [ntdev] Obtaining Dos Device from kernel device
Hi.
I’m looking for a supported method to convert kernel device
paths to dos device paths. I’ve looked through the archives
and was unable to find reference to this.
I’m looking for a way to convert paths like:
\Device\HarddiskVolume1\
\SystemRoot\
Into their Dos respective paths, like:
C:\
C:\WINNT
I’m most certain that there’s a function that does this, in
fact I think it’s IoGetDeviceInterfaceAlias, but I’m unsure
which GUID’s I would use as they don’t seem to be directly
documented. Possibly a GUID in devguid.h? Who knows.
Thanks for the help.
Matt Miller
xxxxx@positivenetworks.net
You are currently subscribed to ntdev as:
xxxxx@stratus.com To unsubscribe send a blank email to
%%email.unsub%%