You should be marking the IRP as pending before adding the request to a
queue. What is happening is the request is completing before your call to
IoMarkIrpPending.
Jamey Kirby, Windows DDK MVP
StorageCraft Inc.
xxxxx@storagecraft.com
http://www.storagecraft.com
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Neil Weicher
Sent: Thursday, January 29, 2004 5:37 AM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] Bugcheck from ExQueueWorkItem in passive mode
Thanks for the reply. As I mentioned it is working fine at dispatch level,
so yes, I believe I am doing it the right way. After I kick off the worker
thread I issue the following:
IoMarkIrpPending(Irp);
return (STATUS_MORE_PROCESSING_REQUIRED);
Before the worker thread returns it completes the Irp:
ntStatus = ioContext->Irp->IoStatus.Status; // crash here
IoCompleteRequest( ioContext->Irp, IO_DISK_INCREMENT );
return (ntStatus);
However, I did determine where the crash is occurring (see comment). It
looks like the file is being closed between the time I kick off the worker
thread and the time I complete the Irp. So it looks like something else is
completing the Irp even though I retruned SMPR!
Neil
----- Original Message -----
What do you mean if you are ‘currently in passive level’? You mean that
if the completion routine fires at passive level as opposed to dispatch?
If so, do you crash in the completion routine itself, or in the worker
thread? Are you aborting completion processing correctly by returning
STATUS_MORE_PROCESSING_REQUIRED, then completing the IRP in the worker
thread after you’re done with it?
Neil Weicher wrote:
I am getting bugcheck 0xD5 (driver is attempting to access memory after it
has been freed) when using a workerthread in a read completion routine.
But
it only happens if the I am currently in passive level. It works fine if
I
am in dispatch level. Now I know it doesn’t make much sense to use a
worker
thread when in passive level, but it shouldn’t blue screen, should it?
Thanks for any enlightenment.
Neil
END OF DIGEST
You are currently subscribed to ntfsd as: xxxxx@netlib.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: xxxxx@storagecraft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com