26 _In_ HANDLE ProcessHandle,
31 static HWND CommandModeWindowHandle;
33 #define PH_COMMAND_OPTION_HWND 1
38 _In_opt_ PVOID Context
49 CommandModeWindowHandle = (HWND)integer;
65 NTSTATUS status = STATUS_SUCCESS;
82 SIZE_T processIdLength;
87 return STATUS_INVALID_PARAMETER;
91 for (i = 0; i < processIdLength; i++)
97 if (i == processIdLength)
102 return STATUS_INVALID_PARAMETER;
104 processId = (HANDLE)processId64;
117 return STATUS_NOT_FOUND;
129 NtClose(processHandle);
137 NtClose(processHandle);
145 NtClose(processHandle);
153 return STATUS_INVALID_PARAMETER;
168 return STATUS_INVALID_PARAMETER;
175 status = NtSetInformationProcess(processHandle, ProcessPriorityClass, &priorityClass,
sizeof(
PROCESS_PRIORITY_CLASS));
176 NtClose(processHandle);
184 return STATUS_INVALID_PARAMETER;
195 return STATUS_INVALID_PARAMETER;
200 NtClose(processHandle);
205 ULONG64 pagePriority64;
209 return STATUS_INVALID_PARAMETER;
212 pagePriority = (ULONG)pagePriority64;
216 status = NtSetInformationProcess(
222 NtClose(processHandle);
228 return STATUS_INVALID_PARAMETER;
236 LARGE_INTEGER timeout;
244 NtClose(processHandle);
250 return STATUS_INVALID_PARAMETER;
266 LARGE_INTEGER timeout;
276 NtClose(processHandle);
282 SC_HANDLE serviceHandle;
283 SERVICE_STATUS serviceStatus;
286 return STATUS_INVALID_PARAMETER;
296 if (!StartService(serviceHandle, 0, NULL))
299 CloseServiceHandle(serviceHandle);
305 SERVICE_PAUSE_CONTINUE
309 if (!ControlService(serviceHandle, SERVICE_CONTROL_CONTINUE, &serviceStatus))
312 CloseServiceHandle(serviceHandle);
318 SERVICE_PAUSE_CONTINUE
322 if (!ControlService(serviceHandle, SERVICE_CONTROL_PAUSE, &serviceStatus))
325 CloseServiceHandle(serviceHandle);
335 if (!ControlService(serviceHandle, SERVICE_CONTROL_STOP, &serviceStatus))
338 CloseServiceHandle(serviceHandle);
348 if (!DeleteService(serviceHandle))
351 CloseServiceHandle(serviceHandle);
361 return STATUS_INVALID_PARAMETER;
364 return STATUS_INVALID_PARAMETER;
366 threadId = (HANDLE)threadId64;
373 NtClose(threadHandle);
381 NtClose(threadHandle);
389 NtClose(threadHandle);
397 typedef struct _GET_DLL_BASE_REMOTE_CONTEXT
403 static BOOLEAN PhpGetDllBaseRemoteCallback(
404 _In_ PLDR_DATA_TABLE_ENTRY Module,
405 _In_opt_ PVOID Context
415 context->DllBase = Module->DllBase;
423 _In_ HANDLE ProcessHandle,
431 BOOLEAN isWow64 =
FALSE;
434 context.BaseDllName = *BaseDllName;
435 context.DllBase = NULL;
442 if (!context.DllBase)
447 *DllBase = context.DllBase;