[ofw] [PATCH] Cancel queued UAL_CEP_GET_REQ_CID IRPs when the CEP is destroyed
Fab Tillier
ftillier at windows.microsoft.com
Mon Jun 30 15:53:46 PDT 2008
> >+ while( !IsListEmpty( &p_cep->irp_que ) )
> >+ {
> >+ LIST_ENTRY* p_list_entry;
> >+ IRP* p_irp;
> >+
> >+ // get IRP
> >+ p_list_entry = RemoveHeadList( &p_cep->irp_que );
> >+ p_irp = (PIRP)CONTAINING_RECORD( p_list_entry, IRP,
> >Tail.Overlay.ListEntry );
> >+
> >+ // complete GetConnectionReq IRP
> >+#pragma warning(push, 3)
> >+ IoSetCancelRoutine( p_irp, NULL );
> >+#pragma warning(pop)
> >+
> >+ p_irp->IoStatus.Information = 0;
> >+ p_irp->IoStatus.Status = STATUS_CANCELLED;
> >+ IoCompleteRequest( p_irp, IO_NETWORK_INCREMENT );
> >+ }
>
> This looks like a generic operation. Is this the only place in the
> code where a
> queue of IRPs is canceled? If not, can a generic routine be used
> instead?
There's not a lot of places in IBAL that handles IRPs directly, let alone queues of IRPs. This is the only place where multiple IRPs are potentially queued manually. All other places handle one IRP at a time, so they don't use a list. The other places where lists are used are in the al_proxy_ndi.c and al_ndi_cm.c files, but these use Cancel Safe queues (IoCsqXxx functions in the DDK) to manage this.
So I'm unaware of other places that do this. This code should eventually use cancel safe queues too, rather than managing things manually, but that's a change for later.
-Fab
More information about the ofw
mailing list