kernelbase: Add SetThreadInformation().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52956
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2022-05-20 15:20:27 +03:00 committed by Alexandre Julliard
parent 821dd844ea
commit 15aa8c6fb8
4 changed files with 36 additions and 1 deletions

View File

@ -1470,6 +1470,7 @@
@ stdcall -import SetThreadGroupAffinity(long ptr ptr)
@ stdcall -import SetThreadIdealProcessor(long long)
@ stdcall -import SetThreadIdealProcessorEx(long ptr ptr)
@ stdcall -import SetThreadInformation(long long ptr long)
@ stdcall -import SetThreadLocale(long)
@ stdcall -import SetThreadPreferredUILanguages(long ptr ptr)
@ stdcall -import SetThreadPriority(long long)

View File

@ -1520,7 +1520,7 @@
@ stdcall SetThreadGroupAffinity(long ptr ptr)
@ stdcall SetThreadIdealProcessor(long long)
@ stdcall SetThreadIdealProcessorEx(long ptr ptr)
# @ stub SetThreadInformation
@ stdcall SetThreadInformation(long long ptr long)
@ stdcall SetThreadLocale(long)
@ stdcall SetThreadPreferredUILanguages(long ptr ptr)
@ stdcall SetThreadPriority(long long)

View File

@ -606,6 +606,25 @@ LANGID WINAPI DECLSPEC_HOTPATCH SetThreadUILanguage( LANGID langid )
}
/**********************************************************************
* SetThreadInformation (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH SetThreadInformation( HANDLE thread, THREAD_INFORMATION_CLASS info_class,
VOID *info, DWORD size )
{
switch (info_class)
{
case ThreadMemoryPriority:
return set_ntstatus( NtSetInformationThread( thread, ThreadPagePriority, info, size ));
case ThreadPowerThrottling:
return set_ntstatus( NtSetInformationThread( thread, ThreadPowerThrottlingState, info, size ));
default:
FIXME("Unsupported class %u.\n", info_class);
return FALSE;
}
}
/**********************************************************************
* SuspendThread (kernelbase.@)
*/

View File

@ -23,8 +23,23 @@
extern "C" {
#endif
typedef enum _THREAD_INFORMATION_CLASS
{
ThreadMemoryPriority,
ThreadAbsoluteCpuPriority,
ThreadDynamicCodePolicy,
ThreadPowerThrottling,
ThreadInformationClassMax
} THREAD_INFORMATION_CLASS;
typedef struct _MEMORY_PRIORITY_INFORMATION
{
ULONG MemoryPriority;
} MEMORY_PRIORITY_INFORMATION, *PMEMORY_PRIORITY_INFORMATION;
WINBASEAPI HRESULT WINAPI GetThreadDescription(HANDLE,PWSTR *);
WINBASEAPI HRESULT WINAPI SetThreadDescription(HANDLE,PCWSTR);
WINBASEAPI BOOL WINAPI SetThreadInformation(HANDLE,THREAD_INFORMATION_CLASS,LPVOID,DWORD);
#ifdef __cplusplus
}