Go to the source code of this file.
◆ DisableTokenPrivileges()
Definition at line 48 of file NtCompareTokens.c.
49{
51
54 {
55 skip(
"AdjustTokenPrivileges() has failed to disable the privileges (error code: %lu)!\n",
GetLastError());
56 return;
57 }
58}
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
DWORD WINAPI GetLastError(void)
Referenced by START_TEST().
◆ GetDuplicateToken()
Definition at line 31 of file NtCompareTokens.c.
32{
35
38 {
39 skip(
"DuplicateToken() has failed to get the process' token (error code: %lu)!\n",
GetLastError());
41 }
42
43 return ReturnedToken;
44}
BOOL WINAPI DuplicateToken(IN HANDLE ExistingTokenHandle, IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel, OUT PHANDLE DuplicateTokenHandle)
Referenced by START_TEST().
◆ GetTokenFromCurrentProcess()
Definition at line 12 of file NtCompareTokens.c.
13{
16
21 {
22 skip(
"OpenProcessToken() has failed to get the process' token (error code: %lu)!\n",
GetLastError());
24 }
25
27}
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
#define GetCurrentProcess()
#define TOKEN_ADJUST_PRIVILEGES
Referenced by START_TEST().
◆ START_TEST()
Definition at line 60 of file NtCompareTokens.c.
61{
66
67
70
71
72
73
74
77
78
79
80
81
84
85
89
90
94
95
97
98
99
100
101
105
106
109}
static VOID DisableTokenPrivileges(_In_ HANDLE Token)
static HANDLE GetDuplicateToken(_In_ HANDLE Token)
static HANDLE GetTokenFromCurrentProcess(VOID)
#define ok_hex(expression, result)
NTSTATUS NTAPI NtCompareTokens(_In_ HANDLE FirstTokenHandle, _In_ HANDLE SecondTokenHandle, _Out_ PBOOLEAN Equal)
Compares tokens if they're equal or not.
#define STATUS_ACCESS_VIOLATION