ReactOS  0.4.12-dev-36-g472787f
sec.c File Reference
#include <advapi32.h>
Include dependency graph for sec.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (advapi)
 
BOOL WINAPI GetSecurityDescriptorControl (PSECURITY_DESCRIPTOR pSecurityDescriptor, PSECURITY_DESCRIPTOR_CONTROL pControl, LPDWORD lpdwRevision)
 
BOOL WINAPI GetSecurityDescriptorDacl (PSECURITY_DESCRIPTOR pSecurityDescriptor, LPBOOL lpbDaclPresent, PACL *pDacl, LPBOOL lpbDaclDefaulted)
 
BOOL WINAPI GetSecurityDescriptorGroup (PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID *pGroup, LPBOOL lpbGroupDefaulted)
 
BOOL WINAPI GetSecurityDescriptorOwner (PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID *pOwner, LPBOOL lpbOwnerDefaulted)
 
DWORD WINAPI GetSecurityDescriptorRMControl (PSECURITY_DESCRIPTOR SecurityDescriptor, PUCHAR RMControl)
 
BOOL WINAPI GetSecurityDescriptorSacl (PSECURITY_DESCRIPTOR pSecurityDescriptor, LPBOOL lpbSaclPresent, PACL *pSacl, LPBOOL lpbSaclDefaulted)
 
BOOL WINAPI IsValidSecurityDescriptor (PSECURITY_DESCRIPTOR pSecurityDescriptor)
 
BOOL WINAPI MakeAbsoluteSD2 (IN OUT PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor, OUT LPDWORD lpdwBufferSize)
 
BOOL WINAPI MakeSelfRelativeSD (PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor, PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor, LPDWORD lpdwBufferLength)
 
BOOL WINAPI SetSecurityDescriptorControl (PSECURITY_DESCRIPTOR pSecurityDescriptor, SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest, SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet)
 
BOOL WINAPI SetSecurityDescriptorDacl (PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent, PACL pDacl, BOOL bDaclDefaulted)
 
BOOL WINAPI SetSecurityDescriptorGroup (PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pGroup, BOOL bGroupDefaulted)
 
BOOL WINAPI SetSecurityDescriptorOwner (PSECURITY_DESCRIPTOR pSecurityDescriptor, PSID pOwner, BOOL bOwnerDefaulted)
 
DWORD WINAPI SetSecurityDescriptorRMControl (PSECURITY_DESCRIPTOR SecurityDescriptor, PUCHAR RMControl)
 
BOOL WINAPI SetSecurityDescriptorSacl (PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bSaclPresent, PACL pSacl, BOOL bSaclDefaulted)
 
VOID WINAPI QuerySecurityAccessMask (IN SECURITY_INFORMATION SecurityInformation, OUT LPDWORD DesiredAccess)
 
VOID WINAPI SetSecurityAccessMask (IN SECURITY_INFORMATION SecurityInformation, OUT LPDWORD DesiredAccess)
 
BOOL WINAPI ConvertToAutoInheritPrivateObjectSecurity (IN PSECURITY_DESCRIPTOR ParentDescriptor, IN PSECURITY_DESCRIPTOR CurrentSecurityDescriptor, OUT PSECURITY_DESCRIPTOR *NewSecurityDescriptor, IN GUID *ObjectType, IN BOOLEAN IsDirectoryObject, IN PGENERIC_MAPPING GenericMapping)
 
DWORD WINAPI BuildSecurityDescriptorW (IN PTRUSTEE_W pOwner OPTIONAL, IN PTRUSTEE_W pGroup OPTIONAL, IN ULONG cCountOfAccessEntries, IN PEXPLICIT_ACCESS_W pListOfAccessEntries OPTIONAL, IN ULONG cCountOfAuditEntries, IN PEXPLICIT_ACCESS_W pListOfAuditEntries OPTIONAL, IN PSECURITY_DESCRIPTOR pOldSD OPTIONAL, OUT PULONG pSizeNewSD, OUT PSECURITY_DESCRIPTOR *pNewSD)
 
