Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

# How to convert DOS file path to usable driver format?

Member Posts: 11
in NTFSD

I saw that drivers use GLOBALROOT etc in kernel mode. How can i convert a DOS file path into this version? I am not sure of how to convert a regular DOS path into something like this.
In other words i have a file system filter and I want to convert it to a DOS path or convert a DOS path into a usable format which I can compare with my file system filter. Is there any api there i can use?

• Member - All Emails Posts: 1,045
edited May 26

Prepend \??\ so c:\foo\bar.txt becomes \??\c:\foo\bar.txt.

• Member Posts: 74

@patrickdaniel said:
I saw that drivers use GLOBALROOT etc in kernel mode. How can i convert a DOS file path into this version? I am not sure of how to convert a regular DOS path into something like this.
In other words i have a file system filter and I want to convert it to a DOS path or convert a DOS path into a usable format which I can compare with my file system filter. Is there any api there i can use?

If I understand correctly you have some DOS file paths in your driver which are pushed by the user mode application or you are reading it from another resource. Now, in your mini-filter driver, you are getting file paths in NT format like "\Device\HarddiskVolume1\something", and you want to match/compare this path with your pre-defined paths.

If yes, then it's always good to provide rule file paths in NT format itself, which eventually save lots of processing at driver side.

#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!