ReactOS  0.4.15-dev-1638-gc0caa5c
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 BOOLEAN
247 NTAPI
249 
250 VOID
251 NTAPI
253 
254 BOOLEAN
255 NTAPI
257 
258 BOOLEAN
259 NTAPI
261 
262 BOOLEAN
263 NTAPI
265 
266 BOOLEAN
267 NTAPI
269 
270 BOOLEAN
271 NTAPI
273 
274 VOID
275 NTAPI
277 
278 NTSTATUS
279 NTAPI
281  IN PTOKEN Parent,
282  OUT PTOKEN *Token,
283  IN BOOLEAN InUse,
285 );
286 
287 NTSTATUS
288 NTAPI
291  IN BOOLEAN DoAudit,
292  OUT POBJECT_NAME_INFORMATION *AuditInfo
293 );
294 
295 NTSTATUS
296 NTAPI
301  IN PAUX_ACCESS_DATA AuxData,
302  IN ACCESS_MASK Access,
304 );
305 
306 NTSTATUS
307 NTAPI
309  IN PTOKEN Token,
311 );
312 
313 NTSTATUS
314 NTAPI
316  IN PTOKEN Token,
317  OUT PBOOLEAN IsSibling
318 );
319 
320 NTSTATUS
321 NTAPI
323  _In_ PTOKEN Token,
324  _In_ PTOKEN PrimaryToken,
325  _Out_ PACL* Dacl
326 );
327 
328 VOID
329 NTAPI
331 
332 PTOKEN
333 NTAPI
335 
336 BOOLEAN
337 NTAPI
339 
340 VOID
341 NTAPI
343 
344 VOID
345 NTAPI
347 
348 NTSTATUS
349 NTAPI
352  _In_ PACCESS_TOKEN NewAccessToken,
353  _Out_ PACCESS_TOKEN* OldAccessToken
354 );
355 
356 VOID
357 NTAPI
362 );
363 
364 NTSTATUS
365 NTAPI
368  ULONG PrivilegeCount,
370  PLUID_AND_ATTRIBUTES AllocatedMem,
371  ULONG AllocatedLength,
373  BOOLEAN CaptureIfKernel,
374  PLUID_AND_ATTRIBUTES* Dest,
375  PULONG Length
376 );
377 
378 VOID
379 NTAPI
383  BOOLEAN CaptureIfKernel
384 );
385 
386 BOOLEAN
387 NTAPI
389  PTOKEN Token,
391  ULONG PrivilegeCount,
392  ULONG PrivilegeControl,
394 );
395 
396 NTSTATUS
397 NTAPI
402  _In_ PTOKEN Token,
403  _Out_opt_ PPRIVILEGE_SET *OutPrivilegeSet,
405 
406 BOOLEAN
407 NTAPI
409  IN LUID PrivilegeValue,
410  IN HANDLE ObjectHandle,
413 );
414 
415 NTSTATUS
416 NTAPI
418  _In_ PTOKEN Token,
424  _Out_ PTOKEN* NewAccessToken
425 );
426 
427 NTSTATUS
428 NTAPI
433  IN BOOLEAN CaptureIfKernel,
434  OUT PSECURITY_QUALITY_OF_SERVICE *CapturedSecurityQualityOfService,
435  OUT PBOOLEAN Present
436 );
437 
438 VOID
439 NTAPI
441  IN PSECURITY_QUALITY_OF_SERVICE CapturedSecurityQualityOfService OPTIONAL,
443  IN BOOLEAN CaptureIfKernel
444 );
445 
446 NTSTATUS
447 NTAPI
449  IN PSID InputSid,
452  IN BOOLEAN CaptureIfKernel,
453  OUT PSID *CapturedSid
454 );
455 
456 VOID
457 NTAPI
459  IN PSID CapturedSid,
461  IN BOOLEAN CaptureIfKernel
462 );
463 
464 NTSTATUS
465 NTAPI
467  _In_ PSID_AND_ATTRIBUTES SrcSidAndAttributes,
468  _In_ ULONG AttributeCount,
470  _In_opt_ PVOID AllocatedMem,
471  _In_ ULONG AllocatedLength,
473  _In_ BOOLEAN CaptureIfKernel,
474  _Out_ PSID_AND_ATTRIBUTES *CapturedSidAndAttributes,
476 
477 VOID
478 NTAPI
480  _In_ _Post_invalid_ PSID_AND_ATTRIBUTES CapturedSidAndAttributes,
482  _In_ BOOLEAN CaptureIfKernel);
483 
484 NTSTATUS
485 NTAPI
488  _Out_ PULONG QuotaInfoSize);
489 
490 NTSTATUS
491 NTAPI
493  IN PACL InputAcl,
496  IN BOOLEAN CaptureIfKernel,
497  OUT PACL *CapturedAcl
498 );
499 
500 VOID
501 NTAPI
503  IN PACL CapturedAcl,
505  IN BOOLEAN CaptureIfKernel
506 );
507 
508 NTSTATUS
510  _Out_writes_bytes_opt_(DaclLength) PACL AclDest,
512  _In_reads_bytes_(AclSource->AclSize) PACL AclSource,
513  _In_ PSID Owner,
514  _In_ PSID Group,
515  _In_ BOOLEAN IsInherited,
518 
519 PACL
521  _In_opt_ PACL ExplicitAcl,
522  _In_ BOOLEAN ExplicitPresent,
523  _In_ BOOLEAN ExplicitDefaulted,
524  _In_opt_ PACL ParentAcl,
525  _In_opt_ PACL DefaultAcl,
527  _In_ PSID Owner,
528  _In_ PSID Group,
529  _Out_ PBOOLEAN AclPresent,
530  _Out_ PBOOLEAN IsInherited,
533 
534 NTSTATUS
535 NTAPI
537  PVOID Object,
538  SECURITY_OPERATION_CODE OperationType,
540  PSECURITY_DESCRIPTOR NewSecurityDescriptor,
542  PSECURITY_DESCRIPTOR *OldSecurityDescriptor,
545 );
546 
547 NTSTATUS
548 NTAPI
553 );
554 
555 NTSTATUS
556 NTAPI
561  OUT PACCESS_TOKEN* NewToken
562 );
563 
564 VOID NTAPI
567 
568 VOID NTAPI
571 
572 BOOLEAN
573 NTAPI
578 
579 BOOLEAN
580 NTAPI
584 
585 VOID
586 NTAPI
590  _In_ PPRIVILEGE_SET PrivilegeSet,
592 
593 NTSTATUS
595  PLUID LogonLuid);
596 
597 NTSTATUS
599  PLUID LogonLuid);
600 
601 NTSTATUS
602 NTAPI
604  IN PLUID LogonId,
605  OUT PDEVICE_MAP * DeviceMap);
606 
607 #endif
608 
609 /* EOF */
struct _KNOWN_ACE * PKNOWN_ACE
const LUID SeSystemEnvironmentPrivilege
Definition: priv.c:39
const LUID SeTimeZonePrivilege
Definition: priv.c:51
const LUID SeRemoteShutdownPrivilege
Definition: priv.c:41
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:52
NTSTATUS NTAPI SeCopyClientToken(IN PACCESS_TOKEN Token, IN SECURITY_IMPERSONATION_LEVEL Level, IN KPROCESSOR_MODE PreviousMode, OUT PACCESS_TOKEN *NewToken)
Definition: token.c:783
#define IN
Definition: typedefs.h:39
#define SE_SACL_PRESENT
Definition: setypes.h:769
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3767
_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
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2654
ACE_HEADER Header
Definition: se.h:5
const LUID SeSystemtimePrivilege
Definition: priv.c:29
#define _Post_invalid_
Definition: no_sal2.h:524
PSID SeRestrictedCodeSid
Definition: sid.c:42
NTSTATUS NTAPI SeIsTokenSibling(IN PTOKEN Token, OUT PBOOLEAN IsSibling)
Definition: token.c:744
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:339
#define SE_SELF_RELATIVE
Definition: setypes.h:780
PACL SePublicDefaultUnrestrictedDacl
Definition: acl.c:20
BOOLEAN NTAPI SepSidInTokenEx(IN PACCESS_TOKEN _Token, IN PSID PrincipalSelfSid, IN PSID _Sid, IN BOOLEAN Deny, IN BOOLEAN Restricted)
Definition: access.c:25
#define _In_reads_bytes_(s)
Definition: no_sal2.h:170
const LUID SeIncreaseQuotaPrivilege
Definition: priv.c:22
const LUID SeIncreaseWorkingSetPrivilege
Definition: priv.c:50
Definition: se.h:3
PTOKEN NTAPI SepCreateSystemProcessToken(VOID)
Definition: token.c:1140
const LUID SeCreateTokenPrivilege
Definition: priv.c:19
VOID NTAPI SeReleaseSidAndAttributesArray(_In_ _Post_invalid_ PSID_AND_ATTRIBUTES CapturedSidAndAttributes, _In_ KPROCESSOR_MODE AccessMode, _In_ BOOLEAN CaptureIfKernel)
Definition: sid.c:555
const LUID SeCreatePermanentPrivilege
Definition: priv.c:33
NTSTATUS NTAPI SeComputeQuotaInformationSize(_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _Out_ PULONG QuotaInfoSize)
const LUID SeDebugPrivilege
Definition: priv.c:37
const LUID SeBackupPrivilege
Definition: priv.c:34
_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:711
PSECURITY_DESCRIPTOR SeSystemDefaultSd
Definition: sd.c:22
_In_opt_ PSECURITY_DESCRIPTOR _Out_ PSECURITY_DESCRIPTOR _In_ BOOLEAN IsDirectoryObject
Definition: sefuncs.h:29
_In_opt_ PSID Group
Definition: rtlfuncs.h:1605
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:44
_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:41
VOID NTAPI SeReleaseLuidAndAttributesArray(PLUID_AND_ATTRIBUTES Privilege, KPROCESSOR_MODE PreviousMode, BOOLEAN CaptureIfKernel)
Definition: priv.c:383
VOID NTAPI SepInitPrivileges(VOID)
Definition: priv.c:60
PSID SeAliasBackupOpsSid
Definition: sid.c:50
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:207
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:24
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
Definition: wmitypes.h:55
PSID SeRestrictedSid
Definition: sid.c:52
const LUID SeAssignPrimaryTokenPrivilege
Definition: priv.c:20
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:728
const LUID SeSystemProfilePrivilege
Definition: priv.c:28
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:229
PSID SeAuthenticatedUsersSid
Definition: sid.c:51
#define SE_DACL_PRESENT
Definition: setypes.h:767
PSID SeCreatorOwnerServerSid
Definition: sid.c:31
PSID SeAliasPrintOpsSid
Definition: sid.c:49
const LUID SeTrustedCredmanPrivilege
Definition: priv.c:48
SID_IDENTIFIER_AUTHORITY SeWorldSidAuthority
Definition: sid.c:21
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:47
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:287
const LUID SeSyncAgentPrivilege
Definition: priv.c:43
#define _In_opt_
Definition: no_sal2.h:212
VOID NTAPI SeSetSecurityAccessMask(IN SECURITY_INFORMATION SecurityInformation, OUT PACCESS_MASK DesiredAccess)
Definition: semgr.c:348
BOOLEAN NTAPI SepInitSecurityIDs(VOID)
Definition: sid.c:96
BOOLEAN NTAPI SepInitDACLs(VOID)
Definition: acl.c:30
const LUID SeChangeNotifyPrivilege
Definition: priv.c:40
BOOLEAN NTAPI SepPrivilegeCheck(PTOKEN Token, PLUID_AND_ATTRIBUTES Privileges, ULONG PrivilegeCount, ULONG PrivilegeControl, KPROCESSOR_MODE PreviousMode)
Definition: priv.c:68
PSECURITY_DESCRIPTOR SeUnrestrictedSd
Definition: sd.c:23
struct _KNOWN_ACE KNOWN_ACE
PSECURITY_DESCRIPTOR SePublicDefaultSd
Definition: sd.c:18
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
PSID SeCreatorGroupSid
Definition: sid.c:30
PACL SePublicOpenDacl
Definition: acl.c:21
enum _SECURITY_IMPERSONATION_LEVEL SECURITY_IMPERSONATION_LEVEL
PSID SeNtAuthoritySid
Definition: sid.c:33
PSID SePrincipalSelfSid
Definition: sid.c:39
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:38
_In_ PEPROCESS _In_ KPROCESSOR_MODE AccessMode
Definition: mmfuncs.h:395
VOID NTAPI SepInitializeTokenImplementation(VOID)
Definition: token.c:831
struct _SECURITY_DESCRIPTOR_RELATIVE * PISECURITY_DESCRIPTOR_RELATIVE
unsigned char BOOLEAN
PSID SeNetworkServiceSid
Definition: sid.c:55
VOID NTAPI SeCaptureSubjectContextEx(IN PETHREAD Thread, IN PEPROCESS Process, OUT PSECURITY_SUBJECT_CONTEXT SubjectContext)
Definition: access.c:266
const LUID SeLoadDriverPrivilege
Definition: priv.c:27
const LUID SeManageVolumePrivilege
Definition: priv.c:45
const LUID SeTakeOwnershipPrivilege
Definition: priv.c:26
#define _Out_
Definition: no_sal2.h:160
NTSTATUS NTAPI SepCaptureAcl(IN PACL InputAcl, IN KPROCESSOR_MODE AccessMode, IN POOL_TYPE PoolType, IN BOOLEAN CaptureIfKernel, OUT PACL *CapturedAcl)
Definition: acl.c:273
_In_ ULONG _In_ ACCESS_MASK _In_ PSID Sid
Definition: rtlfuncs.h:1103
const LUID SeCreateGlobalPrivilege
Definition: priv.c:47
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ SECURITY_INFORMATION SecurityInformation
Definition: fltkernel.h:1339
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:547
NTSTATUS SepRmDereferenceLogonSession(PLUID LogonLuid)
Definition: srm.c:664
PSID SeAliasUsersSid
Definition: sid.c:44
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:214
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
ACE_HEADER Header
Definition: se.h:20
const LUID SeCreatePagefilePrivilege
Definition: priv.c:32
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:35
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:361
INT POOL_TYPE
Definition: typedefs.h:78
struct _KNOWN_COMPOUND_ACE KNOWN_COMPOUND_ACE
ULONG SidStart
Definition: se.h:15
SID_IDENTIFIER_AUTHORITY SeLocalSidAuthority
Definition: sid.c:22
_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:363
PSID SeLocalServiceSid
Definition: sid.c:54
const LUID SeRelabelPrivilege
Definition: priv.c:49
const LUID SeImpersonatePrivilege
Definition: priv.c:46
#define _Inout_
Definition: no_sal2.h:162
BOOL Privilege(LPTSTR pszPrivilege, BOOL bEnable)
Definition: user_lib.cpp:531
SID_IDENTIFIER_AUTHORITY SeNullSidAuthority
Definition: sid.c:20
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
* PFILE_OBJECT
Definition: iotypes.h:1995
_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:1552
char * PBOOLEAN
Definition: retypes.h:11
BOOLEAN NTAPI SeRmInitPhase0(VOID)
Definition: srm.c:155
PSID SeAliasAdminsSid
Definition: sid.c:43
PSECURITY_DESCRIPTOR SePublicOpenUnrestrictedSd
Definition: sd.c:21
PSID SeCreatorOwnerSid
Definition: sid.c:29
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:354
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:21
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:154
NTSTATUS NTAPI SeSetWorldSecurityDescriptor(SECURITY_INFORMATION SecurityInformation, PISECURITY_DESCRIPTOR SecurityDescriptor, PULONG BufferLength)
Definition: sd.c:115
const LUID SeProfileSingleProcessPrivilege
Definition: priv.c:30
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:27
const LUID SeIncreaseBasePriorityPrivilege
Definition: priv.c:31
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:28
PSID SeAliasGuestsSid
Definition: sid.c:45
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
const LUID SeTcbPrivilege
Definition: priv.c:24
FORCEINLINE PSID SepGetGroupFromDescriptor(PVOID _Descriptor)
Definition: se.h:29
#define _In_
Definition: no_sal2.h:158
NTSTATUS NTAPI SeSubProcessToken(IN PTOKEN Parent, OUT PTOKEN *Token, IN BOOLEAN InUse, IN ULONG SessionId)
Definition: token.c:667
static GENERIC_MAPPING GenericMapping
Definition: SeInheritance.c:11
FORCEINLINE PACL SepGetDaclFromDescriptor(PVOID _Descriptor)
Definition: se.h:67
const LUID SeShutdownPrivilege
Definition: priv.c:36
PSID SeAliasPowerUsersSid
Definition: sid.c:46
PSID SeCreatorGroupServerSid
Definition: sid.c:32
BOOLEAN NTAPI SeInitSystem(VOID)
Definition: semgr.c:239
ACCESS_MASK Mask
Definition: se.h:21
PSID SeDialupSid
Definition: sid.c:34
unsigned short USHORT
Definition: pedump.c:61
PSID SeAliasSystemOpsSid
Definition: sid.c:48
SID_IDENTIFIER_AUTHORITY SeCreatorSidAuthority
Definition: sid.c:23
_In_opt_ PVOID _In_opt_ PUNICODE_STRING _In_ PSECURITY_DESCRIPTOR _In_ PACCESS_STATE _In_ BOOLEAN _In_ BOOLEAN AccessGranted
Definition: sefuncs.h:414
#define FORCEINLINE
Definition: wdftypes.h:67
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:1556
#define NULL
Definition: types.h:112
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:253
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:338
BOOL WINAPI IsChild(_In_ HWND, _In_ HWND)
const LUID SeSecurityPrivilege
Definition: priv.c:25
PSID SeLocalSystemSid
Definition: sid.c:40
_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:20
#define OUT
Definition: typedefs.h:40
PACL SeUnrestrictedDacl
Definition: acl.c:23
PACL SePublicOpenUnrestrictedDacl
Definition: acl.c:22
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3810
#define _Out_writes_bytes_opt_(s)
Definition: no_sal2.h:228
PSID SeNetworkSid
Definition: sid.c:35
unsigned int ULONG
Definition: retypes.h:1
ACCESS_MASK * PACCESS_MASK
Definition: nt_native.h:41
#define ULONG_PTR
Definition: config.h:101
const LUID SeUnsolicitedInputPrivilege
Definition: priv.c:23
BOOLEAN NTAPI SeCheckPrivilegedObject(IN LUID PrivilegeValue, IN HANDLE ObjectHandle, IN ACCESS_MASK DesiredAccess, IN KPROCESSOR_MODE PreviousMode)
Definition: priv.c:556
BOOLEAN NTAPI SeRmInitPhase1(VOID)
Definition: srm.c:182
PSID SeInteractiveSid
Definition: sid.c:37
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3776
PSID SeBatchSid
Definition: sid.c:36
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:42
_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
NTSTATUS NTAPI SepCaptureSid(IN PSID InputSid, IN KPROCESSOR_MODE AccessMode, IN POOL_TYPE PoolType, IN BOOLEAN CaptureIfKernel, OUT PSID *CapturedSid)
Definition: sid.c:270
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:436
const LUID SeAuditPrivilege
Definition: priv.c:38
PSID SeNullSid
Definition: sid.c:26
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:225
PSECURITY_DESCRIPTOR SePublicDefaultUnrestrictedSd
Definition: sd.c:19
struct _SECURITY_DESCRIPTOR * PISECURITY_DESCRIPTOR
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_ BOOLEAN _In_ TOKEN_TYPE TokenType
Definition: sefuncs.h:417
BOOLEAN NTAPI SepInitSDs(VOID)
Definition: sd.c:30
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:587
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68