MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / GetProcessNameByProcessId

Function GetProcessNameByProcessId

KernelLibrary/SysMon.cpp:29–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28
29PUCHAR GetProcessNameByProcessId(HANDLE ProcessId) {
30 NTSTATUS status = STATUS_UNSUCCESSFUL;
31 PEPROCESS Process = nullptr;
32 PUCHAR name = nullptr;
33 status = PsLookupProcessByProcessId(ProcessId, &Process);
34 if (NT_SUCCESS(status)) {
35 name = PsGetProcessImageFileName(Process);
36 ObDereferenceObject(Process);
37 }
38 return name;
39}
40
41void OnProcessNotify(_Inout_ PEPROCESS Process, _In_ HANDLE ProcessId, _Inout_opt_ PPS_CREATE_NOTIFY_INFO CreateInfo) {
42 //UNREFERENCED_PARAMETER(Process);

Callers 1

OnProcessNotifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected