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

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

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


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,131
    edited May 2019

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

  • Sourabh_ArvikarSourabh_Arvikar Member Posts: 75

    @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
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Developing Minifilters 15 Jun 2020 LIVE ONLINE
Writing WDF Drivers 22 June 2020 LIVE ONLINE
Internals & Software Drivers 28 Sept 2020 Dulles, VA