DWORD WINAPI BuildSecurityDescriptorA (IN PTRUSTEE_A pOwner OPTIONAL, IN PTRUSTEE_A pGroup OPTIONAL, IN ULONG cCountOfAccessEntries, IN PEXPLICIT_ACCESS_A pListOfAccessEntries OPTIONAL, IN ULONG cCountOfAuditEntries, IN PEXPLICIT_ACCESS_A pListOfAuditEntries OPTIONAL, IN PSECURITY_DESCRIPTOR pOldSD OPTIONAL, OUT PULONG pSizeNewSD, OUT PSECURITY_DESCRIPTOR *pNewSD)
 

Function Documentation

◆ BuildSecurityDescriptorA()

DWORD WINAPI BuildSecurityDescriptorA ( IN PTRUSTEE_A pOwner  OPTIONAL,
IN PTRUSTEE_A pGroup  OPTIONAL,
IN ULONG  cCountOfAccessEntries,
IN PEXPLICIT_ACCESS_A pListOfAccessEntries  OPTIONAL,
IN ULONG  cCountOfAuditEntries,
IN PEXPLICIT_ACCESS_A pListOfAuditEntries  OPTIONAL,
IN PSECURITY_DESCRIPTOR pOldSD  OPTIONAL,
OUT PULONG  pSizeNewSD,
OUT PSECURITY_DESCRIPTOR pNewSD 
)

Definition at line 456 of file sec.c.

465 {
467  return FALSE;
468 }
#define UNIMPLEMENTED
Definition: debug.h:114

◆ BuildSecurityDescriptorW()

DWORD WINAPI BuildSecurityDescriptorW ( IN PTRUSTEE_W pOwner  OPTIONAL,
IN PTRUSTEE_W pGroup  OPTIONAL,
IN ULONG  cCountOfAccessEntries,
IN PEXPLICIT_ACCESS_W pListOfAccessEntries  OPTIONAL,
IN ULONG  cCountOfAuditEntries,
IN PEXPLICIT_ACCESS_W pListOfAuditEntries  OPTIONAL,
IN PSECURITY_DESCRIPTOR pOldSD  OPTIONAL,
OUT PULONG  pSizeNewSD,
OUT PSECURITY_DESCRIPTOR pNewSD 
)

Definition at line 436 of file sec.c.

Referenced by test_BuildSecurityDescriptorW().

445 {
447  return FALSE;
448 }
#define UNIMPLEMENTED
Definition: debug.h:114

◆ ConvertToAutoInheritPrivateObjectSecurity()

BOOL WINAPI ConvertToAutoInheritPrivateObjectSecurity ( IN PSECURITY_DESCRIPTOR  ParentDescriptor,
IN PSECURITY_DESCRIPTOR  CurrentSecurityDescriptor,
OUT PSECURITY_DESCRIPTOR NewSecurityDescriptor,
IN GUID ObjectType,
IN BOOLEAN  IsDirectoryObject,
IN PGENERIC_MAPPING  GenericMapping 
)

Definition at line 419 of file sec.c.

425 {
427  return FALSE;
428 }
#define UNIMPLEMENTED
Definition: debug.h:114

◆ GetSecurityDescriptorControl()

BOOL WINAPI GetSecurityDescriptorControl ( PSECURITY_DESCRIPTOR  pSecurityDescriptor,
PSECURITY_DESCRIPTOR_CONTROL  pControl,
LPDWORD  lpdwRevision 
)

Definition at line 21 of file sec.c.

Referenced by DumpDacl(), DumpSacl(), test_GetNamedSecurityInfoA(), test_GetShellSecurityDescriptor(), test_PrivateObjectSecurity(), test_SetSecurityDescriptorControl(), and test_token_label().

24 {
26 
27  Status = RtlGetControlSecurityDescriptor(pSecurityDescriptor,
28  pControl,
29  (PULONG)lpdwRevision);
30  if (!NT_SUCCESS(Status))
31  {
33  return FALSE;
34  }
35 
36  return TRUE;
37 }
#define TRUE
Definition: types.h:120
NTSYSAPI NTSTATUS NTAPI RtlGetControlSecurityDescriptor(_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _Out_ PSECURITY_DESCRIPTOR_CONTROL Control, _Out_ PULONG Revision)
LONG NTSTATUS
Definition: precomp.h:26
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
#define SetLastError(x)
Definition: compat.h:409
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
unsigned int * PULONG
Definition: retypes.h:1

◆ GetSecurityDescriptorDacl()

BOOL WINAPI GetSecurityDescriptorDacl ( PSECURITY_DESCRIPTOR  pSecurityDescriptor,
LPBOOL  lpbDaclPresent,
PACL pDacl,
LPBOOL  lpbDaclDefaulted 
)

Definition at line 45 of file sec.c.

Referenced by AccRewriteGetHandleRights(), CSecurityDescriptor::BeginDACLInteration(), DumpDacl(), handle_setacl(), IEffectivePermission_fnGetEffectivePermission(), PrintFileDacl(), ReloadPrincipalsList(), RSAENH_CPSetProvParam(), SetupCommitFileQueueW(), test_child_token_sd(), test_default_dacl_owner_sid(), test_GetNamedSecurityInfoA(), test_GetSecurityInfo(), test_GetShellSecurityDescriptor(), test_security_descriptor(), test_token_label(), test_token_security_descriptor(), and validate_default_security_descriptor().

49 {
53 
54  Status = RtlGetDaclSecurityDescriptor(pSecurityDescriptor,
55  &DaclPresent,
56  pDacl,
57  &DaclDefaulted);
58  *lpbDaclPresent = (BOOL)DaclPresent;
59  *lpbDaclDefaulted = (BOOL)DaclDefaulted;
60 
61  if (!NT_SUCCESS(Status))
62  {
64  return FALSE;
65  }
66 
67  return TRUE;
68 }
#define TRUE
Definition: types.h:120
_In_ BOOLEAN _In_opt_ PACL _In_opt_ BOOLEAN DaclDefaulted
Definition: rtlfuncs.h:1595
LONG NTSTATUS
Definition: precomp.h:26
_In_ BOOLEAN DaclPresent
Definition: rtlfuncs.h:1595
NTSYSAPI NTSTATUS NTAPI RtlGetDaclSecurityDescriptor(_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _Out_ PBOOLEAN DaclPresent, _Out_ PACL *Dacl, _Out_ PBOOLEAN DaclDefaulted)
unsigned char BOOLEAN
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
#define SetLastError(x)
Definition: compat.h:409
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
#define BOOL
Definition: msvc.h:23

◆ GetSecurityDescriptorGroup()

BOOL WINAPI GetSecurityDescriptorGroup ( PSECURITY_DESCRIPTOR  pSecurityDescriptor,
PSID pGroup,
LPBOOL  lpbGroupDefaulted 
)

Definition at line 76 of file sec.c.

Referenced by AccRewriteGetHandleRights(), DumpGroup(), handle_setacl(), RSAENH_CPSetProvParam(), SetupCommitFileQueueW(), test_GetNamedSecurityInfoA(), test_GetSecurityInfo(), test_group_equal(), test_security_descriptor(), test_token_label(), and validate_default_security_descriptor().

79 {
82 
83  Status = RtlGetGroupSecurityDescriptor(pSecurityDescriptor,
84  pGroup,
85  &GroupDefaulted);
86  *lpbGroupDefaulted = (BOOL)GroupDefaulted;
87 
88  if (!NT_SUCCESS(Status))
89  {
91  return FALSE;
92  }
93 
94  return TRUE;
95 }
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
NTSYSAPI NTSTATUS NTAPI RtlGetGroupSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor, OUT PSID *Group, OUT PBOOLEAN GroupDefaulted)
Definition: sd.c:280
unsigned char BOOLEAN
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
#define SetLastError(x)
Definition: compat.h:409
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
_In_opt_ PSID _In_opt_ BOOLEAN GroupDefaulted
Definition: rtlfuncs.h:1606
#define BOOL
Definition: msvc.h:23

◆ GetSecurityDescriptorOwner()

BOOL WINAPI GetSecurityDescriptorOwner ( PSECURITY_DESCRIPTOR  pSecurityDescriptor,
PSID pOwner,
LPBOOL  lpbOwnerDefaulted 
)

Definition at line 103 of file sec.c.

Referenced by AccRewriteGetHandleRights(), DumpOwner(), CShellCommandOwner::Execute(), handle_setacl(), ReloadPrincipalsList(), RSAENH_CPSetProvParam(), SetupCommitFileQueueW(), test_default_dacl_owner_sid(), test_GetNamedSecurityInfoA(), test_GetSecurityInfo(), test_owner_equal(), test_security_descriptor(), test_token_label(), and validate_default_security_descriptor().

106 {
109 
110  Status = RtlGetOwnerSecurityDescriptor(pSecurityDescriptor,
111  pOwner,
112  &OwnerDefaulted);
113  *lpbOwnerDefaulted = (BOOL)OwnerDefaulted;
114 
115  if (!NT_SUCCESS(Status))
116  {
118  return FALSE;
119  }
120 
121  return TRUE;
122 }
_In_opt_ PSID _In_opt_ BOOLEAN OwnerDefaulted
Definition: rtlfuncs.h:1630
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
unsigned char BOOLEAN
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
#define SetLastError(x)
Definition: compat.h:409
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
NTSYSAPI NTSTATUS NTAPI RtlGetOwnerSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor, OUT PSID *Owner, OUT PBOOLEAN OwnerDefaulted)
Definition: sd.c:257
#define BOOL
Definition: msvc.h:23

◆ GetSecurityDescriptorRMControl()

DWORD WINAPI GetSecurityDescriptorRMControl ( PSECURITY_DESCRIPTOR  SecurityDescriptor,
PUCHAR  RMControl 
)

Definition at line 130 of file sec.c.

132 {
133  if (!RtlGetSecurityDescriptorRMControl(SecurityDescriptor,
134  RMControl))
135  return ERROR_INVALID_DATA;
136 
137  return ERROR_SUCCESS;
138 }
#define ERROR_SUCCESS
Definition: deptool.c:10
NTSYSAPI BOOLEAN NTAPI RtlGetSecurityDescriptorRMControl(_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _Out_ PUCHAR RMControl)
#define ERROR_INVALID_DATA
Definition: winerror.h:116

◆ GetSecurityDescriptorSacl()

BOOL WINAPI GetSecurityDescriptorSacl ( PSECURITY_DESCRIPTOR  pSecurityDescriptor,
LPBOOL  lpbSaclPresent,
PACL pSacl,
LPBOOL  lpbSaclDefaulted 
)

Definition at line 146 of file sec.c.

Referenced by AccRewriteGetHandleRights(), CSecurityDescriptor::BeginSACLInteration(), DumpSacl(), RSAENH_CPSetProvParam(), SetupCommitFileQueueW(), test_AddMandatoryAce(), test_child_token_sd(), test_child_token_sd_medium(), test_child_token_sd_restricted(), test_security_descriptor(), test_token_label(), and test_token_security_descriptor().

150 {
154 
155  Status = RtlGetSaclSecurityDescriptor(pSecurityDescriptor,
156  &SaclPresent,
157  pSacl,
158  &SaclDefaulted);
159  *lpbSaclPresent = (BOOL)SaclPresent;
160  *lpbSaclDefaulted = (BOOL)SaclDefaulted;
161 
162  if (!NT_SUCCESS(Status))
163  {
165  return FALSE;
166  }
167 
168  return TRUE;
169 }
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
_Out_ PBOOLEAN SaclPresent
Definition: rtlfuncs.h:2415
unsigned char BOOLEAN
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
#define SetLastError(x)
Definition: compat.h:409
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
NTSYSAPI NTSTATUS NTAPI RtlGetSaclSecurityDescriptor(_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _Out_ PBOOLEAN SaclPresent, _Out_ PACL *Sacl, _Out_ PBOOLEAN SaclDefaulted)
_Out_ PBOOLEAN _Out_ PACL _Out_ PBOOLEAN SaclDefaulted
Definition: rtlfuncs.h:2415
#define BOOL
Definition: msvc.h:23

◆ IsValidSecurityDescriptor()

BOOL WINAPI IsValidSecurityDescriptor ( PSECURITY_DESCRIPTOR  pSecurityDescriptor)

Definition at line 176 of file sec.c.

Referenced by test_GetShellSecurityDescriptor(), and validate_default_security_descriptor().

177 {
178  BOOLEAN Result;
179 
180  Result = RtlValidSecurityDescriptor (pSecurityDescriptor);
181  if (Result == FALSE)
183 
184  return (BOOL)Result;
185 }
NTSYSAPI BOOLEAN NTAPI RtlValidSecurityDescriptor(IN PSECURITY_DESCRIPTOR SecurityDescriptor)
Definition: sd.c:1055
#define STATUS_INVALID_SECURITY_DESCR
Definition: ntstatus.h:343
unsigned char BOOLEAN
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
unsigned int BOOL
Definition: ntddk_ex.h:94
#define SetLastError(x)
Definition: compat.h:409
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)

◆ MakeAbsoluteSD2()

BOOL WINAPI MakeAbsoluteSD2 ( IN OUT PSECURITY_DESCRIPTOR  pSelfRelativeSecurityDescriptor,
OUT LPDWORD  lpdwBufferSize 
)

Definition at line 192 of file sec.c.

194 {
196 
197  Status = RtlSelfRelativeToAbsoluteSD2(pSelfRelativeSecurityDescriptor,
198  lpdwBufferSize);
199  if (!NT_SUCCESS(Status))
200  {
202  return FALSE;
203  }
204 
205  return TRUE;
206 }
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
#define SetLastError(x)
Definition: compat.h:409
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
NTSYSAPI NTSTATUS NTAPI RtlSelfRelativeToAbsoluteSD2(_Inout_ PSECURITY_DESCRIPTOR SelfRelativeSD, _Out_ PULONG BufferSize)

◆ MakeSelfRelativeSD()

BOOL WINAPI MakeSelfRelativeSD ( PSECURITY_DESCRIPTOR  pAbsoluteSecurityDescriptor,
PSECURITY_DESCRIPTOR  pSelfRelativeSecurityDescriptor,
LPDWORD  lpdwBufferLength 
)

Definition at line 214 of file sec.c.

Referenced by get_sd(), handle_getacl(), test_BuildSecurityDescriptorW(), and test_security_descriptor().

217 {
219 
220  Status = RtlAbsoluteToSelfRelativeSD(pAbsoluteSecurityDescriptor,
221  pSelfRelativeSecurityDescriptor,
223  if (!NT_SUCCESS(Status))
224  {
226  return FALSE;
227  }
228 
229  return TRUE;
230 }
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
NTSYSAPI NTSTATUS NTAPI RtlAbsoluteToSelfRelativeSD(IN PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor, IN OUT PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor, IN PULONG BufferLength)
Definition: sd.c:626
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
#define SetLastError(x)
Definition: compat.h:409
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
unsigned int * PULONG
Definition: retypes.h:1
_In_ _In_opt_ _Out_writes_bytes_to_opt_ lpdwBufferLength _Inout_ LPDWORD lpdwBufferLength
Definition: winhttp.h:675

◆ QuerySecurityAccessMask()

VOID WINAPI QuerySecurityAccessMask ( IN SECURITY_INFORMATION  SecurityInformation,
OUT LPDWORD  DesiredAccess 
)

Definition at line 377 of file sec.c.

Referenced by GetFileSecurityW().

379 {
380  *DesiredAccess = 0;
381 
384  {
386  }
387 
390 }
#define ACCESS_SYSTEM_SECURITY
Definition: nt_native.h:77
#define GROUP_SECURITY_INFORMATION
Definition: setypes.h:124
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ SECURITY_INFORMATION SecurityInformation
Definition: fltkernel.h:1339
#define SACL_SECURITY_INFORMATION
Definition: setypes.h:126
#define READ_CONTROL
Definition: nt_native.h:58
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK DesiredAccess
Definition: create.c:4157
#define OWNER_SECURITY_INFORMATION
Definition: setypes.h:123
#define DACL_SECURITY_INFORMATION
Definition: setypes.h:125

◆ SetSecurityAccessMask()

VOID WINAPI SetSecurityAccessMask ( IN SECURITY_INFORMATION  SecurityInformation,
OUT LPDWORD  DesiredAccess 
)

Definition at line 398 of file sec.c.

Referenced by SetFileSecurityW().

400 {
401  *DesiredAccess = 0;
402 
405 
408 
411 }
#define ACCESS_SYSTEM_SECURITY
Definition: nt_native.h:77
#define GROUP_SECURITY_INFORMATION
Definition: setypes.h:124
#define WRITE_OWNER
Definition: nt_native.h:60
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ SECURITY_INFORMATION SecurityInformation
Definition: fltkernel.h:1339
#define SACL_SECURITY_INFORMATION
Definition: setypes.h:126
#define WRITE_DAC
Definition: nt_native.h:59
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK DesiredAccess
Definition: create.c:4157
#define OWNER_SECURITY_INFORMATION
Definition: setypes.h:123
#define DACL_SECURITY_INFORMATION
Definition: setypes.h:125

◆ SetSecurityDescriptorControl()

BOOL WINAPI SetSecurityDescriptorControl ( PSECURITY_DESCRIPTOR  pSecurityDescriptor,
SECURITY_DESCRIPTOR_CONTROL  ControlBitsOfInterest,
SECURITY_DESCRIPTOR_CONTROL  ControlBitsToSet 
)

Definition at line 238 of file sec.c.

Referenced by pSetSecurityInfoCheck().

241 {
243 
244  Status = RtlSetControlSecurityDescriptor(pSecurityDescriptor,
245  ControlBitsOfInterest,
246  ControlBitsToSet);
247  if (!NT_SUCCESS(Status))
248  {
250  return FALSE;
251  }
252 
253  return TRUE;
254 }
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
NTSYSAPI NTSTATUS NTAPI RtlSetControlSecurityDescriptor(_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest, _In_ SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet)
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
#define SetLastError(x)
Definition: compat.h:409
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)

◆ SetSecurityDescriptorDacl()

BOOL WINAPI SetSecurityDescriptorDacl ( PSECURITY_DESCRIPTOR  pSecurityDescriptor,
BOOL  bDaclPresent,
PACL  pDacl,
BOOL  bDaclDefaulted 
)

Definition at line 262 of file sec.c.

Referenced by AddAceToDesktop(), AddAceToWindowStation(), CreateAllAccessSecurityAttributes(), CreateDefaultSecurityDescriptor(), CreateLogoffSecurityAttributes(), CreatePublicEvent(), CreateWindowStationAndDesktops(), DwInitializeSdFromThreadToken(), get_sd(), GetShellSecurityDescriptor(), handle_getacl(), InitializeAudioDeviceListLock(), pSetSecurityInfoCheck(), test_AccessCheck(), test_ConvertSecurityDescriptorToString(), test_CreateDirectoryA(), test_event(), test_GetNamedSecurityInfoA(), test_GetSecurityInfo(), test_maximum_allowed(), test_process_security(), test_reg_create_key(), test_reg_open_key(), and test_token_security_descriptor().

266 {
268 
269  Status = RtlSetDaclSecurityDescriptor(pSecurityDescriptor,
270  bDaclPresent,
271  pDacl,
272  bDaclDefaulted);
273  if (!NT_SUCCESS(Status))
274  {
276  return FALSE;
277  }
278 
279  return TRUE;
280 }
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
NTSYSAPI NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR, BOOLEAN, PACL, BOOLEAN)
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
#define SetLastError(x)
Definition: compat.h:409
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)

◆ SetSecurityDescriptorGroup()

BOOL WINAPI SetSecurityDescriptorGroup ( PSECURITY_DESCRIPTOR  pSecurityDescriptor,
PSID  pGroup,
BOOL  bGroupDefaulted 
)

Definition at line 288 of file sec.c.

Referenced by DwInitializeSdFromThreadToken(), get_sd(), handle_getacl(), pSetSecurityInfoCheck(), test_AccessCheck(), test_ConvertSecurityDescriptorToString(), test_process_security(), and test_security_info().

291 {
293 
294  Status = RtlSetGroupSecurityDescriptor(pSecurityDescriptor,
295  pGroup,
296  bGroupDefaulted);
297  if (!NT_SUCCESS(Status))
298  {
300  return FALSE;
301  }
302 
303  return TRUE;
304 }
#define TRUE
Definition: types.h:120
NTSYSAPI NTSTATUS NTAPI RtlSetGroupSecurityDescriptor(IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor, IN PSID Group, IN BOOLEAN GroupDefaulted)
Definition: sd.c:410
LONG NTSTATUS
Definition: precomp.h:26
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
#define SetLastError(x)
Definition: compat.h:409
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)

◆ SetSecurityDescriptorOwner()

BOOL WINAPI SetSecurityDescriptorOwner ( PSECURITY_DESCRIPTOR  pSecurityDescriptor,
PSID  pOwner,
BOOL  bOwnerDefaulted 
)

Definition at line 312 of file sec.c.

Referenced by DwInitializeSdFromThreadToken(), get_sd(), handle_getacl(), pSetSecurityInfoCheck(), TakeOwnershipOfFile(), test_AccessCheck(), test_ConvertSecurityDescriptorToString(), test_process_security(), and test_security_info().

315 {
317 
318  Status = RtlSetOwnerSecurityDescriptor(pSecurityDescriptor,
319  pOwner,
320  bOwnerDefaulted);
321  if (!NT_SUCCESS(Status))
322  {
324  return FALSE;
325  }
326 
327  return TRUE;
328 }
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
#define SetLastError(x)
Definition: compat.h:409
NTSYSAPI NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR, PSID, BOOLEAN)
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)

◆ SetSecurityDescriptorRMControl()

DWORD WINAPI SetSecurityDescriptorRMControl ( PSECURITY_DESCRIPTOR  SecurityDescriptor,
PUCHAR  RMControl 
)

Definition at line 336 of file sec.c.

338 {
339  RtlSetSecurityDescriptorRMControl(SecurityDescriptor,
340  RMControl);
341 
342  return ERROR_SUCCESS;
343 }
NTSYSAPI VOID NTAPI RtlSetSecurityDescriptorRMControl(_Inout_ PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ PUCHAR RMControl)
#define ERROR_SUCCESS
Definition: deptool.c:10

◆ SetSecurityDescriptorSacl()

BOOL WINAPI SetSecurityDescriptorSacl ( PSECURITY_DESCRIPTOR  pSecurityDescriptor,
BOOL  bSaclPresent,
PACL  pSacl,
BOOL  bSaclDefaulted 
)

Definition at line 351 of file sec.c.

Referenced by pSetSecurityInfoCheck(), test_AddMandatoryAce(), test_ConvertSecurityDescriptorToString(), and test_token_security_descriptor().

355 {
357 
358  Status = RtlSetSaclSecurityDescriptor(pSecurityDescriptor,
359  bSaclPresent,
360  pSacl,
361  bSaclDefaulted);
362  if (!NT_SUCCESS(Status))
363  {
365  return FALSE;
366  }
367 
368  return TRUE;
369 }
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
NTSYSAPI NTSTATUS NTAPI RtlSetSaclSecurityDescriptor(IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor, IN BOOLEAN SaclPresent, IN PACL Sacl, IN BOOLEAN SaclDefaulted)
Definition: sd.c:342
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:24
#define SetLastError(x)
Definition: compat.h:409
Status
Definition: gdiplustypes.h:24
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( advapi  )