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/


FO->FileName.Buffer in post-create

Dejan_MaksimovicDejan_Maksimovic Member - All Emails Posts: 335

I should remember this, but.... :)
Is the FileName.Buffer of a file object valid in a mini-filters post-create? Not the file name itself, just the buffer, can it be presumed not-freed or invalid in any way related to this purpose?

E.g. will the buffer be the buffer set by the I/O manager (or some mini-filter above us for a name virtualization filter)?

What I am considering is replacing the file name, and passing the IRP_MJ_CREATE down the line, and not reparsing, so that I can free the buffer myself in the post-create to a lookaside list.

Comments

  • Fernando_RobertoFernando_Roberto Member - All Emails Posts: 198
    There is an API for that.
    Take a look at IoReplaceFileNameObject.

    Regards,


    Fernando Roberto da Silva
    DriverEntry Kernel Development
    http://www.driverentry.com.br

  • Scott_Noone_(OSR)Scott_Noone_(OSR) Administrator Posts: 3,341

    It's perfectly reasonable to return STATUS_REPARSE from PostCreate, which would mean that you need to manipulate/change/free/re-allocate the file object's name buffer in PostCreate.

    -scott
    OSR

  • Dejan_MaksimovicDejan_Maksimovic Member - All Emails Posts: 335
    via Email
    Thanks, Scott, I thought o, but I am somewhat rusty on the topic lately ;)

    I cannot return it from post-create for my purpose.
    And I am trying to avoid STATUS_REPARSE.

    On 2/21/19, Scott_Noone_(OSR)
    wrote:
    > OSR https://community.osr.com/
    > Scott_Noone_(OSR) commented on FO->FileName.Buffer in post-create
    >
    > It's perfectly reasonable to return STATUS_REPARSE from PostCreate, which
    > would mean that you need to manipulate/change/free/re-allocate the file
    > object's name buffer in PostCreate.
    >
    > --
    > Reply to this email directly or follow the link below to check it out:
    > https://community.osr.com/discussion/comment/292711#Comment_292711
    >
    > Check it out:
    > https://community.osr.com/discussion/comment/292711#Comment_292711
    >
  • Scott_Noone_(OSR)Scott_Noone_(OSR) Administrator Posts: 3,341

    Yeah, I mention STATUS_REPARSE by way of example but not by limitation :)

    The fact that one could do a reparse operation in PostCreate means that everyone needs to be sure to keep FileName.Buffer pointing to valid memory (though, as you stated, doesn't mean that it's actually pointing to anything meaningful w.r.t. the name).

    -scott
    OSR

  • Dejan_MaksimovicDejan_Maksimovic Member - All Emails Posts: 335
    via Email
    Yeah, I got that - not at first, so I changed the reply to mention
    reparse afterwards:) Thanks!

    On 2/22/19, Scott_Noone_(OSR)
    wrote:
    > OSR https://community.osr.com/
    > Scott_Noone_(OSR) commented on FO->FileName.Buffer in post-create
    >
    > Yeah, I mention STATUS_REPARSE by way of example but not by limitation
    >
    > The fact that one could do a reparse operation in PostCreate means that
    > everyone needs to be sure to keep FileName.Buffer pointing to valid memory
    > (though, as you stated, doesn't mean that it's actually pointing to anything
    > meaningful w.r.t. the name).
    > --


    Kind regards, Dejan.
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!
Internals & Software Drivers 30 Nov 2020 LIVE ONLINE
Writing WDF Drivers 7 Dec 2020 LIVE ONLINE
Developing Minifilters Early 2021 LIVE ONLINE