FO->FileName.Buffer in post-create

I should remember this, but… :slight_smile:
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.

There is an API for that. Take a look at IoReplaceFileNameObject. Regards,

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.

Thanks, Scott, I thought o, but I am somewhat rusty on the topic lately :wink:

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
>

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

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

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.