IofCompleteRequest(): Implemented APC dispatcing as a real 'idle' APC invocation
authorshort <>
Thu, 3 Apr 2003 12:23:52 +0000 (12:23 +0000)
committershort <>
Thu, 3 Apr 2003 12:23:52 +0000 (12:23 +0000)
ntoskrnl/io/irp.c

index 54b8949..2d40f45 100644 (file)
@@ -214,6 +214,12 @@ IopCompleteRequest(struct _KAPC* Apc,
 
 #endif /* LIBCAPTIVE */
 
+
+#ifdef LIBCAPTIVE
+/* file-scope of libcaptive/io/irp.c: */
+extern void IofCompleteRequest_register_APC(PIRP Irp,CCHAR PriorityBoost);
+#endif /* LIBCAPTIVE */
+
 VOID FASTCALL
 IofCompleteRequest(PIRP Irp,
                   CCHAR PriorityBoost)
@@ -292,7 +298,8 @@ IofCompleteRequest(PIRP Irp,
        /* FIXME: Why the hell should we bother with some damned APCs?!?
         * Call it directly below!
         */
-       DPRINT("IofCompleteRequest() would like to dispatch APC: F*ck off!\n");
+       DPRINT("IofCompleteRequest() dispatching APC: using g_idle_add_full()\n");
+       IofCompleteRequest_register_APC(Irp,PriorityBoost);
 #else /* !LIBCAPTIVE */
        DPRINT("Dispatching APC\n");
        KeInitializeApc(&Irp->Tail.Apc,
@@ -308,12 +315,10 @@ IofCompleteRequest(PIRP Irp,
                         (PVOID)Irp,
                         (PVOID)(ULONG)PriorityBoost,
                         KernelMode);
-       DPRINT("Finished dispatching APC\n");
 #endif /* !LIBCAPTIVE */
+       DPRINT("Finished dispatching APC\n");
      }
-#ifndef LIBCAPTIVE
    else
-#endif /* LIBCAPTIVE */
      {
        DPRINT("Calling completion routine directly\n");
        IoSecondStageCompletion(Irp,PriorityBoost);