implemented GetThreadIOPendingFlag() (only kernel32 part)
authorThomas Bluemel <thomas@reactsoft.com>
Thu, 9 Dec 2004 19:11:07 +0000 (19:11 +0000)
committerThomas Bluemel <thomas@reactsoft.com>
Thu, 9 Dec 2004 19:11:07 +0000 (19:11 +0000)
svn path=/trunk/; revision=11996

reactos/lib/kernel32/misc/stubs.c
reactos/lib/kernel32/thread/thread.c

index 86b869c..b5ecba3 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: stubs.c,v 1.99 2004/12/09 17:28:10 weiden Exp $
+/* $Id: stubs.c,v 1.100 2004/12/09 19:11:07 weiden Exp $
  *
  * KERNEL32.DLL stubs (STUB functions)
  * Remove from this file, if you implement them.
@@ -646,20 +646,6 @@ GetNumaProcessorNode(
     return 0;
 }
 
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-GetThreadIOPendingFlag(
-    HANDLE hThread,
-    PBOOL lpIOIsPending
-    )
-{
-    STUB;
-    return 0;
-}
-
 /*
  * @unimplemented
  */
index 1f4506d..b55278a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: thread.c,v 1.57 2004/12/04 19:30:09 navaraf Exp $
+/* $Id: thread.c,v 1.58 2004/12/09 19:11:07 weiden Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
@@ -794,4 +794,35 @@ QueueUserAPC(PAPCFUNC pfnAPC, HANDLE hThread, ULONG_PTR dwData)
   return NT_SUCCESS(Status);
 }
 
+/*
+ * @implemented
+ */
+BOOL STDCALL
+GetThreadIOPendingFlag(HANDLE hThread,
+                       PBOOL lpIOIsPending)
+{
+  ULONG IoPending;
+  NTSTATUS Status;
+  
+  if(lpIOIsPending == NULL)
+  {
+    SetLastError(ERROR_INVALID_PARAMETER);
+    return FALSE;
+  }
+  
+  Status = NtQueryInformationThread(hThread,
+                                    ThreadIsIoPending,
+                                    (PVOID)&IoPending,
+                                    sizeof(IoPending),
+                                    NULL);
+  if(NT_SUCCESS(Status))
+  {
+    *lpIOIsPending = ((IoPending != 0) ? TRUE : FALSE);
+    return TRUE;
+  }
+  
+  SetLastErrorByStatus(Status);
+  return FALSE;
+}
+
 /* EOF */