55 TRACE(
"IntGetCurrentAccessToken(): The thread doesn't have a token, trying to open the process one...\n");
62 ERR(
"IntGetCurrentAccessToken(): Failed to capture security context, couldn't open the process token (Status 0x%08lx)\n",
Status);
71 ERR(
"IntGetCurrentAccessToken(): Failed to capture security context, couldn't open the thread token (Status 0x%08lx)\n",
Status);
112 ERR(
"IntAllocateSecurityBuffer(): Failed to allocate the buffer (Status 0x%08lx)\n",
Status);
184 ERR(
"IntQueryUserSecurityIdentification(): Couldn't capture the token!\n");
210 ERR(
"IntQueryUserSecurityIdentification(): Couldn't allocate memory for the token user!\n");
217 ERR(
"IntQueryUserSecurityIdentification(): Failed to query the necessary length for the buffer (Status 0x%08lx)!\n",
Status);
231 ERR(
"IntQueryUserSecurityIdentification(): Failed to query token user (Status 0x%08lx)\n",
Status);
291 ERR(
"IntAssignDesktopSecurityOnParse(): Failed to capture the security descriptor from window station (Status 0x%08lx)\n",
Status);
302 ERR(
"IntAssignDesktopSecurityOnParse(): Failed to assign security information to the desktop object (Status 0x%08lx)\n",
Status);
348 ERR(
"IntCreateServiceSecurity(): Failed to query the token user (Status 0x%08lx)\n",
Status);
356 ERR(
"IntCreateServiceSecurity(): Failed to initialize absolute SD (Status 0x%08lx)\n",
Status);
398 ERR(
"IntCreateServiceSecurity(): Failed to allocate memory for service DACL!\n");
409 ERR(
"IntCreateServiceSecurity(): Failed to create service DACL (Status 0x%08lx)\n",
Status);
425 ERR(
"IntCreateServiceSecurity(): Failed to set up window station ACE for authenticated user (Status 0x%08lx)\n",
Status);
442 ERR(
"IntCreateServiceSecurity(): Failed to set up desktop ACE for authenticated user (Status 0x%08lx)\n",
Status);
457 ERR(
"IntCreateServiceSecurity(): Failed to set up window station ACE for admins (Status 0x%08lx)\n",
Status);
473 ERR(
"IntCreateServiceSecurity(): Failed to set up desktop ACE for admins (Status 0x%08lx)\n",
Status);
484 ERR(
"IntCreateServiceSecurity(): Failed to set up service DACL to absolute SD (Status 0x%08lx)\n",
Status);
494 ERR(
"IntCreateServiceSecurity(): Failed to make the absolute SD as ownerless (Status 0x%08lx)\n",
Status);
504 ERR(
"IntCreateServiceSecurity(): Failed to make the absolute SD as having no primary group (Status 0x%08lx)\n",
Status);
517 ERR(
"IntCreateServiceSecurity(): Unexpected status code, must be STATUS_BUFFER_TOO_SMALL (Status 0x%08lx)\n",
Status);
525 ERR(
"IntCreateServiceSecurity(): Failed to allocate memory pool for relative SD!\n");
536 ERR(
"IntCreateServiceSecurity(): Failed to convert absolute SD to a relative one (Status 0x%08lx)\n",
Status);
#define DBG_DEFAULT_CHANNEL(ch)
#define NT_SUCCESS(StatCode)
NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAceEx(PACL, DWORD, DWORD, DWORD, PSID)
NTSYSAPI NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR, PSID, BOOLEAN)
NTSYSAPI NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR, BOOLEAN, PACL, BOOLEAN)
#define DESKTOP_ALL_ACCESS
struct _ACCESS_ALLOWED_ACE ACCESS_ALLOWED_ACE
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
_In_ ACCESS_MASK _In_ ULONG _Out_ PHANDLE TokenHandle
NTSYSAPI NTSTATUS NTAPI ZwOpenThreadToken(_In_ HANDLE ThreadHandle, _In_ ACCESS_MASK DesiredAccess, _In_ BOOLEAN OpenAsSelf, _Out_ PHANDLE TokenHandle)
NTSYSAPI NTSTATUS NTAPI RtlCreateAcl(PACL Acl, ULONG AclSize, ULONG AclRevision)
NTSYSAPI ULONG NTAPI RtlLengthSid(IN PSID Sid)
NTSYSAPI NTSTATUS NTAPI RtlCreateSecurityDescriptor(_Out_ PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ ULONG Revision)
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG DaclSize
_In_ ULONG _In_ ULONG _In_ ULONG Length
NTSYSAPI NTSTATUS NTAPI RtlSetGroupSecurityDescriptor(IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor, IN PSID Group, IN BOOLEAN GroupDefaulted)
NTSYSAPI NTSTATUS NTAPI RtlAbsoluteToSelfRelativeSD(IN PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor, IN OUT PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor, IN PULONG BufferLength)
NTSTATUS NTAPI ObGetObjectSecurity(IN PVOID Object, OUT PSECURITY_DESCRIPTOR *SecurityDescriptor, OUT PBOOLEAN MemoryAllocated)
VOID NTAPI ObReleaseObjectSecurity(IN PSECURITY_DESCRIPTOR SecurityDescriptor, IN BOOLEAN MemoryAllocated)
NTSTATUS NTAPI ObAssignSecurity(IN PACCESS_STATE AccessState, IN PSECURITY_DESCRIPTOR SecurityDescriptor, IN PVOID Object, IN POBJECT_TYPE Type)
#define STATUS_BUFFER_TOO_SMALL
#define STATUS_UNSUCCESSFUL
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
POBJECT_TYPE ExDesktopObjectType
HANDLE IntGetCurrentAccessToken(VOID)
Opens an access token that represents the effective security context of the caller....
NTSTATUS NTAPI IntAssignDesktopSecurityOnParse(_In_ PWINSTATION_OBJECT WinSta, _In_ PDESKTOP Desktop, _In_ PACCESS_STATE AccessState)
Assigns a security descriptor to the desktop object during a desktop object parse procedure.
NTSTATUS IntQueryUserSecurityIdentification(_Out_ PTOKEN_USER *User)
Queries the authenticated user security identifier (SID) that is associated with the security context...
PVOID IntAllocateSecurityBuffer(_In_ SIZE_T Length)
Allocates a buffer within UM (user mode) address space area. Such buffer is reserved for security pur...
NTSTATUS NTAPI IntCreateServiceSecurity(_Out_ PSECURITY_DESCRIPTOR *ServiceSd)
Creates a security descriptor for the service.
VOID IntFreeSecurityBuffer(_In_ PVOID Buffer)
Frees an allocated security buffer from UM memory that is been previously allocated by IntAllocateSec...
#define WINSTA_ACCESS_ALL
#define DESKTOP_ENUMERATE
#define DESKTOP_WRITEOBJECTS
#define DESKTOP_READOBJECTS
_Out_ PSECURITY_DESCRIPTOR _Out_ PBOOLEAN MemoryAllocated
_In_opt_ PVOID _In_opt_ PUNICODE_STRING _In_ PSECURITY_DESCRIPTOR _In_ PACCESS_STATE AccessState
#define OBJECT_INHERIT_ACE
#define NO_PROPAGATE_INHERIT_ACE
#define SECURITY_DESCRIPTOR_REVISION
#define ZwCurrentThread()
NTSYSAPI NTSTATUS NTAPI ZwOpenProcessToken(_In_ HANDLE ProcessHandle, _In_ ACCESS_MASK DesiredAccess, _Out_ PHANDLE TokenHandle)
#define ZwCurrentProcess()