ReactOS  0.4.15-dev-2703-g05fb0f1
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 {
30  struct
31  {
34  } Policies[1];
36 
38 PSID
40 {
43 
44  if (Descriptor->Control & SE_SELF_RELATIVE)
45  {
47  if (!SdRel->Group) return NULL;
48  return (PSID)((ULONG_PTR)Descriptor + SdRel->Group);
49  }
50  else
51  {
52  return Descriptor->Group;
53  }
54 }
55 
57 PSID
59 {
62 
63  if (Descriptor->Control & SE_SELF_RELATIVE)
64  {
66  if (!SdRel->Owner) return NULL;
67  return (PSID)((ULONG_PTR)Descriptor + SdRel->Owner);
68  }
69  else
70  {
71  return Descriptor->Owner;
72  }
73 }
74 
76 PACL
78 {
81 
82  if (!(Descriptor->Control & SE_DACL_PRESENT)) return NULL;
83 
84  if (Descriptor->Control & SE_SELF_RELATIVE)
85  {
87  if (!SdRel->Dacl) return NULL;
88  return (PACL)((ULONG_PTR)Descriptor + SdRel->Dacl);
89  }
90  else
91  {
92  return Descriptor->Dacl;
93  }
94 }
95 
97 PACL
99 {
102 
103  if (!(Descriptor->Control & SE_SACL_PRESENT)) return NULL;
104 
105  if (Descriptor->Control & SE_SELF_RELATIVE)
106  {
108  if (!SdRel->Sacl) return NULL;
109  return (PACL)((ULONG_PTR)Descriptor + SdRel->Sacl);
110  }
111  else
112  {
113  return Descriptor->Sacl;
114  }
115 }
116 
117 #ifndef RTL_H
118 
119 /* SID Authorities */
125 
126 /* SIDs */
127 extern PSID SeNullSid;
128 extern PSID SeWorldSid;
129 extern PSID SeLocalSid;
130 extern PSID SeCreatorOwnerSid;
131 extern PSID SeCreatorGroupSid;
134 extern PSID SeNtAuthoritySid;
135 extern PSID SeDialupSid;
136 extern PSID SeNetworkSid;
137 extern PSID SeBatchSid;
138 extern PSID SeInteractiveSid;
139 extern PSID SeServiceSid;
141 extern PSID SePrincipalSelfSid;
142 extern PSID SeLocalSystemSid;
145 extern PSID SeAliasAdminsSid;
146 extern PSID SeAliasUsersSid;
147 extern PSID SeAliasGuestsSid;
151 extern PSID SeAliasPrintOpsSid;
154 extern PSID SeRestrictedSid;
156 extern PSID SeLocalServiceSid;
158 
159 /* Privileges */
160 extern const LUID SeCreateTokenPrivilege;
162 extern const LUID SeLockMemoryPrivilege;
163 extern const LUID SeIncreaseQuotaPrivilege;
164 extern const LUID SeUnsolicitedInputPrivilege;
165 extern const LUID SeTcbPrivilege;
166 extern const LUID SeSecurityPrivilege;
167 extern const LUID SeTakeOwnershipPrivilege;
168 extern const LUID SeLoadDriverPrivilege;
169 extern const LUID SeSystemProfilePrivilege;
170 extern const LUID SeSystemtimePrivilege;
173 extern const LUID SeCreatePagefilePrivilege;
174 extern const LUID SeCreatePermanentPrivilege;
175 extern const LUID SeBackupPrivilege;
176 extern const LUID SeRestorePrivilege;
177 extern const LUID SeShutdownPrivilege;
178 extern const LUID SeDebugPrivilege;
179 extern const LUID SeAuditPrivilege;
181 extern const LUID SeChangeNotifyPrivilege;
182 extern const LUID SeRemoteShutdownPrivilege;
183 extern const LUID SeUndockPrivilege;
184 extern const LUID SeSyncAgentPrivilege;
185 extern const LUID SeEnableDelegationPrivilege;
186 extern const LUID SeManageVolumePrivilege;
187 extern const LUID SeImpersonatePrivilege;
188 extern const LUID SeCreateGlobalPrivilege;
189 extern const LUID SeTrustedCredmanPrivilege;
190 extern const LUID SeRelabelPrivilege;
192 extern const LUID SeTimeZonePrivilege;
194 
195 /* DACLs */
197 extern PACL SePublicOpenDacl;
199 extern PACL SeUnrestrictedDacl;
201 
202 /* SDs */
210 
211 /* Anonymous Logon Tokens */
214 
215 
216 #define SepAcquireTokenLockExclusive(Token) \
217 { \
218  KeEnterCriticalRegion(); \
219  ExAcquireResourceExclusiveLite(((PTOKEN)Token)->TokenLock, TRUE); \
220 }
221 #define SepAcquireTokenLockShared(Token) \
222 { \
223  KeEnterCriticalRegion(); \
224  ExAcquireResourceSharedLite(((PTOKEN)Token)->TokenLock, TRUE); \
225 }
226 
227 #define SepReleaseTokenLock(Token) \
228 { \
229  ExReleaseResourceLite(((PTOKEN)Token)->TokenLock); \
230  KeLeaveCriticalRegion(); \
231 }
232 
233 //
234 // Token Functions
235 //
236 BOOLEAN
237 NTAPI
239  IN PACCESS_TOKEN _Token,
241  IN BOOLEAN TokenLocked
242 );
243 
244 BOOLEAN
245 NTAPI
247  IN PACCESS_TOKEN _Token,
248  IN PSID Sid
249 );
250 
251 BOOLEAN
252 NTAPI
254  IN PACCESS_TOKEN _Token,
255  IN PSID PrincipalSelfSid,
256  IN PSID _Sid,
257  IN BOOLEAN Deny,
259 );
260 
261 BOOLEAN
262 NTAPI
264  _In_ PTOKEN ProcessToken,
265  _In_ PTOKEN TokenToImpersonate,
267 
268 /* Functions */
269 CODE_SEG("INIT")
270 BOOLEAN
271 NTAPI
273 
274 CODE_SEG("INIT")
275 VOID
276 NTAPI
278 
279 CODE_SEG("INIT")
280 BOOLEAN
281 NTAPI
283 
284 CODE_SEG("INIT")
285 BOOLEAN
286 NTAPI
288 
289 CODE_SEG("INIT")
290 BOOLEAN
291 NTAPI
293 
294 BOOLEAN
295 NTAPI
297 
298 BOOLEAN
299 NTAPI
301 
302 VOID
303 NTAPI
305 
306 NTSTATUS
307 NTAPI
309  IN PTOKEN Parent,
310  OUT PTOKEN *Token,
311  IN BOOLEAN InUse,
313 );
314 
315 NTSTATUS
316 NTAPI
319  IN BOOLEAN DoAudit,
320  OUT POBJECT_NAME_INFORMATION *AuditInfo
321 );
322 
323 NTSTATUS
324 NTAPI
329  IN PAUX_ACCESS_DATA AuxData,
330  IN ACCESS_MASK Access,
332 );
333 
334 NTSTATUS
335 NTAPI
337  IN PTOKEN Token,
339 );
340 
341 NTSTATUS
342 NTAPI
344  IN PTOKEN Token,
345  OUT PBOOLEAN IsSibling
346 );
347 
348 NTSTATUS
349 NTAPI
351  _In_ PTOKEN Token,
352  _In_ PTOKEN PrimaryToken,
353  _Out_ PACL* Dacl
354 );
355 
356 CODE_SEG("INIT")
357 VOID
358 NTAPI
360 
361 CODE_SEG("INIT")
362 PTOKEN
363 NTAPI
365 
366 CODE_SEG("INIT")
367 PTOKEN
369 
370 CODE_SEG("INIT")
371 PTOKEN
373 
374 BOOLEAN
375 NTAPI
377 
378 VOID
379 NTAPI
381 
382 VOID
383 NTAPI
385 
386 NTSTATUS
387 NTAPI
390  _In_ PACCESS_TOKEN NewAccessToken,
391  _Out_ PACCESS_TOKEN* OldAccessToken
392 );
393 
394 VOID
395 NTAPI
400 );
401 
402 NTSTATUS
403 NTAPI
406  ULONG PrivilegeCount,
408  PLUID_AND_ATTRIBUTES AllocatedMem,
409  ULONG AllocatedLength,
411  BOOLEAN CaptureIfKernel,
412  PLUID_AND_ATTRIBUTES* Dest,
413  PULONG Length
414 );
415 
416 VOID
417 NTAPI
421  BOOLEAN CaptureIfKernel
422 );
423 
424 BOOLEAN
425 NTAPI
427  PTOKEN Token,
429  ULONG PrivilegeCount,
430  ULONG PrivilegeControl,
432 );
433 
434 NTSTATUS
435 NTAPI
440  _In_ PTOKEN Token,
441  _Out_opt_ PPRIVILEGE_SET *OutPrivilegeSet,
443 
444 BOOLEAN
445 NTAPI
447  IN LUID PrivilegeValue,
448  IN HANDLE ObjectHandle,
451 );
452 
453 NTSTATUS
454 NTAPI
456  _In_ PTOKEN Token,
462  _Out_ PTOKEN* NewAccessToken
463 );
464 
465 NTSTATUS
466 NTAPI
471  IN BOOLEAN CaptureIfKernel,
472  OUT PSECURITY_QUALITY_OF_SERVICE *CapturedSecurityQualityOfService,
473  OUT PBOOLEAN Present
474 );
475 
476 VOID
477 NTAPI
479  IN PSECURITY_QUALITY_OF_SERVICE CapturedSecurityQualityOfService OPTIONAL,
481  IN BOOLEAN CaptureIfKernel
482 );
483 
484 NTSTATUS
485 NTAPI
487  IN PSID InputSid,
490  IN BOOLEAN CaptureIfKernel,
491  OUT PSID *CapturedSid
492 );
493 
494 VOID
495 NTAPI
497  IN PSID CapturedSid,
499  IN BOOLEAN CaptureIfKernel
500 );
501 
502 NTSTATUS
503 NTAPI
505  _In_ PSID_AND_ATTRIBUTES SrcSidAndAttributes,
506  _In_ ULONG AttributeCount,
508  _In_opt_ PVOID AllocatedMem,
509  _In_ ULONG AllocatedLength,
511  _In_ BOOLEAN CaptureIfKernel,
512  _Out_ PSID_AND_ATTRIBUTES *CapturedSidAndAttributes,
514 
515 VOID
516 NTAPI
518  _In_ _Post_invalid_ PSID_AND_ATTRIBUTES CapturedSidAndAttributes,
520  _In_ BOOLEAN CaptureIfKernel);
521 
522 NTSTATUS
523 NTAPI
526  _Out_ PULONG QuotaInfoSize);
527 
528 NTSTATUS
529 NTAPI
531  IN PACL InputAcl,
534  IN BOOLEAN CaptureIfKernel,
535  OUT PACL *CapturedAcl
536 );
537 
538 VOID
539 NTAPI
541  IN PACL CapturedAcl,
543  IN BOOLEAN CaptureIfKernel
544 );
545 
546 NTSTATUS
548  _Out_writes_bytes_opt_(DaclLength) PACL AclDest,
550  _In_reads_bytes_(AclSource->AclSize) PACL AclSource,
551  _In_ PSID Owner,
552  _In_ PSID Group,
553  _In_ BOOLEAN IsInherited,
556 
557 PACL
559  _In_opt_ PACL ExplicitAcl,
560  _In_ BOOLEAN ExplicitPresent,
561  _In_ BOOLEAN ExplicitDefaulted,
562  _In_opt_ PACL ParentAcl,
563  _In_opt_ PACL DefaultAcl,
565  _In_ PSID Owner,
566  _In_ PSID Group,
567  _Out_ PBOOLEAN AclPresent,
568  _Out_ PBOOLEAN IsInherited,
571 
572 NTSTATUS
573 NTAPI
575  PVOID Object,
576  SECURITY_OPERATION_CODE OperationType,
578  PSECURITY_DESCRIPTOR NewSecurityDescriptor,
580  PSECURITY_DESCRIPTOR *OldSecurityDescriptor,
583 );
584 
585 NTSTATUS
586 NTAPI
591 );
592 
593 NTSTATUS
594 NTAPI
599  OUT PACCESS_TOKEN* NewToken
600 );
601 
602 NTSTATUS
603 NTAPI
610 
611 VOID NTAPI
614 
615 VOID NTAPI
618 
619 BOOLEAN
620 NTAPI
625 
626 BOOLEAN
627 NTAPI
631 
632 VOID
633 NTAPI
637  _In_ PPRIVILEGE_SET PrivilegeSet,
639 
640 NTSTATUS
642  PLUID LogonLuid);
643 
644 NTSTATUS
646  PLUID LogonLuid);
647 
648 NTSTATUS
649 NTAPI
651  IN PLUID LogonId,
652  OUT PDEVICE_MAP * DeviceMap);
653 
654 #endif
655 
656 /* EOF */
PTOKEN SeAnonymousLogonTokenNoEveryone
Definition: semgr.c:19
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:1137
const uint16_t * PCWSTR
Definition: typedefs.h:57
NTSTATUS NTAPI SepRegQueryHelper(_In_ PCWSTR KeyName, _In_ PCWSTR ValueName, _In_ ULONG ValueType, _In_ ULONG DataLength, _Out_ PVOID ValueData)
A private registry helper that returns the desired value data based on the specifics requested by the...
Definition: srm.c:98
#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:1098
_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)
Creates the system process token.
Definition: token.c:1508
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:1065
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
PSECURITY_DESCRIPTOR SeSystemAnonymousLogonSd
Definition: sd.c:24
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:221
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)
PTOKEN SeAnonymousLogonToken
Definition: semgr.c:18
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:577
PSID SeAuthenticatedUsersSid
Definition: sid.c:51
#define SE_DACL_PRESENT
Definition: setypes.h:767
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _In_ ULONG _Out_opt_ PULONG _Out_opt_ PULONG ValueType
Definition: wdfregistry.h:279
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:360
BOOLEAN NTAPI SepInitSecurityIDs(VOID)
Definition: sid.c:96
BOOLEAN NTAPI SepInitDACLs(VOID)
Definition: acl.c:31
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
PTOKEN SepCreateSystemAnonymousLogonToken(VOID)
Creates the anonymous logon token for the system. The difference between this token and the other one...
Definition: token.c:1658
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:1080
FORCEINLINE PACL SepGetSaclFromDescriptor(PVOID _Descriptor)
Definition: se.h:98
PSID SeServiceSid
Definition: sid.c:38
_In_ PEPROCESS _In_ KPROCESSOR_MODE AccessMode
Definition: mmfuncs.h:395
VOID NTAPI SepInitializeTokenImplementation(VOID)
Definition: token.c:1189
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:299
_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_ ULONG _In_opt_ WDFREQUEST _In_opt_ PVOID _In_ size_t _In_ PVOID _In_ size_t _Out_ size_t * DataLength
Definition: cdrom.h:1437
CODE_SEG("INIT")
Definition: Interface.c:1810
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2697
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:547
struct _TOKEN_AUDIT_POLICY_INFORMATION TOKEN_AUDIT_POLICY_INFORMATION
NTSTATUS SepRmDereferenceLogonSession(PLUID LogonLuid)
Definition: srm.c:778
PSID SeAliasUsersSid
Definition: sid.c:44
NTSTATUS SepRmReferenceLogonSession(PLUID LogonLuid)
Definition: srm.c:495
UNICODE_STRING Restricted
Definition: utils.c:24
ULONG Flags
Definition: se.h:14
FORCEINLINE PSID SepGetOwnerFromDescriptor(PVOID _Descriptor)
Definition: se.h:58
#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:387
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
_Out_ PBOOLEAN _Out_ PBOOLEAN _Out_ PSECURITY_IMPERSONATION_LEVEL ImpersonationLevel
Definition: psfuncs.h:154
_In_ GUID _In_ PVOID ValueData
Definition: hubbusif.h:311
struct _TOKEN_AUDIT_POLICY_INFORMATION::@1796 Policies[1]
_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:377
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:1998
_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
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:240
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL Dacl
Definition: rtlfuncs.h:1552
unsigned char UCHAR
Definition: xmlstorage.h:181
char * PBOOLEAN
Definition: retypes.h:11
BOOLEAN NTAPI SeRmInitPhase0(VOID)
Definition: srm.c:173
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:129
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:39
#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:1021
static GENERIC_MAPPING GenericMapping
Definition: SeInheritance.c:11
FORCEINLINE PACL SepGetDaclFromDescriptor(PVOID _Descriptor)
Definition: se.h:77
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:251
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
BOOLEAN NTAPI SeTokenCanImpersonate(_In_ PTOKEN ProcessToken, _In_ PTOKEN TokenToImpersonate, _In_ SECURITY_IMPERSONATION_LEVEL ImpersonationLevel)
Ensures that client impersonation can occur by checking if the token we're going to assign as the imp...
Definition: token.c:2287
_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
struct _TOKEN_AUDIT_POLICY_INFORMATION * PTOKEN_AUDIT_POLICY_INFORMATION
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:200
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:155
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:785
PTOKEN SepCreateSystemAnonymousLogonTokenNoEveryone(VOID)
Creates the anonymous logon token for the system. This kind of token doesn't include the everyone SID...
Definition: token.c:1726
const LUID SeAuditPrivilege
Definition: priv.c:38
PSID SeNullSid
Definition: sid.c:26
PACL SeSystemAnonymousLogonDacl
Definition: acl.c:24
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:251
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:31
VOID NTAPI SeQuerySecurityAccessMask(IN SECURITY_INFORMATION SecurityInformation, OUT PACCESS_MASK DesiredAccess)
Definition: semgr.c:341
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:613
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68