// ntddk.h
HANDLE PsGetProcessId(
[in] PEPROCESS Process
);
View the official Windows Driver Kit DDI reference
No description available.
The PsGetProcessId routine returns the process identifier (process ID) that is associated with a specified process.
Process
[in]A pointer to a process object structure.
PsGetProcessId returns the process ID of the process that the Process parameter specifies.
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.
When used with PsGetCurrentProcess, this function returns the process ID of the process that the current thread is attached to (from APC state). This may differ from PsGetCurrentProcessId, which returns the process ID of the process that created the current thread.