KeWaitForSingleObject(): Invoke idle functions to process ExQueueWorkItem()s
authorshort <>
Mon, 24 Mar 2003 21:11:18 +0000 (21:11 +0000)
committershort <>
Mon, 24 Mar 2003 21:11:18 +0000 (21:11 +0000)
 - needed for ntfs.sys IopMountFilesystem() processing

src/libcaptive/ke/wait.c

index 3a65476..5006345 100644 (file)
@@ -23,6 +23,7 @@
 #include "reactos/ddk/status.h"        /* for STATUS_SUCCESS */
 #include "reactos/napi/types.h"        /* for NTSTATUS */
 #include <glib/gmessages.h>
+#include <glib/gmain.h>
 
 
 /**
@@ -45,6 +46,16 @@ NTSTATUS KeWaitForSingleObject
 {
        g_return_val_if_fail(Object!=NULL,STATUS_INVALID_PARAMETER);
 
+       /* ntfs.sys during IopMountFilesystem() will return STATUS_PENDING
+        * and it expects its ExQueueWorkItem() to be processed before evaluating
+        * the result of its driver call.
+        */
+       while (g_main_context_iteration(
+                       NULL,   /* context; NULL means default one */
+                       FALSE)) /* may_block */
+               g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: g_main_context_iteration() proceeded",G_STRLOC);
+
+
        /* TODO:thread */
        return STATUS_SUCCESS;
 }