Files
loader/ProcessUtils.h
2026-11-03 20:45:39 -08:00

34 lines
614 B
C

#pragma once
#include <windows.h>
struct NewProcInfo
{
HANDLE hProcess;
HANDLE hThread;
DWORD processId;
NewProcInfo()
: hProcess(nullptr)
, hThread(nullptr)
, processId(0)
{
}
};
DWORD GetPidByName(const wchar_t* exeName);
bool ProcessExistsByName(const wchar_t* exeName);
bool StartProcessAsSystem(
HANDLE systemToken,
const wchar_t* exePath,
const wchar_t* args,
bool interactive);
bool CreateProcessSuspendedAsSystem(
HANDLE systemToken,
const wchar_t* exePath,
const wchar_t* args,
bool interactive,
NewProcInfo* out);