IRP_MJ_CREATE Completion on Failure FilObject->FsContext?

Gentlefolk

I am wondering whether any of you excellent folk can shed some light on this
perhaps strange question.

I observe that the value of IrpSp->FileObject->FsContext is often but not
always NULL when IRP_MJ_CREATE fails with (!
NT_SUCCESS(Irp->IoStatus.Status). Is there any such circumstance in which
the value of the FsContext is meaningful?

Thanks in advance!

Cheers
Lyndon

> I observe that the value of IrpSp->FileObject->FsContext is often but not

always NULL when IRP_MJ_CREATE fails with (!

Maybe the memory occupied by the FsContext has already been freed,
but the pointer to it remained in FsContext ?

L.

That’s exactly correct. If the IRP_MJ_CREATE operation failed, the
value in the FsContext is never valid. If it is non-NULL, it’s just
left over from the file system’s attempt to initiate the file object
which eventually failed.

Thanks,
Molly Brown
Microsoft Corporation

This posting is provided “AS IS” with no warranties and confers no
rights.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ladislav Zezula
Sent: Friday, October 15, 2004 2:33 AM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] IRP_MJ_CREATE Completion on Failure
FilObject->FsContext?

I observe that the value of IrpSp->FileObject->FsContext is often but
not always NULL when IRP_MJ_CREATE fails with (!

Maybe the memory occupied by the FsContext has already been freed, but
the pointer to it remained in FsContext ?

L.


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Molly, Ladislav

Thanks for your replies have confirmed my suspicions and allowed me to clear
up that little matter :wink:

Cheers
Lyndon

“Lyndon J Clarke” wrote in message
news:xxxxx@ntfsd…
> Gentlefolk
>
> I am wondering whether any of you excellent folk can shed some light on
> this perhaps strange question.
>
> I observe that the value of IrpSp->FileObject->FsContext is often but not
> always NULL when IRP_MJ_CREATE fails with (!
> NT_SUCCESS(Irp->IoStatus.Status). Is there any such circumstance in which
> the value of the FsContext is meaningful?
>
> Thanks in advance!
>
> Cheers
> Lyndon
>
>
>

> That’s exactly correct. If the IRP_MJ_CREATE operation failed, the

value in the FsContext is never valid. If it is non-NULL, it’s just

Let me ask one more question -
If a file system driver receives an IRP_MJ_CLOSE
(not Cleanup) requests, it performs all necessary operations
and then *clears both FsContexts* in the file object, does
it violate any FSD rule ?

L.

No, it is fine for the FSD to NULL the FsContexts in the CLOSE
processing, it is just not required to do so, therefore filters cannot
count on this behavior.

Thanks,
Molly Brown
Microsoft Corporation

This posting is provided “AS IS” with no warranties and confers no
rights.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ladislav Zezula
Sent: Sunday, October 17, 2004 10:44 PM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] IRP_MJ_CREATE Completion on Failure
FilObject->FsContext?

That’s exactly correct. If the IRP_MJ_CREATE operation failed, the
value in the FsContext is never valid. If it is non-NULL, it’s just

Let me ask one more question -
If a file system driver receives an IRP_MJ_CLOSE (not Cleanup) requests,
it performs all necessary operations and then *clears both FsContexts*
in the file object, does it violate any FSD rule ?

L.


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Note that the SMB Redirector actually sets the FsContext field to
0xffffffff after processing a close. If you are going to set it to
something I would request you set it to NULL. I am going to request
that the redirector devs fix their code to set it to a NULL as well.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no
rights

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Molly Brown
Sent: Monday, October 18, 2004 8:27 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] IRP_MJ_CREATE Completion on Failure
FilObject->FsContext?

No, it is fine for the FSD to NULL the FsContexts in the CLOSE
processing, it is just not required to do so, therefore filters cannot
count on this behavior.

Thanks,
Molly Brown
Microsoft Corporation

This posting is provided “AS IS” with no warranties and confers no
rights.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Ladislav Zezula
Sent: Sunday, October 17, 2004 10:44 PM
To: Windows File Systems Devs Interest List
Subject: Re: [ntfsd] IRP_MJ_CREATE Completion on Failure
FilObject->FsContext?

That’s exactly correct. If the IRP_MJ_CREATE operation failed, the
value in the FsContext is never valid. If it is non-NULL, it’s just

Let me ask one more question -
If a file system driver receives an IRP_MJ_CLOSE (not Cleanup) requests,
it performs all necessary operations and then *clears both FsContexts*
in the file object, does it violate any FSD rule ?

L.


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com