66{
70 HANDLE DuplicatedTokenHandle;
73
74
77 0,
80
81
83
84
86 0,
92
93
94
95
96
97
98
99
100
102
103
106 {
107 skip(
"Failed to query the total size for token statistics structure! (Status -> 0x%lx)\n",
Status);
108 return;
109 }
110
111
113 if (TokenStats ==
NULL)
114 {
115 skip(
"Failed to allocate our token statistics buffer!\n");
116 return;
117 }
118
119
122 {
123 skip(
"Failed to query the token statistics! (Status -> 0x%lx)\n",
Status);
124 return;
125 }
126
128 trace(
"Number of groups of regular token -- %lu\n", TokenStats->
GroupCount);
129
130
132 0,
136 &DuplicatedTokenHandle);
138
139
140
141
142
143
144
145
148 {
149 skip(
"Failed to query the token statistics! (Status -> 0x%lx)\n",
Status);
150 return;
151 }
152
153 trace(
"Number of privileges of effective only token -- %lu\n", TokenStats->
PrivilegeCount);
154 trace(
"Number of groups of effective only token -- %lu\n", TokenStats->
GroupCount);
155
156
157
158
159
163}
static VOID DisablePrivilege(_In_ HANDLE Token, _In_ LPCWSTR PrivilegeName)
static HANDLE OpenTokenFromProcess(VOID)
#define ok_hex(expression, result)
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define NT_SUCCESS(StatCode)
#define InitializeObjectAttributes(p, n, a, r, s)
_In_ ACCESS_MASK _In_ ULONG _Out_ PHANDLE TokenHandle
#define STATUS_ACCESS_VIOLATION
#define STATUS_BUFFER_TOO_SMALL
_Must_inspect_result_ __kernel_entry NTSTATUS NTAPI NtQueryInformationToken(_In_ HANDLE TokenHandle, _In_ TOKEN_INFORMATION_CLASS TokenInformationClass, _Out_writes_bytes_to_opt_(TokenInformationLength, *ReturnLength) PVOID TokenInformation, _In_ ULONG TokenInformationLength, _Out_ PULONG ReturnLength)
Queries a specific type of information in regard of an access token based upon the information class....
_Must_inspect_result_ __kernel_entry NTSTATUS NTAPI NtDuplicateToken(_In_ HANDLE ExistingTokenHandle, _In_ ACCESS_MASK DesiredAccess, _In_opt_ POBJECT_ATTRIBUTES ObjectAttributes, _In_ BOOLEAN EffectiveOnly, _In_ TOKEN_TYPE TokenType, _Out_ PHANDLE NewTokenHandle)
Duplicates a token.
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size