summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorYuhang Zhao <2546789017@qq.com>2021-12-24 15:06:01 +0800
committerYuhang Zhao <2546789017@qq.com>2022-01-13 13:14:30 +0800
commitae7e11e5c6c0e8e9ae03bb8feecf4bcb2d85d72d (patch)
tree2f1dd5032ba6342c5515dc4f52cf7359c9b24aaa /src/corelib/io
parent6241dcb9a446ae39696377d886cd9d2ee0f77601 (diff)
QStandardPaths: Remove old MinGW workaround
From the comments the workaround is for MinGW older than v7, now our CI has MinGW v9 trunk, it should be safe to drop this. The magic number is replaced by the official function, although it was introduced in Win8, Qt6's minimum supported platform is Win10, so it's also safe to do. As a drive-by, remove two unused includes. Change-Id: I891fe3883f17d4914932784868d7446299d32c65 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qstandardpaths_win.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/corelib/io/qstandardpaths_win.cpp b/src/corelib/io/qstandardpaths_win.cpp
index 93034dd9b0..0d24ed3ce9 100644
--- a/src/corelib/io/qstandardpaths_win.cpp
+++ b/src/corelib/io/qstandardpaths_win.cpp
@@ -40,14 +40,12 @@
#include "qstandardpaths.h"
#include <qdir.h>
-#include <private/qsystemlibrary_p.h>
#include <qstringlist.h>
#ifndef QT_BOOTSTRAPPED
#include <qcoreapplication.h>
#endif
-#include <qoperatingsystemversion.h>
#include <qt_windows.h>
#include <shlobj.h>
#include <intshcut.h>
@@ -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<char,256> token_info_buf(256);
auto* token_info = reinterpret_cast<TOKEN_MANDATORY_LABEL*>(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()