[ros-diffs] [dchapyshev] 41367: - Set priority only if PriorityClass != PROCESS_PRIORITY_CLASS_INVALID

dchapyshev at svn.reactos.org dchapyshev at svn.reactos.org
Wed Jun 10 19:11:38 CEST 2009


Author: dchapyshev
Date: Wed Jun 10 21:11:36 2009
New Revision: 41367

URL: http://svn.reactos.org/svn/reactos?rev=41367&view=rev
Log:
- Set priority only if PriorityClass != PROCESS_PRIORITY_CLASS_INVALID

Modified:
    trunk/reactos/dll/win32/kernel32/process/procsup.c

Modified: trunk/reactos/dll/win32/kernel32/process/procsup.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/process/procsup.c?rev=41367&r1=41366&r2=41367&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/process/procsup.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/process/procsup.c [iso-8859-1] Wed Jun 10 21:11:36 2009
@@ -1179,16 +1179,19 @@
         goto Cleanup;
     }
 
-    /* Set new class */
-    Status = NtSetInformationProcess(hProcess,
-                                     ProcessPriorityClass,
-                                     &PriorityClass,
-                                     sizeof(PROCESS_PRIORITY_CLASS));
-    if(!NT_SUCCESS(Status))
-    {
-        DPRINT1("Unable to set new process priority, status 0x%x\n", Status);
-        SetLastErrorByStatus(Status);
-        goto Cleanup;
+    if (PriorityClass.PriorityClass != PROCESS_PRIORITY_CLASS_INVALID)
+    {
+        /* Set new class */
+        Status = NtSetInformationProcess(hProcess,
+                                         ProcessPriorityClass,
+                                         &PriorityClass,
+                                         sizeof(PROCESS_PRIORITY_CLASS));
+        if(!NT_SUCCESS(Status))
+        {
+            DPRINT1("Unable to set new process priority, status 0x%x\n", Status);
+            SetLastErrorByStatus(Status);
+            goto Cleanup;
+        }
     }
 
     /* Set Error Mode */



More information about the Ros-diffs mailing list