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 /* Security Ids of NT */
21 } SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY;
27 BYTE SubAuthorityCount;
28 SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
29 DWORD SubAuthority[1];
33 #define SID_REVISION (1) /* Current revision */
34 #define SID_MAX_SUB_AUTHORITIES (15) /* current max subauths */
35 #define SID_RECOMMENDED_SUB_AUTHORITIES (1) /* recommended subauths */
39 #define ACL_REVISION 2
41 #define ACL_REVISION1 1
42 #define ACL_REVISION2 2
54 /* ACEs, directly starting after an ACL */
55 typedef struct _ACE_HEADER {
59 } ACE_HEADER,*LPACE_HEADER;
62 #define ACCESS_ALLOWED_ACE_TYPE 0
63 #define ACCESS_DENIED_ACE_TYPE 1
64 #define SYSTEM_AUDIT_ACE_TYPE 2
65 #define SYSTEM_ALARM_ACE_TYPE 3
67 /* inherit AceFlags */
68 #define OBJECT_INHERIT_ACE 0x01
69 #define CONTAINER_INHERIT_ACE 0x02
70 #define NO_PROPAGATE_INHERIT_ACE 0x04
71 #define INHERIT_ONLY_ACE 0x08
72 #define VALID_INHERIT_FLAGS 0x0F
74 /* AceFlags mask for what events we (should) audit */
75 #define SUCCESSFUL_ACCESS_ACE_FLAG 0x40
76 #define FAILED_ACCESS_ACE_FLAG 0x80
78 /* different ACEs depending on AceType
79 * SidStart marks the begin of a SID
80 * so the thing finally looks like this:
85 typedef struct _ACCESS_ALLOWED_ACE {
89 } ACCESS_ALLOWED_ACE,*LPACCESS_ALLOWED_ACE;
91 typedef struct _ACCESS_DENIED_ACE {
95 } ACCESS_DENIED_ACE,*LPACCESS_DENIED_ACE;
97 typedef struct _SYSTEM_AUDIT_ACE {
101 } SYSTEM_AUDIT_ACE,*LPSYSTEM_AUDIT_ACE;
103 typedef struct _SYSTEM_ALARM_ACE {
107 } SYSTEM_ALARM_ACE,*LPSYSTEM_ALARM_ACE;
109 #define SECURITY_DESCRIPTOR_REVISION 1
110 #define SECURITY_DESCRIPTOR_REVISION1 1
113 typedef WORD SECURITY_DESCRIPTOR_CONTROL;
116 #define SE_OWNER_DEFAULTED 0x0001
117 #define SE_GROUP_DEFAULTED 0x0002
118 #define SE_DACL_PRESENT 0x0004
119 #define SE_DACL_DEFAULTED 0x0008
120 #define SE_SACL_PRESENT 0x0010
121 #define SE_SACL_DEFAULTED 0x0020
122 #define SE_SELF_RELATIVE 0x8000
124 /* This was moved to windows.h
128 SECURITY_DESCRIPTOR_CONTROL Control;
133 } SECURITY_DESCRIPTOR,*PSECURITY_DESCRIPTOR,*LPSECURITY_DESCRIPTOR;
136 typedef enum tagSID_NAME_USE {
141 SidTypeWellKnownGroup,
142 SidTypeDeletedAccount,
145 } SID_NAME_USE,*PSID_NAME_USE,*LPSID_NAME_USE;
147 /* NT lowlevel Strings (handled by Rtl* functions in NTDLL)
148 * If they are zero terminated, Length does not include the terminating 0.
151 typedef struct _STRING {
153 UINT16 MaximumLength;
155 } STRING,*LPSTRING,ANSI_STRING,*LPANSI_STRING;
157 typedef struct _CSTRING {
159 UINT16 MaximumLength;
161 } CSTRING,*LPCSTRING;
163 typedef struct _UNICODE_STRING {
164 UINT16 Length; /* bytes */
165 UINT16 MaximumLength; /* bytes */
167 } UNICODE_STRING,*LPUNICODE_STRING;
170 BOOL32 WINAPI IsValidSid(LPSID);
171 BOOL32 WINAPI EqualSid(LPSID,LPSID);
172 BOOL32 WINAPI EqualPrefixSid(LPSID,LPSID);
173 DWORD WINAPI GetSidLengthRequired(BYTE);
174 BOOL32 WINAPI AllocateAndInitializeSid(LPSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,
175 DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,
177 VOID* WINAPI FreeSid(LPSID);
178 BOOL32 WINAPI InitializeSecurityDescriptor(SECURITY_DESCRIPTOR*,DWORD);
179 BOOL32 WINAPI InitializeSid(LPSID,LPSID_IDENTIFIER_AUTHORITY,BYTE);
180 DWORD* WINAPI GetSidSubAuthority(LPSID,DWORD);
181 BYTE * WINAPI GetSidSubAuthorityCount(LPSID);
182 DWORD WINAPI GetLengthSid(LPSID);
183 BOOL32 WINAPI CopySid(DWORD,LPSID,LPSID);
184 BOOL32 WINAPI LookupAccountSid32A(LPCSTR,PSID,LPCSTR,LPDWORD,LPCSTR,LPDWORD,
186 BOOL32 WINAPI LookupAccountSid32W(LPCWSTR,PSID,LPCWSTR,LPDWORD,LPCWSTR,LPDWORD,
188 LPSID_IDENTIFIER_AUTHORITY WINAPI GetSidIdentifierAuthority(LPSID);
194 #endif /* __WINE_NTDLL_H */