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

Method GetProcessIdNative

Source/Client/NM_Engine/ProcessFunctions.cpp:218–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218DWORD_PTR CProcessFunctions::GetProcessIdNative(HANDLE hProcess)
219{
220 PROCESS_BASIC_INFORMATION pPBI = { 0 };
221 auto ntStat = g_winapiApiTable->NtQueryInformationProcess(hProcess, ProcessBasicInformation, &pPBI, sizeof(pPBI), 0);
222 if (!NT_SUCCESS(ntStat))
223 {
224 DEBUG_LOG(LL_ERR, "NtQueryInformationProcess fail! Target process: %p Status: %p", hProcess, ntStat);
225 return 0UL;
226 }
227
228 return reinterpret_cast<DWORD_PTR>(pPBI.UniqueProcessId);
229}
230
231DWORD_PTR CProcessFunctions::GetParentProcessIdNative(HANDLE hProcess)
232{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected