blob: b754ee4d7648ebe2c2720e945359dbf246a2e47e [file] [log] [blame] [raw]
#include <windows.h>
#include <nt.h>
#include <unistd.h>
pid_t getpid() {
PROCESS_BASIC_INFORMATION pbi;
NtQueryInformationProcess((void *)-1, ProcessBasicInformation, &pbi, sizeof pbi, NULL);
return pbi.UniqueProcessId;
}
pid_t getppid() {
PROCESS_BASIC_INFORMATION pbi;
NtQueryInformationProcess((void *)-1, ProcessBasicInformation, &pbi, sizeof pbi, NULL);
return pbi.InheritedFromUniqueProcessId;
}