Hi all,
In Windows 2003, QueryDosDevice() returns a name different from that displayed by fltmc volumes for dynamic disks.
fltmc volumes->
C:->\Device\HarddiskDmVolumes\PhysicalDmVolumes\BlockVolume1
QueryDosDevice()->
C:->\Device\HarddiskDmVolumes\Win2k3-32-2Dg0\Volume1
I know that the latter is yet another symbolic link to the former.
What is the correct way to get the first one from a disk letter in the user space?
Thanks in advance,
Greg.
Multiple (nested) symbolic links are generally allowed.
You have to keep translating the symbolic link until there
is none.
L.
Hi Ladislav,
Thanks for the reply.
If I pass the output of the first QueryDosDevice() to the next, I get an error.
Isn’t it supposed to accept only the drive names like “c:”?
Greg.
I solved this problem by opening and querying the symbolic link object -
NtOpenSymbolicLink and NtQuerySymbolicLinkObject. There was a post to this
list some time ago about a better method but I haven’t had the chance to try
it. A search for QueryDosDevice might turn it up.
Bill
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Thursday, May 31, 2012 10:24 AM
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] QueryDosDevice() for Dynamic Disks
Hi Ladislav,
Thanks for the reply.
If I pass the output of the first QueryDosDevice() to the next, I get an
error.
Isn’t it supposed to accept only the drive names like “c:”?
Greg.
NTFSD is sponsored by OSR
For our schedule of debugging and file system 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
Thanks Bill,
I will try to find it.
In the meantime, it seems that there is a way to do it, albeit a cumbersome one.
- Enumerate volumes using FilterVolumeFindFirst/Next()
- Query drive letters using FilterGetDosName()
- Do the reverse look-up for the drive letter in question
I haven’t checked it yet, but it should work.
Greg.
Hi Greg,
I really don’t like QueryDosDevice(). I’d say use the MountMgr interface (if you’re in kernel mode) or the Volume Management Functions (http://msdn.microsoft.com/en-us/library/windows/desktop/aa365730(v=vs.85).aspx) if you’re in user mode (and in particular GetVolumePathNamesForVolumeName() if you actually care about drive letters) .
I have a blog post about this http://fsfilters.blogspot.com/2012/03/volume-names.html where I also have some sample code.
Thanks,
Alex.
Great! Thanks Alex.
On May 31, 2012, at 18:01, xxxxx@gmail.com wrote:
Hi Greg,
I really don’t like QueryDosDevice(). I’d say use the MountMgr interface (if you’re in kernel mode) or the Volume Management Functions (http://msdn.microsoft.com/en-us/library/windows/desktop/aa365730(v=vs.85).aspx) if you’re in user mode (and in particular GetVolumePathNamesForVolumeName() if you actually care about drive letters) .
I have a blog post about this http://fsfilters.blogspot.com/2012/03/volume-names.html where I also have some sample code.
Thanks,
Alex.
NTFSD is sponsored by OSR
For our schedule of debugging and file system 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 will try to find it.
Use \?\Volume{guid} as unique volume ID.
Do not pay attention to the above-mentioned symlinks, they are the undocumented details.
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com
Thank Maxim.
On Jun 1, 2012, at 8:50, “Maxim S. Shatskih” wrote:
>> I will try to find it.
>
> Use \?\Volume{guid} as unique volume ID.
>
> Do not pay attention to the above-mentioned symlinks, they are the undocumented details.
>
> –
> Maxim S. Shatskih
> Windows DDK MVP
> xxxxx@storagecraft.com
> http://www.storagecraft.com
>
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule of debugging and file system 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