PsReferencePrimaryToken function

The PsReferencePrimaryToken routine increments the reference count of the primary token for the specified process.

Syntax

NTKERNELAPI PACCESS_TOKEN PsReferencePrimaryToken(
  PEPROCESS Process
);

Parameters

Process

Pointer to the process whose primary token's reference count is to be incremented.

Return Value

PsReferencePrimaryToken returns a pointer to the primary token for the given process.

Remarks

This routine is available starting with Microsoft Windows 2000.

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:

  • ObDereferenceObject, for Windows 2000

  • PsDereferencePrimaryToken, for Microsoft Windows XP and later.

For more information about security and access control, see the documentation on these topics in the Microsoft Windows SDK.

Requirements

   
Target Platform Universal
Header ntifs.h (include FltKernel.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL PASSIVE_LEVEL

See Also

ObDereferenceObject

PsDereferencePrimaryToken

PsReferenceImpersonationToken

SeQueryInformationToken