Signed-off-by: Chip Davis cdavis@codeweavers.com --- dlls/ntdll/nt.c | 17 +++++++++++++++++ dlls/ntdll/ntdll.spec | 4 ++-- include/winternl.h | 1 + 3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c index b58c2d6e98a..cdfbd9fa822 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -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 diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 323d5eae77a..278699c7077 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -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 diff --git a/include/winternl.h b/include/winternl.h index 49eedaf1f98..d6543917e64 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -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);