MCPcopy Create free account
hub / github.com/CobaltFusion/DebugViewPP / GetParentProcessId

Function GetParentProcessId

Win32Lib/Win32Lib.cpp:420–429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

418}
419
420ULONG_PTR GetParentProcessId()
421{
422 ULONG_PTR pbi[6];
423 ULONG ulSize = 0;
424 long (WINAPI* NtQueryInformationProcess)(HANDLE ProcessHandle, ULONG ProcessInformationClass, void* ProcessInformation, ULONG ProcessInformationLength, ULONG* pReturnLength);
425 *(FARPROC *)&NtQueryInformationProcess = GetProcAddress(LoadLibraryA("NTDLL.DLL"), "NtQueryInformationProcess");
426 if (NtQueryInformationProcess && NtQueryInformationProcess(GetCurrentProcess(), 0, &pbi, sizeof(pbi), &ulSize) >= 0 && ulSize == sizeof(pbi))
427 return pbi[5];
428 return (ULONG_PTR)-1;
429}
430
431std::vector<std::wstring> GetCommandLineArguments()
432{

Callers 2

ForwardMessagesFromPipeFunction · 0.85
CapturePipeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected