PsGetProcessId
Windows Driver Kit: Kernel-Mode Driver Architecture
PsGetProcessId

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

HANDLE
  PsGetProcessId(
    IN PEPROCESS  Process
    );

Parameters

Process
A pointer to a process object structure.

Return Value

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

Comments

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

Versions: PsGetProcessID is available on Windows XP and later versions of Windows.

IRQL: Any level

Headers: Declared in Ntddk.h. Include Ntddk.h.

See Also

ObReferenceObjectByHandle, PsGetCurrentProcess


Send feedback on this topic
Built on November 19, 2009
© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View