55 ok(
Token !=
NULL,
"Token is not captured. Testing SQIT interrupted\n\n");
63 ok(
Buffer !=
NULL,
"Wrong. SQIT call was successful with TokenOwner arg. But Buffer == NULL\n");
81 ok(
Buffer !=
NULL,
"Wrong. SQIT call was successful with TokenDefaultDacl arg. But Buffer == NULL\n");
98 ok(
Buffer !=
NULL,
"Wrong. SQIT call was successful with TokenGroups arg. But Buffer == NULL\n");
104 for (
i = 0;
i < GroupCount;
i++)
113 ok((
Flag ==
TRUE),
"TokenGroup's SIDs are not valid\n");
126 ok(
Buffer ==
NULL,
"SQIT has failed to query the impersonation level but buffer is not NULL!\n");
138 ok(
Buffer ==
NULL,
"Wrong. SQIT call failed. But Buffer != NULL\n");
143 ok(
Buffer ==
NULL,
"Wrong. SQIT call failed. But Buffer != NULL\n");
148 ok(
Buffer ==
NULL,
"Wrong. SQIT call failed. But Buffer != NULL\n");
153 ok(
Buffer ==
NULL,
"Wrong. SQIT call failed. But Buffer != NULL\n");
162 ok(
Buffer !=
NULL,
"Wrong. SQIT call was successful with TokenStatistics arg. But Buffer == NULL\n");
167 ok(1,
"print statistics:\n\tTokenID = %u_%d\n\tSecurityImperLevel = %d\n\tPrivCount = %d\n\tGroupCount = %d\n\n", TStats->
TokenId.
LowPart,
176 ok(
Buffer ==
NULL,
"Wrong. SQIT call failed. But Buffer != NULL\n");
186 ok(
Buffer !=
NULL,
"Wrong. SQIT call was successful with TokenType arg. But Buffer == NULL\n");
202 ok(
Buffer !=
NULL,
"Wrong. SQIT call was successful with TokenUser arg. But Buffer == NULL\n");
232 ULONG InitialPrivilegeCount;
283 trace(
"Initial privilege count = %lu\n", InitialPrivilegeCount);
348 ok(Checker,
"Checker is NULL\n");
352 trace(
"AuxData->PrivilegesUsed->PrivilegeCount = %d ; Privileges->PrivilegeCount = %d\n",
370 ok(
Buffer !=
NULL,
"Wrong. SQIT call was successful with TokenPrivileges arg. But Buffer == NULL\n");
412 ok(Checker,
"Checker is NULL\n");
416 trace(
"AuxData->PrivilegesUsed->PrivilegeCount = %d ; Privileges->PrivilegeCount = %d\n",
void TestsSeQueryInformationToken(PACCESS_TOKEN Token)
static GENERIC_MAPPING ProcessGenericMapping
BOOLEAN NTAPI SeAccessCheck(_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ PSECURITY_SUBJECT_CONTEXT SubjectSecurityContext, _In_ BOOLEAN SubjectContextLocked, _In_ ACCESS_MASK DesiredAccess, _In_ ACCESS_MASK PreviouslyGrantedAccess, _Out_ PPRIVILEGE_SET *Privileges, _In_ PGENERIC_MAPPING GenericMapping, _In_ KPROCESSOR_MODE AccessMode, _Out_ PACCESS_MASK GrantedAccess, _Out_ PNTSTATUS AccessStatus)
Determines whether security access rights can be given to an object depending on the security descrip...
#define ok_eq_ulong(value, expected)
#define ExAllocatePool(type, size)
_Inout_ PLIST_ENTRY _In_ PVOID _In_ PSTRING _In_ BOOLEAN _In_ BOOLEAN _In_ ULONG _In_ PFLT_CALLBACK_DATA _In_opt_ PCHECK_FOR_TRAVERSE_ACCESS _In_opt_ PSECURITY_SUBJECT_CONTEXT SubjectContext
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define PROCESS_SUSPEND_RESUME
#define PROCESS_TERMINATE
#define PROCESS_QUERY_INFORMATION
#define PROCESS_CREATE_THREAD
#define PROCESS_VM_OPERATION
#define PROCESS_SET_INFORMATION
#define PROCESS_CREATE_PROCESS
#define PROCESS_SET_QUOTA
#define PROCESS_DUP_HANDLE
#define ExFreePoolWithTag(_P, _T)
FORCEINLINE PVOID ExAllocatePoolZero(ULONG PoolType, SIZE_T NumberOfBytes, ULONG Tag)
_In_ ACCESS_MASK AccessMask
NTSYSAPI BOOLEAN NTAPI RtlValidSid(IN PSID Sid)
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_ BOOLEAN _In_ TOKEN_TYPE TokenType
#define PROCESS_ALL_ACCESS
#define STANDARD_RIGHTS_READ
#define STANDARD_RIGHTS_WRITE
#define STANDARD_RIGHTS_EXECUTE
VOID NTAPI SeDeleteAccessState(_In_ PACCESS_STATE AccessState)
Deletes an allocated access state from the memory.
NTSTATUS NTAPI SeCreateAccessState(_Out_ PACCESS_STATE AccessState, _Out_ __drv_aliasesMem PAUX_ACCESS_DATA AuxData, _In_ ACCESS_MASK Access, _In_ PGENERIC_MAPPING GenericMapping)
Creates an access state.
BOOLEAN NTAPI SePrivilegeCheck(_In_ PPRIVILEGE_SET Privileges, _In_ PSECURITY_SUBJECT_CONTEXT SubjectContext, _In_ KPROCESSOR_MODE PreviousMode)
Checks if a set of privileges exist and match within a security subject context.
VOID NTAPI SeFreePrivileges(_In_ PPRIVILEGE_SET Privileges)
Frees a set of privileges.
NTSTATUS NTAPI SeAppendPrivileges(_Inout_ PACCESS_STATE AccessState, _In_ PPRIVILEGE_SET Privileges)
Appends additional privileges.
#define STATUS_INVALID_INFO_CLASS
PPRIVILEGE_SET PrivilegesUsed
LUID_AND_ATTRIBUTES Privilege[ANYSIZE_ARRAY]
SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY]
LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]
SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
VOID NTAPI SeLockSubjectContext(_In_ PSECURITY_SUBJECT_CONTEXT SubjectContext)
Locks both the referenced primary and client access tokens of a security subject context.
VOID NTAPI SeUnlockSubjectContext(_In_ PSECURITY_SUBJECT_CONTEXT SubjectContext)
Unlocks both the referenced primary and client access tokens of a security subject context.
VOID NTAPI SeCaptureSubjectContext(_Out_ PSECURITY_SUBJECT_CONTEXT SubjectContext)
Captures the security subject context of the calling thread and calling process.
NTSTATUS NTAPI SeQueryInformationToken(_In_ PACCESS_TOKEN AccessToken, _In_ TOKEN_INFORMATION_CLASS TokenInformationClass, _Outptr_result_buffer_(_Inexpressible_(token-dependent)) PVOID *TokenInformation)
Queries information details about the given token to the call. The difference between NtQueryInformat...
#define FIELD_OFFSET(t, f)
BOOL Privilege(LPTSTR pszPrivilege, BOOL bEnable)
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
_In_ PSECURITY_SUBJECT_CONTEXT _In_ BOOLEAN _In_ ACCESS_MASK _In_ ACCESS_MASK _Outptr_opt_ PPRIVILEGE_SET * Privileges
#define SeQuerySubjectContextToken(SubjectContext)
_In_opt_ PVOID _In_opt_ PUNICODE_STRING _In_ PSECURITY_DESCRIPTOR _In_ PACCESS_STATE AccessState
struct _TOKEN_GROUPS * PTOKEN_GROUPS
struct _TOKEN_STATISTICS * PTOKEN_STATISTICS
struct _TOKEN_DEFAULT_DACL * PTOKEN_DEFAULT_DACL
struct _TOKEN_USER * PTOKEN_USER
@ TokenGroupsAndPrivileges
@ TokenImpersonationLevel
struct _TOKEN_PRIVILEGES * PTOKEN_PRIVILEGES
enum _TOKEN_TYPE * PTOKEN_TYPE