Bewerken

Delen via


PsReferencePrimaryToken function (ntifs.h)

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

Syntax

PACCESS_TOKEN PsReferencePrimaryToken(
  [in, out] PEPROCESS Process
);

Parameters

[in, out] 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

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 Windows security model for driver developers and the documentation on these topics in the Windows SDK.

Requirements

Requirement Value
Minimum supported client Windows 2000
Target Platform Universal
Header ntifs.h (include FltKernel.h, Ntifs.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL PASSIVE_LEVEL
DDI compliance rules HwStorPortProhibitedDDIs(storport), PowerIrpDDis(wdm)

See also

ObDereferenceObject

PsDereferencePrimaryToken

PsReferenceImpersonationToken

SeQueryInformationToken