PsReferencePrimaryToken routine

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

Syntax


PACCESS_TOKEN PsReferencePrimaryToken(
  _Inout_ PEPROCESS Process
);

Parameters

Process [in, out]

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 or Ntifs.h)

Library

NtosKrnl.lib

DLL

NtosKrnl.exe

IRQL

PASSIVE_LEVEL

See also

ObDereferenceObject
PsDereferencePrimaryToken
PsReferenceImpersonationToken
SeQueryInformationToken

 

 

Send comments about this topic to Microsoft

Show: