diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-02-09 13:44:55 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-02-10 11:03:09 -0800 |
commit | 5e378aaff61c9708e0657f3ee29517c06cb075fa (patch) | |
tree | a40d800894f07a55be5b0ae585e6f90c375380bc | |
parent | abf4175436dd3fdb7089b1f7bd62cf2a839d3c13 (diff) |
QStandardPaths/Win: fix build with old MinGW SDK
...that may lack GetCurrentProcessToken. The definition in the new SDKs
is:
FORCEINLINE HANDLE GetCurrentProcessToken (VOID)
{
return (HANDLE)(LONG_PTR) (-4);
}
This is a partial revert of ae7e11e5c6c0e8e9ae03bb8feecf4bcb2d85d72d.
Pick-to: 6.3
Change-Id: I74249c52dc02478ba93cfffd16d23c487229f95d
Reviewed-by: Yuhang Zhao <2546789017@qq.com>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
-rw-r--r-- | src/corelib/io/qstandardpaths_win.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/io/qstandardpaths_win.cpp b/src/corelib/io/qstandardpaths_win.cpp index 2ddf4a5fe1..d191ed33b4 100644 --- a/src/corelib/io/qstandardpaths_win.cpp +++ b/src/corelib/io/qstandardpaths_win.cpp @@ -92,8 +92,10 @@ static inline void appendTestMode(QString &path) path += QLatin1String("/qttest"); } -static bool isProcessLowIntegrity() { - const HANDLE process_token = GetCurrentProcessToken(); +static bool isProcessLowIntegrity() +{ + // same as GetCurrentProcessToken() + const auto process_token = HANDLE(quintptr(-4)); QVarLengthArray<char,256> token_info_buf(256); auto* token_info = reinterpret_cast<TOKEN_MANDATORY_LABEL*>(token_info_buf.data()); |