ReactOS  0.4.14-dev-293-g2b39b42
se.h
Go to the documentation of this file.
1 #pragma once
2 
3 typedef struct _KNOWN_ACE
4 {
9 
10 typedef struct _KNOWN_OBJECT_ACE
11 {
17 
18 typedef struct _KNOWN_COMPOUND_ACE
19 {
26 
28 PSID
30 {
33 
34  if (Descriptor->Control & SE_SELF_RELATIVE)
35  {
37  if (!SdRel->Group) return NULL;
38  return (PSID)((ULONG_PTR)Descriptor + SdRel->Group);
39  }
40  else
41  {
42  return Descriptor->Group;
43  }
44 }
45 
47 PSID
49 {
52 
53  if (Descriptor->Control & SE_SELF_RELATIVE)
54  {
56  if (!SdRel->Owner) return NULL;
57  return (PSID)((ULONG_PTR)Descriptor + SdRel->Owner);
58  }
59  else
60  {
61  return Descriptor->Owner;
62  }
63 }
64 
66 PACL
68 {
71 
72  if (!(Descriptor->Control & SE_DACL_PRESENT)) return NULL;
73 
74  if (Descriptor->Control & SE_SELF_RELATIVE)
75  {
77  if (!SdRel->Dacl) return NULL;
78  return (PACL)((ULONG_PTR)Descriptor + SdRel->Dacl);
79  }
80  else
81  {
82  return Descriptor->Dacl;
83  }
84 }
85 
87 PACL
89 {
92 
93  if (!(Descriptor->Control & SE_SACL_PRESENT)) return NULL;
94 
95  if (Descriptor->Control & SE_SELF_RELATIVE)
96  {
98  if (!SdRel->Sacl) return NULL;
99  return (PACL)((ULONG_PTR)Descriptor + SdRel->Sacl);
100  }
101  else
102  {
103  return Descriptor->Sacl;
104  }
105 }
106 
107 #ifndef RTL_H
108 
109 /* SID Authorities */
115 
116 /* SIDs */
117 extern PSID SeNullSid;
118 extern PSID SeWorldSid;
119 extern PSID SeLocalSid;
120 extern PSID SeCreatorOwnerSid;
121 extern PSID SeCreatorGroupSid;
124 extern PSID SeNtAuthoritySid;
125 extern PSID SeDialupSid;
126 extern PSID SeNetworkSid;
127 extern PSID SeBatchSid;
128 extern PSID SeInteractiveSid;
129 extern PSID SeServiceSid;
131 extern PSID SePrincipalSelfSid;
132 extern PSID SeLocalSystemSid;
135 extern PSID SeAliasAdminsSid;
136 extern PSID SeAliasUsersSid;
137 extern PSID SeAliasGuestsSid;
141 extern PSID SeAliasPrintOpsSid;
144 extern PSID SeRestrictedSid;
146 extern PSID SeLocalServiceSid;
148 
149 /* Privileges */
150 extern const LUID SeCreateTokenPrivilege;
152 extern const LUID SeLockMemoryPrivilege;
153 extern const LUID SeIncreaseQuotaPrivilege;
154 extern const LUID SeUnsolicitedInputPrivilege;
155 extern const LUID SeTcbPrivilege;
156 extern const LUID SeSecurityPrivilege;
157 extern const LUID SeTakeOwnershipPrivilege;
158 extern const LUID SeLoadDriverPrivilege;
159 extern const LUID SeSystemProfilePrivilege;
160 extern const LUID SeSystemtimePrivilege;
163 extern const LUID SeCreatePagefilePrivilege;
164 extern const LUID SeCreatePermanentPrivilege;
165 extern const LUID SeBackupPrivilege;
166 extern const LUID SeRestorePrivilege;
167 extern const LUID SeShutdownPrivilege;
168 extern const LUID SeDebugPrivilege;
169 extern const LUID SeAuditPrivilege;
171 extern const LUID SeChangeNotifyPrivilege;
172 extern const LUID SeRemoteShutdownPrivilege;
173 extern const LUID SeUndockPrivilege;
174 extern const LUID SeSyncAgentPrivilege;
175 extern const LUID SeEnableDelegationPrivilege;
176 extern const LUID SeManageVolumePrivilege;
177 extern const LUID SeImpersonatePrivilege;
178 extern const LUID SeCreateGlobalPrivilege;
179 extern const LUID SeTrustedCredmanPrivilege;
180 extern const LUID SeRelabelPrivilege;
182 extern const LUID SeTimeZonePrivilege;
184 
185 /* DACLs */
187 extern PACL SePublicOpenDacl;
189 extern PACL SeUnrestrictedDacl;
190 
191 /* SDs */
198 
199 
200 #define SepAcquireTokenLockExclusive(Token) \
201 { \
202  KeEnterCriticalRegion(); \
203  ExAcquireResourceExclusiveLite(((PTOKEN)Token)->TokenLock, TRUE); \
204 }
205 #define SepAcquireTokenLockShared(Token) \
206 { \
207  KeEnterCriticalRegion(); \
208  ExAcquireResourceSharedLite(((PTOKEN)Token)->TokenLock, TRUE); \
209 }
210 
211 #define SepReleaseTokenLock(Token) \
212 { \
213  ExReleaseResourceLite(((PTOKEN)Token)->TokenLock); \
214  KeLeaveCriticalRegion(); \
215 }
216 
217 //
218 // Token Functions
219 //
220 BOOLEAN
221 NTAPI
223  IN PACCESS_TOKEN _Token,
225  IN BOOLEAN TokenLocked
226 );
227 
228 BOOLEAN
229 NTAPI
231  IN PACCESS_TOKEN _Token,
232  IN PSID Sid
233 );
234 
235 BOOLEAN
236 NTAPI
238  IN PACCESS_TOKEN _Token,
239  IN PSID PrincipalSelfSid,
240  IN PSID _Sid,
241  IN BOOLEAN Deny,
243 );
244 
245 /* Functions */
246 INIT_FUNCTION
247 BOOLEAN
248 NTAPI
250 
251 INIT_FUNCTION
252 VOID
253 NTAPI
255 
256 INIT_FUNCTION
257 BOOLEAN
258 NTAPI
260 
261 INIT_FUNCTION
262 BOOLEAN
263 NTAPI
265 
266 INIT_FUNCTION
267 BOOLEAN
268 NTAPI
270 
271 BOOLEAN
272 NTAPI
274 
275 BOOLEAN
276 NTAPI
278 
279 VOID
280 NTAPI
282 
283 NTSTATUS
284 NTAPI
286  IN PTOKEN Parent,
287  OUT PTOKEN *Token,
288  IN BOOLEAN InUse,
290 );
291 
292 NTSTATUS
293 NTAPI
296  IN BOOLEAN DoAudit,
297  OUT POBJECT_NAME_INFORMATION *AuditInfo
298 );
299 
300 NTSTATUS
301 NTAPI
306  IN PAUX_ACCESS_DATA AuxData,
307  IN ACCESS_MASK Access,
309 );
310 
311 NTSTATUS
312 NTAPI
314  IN PTOKEN Token,
316 );
317 
318 NTSTATUS
319 NTAPI
321  IN PTOKEN Token,
322  OUT PBOOLEAN IsSibling
323 );
324 
325 NTSTATUS
326 NTAPI
328  _In_ PTOKEN Token,
329  _In_ PTOKEN PrimaryToken,
330  _Out_ PACL* Dacl
331 );
332 
333 INIT_FUNCTION
334 VOID
335 NTAPI
337 
338 PTOKEN
339 NTAPI
341 
342 BOOLEAN
343 NTAPI
345 
346 VOID
347 NTAPI
349 
350 VOID
351 NTAPI
353 
354 NTSTATUS
355 NTAPI
358  _In_ PACCESS_TOKEN NewAccessToken,
359  _Out_ PACCESS_TOKEN* OldAccessToken
360 );
361 
362 VOID
363 NTAPI
368 );
369 
370 NTSTATUS
371 NTAPI
374  ULONG PrivilegeCount,
376  PLUID_AND_ATTRIBUTES AllocatedMem,
377  ULONG AllocatedLength,
379  BOOLEAN CaptureIfKernel,
380  PLUID_AND_ATTRIBUTES* Dest,
381  PULONG Length
382 );
383 
384 VOID
385 NTAPI
389  BOOLEAN CaptureIfKernel
390 );
391 
392 BOOLEAN
393 NTAPI
395  PTOKEN Token,
397  ULONG PrivilegeCount,
398  ULONG PrivilegeControl,
400 );
401 
402 NTSTATUS
403 NTAPI
408  _In_ PTOKEN Token,
409  _Out_opt_ PPRIVILEGE_SET *OutPrivilegeSet,
411 
412 BOOLEAN
413 NTAPI
415  IN LUID PrivilegeValue,
416  IN HANDLE ObjectHandle,
419 );
420 
421 NTSTATUS
422 NTAPI
424  _In_ PTOKEN Token,
430  _Out_ PTOKEN* NewAccessToken
431 );
432 
433 NTSTATUS
434 NTAPI
439  IN BOOLEAN CaptureIfKernel,
440  OUT PSECURITY_QUALITY_OF_SERVICE *CapturedSecurityQualityOfService,
441  OUT PBOOLEAN Present
442 );
443 
444 VOID
445 NTAPI
447  IN PSECURITY_QUALITY_OF_SERVICE CapturedSecurityQualityOfService OPTIONAL,
449  IN BOOLEAN CaptureIfKernel
450 );
451 
452 NTSTATUS
453 NTAPI
455  IN PSID InputSid,
458  IN BOOLEAN CaptureIfKernel,
459  OUT PSID *CapturedSid
460 );
461 
462 VOID
463 NTAPI
465  IN PSID CapturedSid,
467  IN BOOLEAN CaptureIfKernel
468 );
469 
470 NTSTATUS
471 NTAPI
473  _In_ PSID_AND_ATTRIBUTES SrcSidAndAttributes,
474  _In_ ULONG AttributeCount,
476  _In_opt_ PVOID AllocatedMem,
477  _In_ ULONG AllocatedLength,
479  _In_ BOOLEAN CaptureIfKernel,
480  _Out_ PSID_AND_ATTRIBUTES *CapturedSidAndAttributes,
482 
483 VOID
484 NTAPI
486  _In_ _Post_invalid_ PSID_AND_ATTRIBUTES CapturedSidAndAttributes,
488  _In_ BOOLEAN CaptureIfKernel);
489 
490 NTSTATUS
491 NTAPI
494  _Out_ PULONG QuotaInfoSize);
495 
496 NTSTATUS
497 NTAPI
499  IN PACL InputAcl,
502  IN BOOLEAN CaptureIfKernel,
503  OUT PACL *CapturedAcl
504 );
505 
506 VOID
507 NTAPI
509  IN PACL CapturedAcl,
511  IN BOOLEAN CaptureIfKernel
512 );
513 
514 NTSTATUS
516  _Out_writes_bytes_opt_(DaclLength) PACL AclDest,
518  _In_reads_bytes_(AclSource->AclSize) PACL AclSource,
519  _In_ PSID Owner,
520  _In_ PSID Group,
521  _In_ BOOLEAN IsInherited,
524 
525 PACL
527  _In_opt_ PACL ExplicitAcl,
528  _In_ BOOLEAN ExplicitPresent,
529  _In_ BOOLEAN ExplicitDefaulted,
530  _In_opt_ PACL ParentAcl,
531  _In_opt_ PACL DefaultAcl,
533  _In_ PSID Owner,
534  _In_ PSID Group,
535  _Out_ PBOOLEAN AclPresent,
536  _Out_ PBOOLEAN IsInherited,
539 
540 NTSTATUS
541 NTAPI
543  PVOID Object,
544  SECURITY_OPERATION_CODE OperationType,
546  PSECURITY_DESCRIPTOR NewSecurityDescriptor,
548  PSECURITY_DESCRIPTOR *OldSecurityDescriptor,
551 );
552 
553 NTSTATUS
554 NTAPI
559 );
560 
561 NTSTATUS
562 NTAPI
567  OUT PACCESS_TOKEN* NewToken
568 );
569 
570 VOID NTAPI
573 
574 VOID NTAPI
577 
578 BOOLEAN
579 NTAPI
584 
585 BOOLEAN
586 NTAPI
590 
591 VOID
592 NTAPI
596  _In_ PPRIVILEGE_SET PrivilegeSet,
598 
599 NTSTATUS
601  PLUID LogonLuid);
602 
603 NTSTATUS
605  PLUID LogonLuid);
606 
607 NTSTATUS
608 NTAPI
610  IN PLUID LogonId,
611  OUT PDEVICE_MAP * DeviceMap);
612 
613 #endif
614 
615 /* EOF */
INIT_FUNCTION BOOLEAN NTAPI SepInitSDs(VOID)
Definition: sd.c:34
IN CINT OUT PVOID IN ULONG OUT PULONG ResultLength
Definition: conport.c:47
struct _KNOWN_ACE * PKNOWN_ACE
const LUID SeSystemEnvironmentPrivilege
Definition: priv.c:43
const LUID SeTimeZonePrivilege
Definition: priv.c:55
const LUID SeRemoteShutdownPrivilege
Definition: priv.c:45
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
Definition: dumpinfo.c:39
const LUID SeCreateSymbolicLinkPrivilege
Definition: priv.c:56
NTSTATUS NTAPI SeCopyClientToken(IN PACCESS_TOKEN Token, IN SECURITY_IMPERSONATION_LEVEL Level, IN KPROCESSOR_MODE PreviousMode, OUT PACCESS_TOKEN *NewToken)
Definition: token.c:788
#define IN
Definition: typedefs.h:38
#define SE_SACL_PRESENT
Definition: setypes.h:769
_Inout_ PLIST_ENTRY _In_ PVOID _In_ PSTRING _In_ BOOLEAN _In_ BOOLEAN _In_ ULONG _In_ PFLT_CALLBACK_DATA _In_opt_ PCHECK_FOR_TRAVERSE_ACCESS _In_opt_ PSECURITY_SUBJECT_CONTEXT SubjectContext
Definition: fltkernel.h:2239
ACE_HEADER Header
Definition: se.h:5
const LUID SeSystemtimePrivilege
Definition: priv.c:33
#define _Post_invalid_
Definition: no_sal2.h:457
PSID SeRestrictedCodeSid
Definition: sid.c:46
NTSTATUS NTAPI SeIsTokenSibling(IN PTOKEN Token, OUT PBOOLEAN IsSibling)
Definition: token.c:749
#define SE_SELF_RELATIVE
Definition: setypes.h:780
PACL SePublicDefaultUnrestrictedDacl
Definition: acl.c:24
BOOLEAN NTAPI SepSidInTokenEx(IN PACCESS_TOKEN _Token, IN PSID PrincipalSelfSid, IN PSID _Sid, IN BOOLEAN Deny, IN BOOLEAN Restricted)
Definition: access.c:25
const LUID SeIncreaseQuotaPrivilege
Definition: priv.c:26
const LUID SeIncreaseWorkingSetPrivilege
Definition: priv.c:54
Definition: se.h:3
PTOKEN NTAPI SepCreateSystemProcessToken(VOID)
Definition: token.c:1145
const LUID SeCreateTokenPrivilege
Definition: priv.c:23
VOID NTAPI SeReleaseSidAndAttributesArray(_In_ _Post_invalid_ PSID_AND_ATTRIBUTES CapturedSidAndAttributes, _In_ KPROCESSOR_MODE AccessMode, _In_ BOOLEAN CaptureIfKernel)
Definition: sid.c:559
const LUID SeCreatePermanentPrivilege
Definition: priv.c:37
NTSTATUS NTAPI SeComputeQuotaInformationSize(_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _Out_ PULONG QuotaInfoSize)
const LUID SeDebugPrivilege
Definition: priv.c:41
const LUID SeBackupPrivilege
Definition: priv.c:38
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:182
NTSTATUS NTAPI SeIsTokenChild(IN PTOKEN Token, OUT PBOOLEAN IsChild)
Definition: token.c:716
INIT_FUNCTION BOOLEAN NTAPI SepInitDACLs(VOID)
Definition: acl.c:34
PSECURITY_DESCRIPTOR SeSystemDefaultSd
Definition: sd.c:26
INIT_FUNCTION BOOLEAN NTAPI SeInitSystem(VOID)
Definition: semgr.c:239
_In_opt_ PSECURITY_DESCRIPTOR _Out_ PSECURITY_DESCRIPTOR _In_ BOOLEAN IsDirectoryObject
Definition: sefuncs.h:29
_In_opt_ PSID Group
Definition: rtlfuncs.h:1606
VOID NTAPI SeDeassignPrimaryToken(struct _EPROCESS *Process)
struct _KNOWN_OBJECT_ACE * PKNOWN_OBJECT_ACE
ULONG SessionId
Definition: dllmain.c:28
LONG NTSTATUS
Definition: precomp.h:26
const LUID SeEnableDelegationPrivilege
Definition: priv.c:48
_IRQL_requires_same_ _In_ PLSA_STRING _In_ SECURITY_LOGON_TYPE _In_ ULONG _In_ ULONG _In_opt_ PTOKEN_GROUPS _In_ PTOKEN_SOURCE _Out_ PVOID _Out_ PULONG _Inout_ PLUID _Out_ PHANDLE Token
PSID SeAuthenticatedUserSid
Definition: sid.c:45
VOID NTAPI SeReleaseLuidAndAttributesArray(PLUID_AND_ATTRIBUTES Privilege, KPROCESSOR_MODE PreviousMode, BOOLEAN CaptureIfKernel)
Definition: priv.c:387
PSID SeAliasBackupOpsSid
Definition: sid.c:54
ACCESS_MASK Mask
Definition: se.h:6
NTSTATUS NTAPI SepCaptureSecurityQualityOfService(IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN KPROCESSOR_MODE AccessMode, IN POOL_TYPE PoolType, IN BOOLEAN CaptureIfKernel, OUT PSECURITY_QUALITY_OF_SERVICE *CapturedSecurityQualityOfService, OUT PBOOLEAN Present)
Definition: sd.c:211
USHORT Reserved
Definition: se.h:23
NTSTATUS SepPropagateAcl(_Out_writes_bytes_opt_(DaclLength) PACL AclDest, _Inout_ PULONG AclLength, _In_reads_bytes_(AclSource->AclSize) PACL AclSource, _In_ PSID Owner, _In_ PSID Group, _In_ BOOLEAN IsInherited, _In_ BOOLEAN IsDirectoryObject, _In_ PGENERIC_MAPPING GenericMapping)
SID_IDENTIFIER_AUTHORITY SeNtSidAuthority
Definition: sid.c:28
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:55
PSID SeRestrictedSid
Definition: sid.c:56
const LUID SeAssignPrimaryTokenPrivilege
Definition: priv.c:24
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn BOOLEAN Physical UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
Definition: acpixf.h:722
const LUID SeSystemProfilePrivilege
Definition: priv.c:32
VOID NTAPI SeAuditProcessExit(IN PEPROCESS Process)
Definition: audit.c:40
NTSTATUS NTAPI SeExchangePrimaryToken(_In_ PEPROCESS Process, _In_ PACCESS_TOKEN NewAccessToken, _Out_ PACCESS_TOKEN *OldAccessToken)
Definition: token.c:234
PSID SeAuthenticatedUsersSid
Definition: sid.c:55
#define SE_DACL_PRESENT
Definition: setypes.h:767
PSID SeCreatorOwnerServerSid
Definition: sid.c:35
PSID SeAliasPrintOpsSid
Definition: sid.c:53
const LUID SeTrustedCredmanPrivilege
Definition: priv.c:52
SID_IDENTIFIER_AUTHORITY SeWorldSidAuthority
Definition: sid.c:25
ACE_HEADER Header
Definition: se.h:12
BOOLEAN NTAPI SepTokenIsOwner(IN PACCESS_TOKEN _Token, IN PSECURITY_DESCRIPTOR SecurityDescriptor, IN BOOLEAN TokenLocked)
Definition: access.c:120
PSID SeAliasAccountOpsSid
Definition: sid.c:51
NTSTATUS NTAPI SeCaptureLuidAndAttributesArray(PLUID_AND_ATTRIBUTES Src, ULONG PrivilegeCount, KPROCESSOR_MODE PreviousMode, PLUID_AND_ATTRIBUTES AllocatedMem, ULONG AllocatedLength, POOL_TYPE PoolType, BOOLEAN CaptureIfKernel, PLUID_AND_ATTRIBUTES *Dest, PULONG Length)
Definition: priv.c:291
const LUID SeSyncAgentPrivilege
Definition: priv.c:47
#define _In_opt_
Definition: no_sal2.h:213
VOID NTAPI SeSetSecurityAccessMask(IN SECURITY_INFORMATION SecurityInformation, OUT PACCESS_MASK DesiredAccess)
Definition: semgr.c:348
const LUID SeChangeNotifyPrivilege
Definition: priv.c:44
BOOLEAN NTAPI SepPrivilegeCheck(PTOKEN Token, PLUID_AND_ATTRIBUTES Privileges, ULONG PrivilegeCount, ULONG PrivilegeControl, KPROCESSOR_MODE PreviousMode)
Definition: priv.c:72
PSECURITY_DESCRIPTOR SeUnrestrictedSd
Definition: sd.c:27
struct _KNOWN_ACE KNOWN_ACE
PSECURITY_DESCRIPTOR SePublicDefaultSd
Definition: sd.c:22
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
DWORD SECURITY_INFORMATION
Definition: ms-dtyp.idl:311
_In_ ULONG BufferLength
Definition: usbdlib.h:225
PSID SeCreatorGroupSid
Definition: sid.c:34
PACL SePublicOpenDacl
Definition: acl.c:25
enum _SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL
PSID SeNtAuthoritySid
Definition: sid.c:37
PSID SePrincipalSelfSid
Definition: sid.c:43
NTSTATUS NTAPI SeGetLogonIdDeviceMap(IN PLUID LogonId, OUT PDEVICE_MAP *DeviceMap)
Definition: srm.c:966
FORCEINLINE PACL SepGetSaclFromDescriptor(PVOID _Descriptor)
Definition: se.h:88
PSID SeServiceSid
Definition: sid.c:42
_In_ PEPROCESS _In_ KPROCESSOR_MODE AccessMode
Definition: mmfuncs.h:396
struct _SECURITY_DESCRIPTOR_RELATIVE * PISECURITY_DESCRIPTOR_RELATIVE
INIT_FUNCTION BOOLEAN NTAPI SepInitSecurityIDs(VOID)
Definition: sid.c:100
unsigned char BOOLEAN
PSID SeNetworkServiceSid
Definition: sid.c:59
#define _Out_writes_bytes_opt_(a)
Definition: btrfs_drv.h:187
VOID NTAPI SeCaptureSubjectContextEx(IN PETHREAD Thread, IN PEPROCESS Process, OUT PSECURITY_SUBJECT_CONTEXT SubjectContext)
Definition: access.c:266
smooth NULL
Definition: ftsmooth.c:416
const LUID SeLoadDriverPrivilege
Definition: priv.c:31
const LUID SeManageVolumePrivilege
Definition: priv.c:49
const LUID SeTakeOwnershipPrivilege
Definition: priv.c:30
#define FORCEINLINE
Definition: ntbasedef.h:221
#define _Out_
Definition: no_sal2.h:323
NTSTATUS NTAPI SepCaptureAcl(IN PACL InputAcl, IN KPROCESSOR_MODE AccessMode, IN POOL_TYPE PoolType, IN BOOLEAN CaptureIfKernel, OUT PACL *CapturedAcl)
Definition: acl.c:277
_In_ ULONG _In_ ACCESS_MASK _In_ PSID Sid
Definition: rtlfuncs.h:1104
const LUID SeCreateGlobalPrivilege
Definition: priv.c:51
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ SECURITY_INFORMATION SecurityInformation
Definition: fltkernel.h:1339
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
NTSTATUS SepRmDereferenceLogonSession(PLUID LogonLuid)
Definition: srm.c:664
PSID SeAliasUsersSid
Definition: sid.c:48
NTSTATUS SepRmReferenceLogonSession(PLUID LogonLuid)
Definition: srm.c:381
UNICODE_STRING Restricted
Definition: utils.c:24
ULONG Flags
Definition: se.h:14
FORCEINLINE PSID SepGetOwnerFromDescriptor(PVOID _Descriptor)
Definition: se.h:48
#define _Out_opt_
Definition: no_sal2.h:339
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
ACE_HEADER Header
Definition: se.h:20
const LUID SeCreatePagefilePrivilege
Definition: priv.c:36
LPTSTR ServiceName
Definition: ServiceMain.c:15
NTSTATUS NTAPI SeInitializeProcessAuditName(IN PFILE_OBJECT FileObject, IN BOOLEAN DoAudit, OUT POBJECT_NAME_INFORMATION *AuditInfo)
Definition: audit.c:47
const LUID SeRestorePrivilege
Definition: priv.c:39
DWORD * PSECURITY_INFORMATION
Definition: ms-dtyp.idl:311
VOID NTAPI SePrivilegedServiceAuditAlarm(_In_opt_ PUNICODE_STRING ServiceName, _In_ PSECURITY_SUBJECT_CONTEXT SubjectContext, _In_ PPRIVILEGE_SET PrivilegeSet, _In_ BOOLEAN AccessGranted)
Definition: audit.c:214
VOID NTAPI SepReleaseAcl(IN PACL CapturedAcl, IN KPROCESSOR_MODE AccessMode, IN BOOLEAN CaptureIfKernel)
Definition: acl.c:365
INT POOL_TYPE
Definition: typedefs.h:76
struct _KNOWN_COMPOUND_ACE KNOWN_COMPOUND_ACE
ULONG SidStart
Definition: se.h:15
SID_IDENTIFIER_AUTHORITY SeLocalSidAuthority
Definition: sid.c:26
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
VOID NTAPI SepReleaseSecurityQualityOfService(IN PSECURITY_QUALITY_OF_SERVICE CapturedSecurityQualityOfService OPTIONAL, IN KPROCESSOR_MODE AccessMode, IN BOOLEAN CaptureIfKernel)
Definition: sd.c:367
PSID SeLocalServiceSid
Definition: sid.c:58
const LUID SeRelabelPrivilege
Definition: priv.c:53
const LUID SeImpersonatePrivilege
Definition: priv.c:50
#define _Inout_
Definition: no_sal2.h:244
BOOL Privilege(LPTSTR pszPrivilege, BOOL bEnable)
Definition: user_lib.cpp:531
SID_IDENTIFIER_AUTHORITY SeNullSidAuthority
Definition: sid.c:24
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
* PFILE_OBJECT
Definition: iotypes.h:1955
static IUnknown Object
Definition: main.c:512
_In_ PSECURITY_SUBJECT_CONTEXT _In_ BOOLEAN _In_ ACCESS_MASK _In_ ACCESS_MASK _Outptr_opt_ PPRIVILEGE_SET * Privileges
Definition: sefuncs.h:13
_In_opt_ PVOID _In_opt_ PUNICODE_STRING _In_ PSECURITY_DESCRIPTOR _In_ PACCESS_STATE AccessState
Definition: sefuncs.h:414
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL Dacl
Definition: rtlfuncs.h:1553
char * PBOOLEAN
Definition: retypes.h:11
BOOLEAN NTAPI SeRmInitPhase0(VOID)
Definition: srm.c:155
PSID SeAliasAdminsSid
Definition: sid.c:47
PSECURITY_DESCRIPTOR SePublicOpenUnrestrictedSd
Definition: sd.c:25
PSID SeCreatorOwnerSid
Definition: sid.c:33
USHORT CompoundAceType
Definition: se.h:22
NTSTATUS NTAPI SeCaptureSidAndAttributesArray(_In_ PSID_AND_ATTRIBUTES SrcSidAndAttributes, _In_ ULONG AttributeCount, _In_ KPROCESSOR_MODE PreviousMode, _In_opt_ PVOID AllocatedMem, _In_ ULONG AllocatedLength, _In_ POOL_TYPE PoolType, _In_ BOOLEAN CaptureIfKernel, _Out_ PSID_AND_ATTRIBUTES *CapturedSidAndAttributes, _Out_ PULONG ResultLength)
Definition: sid.c:358
VOID NTAPI SeAuditProcessCreate(IN PEPROCESS Process)
Definition: audit.c:33
BOOLEAN NTAPI SepSidInToken(IN PACCESS_TOKEN _Token, IN PSID Sid)
Definition: access.c:111
const LUID SeLockMemoryPrivilege
Definition: priv.c:25
NTSTATUS NTAPI SePrivilegePolicyCheck(_Inout_ PACCESS_MASK DesiredAccess, _Inout_ PACCESS_MASK GrantedAccess, _In_ PSECURITY_SUBJECT_CONTEXT SubjectContext, _In_ PTOKEN Token, _Out_opt_ PPRIVILEGE_SET *OutPrivilegeSet, _In_ KPROCESSOR_MODE PreviousMode)
Definition: priv.c:158
NTSTATUS NTAPI SeSetWorldSecurityDescriptor(SECURITY_INFORMATION SecurityInformation, PISECURITY_DESCRIPTOR SecurityDescriptor, PULONG BufferLength)
Definition: sd.c:119
const LUID SeProfileSingleProcessPrivilege
Definition: priv.c:34
BOOLEAN NTAPI SeFastTraverseCheck(IN PSECURITY_DESCRIPTOR SecurityDescriptor, IN PACCESS_STATE AccessState, IN ACCESS_MASK DesiredAccess, IN KPROCESSOR_MODE AccessMode)
Definition: accesschk.c:460
PSID SeWorldSid
Definition: sid.c:31
#define _In_reads_bytes_(size)
Definition: no_sal2.h:229
const LUID SeIncreaseBasePriorityPrivilege
Definition: priv.c:35
enum _TOKEN_TYPE TOKEN_TYPE
NTSTATUS NTAPI SeDefaultObjectMethod(PVOID Object, SECURITY_OPERATION_CODE OperationType, PSECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR NewSecurityDescriptor, PULONG ReturnLength, PSECURITY_DESCRIPTOR *OldSecurityDescriptor, POOL_TYPE PoolType, PGENERIC_MAPPING GenericMapping)
PSID SeLocalSid
Definition: sid.c:32
PSID SeAliasGuestsSid
Definition: sid.c:49
const LUID SeTcbPrivilege
Definition: priv.c:28
FORCEINLINE PSID SepGetGroupFromDescriptor(PVOID _Descriptor)
Definition: se.h:29
#define _In_
Definition: no_sal2.h:204
NTSTATUS NTAPI SeSubProcessToken(IN PTOKEN Parent, OUT PTOKEN *Token, IN BOOLEAN InUse, IN ULONG SessionId)
Definition: token.c:672
static GENERIC_MAPPING GenericMapping
Definition: SeInheritance.c:11
FORCEINLINE PACL SepGetDaclFromDescriptor(PVOID _Descriptor)
Definition: se.h:67
const LUID SeShutdownPrivilege
Definition: priv.c:40
PSID SeAliasPowerUsersSid
Definition: sid.c:50
PSID SeCreatorGroupServerSid
Definition: sid.c:36
ACCESS_MASK Mask
Definition: se.h:21
PSID SeDialupSid
Definition: sid.c:38
unsigned short USHORT
Definition: pedump.c:61
PSID SeAliasSystemOpsSid
Definition: sid.c:52
SID_IDENTIFIER_AUTHORITY SeCreatorSidAuthority
Definition: sid.c:27
_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
_In_opt_ PVOID _In_opt_ PUNICODE_STRING _In_ PSECURITY_DESCRIPTOR _In_ PACCESS_STATE _In_ BOOLEAN _In_ BOOLEAN AccessGranted
Definition: sefuncs.h:414
unsigned int * PULONG
Definition: retypes.h:1
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ SaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ OwnerSize PSID Owner
Definition: rtlfuncs.h:1557
ACCESS_MASK Mask
Definition: se.h:13
_IRQL_requires_same_ _In_ PLSA_STRING _In_ SECURITY_LOGON_TYPE _In_ ULONG _In_ ULONG _In_opt_ PTOKEN_GROUPS _In_ PTOKEN_SOURCE _Out_ PVOID _Out_ PULONG _Inout_ PLUID LogonId
BOOLEAN NTAPI SeCheckAuditPrivilege(_In_ PSECURITY_SUBJECT_CONTEXT SubjectContext, _In_ KPROCESSOR_MODE PreviousMode)
Definition: priv.c:257
struct _KNOWN_OBJECT_ACE KNOWN_OBJECT_ACE
ULONG SidStart
Definition: se.h:7
ULONG SidStart
Definition: se.h:24
VOID NTAPI SepReleaseSid(IN PSID CapturedSid, IN KPROCESSOR_MODE AccessMode, IN BOOLEAN CaptureIfKernel)
Definition: sid.c:342
BOOL WINAPI IsChild(_In_ HWND, _In_ HWND)
const LUID SeSecurityPrivilege
Definition: priv.c:29
INIT_FUNCTION VOID NTAPI SepInitPrivileges(VOID)
Definition: priv.c:64
PSID SeLocalSystemSid
Definition: sid.c:44
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
PSECURITY_DESCRIPTOR SePublicOpenSd
Definition: sd.c:24
#define OUT
Definition: typedefs.h:39
PACL SeUnrestrictedDacl
Definition: acl.c:27
PACL SePublicOpenUnrestrictedDacl
Definition: acl.c:26
PSID SeNetworkSid
Definition: sid.c:39
unsigned int ULONG
Definition: retypes.h:1
ACCESS_MASK * PACCESS_MASK
Definition: nt_native.h:41
INIT_FUNCTION VOID NTAPI SepInitializeTokenImplementation(VOID)
Definition: token.c:836
#define ULONG_PTR
Definition: config.h:101
const LUID SeUnsolicitedInputPrivilege
Definition: priv.c:27
BOOLEAN NTAPI SeCheckPrivilegedObject(IN LUID PrivilegeValue, IN HANDLE ObjectHandle, IN ACCESS_MASK DesiredAccess, IN KPROCESSOR_MODE PreviousMode)
Definition: priv.c:560
BOOLEAN NTAPI SeRmInitPhase1(VOID)
Definition: srm.c:182
PSID SeInteractiveSid
Definition: sid.c:41
PSID SeBatchSid
Definition: sid.c:40
PSID SeAnonymousLogonSid
Definition: se.h:145
NTSTATUS NTAPI SeCreateAccessStateEx(IN PETHREAD Thread, IN PEPROCESS Process, IN OUT PACCESS_STATE AccessState, IN PAUX_ACCESS_DATA AuxData, IN ACCESS_MASK Access, IN PGENERIC_MAPPING GenericMapping)
Definition: access.c:378
BOOLEAN NTAPI SeDetailedAuditingWithToken(IN PTOKEN Token)
Definition: audit.c:25
const LUID SeUndockPrivilege
Definition: priv.c:46
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_ BOOLEAN EffectiveOnly
Definition: sefuncs.h:417
_In_ PSECURITY_SUBJECT_CONTEXT _In_ BOOLEAN _In_ ACCESS_MASK _In_ ACCESS_MASK _Outptr_opt_ PPRIVILEGE_SET _In_ PGENERIC_MAPPING _In_ KPROCESSOR_MODE _Out_ PACCESS_MASK GrantedAccess
Definition: sefuncs.h:13
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE _In_ SIZE_T _In_ POOL_TYPE PoolType
Definition: fltkernel.h:1444
NTSTATUS NTAPI SepCaptureSid(IN PSID InputSid, IN KPROCESSOR_MODE AccessMode, IN POOL_TYPE PoolType, IN BOOLEAN CaptureIfKernel, OUT PSID *CapturedSid)
Definition: sid.c:274
NTSTATUS NTAPI SepDuplicateToken(_In_ PTOKEN Token, _In_opt_ POBJECT_ATTRIBUTES ObjectAttributes, _In_ BOOLEAN EffectiveOnly, _In_ TOKEN_TYPE TokenType, _In_ SECURITY_IMPERSONATION_LEVEL Level, _In_ KPROCESSOR_MODE PreviousMode, _Out_ PTOKEN *NewAccessToken)
Definition: token.c:441
const LUID SeAuditPrivilege
Definition: priv.c:42
PSID SeNullSid
Definition: sid.c:30
SECURITY_OPERATION_CODE
Definition: setypes.h:142
ULONG ACCESS_MASK
Definition: nt_native.h:40
_In_ ULONG AclLength
Definition: rtlfuncs.h:1844
struct _KNOWN_COMPOUND_ACE * PKNOWN_COMPOUND_ACE
NTSTATUS NTAPI SepCreateImpersonationTokenDacl(_In_ PTOKEN Token, _In_ PTOKEN PrimaryToken, _Out_ PACL *Dacl)
Definition: acl.c:229
PSECURITY_DESCRIPTOR SePublicDefaultUnrestrictedSd
Definition: sd.c:23
struct _SECURITY_DESCRIPTOR * PISECURITY_DESCRIPTOR
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_ BOOLEAN _In_ TOKEN_TYPE TokenType
Definition: sefuncs.h:417
VOID NTAPI SeQuerySecurityAccessMask(IN SECURITY_INFORMATION SecurityInformation, OUT PACCESS_MASK DesiredAccess)
Definition: semgr.c:329
PACL SepSelectAcl(_In_opt_ PACL ExplicitAcl, _In_ BOOLEAN ExplicitPresent, _In_ BOOLEAN ExplicitDefaulted, _In_opt_ PACL ParentAcl, _In_opt_ PACL DefaultAcl, _Out_ PULONG AclLength, _In_ PSID Owner, _In_ PSID Group, _Out_ PBOOLEAN AclPresent, _Out_ PBOOLEAN IsInherited, _In_ BOOLEAN IsDirectoryObject, _In_ PGENERIC_MAPPING GenericMapping)
Definition: acl.c:591
_In_ PSTORAGE_PROPERTY_ID _Outptr_ PSTORAGE_DESCRIPTOR_HEADER * Descriptor
Definition: classpnp.h:966
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68