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
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.
Requirements
| 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
Feedback
Submit and view feedback for