Please excuse the terminology if not correct.
I have a monitoring system where I'm receiving notification of changes to
the system. A subset of this is file changes. When I receive notification,
the filename is shown as a physical path:
\Device\HarddiskVolumn1\Windows\System32\xxxx
I need to convert this back into a symbolic?? file name i.e.
c:\Windows\System32\xxxx.
At the minute I have a lookup list that uses QueryDosDevice to map the
correlation between the physical (is this the correct terminology??) drive
names and symbolic drive letters. However, this is a bit limited and I was
hoping that there may be some better way of achieving this..
Many Thanks in advance
Mike C
Try RtlNtPathNameToDosPathName from NTDLL.
Does RtlNtPathNameToDosPathName allow you to convert a whole path i.e.
\Device\HarddiskVolumn1\Windows\System32\somefile.exe
or do you have to strip out the drive section (\Device\HarddiskVolumn1\)
first of all and look just that up?
If I have to strip down the path then I might as well stick with my look up
system.
Also, is it possible to do the reverse i.e. symbolic to physical?
Thanks again
Mike C
"JJ" <jcu...@gmxNOSPAM.net> wrote in message
Sorry, it isn't possible using RtlNtPathNameToDosPathName, AFAIK.
I guess you'll have to stick using QueryDosDevice and do a lookup.
To get a faster code, cache the lookup table so the QueryDosDevice will
not be called each time. Do monitor for device change messages and
update the lookup table as needed.
[...]
> At the minute I have a lookup list that uses QueryDosDevice to map the
> correlation between the physical (is this the correct terminology??) drive
> names and symbolic drive letters. However, this is a bit limited and I
> was hoping that there may be some better way of achieving this..
[...]
This article should help you:
http://www.osronline.com/custom.cfm?name=articlePrint.cfm&id=107 . More
specifically, the QueryMountPoint allows you to get a table of equivalence
between those ugly \Device\HardwareVolumeX and normal letter based pathes.
Once you build this table, you can perform mappings quite fast.
--
Volodymyr M. Shcherbyna, blog: http://www.shcherbyna.com/
(This posting is provided "AS IS" with no warranties, and confers no
rights)