Author: ion
Date: Sat Jul 23 11:43:57 2011
New Revision: 52802

URL: http://svn.reactos.org/svn/reactos?rev=52802&view=rev
Log:
[KERNEL32]: Bug #42: GetThreadPriority was only returning -2, -1, 0, 1, 2 or 15 
and -15. For realtime threads, priorities of 3, 4, 5, 6, 7, and their 
negatives, are also valid. Also, GetThreadPriority was returning -15/15 for any 
priorty outside the -2/2 range, instead of just the special saturation values 
(I should count this as a separate bug, really...)

Modified:
    trunk/reactos/dll/win32/kernel32/client/thread.c

Modified: trunk/reactos/dll/win32/kernel32/client/thread.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/thread.c?rev=52802&r1=52801&r2=52802&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/thread.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/thread.c [iso-8859-1] Sat Jul 23 
11:43:57 2011
@@ -621,13 +621,15 @@
         return THREAD_PRIORITY_ERROR_RETURN;
     }
 
-    /* Do some conversions for out of boundary values */
-    if (ThreadBasic.BasePriority > THREAD_BASE_PRIORITY_MAX)
-    {
+    /* Do some conversions for saturation values */
+    if (ThreadBasic.BasePriority == ((HIGH_PRIORITY + 1) / 2))
+    {
+        /* Win32 calls this "time critical" */
         ThreadBasic.BasePriority = THREAD_PRIORITY_TIME_CRITICAL;
     }
-    else if (ThreadBasic.BasePriority < THREAD_BASE_PRIORITY_MIN)
-    {
+    else if (ThreadBasic.BasePriority == -((HIGH_PRIORITY + 1) / 2))
+    {
+        /* Win32 calls this "idle" */
         ThreadBasic.BasePriority = THREAD_PRIORITY_IDLE;
     }
 


Reply via email to