SHTestTokenPrivilegeW

Go to Home Page

Checks whether a privilege is present in a token

Syntax

BOOL WINAPI SHTestTokenPrivilegeW (
    HANDLE hToken,
    LPCWSTR pwszPrivilege
)

Parameters

hToken
The token to test
privilege
The privilege to check the presence of

Return Value

TRUE is the privilege is present, FALSE otherwise

Remarks

If hToken is NULL, the calling threads' token is used. If the calling thread doesn't have its own token, the process token is used instead.

pwszPrivilege must be one the predefined SE_*_NAME constants.

This function is also known as _SHTestTokenPrivilegeW@8.