// ntifs.h
PACCESS_TOKEN PsReferencePrimaryToken(
[in, out] PEPROCESS Process
);
View the official Windows Driver Kit DDI referenceNo description available.
The PsReferencePrimaryToken routine increments the reference count of the primary token for the specified process.
Process [in, out]Pointer to the process whose primary token's reference count is to be incremented.
PsReferencePrimaryToken returns a pointer to the primary token for the given process.
PsReferencePrimaryToken increments the reference count of the returned primary token. Thus for every successful call to PsReferencePrimaryToken, the primary token's reference count must be decremented by calling one of the following functions:
For more information about security and access control, see Windows security model for driver developers and the documentation on these topics in the Windows SDK.