MCPcopy Create free account
hub / github.com/Schnocker/NoEye / GetParentPid

Method GetParentPid

NoEye_Service/CProcess.cpp:147–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145 return GetProcessId(this->hProcess);
146 }
147 DWORD CProcess::GetParentPid()
148 {
149 ULONG_PTR pbi[6];
150 ULONG ulSize = 0;
151 typedef NTSTATUS(WINAPI *_NtQueryInformationProcess)(HANDLE ProcessHandle, ULONG ProcessInformationClass, PVOID ProcessInformation, ULONG ProcessInformationLength, PULONG ReturnLength);
152 static _NtQueryInformationProcess __NtQueryInformationProcess = reinterpret_cast<_NtQueryInformationProcess>(GetProcAddress(GetModuleHandleA("ntdll.dll"), "NtQueryInformationProcess"));;
153 if (!__NtQueryInformationProcess)
154 return 0;
155 if (__NtQueryInformationProcess(this->hProcess, 0, &pbi, sizeof(pbi), &ulSize) >= 0 && ulSize == sizeof(pbi))
156 return static_cast<DWORD>(pbi[5]);
157 return 0;
158 }
159
160 int CProcess::Is64(PBOOL Is64)
161 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected