MCPcopy Create free account
hub / github.com/NoMercy-ac/NoMercy / GetParentProcessIdNative

Method GetParentProcessIdNative

Source/Client/NM_Engine/ProcessFunctions.cpp:231–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

229}
230
231DWORD_PTR CProcessFunctions::GetParentProcessIdNative(HANDLE hProcess)
232{
233 PROCESS_BASIC_INFORMATION pPBI = { 0 };
234 auto ntStat = g_winapiApiTable->NtQueryInformationProcess(hProcess, ProcessBasicInformation, &pPBI, sizeof(pPBI), 0);
235 if (!NT_SUCCESS(ntStat))
236 {
237 DEBUG_LOG(LL_ERR, "NtQueryInformationProcess fail! Target process: %p Status: %p", hProcess, ntStat);
238 return 0UL;
239 }
240
241 return reinterpret_cast<DWORD_PTR>(pPBI.InheritedFromUniqueProcessId);
242}
243
244std::string CProcessFunctions::GetParentProcessName(DWORD dwCurrPID)
245{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected