Hi All,
I want to convert the symbolic links of the following form to corresponding dos path
i)\DEVICE\HARDDISKVOLUME2\
ii)\DEVICE\LANMANREDIRECTOR
iii)\DEVICE\HARDDISKDMVOLUME1\PHYSICALDMVOLUME\BLOCKVOLUME1\
to their corresponding dos path.
The symbolic link of first kind I’m able to convert.
For this what I did is , get the symbolic links of all the drives say A, B, C…Z and compare, then replace the link with their corresponding drive letters.
using ZwOpenSymbolicLinkObject() & ZwQuerySymbolicLinkObject()
For the rest of the type I’m not able to find a solution.
Kindly help me to find a solution for other two !!!
You seem to confuse symbolic links with real names. What you have mentioned above are real names and not symbolic links like //Dosdevices//yyy (although symbolic links don’t necessarily have to refer to //Dosdevices object directory). ZwQuerySymbolicLinkObject() returns the real name that corresponds to a symbolic link. However, AFAIK, there is no “official” way to do the reverse - you have to go through all object directories in order to enumerate all symbolic links to a given real name…
Anton Bassov
Actually my intention on the whole thing is to convert the above mentioned paths to a format which normal windows file handling functions like fopen() can use
Try sending IOCTL_MOUNTMGR_QUERY_POINTS to \Device\MountPointManager.
You can retrieve all symbolic links associated to a non-persistent
device name. Even better if you use volume GUIDs instead of drive
letters if you don’t need to show those paths to the user. You could
also be interested in IoVolumeDeviceToDosName and
RtlVolumeDeviceToDosName routines.
xxxxx@huawei.com escribió:
Actually my intention on the whole thing is to convert the above mentioned paths to a format which normal windows file handling functions like fopen() can use
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
If you have a file object you can use IoQueryFileDosDeviceName. If you don’t
have a file object you can use ZwCreateFile to open the volume and get the
file object from the handle.
Bill Wandel
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]
On Behalf Of xxxxx@huawei.com
Sent: Thursday, October 23, 2008 6:53 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Convert native NT path to DOS path
Hi All,
I want to convert the symbolic links of the following form to corresponding
dos path
i)\DEVICE\HARDDISKVOLUME2\
ii)\DEVICE\LANMANREDIRECTOR
iii)\DEVICE\HARDDISKDMVOLUME1\PHYSICALDMVOLUME\BLOCKVOLUME1\
to their corresponding dos path.
The symbolic link of first kind I’m able to convert.
For this what I did is , get the symbolic links of all the drives say A, B,
C…Z and compare, then replace the link with their corresponding drive
letters.
using ZwOpenSymbolicLinkObject() & ZwQuerySymbolicLinkObject()
For the rest of the type I’m not able to find a solution.
Kindly help me to find a solution for other two !!!
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
I think use ObReferebceObjectByName to get the driverobject,and then IoVolumeDeviceToDosName(DriverObject->DeviceOoject) is more better.
??2008-10-23??“Bill Wandel” д???
>If you have a file object you can use IoQueryFileDosDeviceName. If you don’t
>have a file object you can use ZwCreateFile to open the volume and get the
>file object from the handle.
>
>Bill Wandel
>
>-----Original Message-----
>From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]
>On Behalf Of xxxxx@huawei.com
>Sent: Thursday, October 23, 2008 6:53 AM
>To: Windows System Software Devs Interest List
>Subject: [ntdev] Convert native NT path to DOS path
>
>Hi All,
>
>I want to convert the symbolic links of the following form to corresponding
>dos path
>
>i)\DEVICE\HARDDISKVOLUME2<br>>ii)\DEVICE\LANMANREDIRECTOR
>iii)\DEVICE\HARDDISKDMVOLUME1\PHYSICALDMVOLUME\BLOCKVOLUME1<br>>
>to their corresponding dos path.
>
>The symbolic link of first kind I’m able to convert.
>For this what I did is , get the symbolic links of all the drives say A, B,
>C…Z and compare, then replace the link with their corresponding drive
>letters.
>using ZwOpenSymbolicLinkObject() & ZwQuerySymbolicLinkObject()
>
>For the rest of the type I’m not able to find a solution.
>
>Kindly help me to find a solution for other two !!!
>
>—
>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
>
>
>—
>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