22 ok(0,
"OpenProcessToken() has failed to get the process' token (error code: %lu)!\n",
GetLastError());
48 ok(0,
"Failed to query buffer length, STATUS_BUFFER_TOO_SMALL has to be expected (Status code %lx)!\n",
Status);
55 ok(0,
"Failed to allocate from heap for token default DACL (required buffer length %lu)!\n",
BufferLength);
66 ok(0,
"Failed to query default DACL (Status code %lx)!\n",
Status);
95 ok(0,
"Failed to allocate Local System SID (Status code %lx)!\n",
Status);
107 ok(0,
"Failed to allocate from heap for DACL!\n");
117 ok(0,
"Failed to create ACL (Status code %lx)!\n",
Status);
129 ok(0,
"Failed to add access allowed ACE (Status code %lx)!\n",
Status);
149 ULONG OriginalDaclLength, NewDaclLength;
159 ok(0,
"Failed to query token's default DACL!\n");
167 ok(0,
"Failed to allocate buffer for new DACL!\n");
216 ULONG DummyReturnLength = 0;
#define STATUS_PRIVILEGE_NOT_HELD
#define ok_ntstatus(status, expected)
static SID_IDENTIFIER_AUTHORITY NtAuthority
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)
#define STATUS_INVALID_HANDLE
#define NT_SUCCESS(StatCode)
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
#define GetCurrentProcess()
NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL, DWORD, DWORD, PSID)
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL Dacl
NTSYSAPI NTSTATUS NTAPI RtlCreateAcl(PACL Acl, ULONG AclSize, ULONG AclRevision)
NTSYSAPI ULONG NTAPI RtlLengthSid(IN PSID Sid)
_In_ ULONG _In_ ULONG _In_ ULONG Length
NTSYSAPI NTSTATUS NTAPI RtlAllocateAndInitializeSid(IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, IN UCHAR SubAuthorityCount, IN ULONG SubAuthority0, IN ULONG SubAuthority1, IN ULONG SubAuthority2, IN ULONG SubAuthority3, IN ULONG SubAuthority4, IN ULONG SubAuthority5, IN ULONG SubAuthority6, IN ULONG SubAuthority7, OUT PSID *Sid)
#define STATUS_INVALID_INFO_CLASS
#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 NtSetInformationToken(_In_ HANDLE TokenHandle, _In_ TOKEN_INFORMATION_CLASS TokenInformationClass, _In_reads_bytes_(TokenInformationLength) PVOID TokenInformation, _In_ ULONG TokenInformationLength)
Sets (modifies) some specific information in regard of an access token. The calling thread must have ...
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
DWORD WINAPI GetLastError(void)
#define SECURITY_LOCAL_SYSTEM_RID
#define TOKEN_ADJUST_SESSIONID
#define SECURITY_NT_AUTHORITY
#define TOKEN_ADJUST_DEFAULT