Dear “Ravisankar Pudipeddi”
On Fri, 16 Nov 2001 14:52:53 -0800, you wrote:
1.) STATUS_PENDING is not a valid status to return from a completion
routine, so I meant the dispatch.
Of course.
2.) You can tell what the IRP is by pressing ‘b’ and looking at it via
!irp in the debugger.
Grr. I use SoftICE. Anyone know if/how to get this info out of SoftIce.
3.) From your description it appears you are synchronizing the IRP in
your create dispatch - i.e. you signalled an event from your completion
routine & picked up processing in your dispatch (point number 4. where
you are touching the IRP after calling IoCallDriver(). Not safe unless
you aborted completion in your completion routine)
Oops, forgot to say that the completion return
STATUS_MORE_PROCESSING_REQUIRED
4.) I fail to understand point number 0) where you claim to set a
completion routine only on failure.
Sorry. I do a
IoSetCompletionRoutine
(
Irp, // IN PIRP Irp
SfCreateCompletion, // IN PIO_COMPLETION_ROUTINE
0, // IN PVOID Context,
FALSE, // IN BOOLEAN InvokeOnSuccess,
TRUE, // IN BOOLEAN InvokeOnError,
FALSE // IN BOOLEAN InvokeOnCancel
);
Is that clearer?
That wouldn’t work, as it is not
possible to safely determine whether you can touch the IRP or not in
your dispatch.
??? I thought the entire point of STATUS_MORE_PROCESSING_REQUIRED was to
return the Irp back to the dispatch routine.
Or do I need to allocate a new Irp?
5.) In any case - since you synchronize the IRP - don’t mark the IRP
pending to begin with.
I am not explicitly synchronizing the Irp. I am using the technique
explained in Chapter 12 if Rajeev Nagar’s *Windows NT File System Internals*
as I am willing to live with the overhead.
Are you familiar with the technique that Nagar suggests?
6.) You can avoid all this mess if you just return status of
IoCallDriver() from your dispatch and modify Irp->IoStatus.Status
appropriately in your completion on create failure. Since you are
trapping only failure, you wouldn’t need to cancel the open & you can do
this at DISPATCH_LEVEL.
From my poor understanding of the documentation, I am unclear as to what
IRQL the completion routine runs at.
7.) No there isn’t an IoUnmarkIrpPending(). Believe me, this gets asked
a lot.
I’m sure it gets asked a lot.
Assuming it gets asked a lot, why is such functionality not provided? What
in the OS prevents an IRP from being unmarked as pending?
Thanks,
Ravi
This posting is provided “AS IS” with no warranties, and confers no
rights. You assume all risk for your use.
Ralph Shnelvar
-----Original Message-----
From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
Sent: Friday, November 16, 2001 1:11 PM
To: File Systems Developers
Subject: [ntfsd] RE: parse.c
Dear Ravisankar Pudipeddi:
On Fri, 16 Nov 2001 12:10:08 -0800, you wrote:
Sigh. I have so many questions.
>You issued an IoMarkIrpPending() on the IRP
Correct.
>but failed to return
>STATUS_PENDING:
Failed to return it from where? The completion routine? THe dispatch
routine?
>this is a CREATE irp,
I’m guessing you know that because you have access to the source code.
Is there any other way to know that?
> so I’m
>guessing you just did IoMarkIrpPending() on the IRP, but then went
ahead
>and called the file system
>anyways & returned the status of IoCallDriver() from your create
>dispatch.
I’m not sure.
The sequence of events is roughly what Nagar outlines:
0) A completion routine is set up to be called on failure.
- IoMarkIrpPending() is called.
- IoCallDriver() is called
- The completion routine does the standard
if (Irp->PendingReturned)
IoMarkIrpPending( Irp );
Now I do stuff that Nagar doesn’t talk about
- On return from IoCallDriver() I modify the Irp to point to
a new file name.
- I issue IoComplete on the Irp
- I return STATUS_REPARSE from the dispatch routine.
So where did I go wrong? 
BTW, is there a routine to unmark the Irp as pending?
>Ravi
Ralph Shnelvar
>
>
>-----Original Message-----
>From: Ralph Shnelvar [mailto:xxxxx@dos32.com]
>Sent: Friday, November 16, 2001 11:53 AM
>To: File Systems Developers
>Subject: [ntfsd] parse.c
>
>
>The debugger caught the following error:
>
>*** Assertion Failed : !irp->PendingReturned
>*** Source File : D:\nt\private\ntos\io\parse.c, line 1236
>
>Is the source to this module available? Is there a list explaining
>what these errors might mean?
>
>Ralph Shnelvar
>
>—
>You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
>To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>—
>You are currently subscribed to ntfsd as: xxxxx@dos32.com
>To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntfsd as: xxxxx@dos32.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com