From: Joachim Priesner <joachim.priesner(a)web.de> SchedulerPolicy_SetPolicyValue(ContextPriority, THREAD_PRIORITY_BELOW_NORMAL) would erroneously throw an exception because THREAD_PRIORITY_BELOW_NORMAL == -1 and -1 > 6 when compared as unsigned. --- dlls/msvcrt/concurrency.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/msvcrt/concurrency.c b/dlls/msvcrt/concurrency.c index 561b4d23289..3d019a86f8f 100644 --- a/dlls/msvcrt/concurrency.c +++ b/dlls/msvcrt/concurrency.c @@ -1246,7 +1246,7 @@ unsigned int __thiscall SchedulerPolicy_SetPolicyValue(SchedulerPolicy *this, break; case ContextPriority: if (((int)val < -7 /* THREAD_PRIORITY_REALTIME_LOWEST */ - || val > 6 /* THREAD_PRIORITY_REALTIME_HIGHEST */) + || (int)val > 6 /* THREAD_PRIORITY_REALTIME_HIGHEST */) && val != THREAD_PRIORITY_IDLE && val != THREAD_PRIORITY_TIME_CRITICAL && val != INHERIT_THREAD_PRIORITY) { invalid_scheduler_policy_value e; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7804