• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1946
  • Last Modified:

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.
  • 2
1 Solution
'QueryDosDevice()' (http://msdn2.microsoft.com/en-us/library/aa365461.aspx) is what you are looking for. See the sample code at http://support.microsoft.com/kb/235128 ("INFO: Understanding Device Names and Symbolic Links")
jimstarAuthor Commented:
>> 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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now