diff --git a/src/corelib/io/qstandardpaths_win.cpp b/src/corelib/io/qstandardpaths_win.cpp index 93034dd9b0b..0d24ed3ce92 100644 --- a/src/corelib/io/qstandardpaths_win.cpp +++ b/src/corelib/io/qstandardpaths_win.cpp @@ -40,14 +40,12 @@ #include "qstandardpaths.h" #include -#include #include #ifndef QT_BOOTSTRAPPED #include #endif -#include #include #include #include @@ -95,14 +93,7 @@ static inline void appendTestMode(QString &path) } static bool isProcessLowIntegrity() { -#ifdef Q_CC_MINGW - // GetCurrentProcessToken was introduced in MinGW w64 in v7 - // Disable function until Qt CI is updated - return false; -#else - // non-leaking pseudo-handle. Expanded inline function GetCurrentProcessToken() - // (was made an inline function in Windows 8). - const auto process_token = HANDLE(quintptr(-4)); + const HANDLE process_token = GetCurrentProcessToken(); QVarLengthArray token_info_buf(256); auto* token_info = reinterpret_cast(token_info_buf.data()); @@ -119,7 +110,6 @@ static bool isProcessLowIntegrity() { // there's no point in checking before dereferencing DWORD integrity_level = *GetSidSubAuthority(token_info->Label.Sid, *GetSidSubAuthorityCount(token_info->Label.Sid) - 1); return (integrity_level < SECURITY_MANDATORY_MEDIUM_RID); -#endif } // Map QStandardPaths::StandardLocation to KNOWNFOLDERID of SHGetKnownFolderPath()