5 * contains NT internal defines that don't show on the Win32 API level
7 * Copyright 1997 Marcus Meissner
10 /* assumes windows.h already included */
16 typedef DWORD NTSTATUS
;
18 /* Security Ids of NT */
23 } SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY;
29 BYTE SubAuthorityCount;
30 SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
31 DWORD SubAuthority[1];
35 #define SID_REVISION (1) /* Current revision */
36 #define SID_MAX_SUB_AUTHORITIES (15) /* current max subauths */
37 #define SID_RECOMMENDED_SUB_AUTHORITIES (1) /* recommended subauths */
41 #define ACL_REVISION 2
43 #define ACL_REVISION1 1
44 #define ACL_REVISION2 2
56 /* ACEs, directly starting after an ACL */
57 typedef struct _ACE_HEADER
{
61 } ACE_HEADER
,*LPACE_HEADER
;
64 #define ACCESS_ALLOWED_ACE_TYPE 0
65 #define ACCESS_DENIED_ACE_TYPE 1
66 #define SYSTEM_AUDIT_ACE_TYPE 2
67 #define SYSTEM_ALARM_ACE_TYPE 3
69 /* inherit AceFlags */
70 #define OBJECT_INHERIT_ACE 0x01
71 #define CONTAINER_INHERIT_ACE 0x02
72 #define NO_PROPAGATE_INHERIT_ACE 0x04
73 #define INHERIT_ONLY_ACE 0x08
74 #define VALID_INHERIT_FLAGS 0x0F
76 /* AceFlags mask for what events we (should) audit */
77 #define SUCCESSFUL_ACCESS_ACE_FLAG 0x40
78 #define FAILED_ACCESS_ACE_FLAG 0x80
80 /* different ACEs depending on AceType
81 * SidStart marks the begin of a SID
82 * so the thing finally looks like this:
87 typedef struct _ACCESS_ALLOWED_ACE
{
91 } ACCESS_ALLOWED_ACE
,*LPACCESS_ALLOWED_ACE
;
93 typedef struct _ACCESS_DENIED_ACE
{
97 } ACCESS_DENIED_ACE
,*LPACCESS_DENIED_ACE
;
99 typedef struct _SYSTEM_AUDIT_ACE
{
103 } SYSTEM_AUDIT_ACE
,*LPSYSTEM_AUDIT_ACE
;
105 typedef struct _SYSTEM_ALARM_ACE
{
109 } SYSTEM_ALARM_ACE
,*LPSYSTEM_ALARM_ACE
;
111 #define SECURITY_DESCRIPTOR_REVISION 1
112 #define SECURITY_DESCRIPTOR_REVISION1 1
115 typedef WORD SECURITY_DESCRIPTOR_CONTROL;
118 #define SE_OWNER_DEFAULTED 0x0001
119 #define SE_GROUP_DEFAULTED 0x0002
120 #define SE_DACL_PRESENT 0x0004
121 #define SE_DACL_DEFAULTED 0x0008
122 #define SE_SACL_PRESENT 0x0010
123 #define SE_SACL_DEFAULTED 0x0020
124 #define SE_SELF_RELATIVE 0x8000
126 /* This was moved to windows.h
130 SECURITY_DESCRIPTOR_CONTROL Control;
135 } SECURITY_DESCRIPTOR,*PSECURITY_DESCRIPTOR,*LPSECURITY_DESCRIPTOR;
138 typedef enum tagSID_NAME_USE
{
143 SidTypeWellKnownGroup
,
144 SidTypeDeletedAccount
,
147 } SID_NAME_USE
,*PSID_NAME_USE
,*LPSID_NAME_USE
;
149 /* NT lowlevel Strings (handled by Rtl* functions in NTDLL)
150 * If they are zero terminated, Length does not include the terminating 0.
153 typedef struct _STRING
{
155 UINT16 MaximumLength
;
157 } STRING
,*LPSTRING
,ANSI_STRING
,*LPANSI_STRING
;
159 typedef struct _CSTRING
{
161 UINT16 MaximumLength
;
163 } CSTRING
,*LPCSTRING
;
165 typedef struct _UNICODE_STRING
{
166 UINT16 Length
; /* bytes */
167 UINT16 MaximumLength
; /* bytes */
169 } UNICODE_STRING
,*LPUNICODE_STRING
;
172 BOOL32 WINAPI
IsValidSid(LPSID
);
173 BOOL32 WINAPI
EqualSid(LPSID
,LPSID
);
174 BOOL32 WINAPI
EqualPrefixSid(LPSID
,LPSID
);
175 DWORD WINAPI
GetSidLengthRequired(BYTE
);
176 BOOL32 WINAPI
AllocateAndInitializeSid(LPSID_IDENTIFIER_AUTHORITY
,BYTE
,DWORD
,
177 DWORD
,DWORD
,DWORD
,DWORD
,DWORD
,DWORD
,
179 VOID
* WINAPI
FreeSid(LPSID
);
180 BOOL32 WINAPI
InitializeSecurityDescriptor(SECURITY_DESCRIPTOR
*,DWORD
);
181 BOOL32 WINAPI
InitializeSid(LPSID
,LPSID_IDENTIFIER_AUTHORITY
,BYTE
);
182 DWORD
* WINAPI
GetSidSubAuthority(LPSID
,DWORD
);
183 BYTE
* WINAPI
GetSidSubAuthorityCount(LPSID
);
184 DWORD WINAPI
GetLengthSid(LPSID
);
185 BOOL32 WINAPI
CopySid(DWORD
,LPSID
,LPSID
);
186 BOOL32 WINAPI
LookupAccountSid32A(LPCSTR
,PSID
,LPCSTR
,LPDWORD
,LPCSTR
,LPDWORD
,
188 BOOL32 WINAPI
LookupAccountSid32W(LPCWSTR
,PSID
,LPCWSTR
,LPDWORD
,LPCWSTR
,LPDWORD
,
190 LPSID_IDENTIFIER_AUTHORITY WINAPI
GetSidIdentifierAuthority(LPSID
);
196 #endif /* __WINE_NTDLL_H */