diff options
author | Morten Sørvig <morten.sorvig@qt.io> | 2021-08-02 16:28:04 +0200 |
---|---|---|
committer | Morten Sørvig <morten.sorvig@qt.io> | 2021-08-20 13:50:24 +0200 |
commit | 7b14329d78c63ea8c7383b07c54399a3ff888ba0 (patch) | |
tree | bd7894279804effeb22388e8931f144df258f54d /src/plugins/platforms/windows/qwindowscontext.cpp | |
parent | 80de5165658e1cfb12d0813ea93dcfecca0dcb45 (diff) |
Check for correct "Access Denied" error
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ø <tor.arne.vestbo@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowscontext.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowscontext.cpp | 4 |
1 files 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); } |