From: Brendan Shanks <bshanks@codeweavers.com> --- dlls/user32/tests/sysparams.c | 7 +++++++ dlls/win32u/sysparams.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c index 501d9afe5ea..ebf4bf7ca9e 100644 --- a/dlls/user32/tests/sysparams.c +++ b/dlls/user32/tests/sysparams.c @@ -4329,6 +4329,7 @@ static void test_dpi_context(void) DPI_AWARENESS_CONTEXT context; BOOL ret; UINT dpi; + HANDLE process; HDC hdc = GetDC( 0 ); context = pGetThreadDpiAwarenessContext(); @@ -4375,6 +4376,12 @@ static void test_dpi_context(void) ret = pGetProcessDpiAwarenessInternal( GetCurrentProcess(), &awareness ); ok( ret, "got %d\n", ret ); ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong value %d\n", awareness ); + process = OpenProcess( PROCESS_QUERY_LIMITED_INFORMATION, FALSE, GetCurrentProcessId() ); + ret = pGetProcessDpiAwarenessInternal( process, &awareness ); + ok( ret, "got %d\n", ret ); + ok( awareness == DPI_AWARENESS_SYSTEM_AWARE, "wrong value %d\n", awareness ); + CloseHandle(process); + SetLastError(0xdeadbeef); ret = pGetProcessDpiAwarenessInternal( (HANDLE)0xdeadbeef, &awareness ); todo_wine diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index ea477939eba..527f39cdfe8 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -7387,7 +7387,7 @@ ULONG WINAPI NtUserGetProcessDpiAwarenessContext( HANDLE process ) { ULONG context; - if (process && process != GetCurrentProcess()) + if (process && !(process == GetCurrentProcess() || !NtCompareObjects( GetCurrentProcess(), process ))) { WARN( "not supported on other process %p\n", process ); return NTUSER_DPI_UNAWARE; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10102