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?

patrickdanielpatrickdaniel Member Posts: 11

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?

Comments

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

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

  • Sourabh_ArvikarSourabh_Arvikar 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.

Sign In or Register to comment.

Howdy, Stranger!

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

Upcoming OSR Seminars
Developing Minifilters 29 July 2019 OSR Seminar Space
Writing WDF Drivers 23 Sept 2019 OSR Seminar Space
Kernel Debugging 21 Oct 2019 OSR Seminar Space
Internals & Software Drivers 18 Nov 2019 Dulles, VA