Sorry for the stupid question, but I'm just interested in. Why on earth process ID is always a pointer in the kernel header files and functions? In the same time process id is just a DWORD in user mode.
Code: Select all
From ntdef.h
NTSTATUS PsLookupProcessByProcessId(
_In_ HANDLE ProcessId,
_Out_ PEPROCESS *Process
);
Code: Select all
Also both process ID and thread ID are pointers in CLIENT_ID structure.typedef void *HANDLE;
Code: Select all
User mode function
typedef struct _CLIENT_ID
{
PVOID UniqueProcess;
PVOID UniqueThread;
} CLIENT_ID, *PCLIENT_ID;
Code: Select all
DWORD WINAPI GetCurrentProcessId