If the caller sets irp_usriostat or irp_usrevent it try to process it
whatever the IRP flag is because some drivers (eg. RTL8187L NDIS driver) call IoCompleteRequest() without setting flags. It will prevent waiting a event forever at attach.
This commit is contained in:
parent
3e7d76cc71
commit
08e06b60c1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=189942
@ -1197,6 +1197,11 @@ IofCompleteRequest(irp *ip, uint8_t prioboost)
|
||||
sl++;
|
||||
} while (ip->irp_currentstackloc <= (ip->irp_stackcnt + 1));
|
||||
|
||||
if (ip->irp_usriostat != NULL)
|
||||
*ip->irp_usriostat = ip->irp_iostat;
|
||||
if (ip->irp_usrevent != NULL)
|
||||
KeSetEvent(ip->irp_usrevent, prioboost, FALSE);
|
||||
|
||||
/* Handle any associated IRPs. */
|
||||
|
||||
if (ip->irp_flags & IRP_ASSOCIATED_IRP) {
|
||||
@ -1220,16 +1225,10 @@ IofCompleteRequest(irp *ip, uint8_t prioboost)
|
||||
|
||||
/* With any luck, these conditions will never arise. */
|
||||
|
||||
if (ip->irp_flags & (IRP_PAGING_IO|IRP_CLOSE_OPERATION)) {
|
||||
if (ip->irp_usriostat != NULL)
|
||||
*ip->irp_usriostat = ip->irp_iostat;
|
||||
if (ip->irp_usrevent != NULL)
|
||||
KeSetEvent(ip->irp_usrevent, prioboost, FALSE);
|
||||
if (ip->irp_flags & IRP_PAGING_IO) {
|
||||
if (ip->irp_mdl != NULL)
|
||||
IoFreeMdl(ip->irp_mdl);
|
||||
IoFreeIrp(ip);
|
||||
}
|
||||
if (ip->irp_flags & IRP_PAGING_IO) {
|
||||
if (ip->irp_mdl != NULL)
|
||||
IoFreeMdl(ip->irp_mdl);
|
||||
IoFreeIrp(ip);
|
||||
}
|
||||
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user