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

Home NTFSD

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/


Before Posting...

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

Unset FILE_FLAG_DELETE_ON_CLOSE

AlbertAlbert Member - All Emails Posts: 502
FILE_FLAG_DELETE_ON_CLOSE gives atomicity to the Create delete operations. But is there a way to unset/reset/clear this flag once set, if the user believed they needed to not delete the file on close after all?

I am checking this, but i am not sure if FILE_DISPOSITION_DO_NOT_DELETE or FILE_DISPOSITION_ON_CLOSE will work.

https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddk/ns-ntddk-_file_disposition_information_ex

Any pointers would be much appreciated.

Comments

  • Don_BurnDon_Burn Member - All Emails Posts: 1,730

    If you look at the bottom of the page you cited above you would see that ZwSetInformationFile allows you to change the file disposition. FltSetInformationFile is a wrapper for this for minifilters.

  • AlbertAlbert Member - All Emails Posts: 502

    @Don_Burn said:
    If you look at the bottom of the page you cited above you would see that ZwSetInformationFile allows you to change the file disposition. FltSetInformationFile is a wrapper for this for minifilters.

    Thanks Don. Like with anything related to File systems, there are too many edge cases, and didn't want to break something which I didn't intend to by using the wrong flags.

  • Dejan_MaksimovicDejan_Maksimovic Member - All Emails Posts: 435
    via Email
    That is available on W10 1709+ only.
    On earlier OSes, you can only query FileModeInformation, but IIRC no FSes
    process changing it.
  • AlbertAlbert Member - All Emails Posts: 502

    @Dejan_Maksimovic said:
    That is available on W10 1709+ only.
    On earlier OSes, you can only query FileModeInformation, but IIRC no FSes
    process changing it.

    Oh, is it? Doesnt say anywhere on the page though.

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!
Developing Minifilters 24 May 2021 Live, Online
Writing WDF Drivers 14 June 2021 Live, Online
Internals & Software Drivers 27 September 2021 Live, Online
Kernel Debugging 15 November 2021 Live, Online