My FS driver is doing some lengthy work on create in some case so I
actually queue it into a worker thread. If user want to exit that
application which initially send down the IRP_MJ_CREATE, how can I get
this IRP cancelled? I have marked the IRP cancelllable, it seems that
Cancel routine does not get called for IRP_MJ_CREATE. Can somebody help
me with cleanup sequence of process? I have several option to try, though
I do not know which one would work.
- Try to issue a pending READ or WRITE Irp in the context of that
original process before I queue IRP_MJ_CREATE. If that READ/WRITE Irp’s
cancel routine can be called in the process termination, then problem is
solved.
- Hook into system call(NtTerminateProcess) and call down to my driver to
cancel that IRP_MJ_CREATE.
Can anybody shed some light on this problem?
Thanks
For your create IRP, you can use the new cancel safe queue functions on XP
to manage cancelation. There is a sample in the DDK called cancel that
demonstrates how to do this.
-Sebastien
From: xxxxx@math.uic.edu
Reply-To: “File Systems Developers”
>To: “File Systems Developers”
>Subject: [ntfsd] How to make a cancellable IRP_MJ_CREATE in the process
>termination.
>Date: Tue, 30 Apr 2002 14:08:25 -0400
>
>My FS driver is doing some lengthy work on create in some case so I
>actually queue it into a worker thread. If user want to exit that
>application which initially send down the IRP_MJ_CREATE, how can I get
>this IRP cancelled? I have marked the IRP cancelllable, it seems that
>Cancel routine does not get called for IRP_MJ_CREATE. Can somebody help
>me with cleanup sequence of process? I have several option to try, though
>I do not know which one would work.
>1) Try to issue a pending READ or WRITE Irp in the context of that
>original process before I queue IRP_MJ_CREATE. If that READ/WRITE Irp’s
>cancel routine can be called in the process termination, then problem is
>solved.
>2) Hook into system call(NtTerminateProcess) and call down to my driver to
>cancel that IRP_MJ_CREATE.
>
>Can anybody shed some light on this problem?
>
>Thanks
>
>—
>You are currently subscribed to ntfsd as: xxxxx@hotmail.com
>To unsubscribe send a blank email to %%email.unsub%%
_________________________________________________________________
Téléchargez MSN Explorer gratuitement à l’adresse
http://explorer.msn.fr/intl.asp.
The issue here is a pending IRP_MJ_CREATE’s cancel routine does not get
invoked in process termination. For other pending irp which has set with
cancel routine, that cancel proc will get called. I am sure that new
cancel safe queue have nothing to do with this.
Yuedong.
For your create IRP, you can use the new cancel safe queue functions on XP
to manage cancelation. There is a sample in the DDK called cancel that
demonstrates how to do this.
-Sebastien
>From: xxxxx@math.uic.edu
>Reply-To: “File Systems Developers”
> >To: “File Systems Developers”
> >Subject: [ntfsd] How to make a cancellable IRP_MJ_CREATE in the process
> >termination.
> >Date: Tue, 30 Apr 2002 14:08:25 -0400
> >
> >My FS driver is doing some lengthy work on create in some case so I
> >actually queue it into a worker thread. If user want to exit that
> >application which initially send down the IRP_MJ_CREATE, how can I get
> >this IRP cancelled? I have marked the IRP cancelllable, it seems that
> >Cancel routine does not get called for IRP_MJ_CREATE. Can somebody help
> >me with cleanup sequence of process? I have several option to try, though
> >I do not know which one would work.
> >1) Try to issue a pending READ or WRITE Irp in the context of that
> >original process before I queue IRP_MJ_CREATE. If that READ/WRITE Irp’s
> >cancel routine can be called in the process termination, then problem is
> >solved.
> >2) Hook into system call(NtTerminateProcess) and call down to my driver to
> >cancel that IRP_MJ_CREATE.
> >
> >Can anybody shed some light on this problem?
> >
> >Thanks
> >
> >—
> >You are currently subscribed to ntfsd as: xxxxx@hotmail.com
> >To unsubscribe send a blank email to %%email.unsub%%
>
>
>
>
> _________________________________________________________________
> Téléchargez MSN Explorer gratuitement à l’adresse
> http://explorer.msn.fr/intl.asp.
Yuedong -
Creates are inherently synchronous today. I/O manager does a non-alertable wait on creates if you return pending. So creates are non-cancellable on thread exit. The solution is not to have a high-latency create: NT in general does not tolerate high-latency creates well for a variety of reasons.
You need to let creates go through /fail, and postpone your processing as needed (maybe on first read/write?)
By the way, you cannot let create go through on a ‘worker thread’ at any rate.
Ravi
This posting is provided “AS IS” with no warranties, and confers no rights. You assume all risk for your use
-----Original Message-----
From: xxxxx@math.uic.edu [mailto:xxxxx@math.uic.edu]
Sent: Tuesday, April 30, 2002 5:11 PM
To: File Systems Developers
Subject: [ntfsd] Re: How to make a cancellable IRP_MJ_CREATE in the process termination.
The issue here is a pending IRP_MJ_CREATE’s cancel routine does not get invoked in process termination. For other pending irp which has set with cancel routine, that cancel proc will get called. I am sure that new cancel safe queue have nothing to do with this.
Yuedong.
For your create IRP, you can use the new cancel safe queue functions
on XP to manage cancelation. There is a sample in the DDK called
cancel that demonstrates how to do this.
-Sebastien
>From: xxxxx@math.uic.edu
>Reply-To: “File Systems Developers”
> >To: “File Systems Developers”
> >Subject: [ntfsd] How to make a cancellable IRP_MJ_CREATE in the
> >process termination.
> >Date: Tue, 30 Apr 2002 14:08:25 -0400
> >
> >My FS driver is doing some lengthy work on create in some case so I
> >actually queue it into a worker thread. If user want to exit that
> >application which initially send down the IRP_MJ_CREATE, how can I
> >get this IRP cancelled? I have marked the IRP cancelllable, it seems
> >that Cancel routine does not get called for IRP_MJ_CREATE. Can
> >somebody help me with cleanup sequence of process? I have several
> >option to try, though I do not know which one would work.
> >1) Try to issue a pending READ or WRITE Irp in the context of that
> >original process before I queue IRP_MJ_CREATE. If that READ/WRITE
> >Irp’s cancel routine can be called in the process termination, then
> >problem is solved.
> >2) Hook into system call(NtTerminateProcess) and call down to my
> >driver to cancel that IRP_MJ_CREATE.
> >
> >Can anybody shed some light on this problem?
> >
> >Thanks
> >
> >—
> >You are currently subscribed to ntfsd as: xxxxx@hotmail.com To
> >unsubscribe send a blank email to %%email.unsub%%
>
>
>
>
> _________________________________________________________________
> T?l?chargez MSN Explorer gratuitement ? l’adresse
> http://explorer.msn.fr/intl.asp.
—
You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com To unsubscribe send a blank email to %%email.unsub%%