Previous Next

PsGetCurrentProcessId

PsGetCurrentProcessId identifies the current process.

HANDLE
  PsGetCurrentProcessId(
    );

Include

ntddk.h

Return Value

PsGetCurrentProcessId returns the 4-byte identifier of the current process.

Comments

Highest-level drivers, such as system profilers or IFSs, that register their own callback(s) with PsSetCreateProcessNotifyRoutine, PsSetCreateThreadNotifyRoutine, and/or PsSetLoadImageNotifyRoutine are likely to call PsGetCurrentProcessId.

Callers of PsGetCurrentProcessId should treat the returned ID as a read-only value.

Callers of PsGetCurrentProcessId can be running at any IRQL.

See Also

IoGetCurrentProcess, PsGetCurrentProcess, PsGetCurrentThread, PsGetCurrentThreadId, PsSetCreateProcessNotifyRoutine, PsSetCreateThreadNotifyRoutine, PsSetLoadImageNotifyRoutine