[PATCH 1/2] ntdll: Improve NtSetThreadExecutionState() stub.

Alexandre Julliard julliard at winehq.org
Tue Aug 13 04:10:35 CDT 2019


Chip Davis <cdavis at codeweavers.com> writes:

> @@ -3062,14 +3062,14 @@ NTSTATUS WINAPI NtInitiatePowerAction(
>   */
>  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;
> +    struct ntdll_thread_data *thread_data = ntdll_get_thread_data();
> +
> +    *old_state = thread_data->exec_state;
>  
>      WARN( "(0x%x, %p): stub, harmless.\n", new_state, old_state );
>  
> -    if (!(current & ES_CONTINUOUS) || (new_state & ES_CONTINUOUS))
> -        current = new_state;
> +    if (new_state & ES_CONTINUOUS)
> +        thread_data->exec_state = new_state;
>      return STATUS_SUCCESS;
>  }

This would most likely need to be stored in the server, it doesn't seem
very useful to have in the local thread data.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list