Fix runas regression from commit
@@ -1198,6 +1198,8 @@ INT_PTR CALLBACK PhpRunAsDlgProc(
if (userPart) PhDereferenceObject(userPart);
}
else
+ {
+ if (context->ProcessId)
{
HANDLE processHandle = NULL;
HANDLE newProcessHandle;
@@ -1276,20 +1278,22 @@ INT_PTR CALLBACK PhpRunAsDlgProc(
{
NtClose(processHandle);
}
-
- // TODO: Commented out while testing above method (dmex)
- //status = PhExecuteRunAsCommand3(
- // hwndDlg,
- // PhGetString(program),
- // PhGetString(username),
- // PhGetStringOrEmpty(password),
- // logonType,
- // context->ProcessId,
- // sessionId,
- // PhGetString(desktopName),
- // useLinkedToken,
- // createSuspended
- // );
+ }
+ else
+ {
+ status = PhExecuteRunAsCommand3(
+ hwndDlg,
+ PhGetString(program),
+ PhGetString(username),
+ PhGetStringOrEmpty(password),
+ logonType,
+ context->ProcessId,
+ sessionId,
+ PhGetString(desktopName),
+ useLinkedToken,
+ createSuspended
+ );
+ }
}
}
else
