IOSETCANCELROUTINE is not working as expected!!!!

HI NT GURUS,

This Problem is about the IOSETCANCELROUTINE call.My driver is a filter
driver between the file system driver and the disk driver.It is a WDM
Driver.

The following is the code used to set the cancel routine.

IoAcquireCancelSpinLock(&oldIrql);
IoMarkIrpPending(Irp);
oldCancelRoutine = IoSetCancelRoutine(Irp,MyCancelRoutine);
ASSERT(!oldCancelRoutine);
IoReleaseCancelSpinLock(oldIrql);

Now,when i kill a process by clicking on ENDTASK from the task manager…SHD
I GET CALLED ON THE CANCEL ROUTINE???

What my understanding is as the IRP is being cancelled it should call the
cancel routine…if this is true it is not happening in my case…why so
??? IF that is not the case when exactly is the cancel routine called???

Also,is there any call that is called in the application layer??? One way
that i know is by handling the SIGABRT signal.

Detailed information on this will be very helpful.

Thanks,
rajanish


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Your cancel routine will be called, if the CancelRoutine pointer in the IRP
is not NULL. That is an absolute … it WILL be called. If your cancel
routine is not being called then someone somewhere is either completing the
IRP before you think they are, or setting the CancelRoutine back to NULL.

Gary G. Little
Staff Engineer
Broadband Storage, Inc.
xxxxx@broadstor.com

-----Original Message-----
From: Rajanish, MS [mailto:xxxxx@digital.com]
Sent: Monday, July 23, 2001 10:04 PM
To: NT Developers Interest List
Subject: [ntdev] IOSETCANCELROUTINE is not working as expected!!!

HI NT GURUS,

This Problem is about the IOSETCANCELROUTINE call.My driver is a filter
driver between the file system driver and the disk driver.It is a WDM
Driver.

The following is the code used to set the cancel routine.

IoAcquireCancelSpinLock(&oldIrql);
IoMarkIrpPending(Irp);
oldCancelRoutine = IoSetCancelRoutine(Irp,MyCancelRoutine);
ASSERT(!oldCancelRoutine);
IoReleaseCancelSpinLock(oldIrql);

Now,when i kill a process by clicking on ENDTASK from the task manager…SHD
I GET CALLED ON THE CANCEL ROUTINE???

What my understanding is as the IRP is being cancelled it should call the
cancel routine…if this is true it is not happening in my case…why so
??? IF that is not the case when exactly is the cancel routine called???

Also,is there any call that is called in the application layer??? One way
that i know is by handling the SIGABRT signal.

Detailed information on this will be very helpful.

Thanks,
rajanish


You are currently subscribed to ntdev as: xxxxx@broadstor.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Play around with these samples and you will understand everything:

http://support.microsoft.com/support/kb/articles/Q188/2/76.asp
http://support.microsoft.com/support/kb/articles/Q181/2/79.asp

-Eliyas

-----Original Message-----
From: Rajanish, MS [mailto:xxxxx@digital.com]
Sent: Monday, July 23, 2001 10:04 PM
To: NT Developers Interest List
Subject: [ntdev] IOSETCANCELROUTINE is not working as expected!!!

HI NT GURUS,

This Problem is about the IOSETCANCELROUTINE call.My driver is a
filter
driver between the file system driver and the disk driver.It is a WDM
Driver.

The following is the code used to set the cancel routine.

IoAcquireCancelSpinLock(&oldIrql);
IoMarkIrpPending(Irp);
oldCancelRoutine = IoSetCancelRoutine(Irp,MyCancelRoutine);
ASSERT(!oldCancelRoutine);
IoReleaseCancelSpinLock(oldIrql);

Now,when i kill a process by clicking on ENDTASK from the task
manager…SHD
I GET CALLED ON THE CANCEL ROUTINE???

What my understanding is as the IRP is being cancelled it should call
the
cancel routine…if this is true it is not happening in my case…why
so
??? IF that is not the case when exactly is the cancel routine
called???

Also,is there any call that is called in the application layer??? One
way
that i know is by handling the SIGABRT signal.

Detailed information on this will be very helpful.

Thanks,
rajanish


You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com