Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Physical to symbolic filename converstion

527 views
Skip to first unread message

Mike Collins

unread,
Apr 17, 2009, 10:45:48 AM4/17/09
to
Hi all,

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


JJ

unread,
Apr 17, 2009, 2:24:39 PM4/17/09
to

Try RtlNtPathNameToDosPathName from NTDLL.

Mike Collins

unread,
Apr 17, 2009, 5:08:43 PM4/17/09
to
Hay JJ,

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


JJ

unread,
Apr 18, 2009, 3:48:54 PM4/18/09
to

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.

Volodymyr Shcherbyna

unread,
Apr 21, 2009, 9:57:53 AM4/21/09
to
"Mike Collins" <its@TheBottomOfThePost> wrote in message
news:OrWdaF2v...@TK2MSFTNGP05.phx.gbl...

[...]

> 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)


0 new messages