Module: wine Branch: master Commit: 25b05840d4fad5d12f308077925e3cf92bcebfb7 URL: https://gitlab.winehq.org/wine/wine/-/commit/25b05840d4fad5d12f308077925e3cf... Author: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Date: Mon Sep 19 00:13:24 2022 +0900 win32u: Fix data race in NtUserGetProcessDpiAwarenessContext. --- dlls/win32u/sysparams.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 498ed386386..9f0812b843e 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -5330,14 +5330,17 @@ BOOL WINAPI NtUserSetProcessDpiAwarenessContext( ULONG awareness, ULONG unknown */ ULONG WINAPI NtUserGetProcessDpiAwarenessContext( HANDLE process ) { + DPI_AWARENESS val; + if (process && process != GetCurrentProcess()) { WARN( "not supported on other process %p\n", process ); return NTUSER_DPI_UNAWARE; } - if (!dpi_awareness) return NTUSER_DPI_UNAWARE; - return dpi_awareness; + val = ReadNoFence( &dpi_awareness ); + if (!val) return NTUSER_DPI_UNAWARE; + return val; } BOOL message_beep( UINT i )