Commit 60cae6e2 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Implemented kernel32:SetThreadPriority on top of ntdll's equivalent

functions.
parent 856221c0
...@@ -416,16 +416,19 @@ BOOL WINAPI SetThreadPriority( ...@@ -416,16 +416,19 @@ BOOL WINAPI SetThreadPriority(
HANDLE hthread, /* [in] Handle to thread */ HANDLE hthread, /* [in] Handle to thread */
INT priority) /* [in] Thread priority level */ INT priority) /* [in] Thread priority level */
{ {
BOOL ret; DWORD prio = priority;
SERVER_START_REQ( set_thread_info ) NTSTATUS status;
status = NtSetInformationThread(hthread, ThreadBasePriority,
&prio, sizeof(prio));
if (status)
{ {
req->handle = hthread; SetLastError( RtlNtStatusToDosError(status) );
req->priority = priority; return FALSE;
req->mask = SET_THREAD_INFO_PRIORITY;
ret = !wine_server_call_err( req );
} }
SERVER_END_REQ;
return ret; return TRUE;
} }
......
...@@ -634,12 +634,25 @@ NTSTATUS WINAPI NtSetInformationThread( HANDLE handle, THREADINFOCLASS class, ...@@ -634,12 +634,25 @@ NTSTATUS WINAPI NtSetInformationThread( HANDLE handle, THREADINFOCLASS class,
status = wine_server_call( req ); status = wine_server_call( req );
} }
SERVER_END_REQ; SERVER_END_REQ;
return status;
} }
return status;
case ThreadBasePriority:
{
const DWORD *pprio = data;
if (length != sizeof(DWORD)) return STATUS_INVALID_PARAMETER;
SERVER_START_REQ( set_thread_info )
{
req->handle = handle;
req->priority = *pprio;
req->mask = SET_THREAD_INFO_PRIORITY;
status = wine_server_call( req );
}
SERVER_END_REQ;
}
return status;
case ThreadBasicInformation: case ThreadBasicInformation:
case ThreadTimes: case ThreadTimes:
case ThreadPriority: case ThreadPriority:
case ThreadBasePriority:
case ThreadAffinityMask: case ThreadAffinityMask:
case ThreadDescriptorTableEntry: case ThreadDescriptorTableEntry:
case ThreadEnableAlignmentFaultFixup: case ThreadEnableAlignmentFaultFixup:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment