Added Win16 implementation for GetRegionData().
[wine.git] / include / ntdll.h
blob2b1120710c5198ffd96b9a4bcbd99779937e7835
1 #ifndef __WINE_NTDLL_H
2 #define __WINE_NTDLL_H
3 /* ntdll.h
5 * contains NT internal defines that don't show on the Win32 API level
7 * Copyright 1997 Marcus Meissner
8 */
10 /* assumes windows.h already included */
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
16 typedef DWORD NTSTATUS;
18 /* Security Ids of NT */
20 /* Moved to windows.h
21 typedef struct {
22 BYTE Value[6];
23 } SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY;
26 /* Moved to windows.h
27 typedef struct _SID {
28 BYTE Revision;
29 BYTE SubAuthorityCount;
30 SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
31 DWORD SubAuthority[1];
32 } SID,*PSID,*LPSID;
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 */
39 /* ACLs of NT */
41 #define ACL_REVISION 2
43 #define ACL_REVISION1 1
44 #define ACL_REVISION2 2
46 /* Moved to windows.h
47 typedef struct _ACL {
48 BYTE AclRevision;
49 BYTE Sbz1;
50 WORD AclSize;
51 WORD AceCount;
52 WORD Sbz2;
53 } ACL,*LPACL;
56 /* ACEs, directly starting after an ACL */
57 typedef struct _ACE_HEADER {
58 BYTE AceType;
59 BYTE AceFlags;
60 WORD AceSize;
61 } ACE_HEADER,*LPACE_HEADER;
63 /* AceType */
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:
83 * 0: ACE_HEADER
84 * 4: ACCESS_MASK
85 * 8... : SID
87 typedef struct _ACCESS_ALLOWED_ACE {
88 ACE_HEADER Header;
89 DWORD Mask;
90 DWORD SidStart;
91 } ACCESS_ALLOWED_ACE,*LPACCESS_ALLOWED_ACE;
93 typedef struct _ACCESS_DENIED_ACE {
94 ACE_HEADER Header;
95 DWORD Mask;
96 DWORD SidStart;
97 } ACCESS_DENIED_ACE,*LPACCESS_DENIED_ACE;
99 typedef struct _SYSTEM_AUDIT_ACE {
100 ACE_HEADER Header;
101 DWORD Mask;
102 DWORD SidStart;
103 } SYSTEM_AUDIT_ACE,*LPSYSTEM_AUDIT_ACE;
105 typedef struct _SYSTEM_ALARM_ACE {
106 ACE_HEADER Header;
107 DWORD Mask;
108 DWORD SidStart;
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
127 typedef struct {
128 BYTE Revision;
129 BYTE Sbz1;
130 SECURITY_DESCRIPTOR_CONTROL Control;
131 LPSID Owner;
132 LPSID Group;
133 LPACL Sacl;
134 LPACL Dacl;
135 } SECURITY_DESCRIPTOR,*PSECURITY_DESCRIPTOR,*LPSECURITY_DESCRIPTOR;
138 typedef enum tagSID_NAME_USE {
139 SidTypeUser = 1,
140 SidTypeGroup,
141 SidTypeDomain,
142 SidTypeAlias,
143 SidTypeWellKnownGroup,
144 SidTypeDeletedAccount,
145 SidTypeInvalid,
146 SidTypeUnknown
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 {
154 UINT16 Length;
155 UINT16 MaximumLength;
156 LPSTR Buffer;
157 } STRING,*LPSTRING,ANSI_STRING,*LPANSI_STRING;
159 typedef struct _CSTRING {
160 UINT16 Length;
161 UINT16 MaximumLength;
162 LPCSTR Buffer;
163 } CSTRING,*LPCSTRING;
165 typedef struct _UNICODE_STRING {
166 UINT16 Length; /* bytes */
167 UINT16 MaximumLength; /* bytes */
168 LPWSTR Buffer;
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,
178 DWORD,LPSID*);
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,
187 PSID_NAME_USE);
188 BOOL32 WINAPI LookupAccountSid32W(LPCWSTR,PSID,LPCWSTR,LPDWORD,LPCWSTR,LPDWORD,
189 PSID_NAME_USE);
190 LPSID_IDENTIFIER_AUTHORITY WINAPI GetSidIdentifierAuthority(LPSID);
192 #ifdef __cplusplus
194 #endif
196 #endif /* __WINE_NTDLL_H */