DOS device name to NT device name in kernel

Hi all, I met a problem on how to convert the DOS device name to NT device
name in my file system filter driver. Here is the case.

I have 2 physical volumes in the system, volume 1 and volume 2. I mounted
volume 1 and assigned a drive letter to it, d:. Then I mounted volume 2 to a
NTFS folder on volume 1, d:\volume2. I didn’t assign drive letter to volume
2.

And here is my question. In my file system filter driver I received a path,
say d:\volume2\abc\d.txt. How can I know that this file, d.txt, is located
on volume 1 or volume 2? In other words, is it possible that I can convert
d:\volume2\abc\d.txt to the fully qualified path like
\Device\HarddiskVolume1\abc\d.txt? Or how can I know which part in
d:\volume2\abc\d.txt is for the volume device name? Then I can use
IoGetDeviceObjectPointer() to find the volume device object.

Thanks.

Please refer http://www.osronline.com/ShowThread.cfm?link=142983

FSF does not receive the path like “d:\volume2\abc\d.txt”

It receives “\volume2\abc\d.txt” to the device object which corresponds to “d:”


Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com

“Michael Zhu” wrote in message news:xxxxx@ntfsd…
Hi all, I met a problem on how to convert the DOS device name to NT device name in my file system filter driver. Here is the case.

I have 2 physical volumes in the system, volume 1 and volume 2. I mounted volume 1 and assigned a drive letter to it, d:. Then I mounted volume 2 to a NTFS folder on volume 1, d:\volume2. I didn’t assign drive letter to volume 2.

And here is my question. In my file system filter driver I received a path, say d:\volume2\abc\d.txt. How can I know that this file, d.txt, is located on volume 1 or volume 2? In other words, is it possible that I can convert d:\volume2\abc\d.txt to the fully qualified path like \Device\HarddiskVolume1\abc\d.txt? Or how can I know which part in d:\volume2\abc\d.txt is for the volume device name? Then I can use IoGetDeviceObjectPointer() to find the volume device object.

Thanks.

> FSF does not receive the path like “d:\volume2\abc\d.txt”

Except when it does - I’ve even seen OS components send me creates like
that. Of course what the FSD will say is something like OBJECT_NAME_INVALID
or some such