| 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 | { |
nothing calls this directly
no outgoing calls
no test coverage detected