45 _In_ ULONG CharactersPerLine,
51 BOOLEAN afterFirstLine;
55 bytesPerLine = CharactersPerLine *
sizeof(WCHAR);
56 afterFirstLine =
FALSE;
60 bytesToAppend = line.
Length;
62 if (bytesToAppend > bytesPerLine)
63 bytesToAppend = bytesPerLine;
69 if (IndentAfterFirstLine)
74 afterFirstLine =
TRUE;
79 static int __cdecl ServiceForTooltipCompare(
80 _In_
const void *elem1,
81 _In_
const void *elem2
92 _Out_opt_ PULONG ValidToTickCount
96 ULONG validForMs = 60 * 60 * 1000;
104 if (Process->CommandLine)
120 &Process->VersionInfo,
137 if (Process->QueryHandle)
140 if (Process->CommandLine && Process->QueryHandle)
145 Process->CommandLine,
241 if (Process->ServiceList && Process->ServiceList->Count != 0)
243 ULONG enumerationKey = 0;
250 serviceList =
PhCreateList(Process->ServiceList->Count);
255 Process->ServiceList,
271 for (i = 0; i < serviceList->
Count; i++)
273 serviceItem = serviceList->
Items[i];
322 validForMs = 10 * 1000;
347 if (Process->FileName)
356 else if (Process->VerifyResult ==
VrUnknown)
366 if (Process->IsPacked)
370 L
" Image is probably packed (%u imports over %u modules).\n",
371 Process->ImportFunctions,
372 Process->ImportModules
376 if ((ULONG_PTR)Process->ConsoleHostProcessId & ~3)
379 PWSTR description = L
"Console host";
382 clientId.
UniqueProcess = (HANDLE)((ULONG_PTR)Process->ConsoleHostProcessId & ~3);
385 if ((ULONG_PTR)Process->ConsoleHostProcessId & 2)
386 description = L
"Console application";
393 if (Process->PackageFullName)
398 if (Process->IsDotNet)
400 if (Process->IsElevated)
402 if (Process->IsImmersive)
404 if (Process->IsInJob)
406 if (Process->IsPosix)
408 if (Process->IsWow64)
420 if (ValidToTickCount)
421 *ValidToTickCount = GetTickCount() + validForMs;
438 HANDLE processHandle;
441 ULONG environmentLength;
442 ULONG enumerationKey;
454 if (Process->IsWow64)
475 remainingPart = variable.
Value;
477 while (remainingPart.
Length != 0)
483 HANDLE driverKeyHandle;
506 deviceName = secondPart;
508 deviceName = deviceDesc->
sr;
524 if (hardwareId->
Length != 0)
536 NtClose(driverKeyHandle);
547 NtClose(processHandle);
555 static CLSID CLSID_TaskScheduler_I = { 0x0f87369f, 0xa4e5, 0x4cfc, { 0xbd, 0x3e, 0x73, 0xe6, 0x15, 0x45, 0x72, 0xdd } };
556 static IID IID_ITaskService_I = { 0x2faba4c7, 0x4da9, 0x4013, { 0x96, 0x97, 0x20, 0xcc, 0x3f, 0xd4, 0x0f, 0x85 } };
558 ITaskService *taskService;
560 if (SUCCEEDED(CoCreateInstance(
561 &CLSID_TaskScheduler_I,
563 CLSCTX_INPROC_SERVER,
568 VARIANT empty = { 0 };
570 if (SUCCEEDED(ITaskService_Connect(taskService, empty, empty, empty, empty)))
572 IRunningTaskCollection *runningTasks;
574 if (SUCCEEDED(ITaskService_GetRunningTasks(
586 if (SUCCEEDED(IRunningTaskCollection_get_Count(runningTasks, &count)))
588 for (i = 1; i <= count; i++)
590 IRunningTask *runningTask;
594 if (SUCCEEDED(IRunningTaskCollection_get_Item(runningTasks, index, &runningTask)))
601 SUCCEEDED(IRunningTask_get_EnginePID(runningTask, &pid)) &&
602 pid == (ULONG)Process->ProcessId
605 IRunningTask_get_CurrentAction(runningTask, &action);
606 IRunningTask_get_Path(runningTask, &path);
615 SysFreeString(action);
620 IRunningTask_Release(runningTask);
625 IRunningTaskCollection_Release(runningTasks);
629 ITaskService_Release(taskService);
638 SC_HANDLE serviceHandle;
642 if (serviceHandle =
PhOpenService(Service->Name->Buffer, SERVICE_QUERY_CONFIG))
690 CloseServiceHandle(serviceHandle);