The PsGetCurrentProcessId routine identifies the current thread's process.
HANDLE PsGetCurrentProcessId( VOID );
PsGetCurrentProcessId returns the process ID of the of the current thread's process.
IRQL: Any level
Headers: Declared in Ntddk.h. Include Ntddk.h.
IoGetCurrentProcess, PsGetCurrentProcess, PsGetCurrentThread, PsGetCurrentThreadId, PsSetCreateProcessNotifyRoutine, PsSetCreateThreadNotifyRoutine, PsSetLoadImageNotifyRoutine