Export (0) Print
Expand All

PsGetProcessId routine

The PsGetProcessId routine returns the process identifier (process ID) that is associated with a specified process.

Syntax


HANDLE PsGetProcessId(
  _In_  PEPROCESS Process
);

Parameters

Process [in]

A pointer to a process object structure.

Return value

PsGetProcessId returns the process ID of the process that the Process parameter specifies.

Remarks

The EPROCESS-typed process object structure is an opaque data structure that the operating system uses internally. To obtain a pointer to the EPROCESS structure for the current process, a driver can call PsGetCurrentProcess. To obtain a pointer to the EPROCESS structure for a different process, the driver can call ObReferenceObjectByHandle.

Requirements

Version

Available in Windows XP and later versions of Windows.

Header

Ntddk.h (include Ntddk.h)

Library

Ntoskrnl.lib

IRQL

Any level

See also

ObReferenceObjectByHandle
PsGetCurrentProcess

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft