Commit a8b373d6 authored by Fredrik Orderud's avatar Fredrik Orderud Committed by Friedemann Kleint

qstandardpaths_win.cpp: Fix GetCurrentProcessToken() for Win7

The GetCurrentProcessToken() was made an inline function
for Windows 8. Expand it to ensure builds work independent
of WINVER and disable low integrity support for Windows 7.

Fixes: QTBUG-83941
Task-number: QTBUG-83453
Change-Id: Ic989f16621cd80cbc70c6b62779afab8a12714df
Reviewed-by: default avatarFredrik Orderud <>
Reviewed-by: default avatarVolker Hilsheimer <>
Reviewed-by: default avatarThiago Macieira <>
parent 798492cc
......@@ -47,6 +47,7 @@
#include <qcoreapplication.h>
#include <qoperatingsystemversion.h>
#include <qt_windows.h>
#include <shlobj.h>
#include <intshcut.h>
......@@ -99,7 +100,11 @@ static bool isProcessLowIntegrity() {
// Disable function until Qt CI is updated
return false;
HANDLE process_token = GetCurrentProcessToken(); // non-leaking pseudo-handle
if (QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows8)
return false;
// non-leaking pseudo-handle. Expanded inline function GetCurrentProcessToken()
// (was made an inline function in Windows 8).
const auto process_token = HANDLE(quintptr(-4));
QVarLengthArray<char,256> token_info_buf(256);
auto* token_info = reinterpret_cast<TOKEN_MANDATORY_LABEL*>(;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment