20 #include <winpr/config.h>
22 #include <winpr/crt.h>
24 #ifdef WINPR_HAVE_UNISTD_H
28 #include <winpr/security.h>
30 #include "../handle/handle.h"
126 #include "security.h"
128 BOOL InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD dwRevision)
133 DWORD GetSecurityDescriptorLength(PSECURITY_DESCRIPTOR pSecurityDescriptor)
138 BOOL IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor)
143 BOOL GetSecurityDescriptorControl(PSECURITY_DESCRIPTOR pSecurityDescriptor,
144 PSECURITY_DESCRIPTOR_CONTROL pControl, LPDWORD lpdwRevision)
149 BOOL SetSecurityDescriptorControl(PSECURITY_DESCRIPTOR pSecurityDescriptor,
150 SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,
151 SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet)
156 BOOL GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, LPBOOL lpbDaclPresent,
157 PACL* pDacl, LPBOOL lpbDaclDefaulted)
162 BOOL SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent,
163 PACL pDacl, BOOL bDaclDefaulted)
168 BOOL GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID* pGroup,
169 LPBOOL lpbGroupDefaulted)
174 BOOL SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pGroup,
175 BOOL bGroupDefaulted)
180 BOOL GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID* pOwner,
181 LPBOOL lpbOwnerDefaulted)
186 BOOL SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pOwner,
187 BOOL bOwnerDefaulted)
192 DWORD GetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR SecurityDescriptor, PUCHAR RMControl)
197 DWORD SetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR SecurityDescriptor, PUCHAR RMControl)
202 BOOL GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, LPBOOL lpbSaclPresent,
203 PACL* pSacl, LPBOOL lpbSaclDefaulted)
208 BOOL SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bSaclPresent,
209 PACL pSacl, BOOL bSaclDefaulted)
216 BOOL AccessTokenIsValid(HANDLE handle)
220 if (!h || (h->Type != HANDLE_TYPE_ACCESS_TOKEN))
222 SetLastError(ERROR_INVALID_PARAMETER);