Hi All,
DDK says:
Unless an IRP’s dispatch routine completes the IRP (by calling IoCompleteRequest) or passes the IRP on to lower drivers, it must call IoMarkIrpPending with the IRP. Otherwise, the I/O manager attempts to complete the IRP as soon as the dispatch routine returns control.
“Assume we have to complete the IRP”.
Does it mean that if we don’t call IoCompleteRequest (and IoMarkIrpPending), then the I/O manager will call it for us? So from the foll usual statements
//++++
pIrp->IoStatus.Status = STATUS_SUCCESS ;
NTStatus = pIrp->IoStatus.Status ;
IoCompleteRequest ( pIrp , IO_NO_INCREMENT ) ;
return NTStatus ;
//----
we can skip the call to IoCompleteRequest.
Will everything function fine ?
TIA
Abhijit
NO!
This might appear to work in some cases but it is simply wrong.
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Abhijit
Sent: Friday, April 09, 2004 2:48 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Can IoCompleteRequest be skipped
Hi All,
DDK says:
Unless an IRP’s dispatch routine completes the IRP (by calling
IoCompleteRequest) or passes the IRP on to lower drivers, it must call
IoMarkIrpPending with the IRP. Otherwise, the I/O manager attempts to
complete the IRP as soon as the dispatch routine returns control.
“Assume we have to complete the IRP”.
Does it mean that if we don’t call IoCompleteRequest (and IoMarkIrpPending),
then the I/O manager will call it for us? So from the foll usual statements
//++++
pIrp->IoStatus.Status = STATUS_SUCCESS ;
NTStatus = pIrp->IoStatus.Status ;
IoCompleteRequest ( pIrp , IO_NO_INCREMENT ) ;
return NTStatus ;
//----
we can skip the call to IoCompleteRequest.
Will everything function fine ?
TIA
Abhijit
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@hollistech.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
No, you can’t do this. Not ALL IRPs are created by IoManager, some IRP created by drivers. If driver created and IRP using IoBuildAsynchronousFdsRequest or IoAllocateIrp it registers a completion routine that is used to deallocate IRP and usually signal some event. Completion routine is invoked by IoCompleteRequest, failing to call it will confuse drivers above you.
Alexei.
“Abhijit” wrote in message news:xxxxx@ntdev…
Hi All,
DDK says:
Unless an IRP’s dispatch routine completes the IRP (by calling IoCompleteRequest) or passes the IRP on to lower drivers, it must call IoMarkIrpPending with the IRP. Otherwise, the I/O manager attempts to complete the IRP as soon as the dispatch routine returns control.
“Assume we have to complete the IRP”.
Does it mean that if we don’t call IoCompleteRequest (and IoMarkIrpPending), then the I/O manager will call it for us? So from the foll usual statements
//++++
pIrp->IoStatus.Status = STATUS_SUCCESS ;
NTStatus = pIrp->IoStatus.Status ;
IoCompleteRequest ( pIrp , IO_NO_INCREMENT ) ;
return NTStatus ;
//----
we can skip the call to IoCompleteRequest.
Will everything function fine ?
TIA
Abhijit