Commit 15aa8c6f authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

kernelbase: Add SetThreadInformation().

parent 821dd844
...@@ -1470,6 +1470,7 @@ ...@@ -1470,6 +1470,7 @@
@ stdcall -import SetThreadGroupAffinity(long ptr ptr) @ stdcall -import SetThreadGroupAffinity(long ptr ptr)
@ stdcall -import SetThreadIdealProcessor(long long) @ stdcall -import SetThreadIdealProcessor(long long)
@ stdcall -import SetThreadIdealProcessorEx(long ptr ptr) @ stdcall -import SetThreadIdealProcessorEx(long ptr ptr)
@ stdcall -import SetThreadInformation(long long ptr long)
@ stdcall -import SetThreadLocale(long) @ stdcall -import SetThreadLocale(long)
@ stdcall -import SetThreadPreferredUILanguages(long ptr ptr) @ stdcall -import SetThreadPreferredUILanguages(long ptr ptr)
@ stdcall -import SetThreadPriority(long long) @ stdcall -import SetThreadPriority(long long)
......
...@@ -1520,7 +1520,7 @@ ...@@ -1520,7 +1520,7 @@
@ stdcall SetThreadGroupAffinity(long ptr ptr) @ stdcall SetThreadGroupAffinity(long ptr ptr)
@ stdcall SetThreadIdealProcessor(long long) @ stdcall SetThreadIdealProcessor(long long)
@ stdcall SetThreadIdealProcessorEx(long ptr ptr) @ stdcall SetThreadIdealProcessorEx(long ptr ptr)
# @ stub SetThreadInformation @ stdcall SetThreadInformation(long long ptr long)
@ stdcall SetThreadLocale(long) @ stdcall SetThreadLocale(long)
@ stdcall SetThreadPreferredUILanguages(long ptr ptr) @ stdcall SetThreadPreferredUILanguages(long ptr ptr)
@ stdcall SetThreadPriority(long long) @ stdcall SetThreadPriority(long long)
......
...@@ -607,6 +607,25 @@ LANGID WINAPI DECLSPEC_HOTPATCH SetThreadUILanguage( LANGID langid ) ...@@ -607,6 +607,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.@) * SuspendThread (kernelbase.@)
*/ */
DWORD WINAPI DECLSPEC_HOTPATCH SuspendThread( HANDLE thread ) DWORD WINAPI DECLSPEC_HOTPATCH SuspendThread( HANDLE thread )
......
...@@ -23,8 +23,23 @@ ...@@ -23,8 +23,23 @@
extern "C" { extern "C" {
#endif #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 GetThreadDescription(HANDLE,PWSTR *);
WINBASEAPI HRESULT WINAPI SetThreadDescription(HANDLE,PCWSTR); WINBASEAPI HRESULT WINAPI SetThreadDescription(HANDLE,PCWSTR);
WINBASEAPI BOOL WINAPI SetThreadInformation(HANDLE,THREAD_INFORMATION_CLASS,LPVOID,DWORD);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
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