Link to home
Start Free TrialLog in
Avatar of jimstar
jimstar

asked on

Normalize path name API

I'm trying to find an API to normalize a path passed as a parameter, for example:

c:\windows\system32\driver.sys --> \Device\HarddiskVolume2\windows\system32\driver.sys
\\server\path\file.ext --> \Device\LanmanRedirector\server\path\file.ext

Any pointers to a Win32 API to accomplish this would be very helpful.
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jimstar
jimstar

ASKER

>> See the sample code ...
Thanks, this is what really helped. I had been playing with QueryDosDevice but the docs on MSDN were not the best - the sample code cleared up everything.

Do you happen to know how Internal NT Device Names are assigned?

I'm wondering in what cases the \Device\HarddriveVolume2 would change... for example, whether it would change if another HDD were added, if Volume1 were deleted then perhaps Volume2 would change to be Volume1, etc etc.
>>Do you happen to know how Internal NT Device Names are assigned?

AFAIK the object manager assigns these upon boot. You can be sure that they (except for removable devices) do not change at runtime.