Commit in reactos/lib/kernel32 on MAIN
misc/stubs.c+1-291.81 -> 1.82
process/proc.c+53-11.63 -> 1.64
+54-30
2 modified files
implemented SetProcessPriorityBoost() and GetProcessPriorityBoost() (only the kernel32 part)

reactos/lib/kernel32/misc
stubs.c 1.81 -> 1.82
diff -u -r1.81 -r1.82
--- stubs.c	30 Jul 2004 19:18:39 -0000	1.81
+++ stubs.c	29 Aug 2004 14:45:55 -0000	1.82
@@ -1,4 +1,4 @@
-/* $Id: stubs.c,v 1.81 2004/07/30 19:18:39 jimtabor Exp $
+/* $Id: stubs.c,v 1.82 2004/08/29 14:45:55 weiden Exp $
  *
  * KERNEL32.DLL stubs (unimplemented functions)
  * Remove from this file, if you implement them.
@@ -878,20 +878,6 @@
  */
 BOOL
 STDCALL
-GetProcessPriorityBoost(
-    HANDLE hProcess,
-    PBOOL pDisablePriorityBoost
-    )
-{
-    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-    return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
 GetSystemRegistryQuota(
     PDWORD pdwQuotaAllowed,
     PDWORD pdwQuotaUsed
@@ -1301,20 +1287,6 @@
 /*
  * @unimplemented
  */
-BOOL
-STDCALL
-SetProcessPriorityBoost(
-    HANDLE hProcess,
-    BOOL bDisablePriorityBoost
-    )
-{
-    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-    return 0;
-}
-
-/*
- * @unimplemented
- */
 EXECUTION_STATE
 STDCALL
 SetThreadExecutionState(

reactos/lib/kernel32/process
proc.c 1.63 -> 1.64
diff -u -r1.63 -r1.64
--- proc.c	2 Jul 2004 12:18:04 -0000	1.63
+++ proc.c	29 Aug 2004 14:46:02 -0000	1.64
@@ -1,4 +1,4 @@
-/* $Id: proc.c,v 1.63 2004/07/02 12:18:04 gvg Exp $
+/* $Id: proc.c,v 1.64 2004/08/29 14:46:02 weiden Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
@@ -868,4 +868,56 @@
   return TRUE;
 }
 
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+GetProcessPriorityBoost(HANDLE hProcess,
+                        PBOOL pDisablePriorityBoost)
+{
+  NTSTATUS Status;
+  BOOL PriorityBoost;
+
+  Status = NtQueryInformationProcess(hProcess,
+				     ProcessPriorityBoost,
+				     &PriorityBoost,
+				     sizeof(BOOL),
+				     NULL);
+  if (NT_SUCCESS(Status))
+    {
+      *pDisablePriorityBoost = PriorityBoost;
+      return TRUE;
+    }
+
+  SetLastErrorByStatus(Status);
+  return FALSE;
+}
+
+
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+SetProcessPriorityBoost(HANDLE hProcess,
+                        BOOL bDisablePriorityBoost)
+{
+  NTSTATUS Status;
+  BOOL PriorityBoost = (bDisablePriorityBoost ? TRUE : FALSE); /* prevent setting values other than 1 and 0 */
+
+  Status = NtSetInformationProcess(hProcess,
+				   ProcessPriorityBoost,
+				   &PriorityBoost,
+				   sizeof(BOOL));
+  if (!NT_SUCCESS(Status))
+    {
+      SetLastErrorByStatus(Status);
+      return FALSE;
+    }
+
+  return TRUE;
+}
+
 /* EOF */
CVSspam 0.2.8