RtlCheckTokenMembershipEx - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTRTL_H
#if (PHNT_VERSION >= PHNT_WIN8)

// rev
NTSYSAPI
NTSTATUS
NTAPI
RtlCheckTokenMembershipEx(
    _In_opt_ HANDLE TokenHandle,
    _In_ PSID SidToCheck,
    _In_ ULONG Flags, // CTMF_VALID_FLAGS
    _Out_ PBOOLEAN IsMember
    );

#endif
#endif

View code on GitHub

Determines if a token can pass access checks against the specified SID.

Parameters

Flags

Pseudo-handles

This function supports the following pseudo-handle values:

Implementation details

This function creates a security descriptor with the owner set to the provided SID and a DACL that grants access to the SID. When the flag for including AppContainers is set, it also adds as access allowed ACE for ALL APPLICATION PACKAGES (S-1-15-2-1). When the LPAC flag is set, the function adds an access allowed ACE for ALL RESTRICTED APPLICATION PACKAGES (S-1-15-2-2). Then the function performs an access checks against it via NtAccessCheck.

Required OS version

This function was introduced in Windows 8.

Related Win32 API

See also