From 7b14329d78c63ea8c7383b07c54399a3ff888ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Mon, 2 Aug 2021 16:28:04 +0200 Subject: [PATCH] Check for correct "Access Denied" error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SetProcessDpiAwarenessContext() returns ERROR_ACCESS_DENIED if the DPI awareness has already been set, and not E_ACCESSDENIED like SetProcessDpiAwareness() does. Pick-to: 6.2 Change-Id: I6b29214773776f31c0622a35494d98c5c9637b0b Reviewed-by: Tor Arne Vestbø Reviewed-by: Oliver Wolff --- src/plugins/platforms/windows/qwindowscontext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 96abd046fb..433e58a97a 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -510,9 +510,9 @@ void QWindowsContext::setProcessDpiV2Awareness() QWindowsContextPrivate::m_v2DpiAware = true; } else { const HRESULT errorCode = GetLastError(); - // E_ACCESSDENIED means set externally (MSVC manifest or external app loading Qt plugin). + // ERROR_ACCESS_DENIED means set externally (MSVC manifest or external app loading Qt plugin). // Silence warning in that case unless debug is enabled. - if (errorCode != E_ACCESSDENIED || lcQpaWindows().isDebugEnabled()) { + if (errorCode != ERROR_ACCESS_DENIED || lcQpaWindows().isDebugEnabled()) { qWarning().noquote().nospace() << "setProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2) failed: " << QWindowsContext::comErrorString(errorCode); }