[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:41:40 PDT 2008


This patch cancels all outstanding UAL_CEP_GET_REQ_CID IRPs queued in a CEP when the CEP is destroyed.

Signed-off-by: Fab Tillier <ftillier at microsoft.com>

diff -up -r -X trunk\docs\dontdiff.txt -I \$Id: old\core\al\kernel\al_cm_cep.c trunk\core\al\kernel\al_cm_cep.c
--- old\core\al\kernel\al_cm_cep.c      Mon Jun 30 14:50:58 2008
+++ trunk\core\al\kernel\al_cm_cep.c    Mon Jun 30 15:25:38 2008
@@ -4155,6 +4155,25 @@ al_destroy_cep(
        /* Cancel any queued IRP */
        __cep_complete_irp( p_cep, STATUS_CANCELLED, IO_NO_INCREMENT );

+    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 );
+    }
+
        __unbind_cep( p_cep );
        ref_cnt = __cleanup_cep( p_cep );
        KeReleaseInStackQueuedSpinLock( &hdl );
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cancel_get_req_cid_irp.patch
Type: application/octet-stream
Size: 1080 bytes
Desc: cancel_get_req_cid_irp.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20080630/f19ff899/attachment.obj>


More information about the ofw mailing list