FreeRDP
winpr/libwinpr/security/security.c
1 
20 #include <winpr/config.h>
21 
22 #include <winpr/crt.h>
23 
24 #ifdef WINPR_HAVE_UNISTD_H
25 #include <unistd.h>
26 #endif
27 
28 #include <winpr/security.h>
29 
30 #include "../handle/handle.h"
31 
124 #ifndef _WIN32
125 
126 #include "security.h"
127 
128 BOOL InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD dwRevision)
129 {
130  return TRUE;
131 }
132 
133 DWORD GetSecurityDescriptorLength(PSECURITY_DESCRIPTOR pSecurityDescriptor)
134 {
135  return 0;
136 }
137 
138 BOOL IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor)
139 {
140  return TRUE;
141 }
142 
143 BOOL GetSecurityDescriptorControl(PSECURITY_DESCRIPTOR pSecurityDescriptor,
144  PSECURITY_DESCRIPTOR_CONTROL pControl, LPDWORD lpdwRevision)
145 {
146  return TRUE;
147 }
148 
149 BOOL SetSecurityDescriptorControl(PSECURITY_DESCRIPTOR pSecurityDescriptor,
150  SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest,
151  SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet)
152 {
153  return TRUE;
154 }
155 
156 BOOL GetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, LPBOOL lpbDaclPresent,
157  PACL* pDacl, LPBOOL lpbDaclDefaulted)
158 {
159  return TRUE;
160 }
161 
162 BOOL SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent,
163  PACL pDacl, BOOL bDaclDefaulted)
164 {
165  return TRUE;
166 }
167 
168 BOOL GetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID* pGroup,
169  LPBOOL lpbGroupDefaulted)
170 {
171  return TRUE;
172 }
173 
174 BOOL SetSecurityDescriptorGroup(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pGroup,
175  BOOL bGroupDefaulted)
176 {
177  return TRUE;
178 }
179 
180 BOOL GetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID* pOwner,
181  LPBOOL lpbOwnerDefaulted)
182 {
183  return TRUE;
184 }
185 
186 BOOL SetSecurityDescriptorOwner(PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pOwner,
187  BOOL bOwnerDefaulted)
188 {
189  return TRUE;
190 }
191 
192 DWORD GetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR SecurityDescriptor, PUCHAR RMControl)
193 {
194  return 0;
195 }
196 
197 DWORD SetSecurityDescriptorRMControl(PSECURITY_DESCRIPTOR SecurityDescriptor, PUCHAR RMControl)
198 {
199  return 0;
200 }
201 
202 BOOL GetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, LPBOOL lpbSaclPresent,
203  PACL* pSacl, LPBOOL lpbSaclDefaulted)
204 {
205  return TRUE;
206 }
207 
208 BOOL SetSecurityDescriptorSacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bSaclPresent,
209  PACL pSacl, BOOL bSaclDefaulted)
210 {
211  return TRUE;
212 }
213 
214 #endif
215 
216 BOOL AccessTokenIsValid(HANDLE handle)
217 {
218  WINPR_HANDLE* h = (WINPR_HANDLE*)handle;
219 
220  if (!h || (h->Type != HANDLE_TYPE_ACCESS_TOKEN))
221  {
222  SetLastError(ERROR_INVALID_PARAMETER);
223  return FALSE;
224  }
225  return TRUE;
226 }