[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...)

svn path=/trunk/; revision=52802
This commit is contained in:
Alex Ionescu 2011-07-23 11:43:57 +00:00
parent 0d4067e028
commit e6a3064cd7

View file

@ -621,13 +621,15 @@ GetThreadPriority(HANDLE hThread)
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;
}