Skip to content

Commit 46993ac

Browse files
committed
Fix for issue9118 - wrong elevation detection for non-admin accounts with UAC
1 parent baf02e9 commit 46993ac

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/libs/dutil/WixToolset.DUtil/procutil.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ extern "C" HRESULT DAPI ProcElevated(
4444
HANDLE hToken = NULL;
4545
TOKEN_ELEVATION tokenElevated = { };
4646
DWORD cbToken = 0;
47+
BOOL bPrivileged = FALSE;
48+
49+
if (OsCouldRunPrivileged(&bPrivileged) != S_OK ||
50+
!bPrivileged)
51+
{
52+
*pfElevated = FALSE;
53+
ExitFunction1(hr = S_OK);
54+
}
4755

4856
if (!::OpenProcessToken(hProcess, TOKEN_QUERY, &hToken))
4957
{

0 commit comments

Comments
 (0)