Skip to content

Commit

Permalink
Fix EnableStartAsAdminAlwaysOnTop feature
Browse files Browse the repository at this point in the history
  • Loading branch information
DartVanya committed Sep 17, 2024
1 parent 5fc950c commit 4048311
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions SystemInformer/admintask.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,6 @@ NTSTATUS PhRunAsAdminTaskUIAccess(
NTSTATUS status;
BOOLEAN tokenIsUIAccess;
ULONG sessionId;
CLIENT_ID desktopId;
PPH_STRING fileName;

if (!PhGetOwnTokenAttributes().Elevated)
Expand All @@ -454,13 +453,6 @@ NTSTATUS PhRunAsAdminTaskUIAccess(
if (PhIsNullOrEmptyString(fileName))
return STATUS_UNSUCCESSFUL;

// Query the process from the current desktop.

status = PhGetWindowClientId(GetDesktopWindow(), &desktopId);

if (!NT_SUCCESS(status))
return status;

// Query the session from the current process.

status = PhGetProcessSessionId(NtCurrentProcess(), &sessionId);
Expand All @@ -474,10 +466,10 @@ NTSTATUS PhRunAsAdminTaskUIAccess(
NULL,
NULL,
LOGON32_LOGON_INTERACTIVE,
desktopId.UniqueProcess,
NtCurrentProcessId(),
sessionId,
NULL,
TRUE,
FALSE,
FALSE,
TRUE
);
Expand Down

0 comments on commit 4048311

Please sign in to comment.