Commit 6420ebdf authored by Chip Davis's avatar Chip Davis Committed by Alexandre Julliard

ntdll: Move SetThreadExecutionState() implementation to ntdll.

parent 4e4aa467
......@@ -21,6 +21,7 @@
#include "windef.h"
#include "winbase.h"
#include "winternl.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(powermgnt);
......@@ -100,14 +101,10 @@ BOOL WINAPI SetSystemPowerState(BOOL suspend_or_hibernate,
*/
EXECUTION_STATE WINAPI SetThreadExecutionState(EXECUTION_STATE flags)
{
static EXECUTION_STATE current =
ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED | ES_USER_PRESENT;
EXECUTION_STATE old = current;
EXECUTION_STATE old;
WARN("(0x%x): stub, harmless.\n", flags);
NtSetThreadExecutionState(flags, &old);
if (!(current & ES_CONTINUOUS) || (flags & ES_CONTINUOUS))
current = flags;
return old;
}
......
......@@ -3056,6 +3056,23 @@ NTSTATUS WINAPI NtInitiatePowerAction(
return STATUS_NOT_IMPLEMENTED;
}
/******************************************************************************
* NtSetThreadExecutionState [NTDLL.@]
*
*/
NTSTATUS WINAPI NtSetThreadExecutionState( EXECUTION_STATE new_state, EXECUTION_STATE *old_state )
{
static EXECUTION_STATE current =
ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED | ES_USER_PRESENT;
*old_state = current;
WARN( "(0x%x, %p): stub, harmless.\n", new_state, old_state );
if (!(current & ES_CONTINUOUS) || (new_state & ES_CONTINUOUS))
current = new_state;
return STATUS_SUCCESS;
}
#ifdef linux
/* Fallback using /proc/cpuinfo for Linux systems without cpufreq. For
* most distributions on recent enough hardware, this is only likely to
......
......@@ -381,7 +381,7 @@
@ stdcall NtSetSystemInformation(long ptr long)
@ stub NtSetSystemPowerState
@ stdcall NtSetSystemTime(ptr ptr)
# @ stub NtSetThreadExecutionState
@ stdcall NtSetThreadExecutionState(long ptr)
@ stdcall NtSetTimer(long ptr ptr ptr long long ptr)
@ stdcall NtSetTimerResolution(long long ptr)
# @ stub NtSetUuidSeed
......@@ -1330,7 +1330,7 @@
@ stdcall -private ZwSetSystemInformation(long ptr long) NtSetSystemInformation
@ stub ZwSetSystemPowerState
@ stdcall -private ZwSetSystemTime(ptr ptr) NtSetSystemTime
# @ stub ZwSetThreadExecutionState
@ stdcall ZwSetThreadExecutionState(long ptr) NtSetThreadExecutionState
@ stdcall -private ZwSetTimer(long ptr ptr ptr long long ptr) NtSetTimer
@ stdcall -private ZwSetTimerResolution(long long ptr) NtSetTimerResolution
# @ stub ZwSetUuidSeed
......
......@@ -2515,6 +2515,7 @@ NTSYSAPI NTSTATUS WINAPI NtSetSystemEnvironmentValue(PUNICODE_STRING,PUNICODE_S
NTSYSAPI NTSTATUS WINAPI NtSetSystemInformation(SYSTEM_INFORMATION_CLASS,PVOID,ULONG);
NTSYSAPI NTSTATUS WINAPI NtSetSystemPowerState(POWER_ACTION,SYSTEM_POWER_STATE,ULONG);
NTSYSAPI NTSTATUS WINAPI NtSetSystemTime(const LARGE_INTEGER*,LARGE_INTEGER*);
NTSYSAPI NTSTATUS WINAPI NtSetThreadExecutionState(EXECUTION_STATE,EXECUTION_STATE*);
NTSYSAPI NTSTATUS WINAPI NtSetTimer(HANDLE, const LARGE_INTEGER*, PTIMER_APC_ROUTINE, PVOID, BOOLEAN, ULONG, BOOLEAN*);
NTSYSAPI NTSTATUS WINAPI NtSetTimerResolution(ULONG,BOOLEAN,PULONG);
NTSYSAPI NTSTATUS WINAPI NtSetValueKey(HANDLE,const UNICODE_STRING *,ULONG,ULONG,const void *,ULONG);
......
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