From: Marc-Aurel Zent mzent@codeweavers.com
Also removes todo_wine for GetThreadPriorityBoost calls. --- dlls/kernel32/tests/thread.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-)
diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c index fa25fd4e4a7..e09f6f29c65 100644 --- a/dlls/kernel32/tests/thread.c +++ b/dlls/kernel32/tests/thread.c @@ -77,9 +77,11 @@
static void (WINAPI *pGetCurrentThreadStackLimits)(PULONG_PTR,PULONG_PTR); static BOOL (WINAPI *pGetThreadPriorityBoost)(HANDLE,PBOOL); +static BOOL (WINAPI *pGetProcessPriorityBoost)(HANDLE,PBOOL); static HANDLE (WINAPI *pOpenThread)(DWORD,BOOL,DWORD); static BOOL (WINAPI *pQueueUserWorkItem)(LPTHREAD_START_ROUTINE,PVOID,ULONG); static BOOL (WINAPI *pSetThreadPriorityBoost)(HANDLE,BOOL); +static BOOL (WINAPI *pSetProcessPriorityBoost)(HANDLE,BOOL); static BOOL (WINAPI *pSetThreadStackGuarantee)(ULONG*); static BOOL (WINAPI *pRegisterWaitForSingleObject)(PHANDLE,HANDLE,WAITORTIMERCALLBACK,PVOID,ULONG,ULONG); static BOOL (WINAPI *pUnregisterWait)(HANDLE); @@ -777,17 +779,33 @@ static VOID test_thread_priority(void)
rc = pSetThreadPriorityBoost(curthread,1); ok( rc != 0, "error=%ld\n",GetLastError()); - todo_wine { - rc=pGetThreadPriorityBoost(curthread,&disabled); - ok(rc!=0 && disabled==1, - "rc=%d error=%ld disabled=%d\n",rc,GetLastError(),disabled); - } + rc=pGetThreadPriorityBoost(curthread,&disabled); + ok(rc!=0 && disabled==1, + "rc=%d error=%ld disabled=%d\n",rc,GetLastError(),disabled); + + rc = pSetThreadPriorityBoost(curthread,0); + ok( rc != 0, "error=%ld\n",GetLastError()); + rc=pGetThreadPriorityBoost(curthread,&disabled); + ok(rc!=0 && disabled==0, + "rc=%d error=%ld disabled=%d\n",rc,GetLastError(),disabled); + + rc = pSetProcessPriorityBoost(GetCurrentProcess(),1); + ok( rc != 0, "error=%ld\n",GetLastError()); + rc=pGetThreadPriorityBoost(curthread,&disabled); + ok(rc!=0 && disabled==1, + "rc=%d error=%ld disabled=%d\n",rc,GetLastError(),disabled); + rc=pGetProcessPriorityBoost(GetCurrentProcess(),&disabled); + ok(rc!=0 && disabled==1, + "rc=%d error=%ld disabled=%d\n",rc,GetLastError(),disabled);
rc = pSetThreadPriorityBoost(curthread,0); ok( rc != 0, "error=%ld\n",GetLastError()); rc=pGetThreadPriorityBoost(curthread,&disabled); ok(rc!=0 && disabled==0, "rc=%d error=%ld disabled=%d\n",rc,GetLastError(),disabled); + rc=pGetProcessPriorityBoost(GetCurrentProcess(),&disabled); + ok(rc!=0 && disabled==1, + "rc=%d error=%ld disabled=%d\n",rc,GetLastError(),disabled); }
/* check the GetThreadTimes function */ @@ -2583,9 +2601,11 @@ static void init_funcs(void) #define X(f) p##f = (void*)GetProcAddress(hKernel32, #f) X(GetCurrentThreadStackLimits); X(GetThreadPriorityBoost); + X(GetProcessPriorityBoost); X(OpenThread); X(QueueUserWorkItem); X(SetThreadPriorityBoost); + X(SetProcessPriorityBoost); X(SetThreadStackGuarantee); X(RegisterWaitForSingleObject); X(UnregisterWait);