How to convert DOS file path to usable driver format?

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?

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

1 Like

@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.