[CMAKE]
[reactos.git] / include / psdk / winnt.h
1 #ifndef _WINNT_H
2 #define _WINNT_H
3
4 #if !defined(__ROS_LONG64__)
5 #ifdef __WINESRC__
6 #define __ROS_LONG64__
7 #endif
8 #endif
9
10 #ifdef __GNUC__
11 #include <msvctarget.h>
12 #endif
13
14 #ifndef DECLSPEC_ALIGN
15 # if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS)
16 # define DECLSPEC_ALIGN(x) __declspec(align(x))
17 # elif defined(__GNUC__)
18 # define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
19 # else
20 # define DECLSPEC_ALIGN(x)
21 # endif
22 #endif
23
24 # define DECLSPEC_HIDDEN
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 #include <excpt.h>
31 #include <basetsd.h>
32 #include <guiddef.h>
33
34 #include <ctype.h>
35 #undef __need_wchar_t
36
37 #include <winerror.h>
38 #include <stddef.h>
39 #include <sdkddkver.h>
40
41 #ifndef RC_INVOKED
42 #include <string.h>
43
44 /* FIXME: add more architectures. Is there a way to specify this in GCC? */
45 #if defined(_M_AMD64)
46 #undef UNALIGNED
47 #define UNALIGNED __unaligned
48 #else
49 #define UNALIGNED
50 #endif
51
52 #ifndef DECLSPEC_NOVTABLE
53 # if defined(_MSC_VER) && (_MSC_VER >= 1100) && defined(__cplusplus)
54 # define DECLSPEC_NOVTABLE __declspec(novtable)
55 # else
56 # define DECLSPEC_NOVTABLE
57 # endif
58 #endif
59
60 #ifndef DECLSPEC_ADDRSAFE
61 #if (_MSC_VER >= 1200) && (defined(_M_ALPHA) || defined(_M_AXP64))
62 #define DECLSPEC_ADDRSAFE __declspec(address_safe)
63 #else
64 #define DECLSPEC_ADDRSAFE
65 #endif
66 #endif
67
68 /*#ifdef _WINE*/
69 #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))
70 #define __WINE_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
71 #else
72 #define __WINE_ALLOC_SIZE(x)
73 #endif
74 /*#endif*/
75
76 #ifndef FORCEINLINE
77 #if (_MSC_VER >= 1200)
78 #define FORCEINLINE __forceinline
79 #elif (_MSC_VER)
80 #define FORCEINLINE __inline
81 #else
82 #define FORCEINLINE extern __inline__ __attribute__((always_inline))
83 #endif
84 #endif
85
86 #if !defined(_NTSYSTEM_)
87 #define NTSYSAPI DECLSPEC_IMPORT
88 #define NTSYSCALLAPI DECLSPEC_IMPORT
89 #else
90 #define NTSYSAPI
91 #if defined(_NTDLLBUILD_)
92 #define NTSYSCALLAPI
93 #else
94 #define NTSYSCALLAPI DECLSPEC_ADDRSAFE
95 #endif
96 #endif
97
98 #ifndef VOID
99 #define VOID void
100 #endif
101 typedef char CHAR;
102 typedef short SHORT;
103 #if !defined(__ROS_LONG64__) || defined(_M_AMD64)
104 typedef long LONG;
105 #else
106 typedef int LONG;
107 #endif
108 typedef char CCHAR, *PCCHAR;
109 typedef void *PVOID;
110
111 /* FIXME for __WIN64 */
112 #ifndef __ptr64
113 #define __ptr64
114 #endif
115 typedef void* __ptr64 PVOID64;
116
117 #ifdef __cplusplus
118 # define EXTERN_C extern "C"
119 #else
120 # define EXTERN_C extern
121 #endif
122
123 #define STDMETHODCALLTYPE __stdcall
124 #define STDMETHODVCALLTYPE __cdecl
125 #define STDAPICALLTYPE __stdcall
126 #define STDAPIVCALLTYPE __cdecl
127
128 #define STDAPI EXTERN_C HRESULT STDAPICALLTYPE
129 #define STDAPI_(type) EXTERN_C type STDAPICALLTYPE
130 #define STDMETHODIMP HRESULT STDMETHODCALLTYPE
131 #define STDMETHODIMP_(type) type STDMETHODCALLTYPE
132 #define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE
133 #define STDAPIV_(type) EXTERN_C type STDAPIVCALLTYPE
134 #define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE
135 #define STDMETHODIMPV_(type) type STDMETHODVCALLTYPE
136
137 /* C99 restrict support */
138 #if defined(ENABLE_RESTRICTED) && !defined(MIDL_PASS) && !defined(RC_INVOKED)
139 #if defined(_MSC_VER) && defined(_M_MRX000)
140 #define RESTRICTED_POINTER __restrict
141 #elif defined(__GNUC__) && ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 95)))
142 #define RESTRICTED_POINTER __restrict
143 #else
144 #define RESTRICTED_POINTER
145 #endif
146 #else
147 #define RESTRICTED_POINTER
148 #endif
149
150 typedef wchar_t WCHAR;
151 typedef WCHAR *PWCHAR,*LPWCH,*PWCH,*NWPSTR,*LPWSTR,*PWSTR,*PZZWSTR;
152 typedef CONST WCHAR *LPCWCH,*PCWCH,*LPCWSTR,*PCWSTR,*PCZZWSTR;
153 typedef CHAR *PCHAR,*LPCH,*PCH,*NPSTR,*LPSTR,*PSTR;
154 typedef CONST CHAR *LPCCH,*PCCH,*PCSTR,*LPCSTR;
155 typedef PWSTR *PZPWSTR;
156 typedef CONST PWSTR *PCZPWSTR;
157 typedef WCHAR UNALIGNED *LPUWSTR,*PUWSTR;
158 typedef PCWSTR *PZPCWSTR;
159 typedef CONST WCHAR UNALIGNED *LPCUWSTR,*PCUWSTR;
160 typedef PSTR *PZPSTR;
161 typedef CONST PSTR *PCZPSTR;
162 typedef PCSTR *PZPCSTR;
163
164
165 #ifdef UNICODE
166 #ifndef _TCHAR_DEFINED
167 #define _TCHAR_DEFINED
168 typedef WCHAR TCHAR,*PTCHAR;
169 typedef WCHAR TBYTE ,*PTBYTE;
170 #endif
171 typedef LPWSTR LPTCH,PTCH,PTSTR,LPTSTR,LP;
172 typedef LPCWSTR PCTSTR,LPCTSTR;
173 typedef LPUWSTR PUTSTR,LPUTSTR;
174 typedef LPCUWSTR PCUTSTR,LPCUTSTR;
175 #define __TEXT(quote) L##quote
176 #else
177 #ifndef _TCHAR_DEFINED
178 #define _TCHAR_DEFINED
179 typedef char TCHAR,*PTCHAR;
180 typedef unsigned char TBYTE ,*PTBYTE;
181 #endif
182 typedef LPSTR LPTCH,PTCH,PTSTR,LPTSTR,PUTSTR,LPUTSTR;
183 typedef LPCSTR PCTSTR,LPCTSTR,PCUTSTR,LPCUTSTR;
184 #define __TEXT(quote) quote
185 #endif
186
187 #define TEXT(quote) __TEXT(quote)
188
189 typedef SHORT *PSHORT;
190 typedef LONG *PLONG;
191 #ifdef STRICT
192 typedef void *HANDLE;
193 #define DECLARE_HANDLE(n) typedef struct n##__{int i;}*n
194 #else
195 typedef PVOID HANDLE;
196 #define DECLARE_HANDLE(n) typedef HANDLE n
197 #endif
198 typedef HANDLE *PHANDLE;
199 typedef DWORD LCID;
200 typedef PDWORD PLCID;
201 typedef WORD LANGID;
202 #ifdef __GNUC__
203 #define _HAVE_INT64
204 #ifndef _INTEGRAL_MAX_BITS
205 # define _INTEGRAL_MAX_BITS 64
206 #endif
207 #undef __int64
208 #define __int64 long long
209 #elif (defined(__WATCOMC__) || defined(_MSC_VER)) && (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 64 )
210 #define _HAVE_INT64
211 #endif /* __GNUC__/__WATCOMC */
212 #if defined(_HAVE_INT64) || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 64)
213 typedef __int64 LONGLONG;
214 typedef unsigned __int64 DWORDLONG;
215 #else
216 typedef double LONGLONG,DWORDLONG;
217 #endif
218 typedef LONGLONG *PLONGLONG;
219 typedef DWORDLONG *PDWORDLONG;
220 typedef DWORDLONG ULONGLONG,*PULONGLONG;
221 typedef LONGLONG USN;
222 #ifdef _HAVE_INT64
223 #define Int32x32To64(a,b) ((LONGLONG)(a)*(LONGLONG)(b))
224 #define UInt32x32To64(a,b) ((DWORDLONG)(a)*(DWORDLONG)(b))
225 #define Int64ShllMod32(a,b) ((DWORDLONG)(a)<<(b))
226 #define Int64ShraMod32(a,b) ((LONGLONG)(a)>>(b))
227 #define Int64ShrlMod32(a,b) ((DWORDLONG)(a)>>(b))
228 #endif
229 #define ANSI_NULL ((CHAR)0)
230 #define UNICODE_NULL ((WCHAR)0)
231 typedef BYTE BOOLEAN,*PBOOLEAN;
232 #endif
233 typedef BYTE FCHAR;
234 typedef WORD FSHORT;
235 typedef DWORD FLONG;
236
237 #define C_ASSERT(expr) extern char (*c_assert(void)) [(expr) ? 1 : -1]
238
239 #include "intrin.h"
240
241 #define NTAPI __stdcall
242 #include <basetsd.h>
243
244 #ifdef _MSC_VER
245 #pragma warning(push)
246 #pragma warning(disable:4201)
247 #pragma warning(disable:4214)
248 #pragma warning(disable:4820)
249 #endif
250
251 #define ACE_OBJECT_TYPE_PRESENT 0x00000001
252 #define ACE_INHERITED_OBJECT_TYPE_PRESENT 0x00000002
253 #define APPLICATION_ERROR_MASK 0x20000000
254 #define ERROR_SEVERITY_SUCCESS 0x00000000
255 #define ERROR_SEVERITY_INFORMATIONAL 0x40000000
256 #define ERROR_SEVERITY_WARNING 0x80000000
257 #define ERROR_SEVERITY_ERROR 0xC0000000
258 /* also in ddk/ntifs.h */
259 #define COMPRESSION_FORMAT_NONE (0x0000)
260 #define COMPRESSION_FORMAT_DEFAULT (0x0001)
261 #define COMPRESSION_FORMAT_LZNT1 (0x0002)
262 #define COMPRESSION_ENGINE_STANDARD (0x0000)
263 #define COMPRESSION_ENGINE_MAXIMUM (0x0100)
264 #define COMPRESSION_ENGINE_HIBER (0x0200)
265 #define ACCESS_ALLOWED_ACE_TYPE (0x0)
266 #define ACCESS_DENIED_ACE_TYPE (0x1)
267 #define SYSTEM_AUDIT_ACE_TYPE (0x2)
268 #define SYSTEM_ALARM_ACE_TYPE (0x3)
269 /*end ntifs.h */
270 #define ANYSIZE_ARRAY 1
271 #define OBJECT_INHERIT_ACE 1
272 #define CONTAINER_INHERIT_ACE 2
273 #define NO_PROPAGATE_INHERIT_ACE 4
274 #define INHERIT_ONLY_ACE 8
275 #define INHERITED_ACE 10
276 #define VALID_INHERIT_FLAGS 0x1F
277 #define SUCCESSFUL_ACCESS_ACE_FLAG 64
278 #define FAILED_ACCESS_ACE_FLAG 128
279 #define DELETE 0x00010000L
280 #define READ_CONTROL 0x20000L
281 #define WRITE_DAC 0x40000L
282 #define WRITE_OWNER 0x80000L
283 #define SYNCHRONIZE 0x100000L
284 #define STANDARD_RIGHTS_REQUIRED 0xF0000
285 #define STANDARD_RIGHTS_READ 0x20000
286 #define STANDARD_RIGHTS_WRITE 0x20000
287 #define STANDARD_RIGHTS_EXECUTE 0x20000
288 #define STANDARD_RIGHTS_ALL 0x1F0000
289 #define SPECIFIC_RIGHTS_ALL 0xFFFF
290 #define ACCESS_SYSTEM_SECURITY 0x1000000
291
292 #define REG_STANDARD_FORMAT 1
293 #define REG_LATEST_FORMAT 2
294 #define REG_NO_COMPRESSION 4
295
296 #ifndef WIN32_NO_STATUS
297
298 #define STATUS_WAIT_0 ((DWORD)0x00000000)
299 #define STATUS_ABANDONED_WAIT_0 ((DWORD)0x00000080)
300 #define STATUS_USER_APC ((DWORD)0x000000C0)
301 #define STATUS_TIMEOUT ((DWORD)0x00000102)
302 #define STATUS_PENDING ((DWORD)0x00000103)
303 #define STATUS_SEGMENT_NOTIFICATION ((DWORD)0x40000005)
304 #define STATUS_GUARD_PAGE_VIOLATION ((DWORD)0x80000001)
305 #define STATUS_DATATYPE_MISALIGNMENT ((DWORD)0x80000002)
306 #define STATUS_BREAKPOINT ((DWORD)0x80000003)
307 #define STATUS_SINGLE_STEP ((DWORD)0x80000004)
308 #define STATUS_ACCESS_VIOLATION ((DWORD)0xC0000005)
309 #define STATUS_IN_PAGE_ERROR ((DWORD)0xC0000006)
310 #define STATUS_INVALID_HANDLE ((DWORD)0xC0000008)
311 #define STATUS_NO_MEMORY ((DWORD)0xC0000017)
312 #define STATUS_ILLEGAL_INSTRUCTION ((DWORD)0xC000001D)
313 #define STATUS_NONCONTINUABLE_EXCEPTION ((DWORD)0xC0000025)
314 #define STATUS_INVALID_DISPOSITION ((DWORD)0xC0000026)
315 #define STATUS_ARRAY_BOUNDS_EXCEEDED ((DWORD)0xC000008C)
316 #define STATUS_FLOAT_DENORMAL_OPERAND ((DWORD)0xC000008D)
317 #define STATUS_FLOAT_DIVIDE_BY_ZERO ((DWORD)0xC000008E)
318 #define STATUS_FLOAT_INEXACT_RESULT ((DWORD)0xC000008F)
319 #define STATUS_FLOAT_INVALID_OPERATION ((DWORD)0xC0000090)
320 #define STATUS_FLOAT_OVERFLOW ((DWORD)0xC0000091)
321 #define STATUS_FLOAT_STACK_CHECK ((DWORD)0xC0000092)
322 #define STATUS_FLOAT_UNDERFLOW ((DWORD)0xC0000093)
323 #define STATUS_INTEGER_DIVIDE_BY_ZERO ((DWORD)0xC0000094)
324 #define STATUS_INTEGER_OVERFLOW ((DWORD)0xC0000095)
325 #define STATUS_PRIVILEGED_INSTRUCTION ((DWORD)0xC0000096)
326 #define STATUS_STACK_OVERFLOW ((DWORD)0xC00000FD)
327 #define STATUS_CONTROL_C_EXIT ((DWORD)0xC000013A)
328 #define STATUS_FLOAT_MULTIPLE_FAULTS ((DWORD)0xC00002B4)
329 #define STATUS_FLOAT_MULTIPLE_TRAPS ((DWORD)0xC00002B5)
330 #define STATUS_REG_NAT_CONSUMPTION ((DWORD)0xC00002C9)
331 #define STATUS_SXS_EARLY_DEACTIVATION ((DWORD)0xC015000F)
332 #define STATUS_SXS_INVALID_DEACTIVATION ((DWORD)0xC0150010)
333
334 #define DBG_EXCEPTION_HANDLED ((DWORD)0x00010001)
335 #define DBG_CONTINUE ((DWORD)0x00010002)
336 #define DBG_TERMINATE_THREAD ((DWORD)0x40010003)
337 #define DBG_TERMINATE_PROCESS ((DWORD)0x40010004)
338 #define DBG_CONTROL_C ((DWORD)0x40010005)
339 #define DBG_CONTROL_BREAK ((DWORD)0x40010008)
340 #define DBG_COMMAND_EXCEPTION ((DWORD)0x40010009)
341 #define DBG_EXCEPTION_NOT_HANDLED ((DWORD)0x80010001)
342
343 #endif /* WIN32_NO_STATUS */
344
345 #define MAXIMUM_ALLOWED 0x2000000
346 #define GENERIC_READ 0x80000000
347 #define GENERIC_WRITE 0x40000000
348 #define GENERIC_EXECUTE 0x20000000
349 #define GENERIC_ALL 0x10000000
350
351 #define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
352
353 /* Also in ddk/winddk.h */
354 #define FILE_LIST_DIRECTORY 0x00000001
355 #define FILE_READ_DATA 0x00000001
356 #define FILE_ADD_FILE 0x00000002
357 #define FILE_WRITE_DATA 0x00000002
358 #define FILE_ADD_SUBDIRECTORY 0x00000004
359 #define FILE_APPEND_DATA 0x00000004
360 #define FILE_CREATE_PIPE_INSTANCE 0x00000004
361 #define FILE_READ_EA 0x00000008
362 #define FILE_READ_PROPERTIES 0x00000008
363 #define FILE_WRITE_EA 0x00000010
364 #define FILE_WRITE_PROPERTIES 0x00000010
365 #define FILE_EXECUTE 0x00000020
366 #define FILE_TRAVERSE 0x00000020
367 #define FILE_DELETE_CHILD 0x00000040
368 #define FILE_READ_ATTRIBUTES 0x00000080
369 #define FILE_WRITE_ATTRIBUTES 0x00000100
370
371 #define FILE_SHARE_READ 0x00000001
372 #define FILE_SHARE_WRITE 0x00000002
373 #define FILE_SHARE_DELETE 0x00000004
374 #define FILE_SHARE_VALID_FLAGS 0x00000007
375
376 #define FILE_ATTRIBUTE_READONLY 0x00000001
377 #define FILE_ATTRIBUTE_HIDDEN 0x00000002
378 #define FILE_ATTRIBUTE_SYSTEM 0x00000004
379 #define FILE_ATTRIBUTE_DIRECTORY 0x00000010
380 #define FILE_ATTRIBUTE_ARCHIVE 0x00000020
381 #define FILE_ATTRIBUTE_DEVICE 0x00000040
382 #define FILE_ATTRIBUTE_NORMAL 0x00000080
383 #define FILE_ATTRIBUTE_TEMPORARY 0x00000100
384 #define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200
385 #define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400
386 #define FILE_ATTRIBUTE_COMPRESSED 0x00000800
387 #define FILE_ATTRIBUTE_OFFLINE 0x00001000
388 #define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
389 #define FILE_ATTRIBUTE_ENCRYPTED 0x00004000
390 #define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
391 #define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
392
393 #define FILE_COPY_STRUCTURED_STORAGE 0x00000041
394 #define FILE_STRUCTURED_STORAGE 0x00000441
395
396 #define FILE_VALID_OPTION_FLAGS 0x00ffffff
397 #define FILE_VALID_PIPE_OPTION_FLAGS 0x00000032
398 #define FILE_VALID_MAILSLOT_OPTION_FLAGS 0x00000032
399 #define FILE_VALID_SET_FLAGS 0x00000036
400
401 #define FILE_DIRECTORY_FILE 0x00000001
402 #define FILE_WRITE_THROUGH 0x00000002
403 #define FILE_SEQUENTIAL_ONLY 0x00000004
404 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
405 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
406 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
407 #define FILE_NON_DIRECTORY_FILE 0x00000040
408 #define FILE_CREATE_TREE_CONNECTION 0x00000080
409 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100
410 #define FILE_NO_EA_KNOWLEDGE 0x00000200
411 #define FILE_OPEN_REMOTE_INSTANCE 0x00000400
412 #define FILE_RANDOM_ACCESS 0x00000800
413 #define FILE_DELETE_ON_CLOSE 0x00001000
414 #define FILE_OPEN_BY_FILE_ID 0x00002000
415 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
416 #define FILE_NO_COMPRESSION 0x00008000
417 #define FILE_RESERVE_OPFILTER 0x00100000
418 #define FILE_OPEN_REPARSE_POINT 0x00200000
419 #define FILE_OPEN_NO_RECALL 0x00400000
420 #define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
421
422 #define FILE_ALL_ACCESS \
423 (STANDARD_RIGHTS_REQUIRED | \
424 SYNCHRONIZE | \
425 0x1FF)
426
427 #define FILE_GENERIC_EXECUTE \
428 (STANDARD_RIGHTS_EXECUTE | \
429 FILE_READ_ATTRIBUTES | \
430 FILE_EXECUTE | \
431 SYNCHRONIZE)
432
433 #define FILE_GENERIC_READ \
434 (STANDARD_RIGHTS_READ | \
435 FILE_READ_DATA | \
436 FILE_READ_ATTRIBUTES | \
437 FILE_READ_EA | \
438 SYNCHRONIZE)
439
440 #define FILE_GENERIC_WRITE \
441 (STANDARD_RIGHTS_WRITE | \
442 FILE_WRITE_DATA | \
443 FILE_WRITE_ATTRIBUTES | \
444 FILE_WRITE_EA | \
445 FILE_APPEND_DATA | \
446 SYNCHRONIZE)
447 /* end winddk.h */
448 /* also in ddk/ntifs.h */
449 #define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001
450 #define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002
451 #define FILE_NOTIFY_CHANGE_NAME 0x00000003
452 #define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004
453 #define FILE_NOTIFY_CHANGE_SIZE 0x00000008
454 #define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010
455 #define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020
456 #define FILE_NOTIFY_CHANGE_CREATION 0x00000040
457 #define FILE_NOTIFY_CHANGE_EA 0x00000080
458 #define FILE_NOTIFY_CHANGE_SECURITY 0x00000100
459 #define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200
460 #define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400
461 #define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800
462 #define FILE_NOTIFY_VALID_MASK 0x00000fff
463
464 #define FILE_CASE_SENSITIVE_SEARCH 0x00000001
465 #define FILE_CASE_PRESERVED_NAMES 0x00000002
466 #define FILE_UNICODE_ON_DISK 0x00000004
467 #define FILE_PERSISTENT_ACLS 0x00000008
468 #define FILE_FILE_COMPRESSION 0x00000010
469 #define FILE_VOLUME_QUOTAS 0x00000020
470 #define FILE_SUPPORTS_SPARSE_FILES 0x00000040
471 #define FILE_SUPPORTS_REPARSE_POINTS 0x00000080
472 #define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100
473 #define FS_LFN_APIS 0x00004000
474 #define FILE_VOLUME_IS_COMPRESSED 0x00008000
475 #define FILE_SUPPORTS_OBJECT_IDS 0x00010000
476 #define FILE_SUPPORTS_ENCRYPTION 0x00020000
477 #define FILE_NAMED_STREAMS 0x00040000
478
479 #define IO_COMPLETION_QUERY_STATE 0x0001
480 #define IO_COMPLETION_MODIFY_STATE 0x0002
481 #define IO_COMPLETION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
482 /* end ntifs.h */
483
484 /* also in ddk/winddk.h */
485 #define DUPLICATE_CLOSE_SOURCE 0x00000001
486 #define DUPLICATE_SAME_ACCESS 0x00000002
487 /* end winddk.k */
488
489 #define MAILSLOT_NO_MESSAGE ((DWORD)-1)
490 #define MAILSLOT_WAIT_FOREVER ((DWORD)-1)
491 #define PROCESS_TERMINATE 1
492 #define PROCESS_CREATE_THREAD 2
493 #define PROCESS_SET_SESSIONID 4
494 #define PROCESS_VM_OPERATION 8
495 #define PROCESS_VM_READ 16
496 #define PROCESS_VM_WRITE 32
497 #define PROCESS_CREATE_PROCESS 128
498 #define PROCESS_SET_QUOTA 256
499 #define PROCESS_SET_INFORMATION 512
500 #define PROCESS_QUERY_INFORMATION 1024
501 #define PROCESS_SUSPEND_RESUME 2048
502 #define PROCESS_QUERY_LIMITED_INFORMATION 0x1000
503 #define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0xFFF)
504 #define PROCESS_DUP_HANDLE 64
505 #define THREAD_TERMINATE 1
506 #define THREAD_SUSPEND_RESUME 2
507 #define THREAD_GET_CONTEXT 8
508 #define THREAD_SET_CONTEXT 16
509 #define THREAD_SET_INFORMATION 32
510 #define THREAD_QUERY_INFORMATION 64
511 #define THREAD_SET_THREAD_TOKEN 128
512 #define THREAD_IMPERSONATE 256
513 #define THREAD_DIRECT_IMPERSONATION 0x200
514 #define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3FF)
515 #define MUTANT_QUERY_STATE 0x0001
516 #define MUTANT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|MUTANT_QUERY_STATE)
517 #define TIMER_QUERY_STATE 0x0001
518 #define TIMER_MODIFY_STATE 0x0002
519 #define TIMER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|TIMER_QUERY_STATE|TIMER_MODIFY_STATE)
520 #define THREAD_BASE_PRIORITY_LOWRT 15
521 #define THREAD_BASE_PRIORITY_MAX 2
522 #define THREAD_BASE_PRIORITY_MIN (-2)
523 #define THREAD_BASE_PRIORITY_IDLE (-15)
524 /*
525 * To prevent gcc compiler warnings, bracket these defines when initialising
526 * a SID_IDENTIFIER_AUTHORITY, eg.
527 * SID_IDENTIFIER_AUTHORITY aNullSidAuthority = {SECURITY_NULL_SID_AUTHORITY};
528 */
529 #define SID_MAX_SUB_AUTHORITIES 15
530
531 /* security entities */
532 #define SECURITY_NULL_RID (0x00000000L)
533 #define SECURITY_WORLD_RID (0x00000000L)
534 #define SECURITY_LOCAL_RID (0X00000000L)
535
536 #define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0}
537
538 /* S-1-1 */
539 #define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1}
540
541 /* S-1-2 */
542 #define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2}
543
544 /* S-1-3 */
545 #define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3}
546 #define SECURITY_CREATOR_OWNER_RID (0x00000000L)
547 #define SECURITY_CREATOR_GROUP_RID (0x00000001L)
548 #define SECURITY_CREATOR_OWNER_SERVER_RID (0x00000002L)
549 #define SECURITY_CREATOR_GROUP_SERVER_RID (0x00000003L)
550
551 /* S-1-4 */
552 #define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4}
553
554 /* S-1-5 */
555 #define SECURITY_NT_AUTHORITY {0,0,0,0,0,5}
556 #define SECURITY_DIALUP_RID 0x00000001L
557 #define SECURITY_NETWORK_RID 0x00000002L
558 #define SECURITY_BATCH_RID 0x00000003L
559 #define SECURITY_INTERACTIVE_RID 0x00000004L
560 #define SECURITY_LOGON_IDS_RID 0x00000005L
561 #define SECURITY_SERVICE_RID 0x00000006L
562 #define SECURITY_ANONYMOUS_LOGON_RID 0x00000007L
563 #define SECURITY_PROXY_RID 0x00000008L
564 #define SECURITY_ENTERPRISE_CONTROLLERS_RID 0x00000009L
565 #define SECURITY_SERVER_LOGON_RID SECURITY_ENTERPRISE_CONTROLLERS_RID
566 #define SECURITY_PRINCIPAL_SELF_RID 0x0000000AL
567 #define SECURITY_AUTHENTICATED_USER_RID 0x0000000BL
568 #define SECURITY_RESTRICTED_CODE_RID 0x0000000CL
569 #define SECURITY_TERMINAL_SERVER_RID 0x0000000DL
570 #define SECURITY_REMOTE_LOGON_RID 0x0000000EL
571 #define SECURITY_THIS_ORGANIZATION_RID 0x0000000FL
572 #define SECURITY_LOCAL_SYSTEM_RID 0x00000012L
573 #define SECURITY_LOCAL_SERVICE_RID 0x00000013L
574 #define SECURITY_NETWORK_SERVICE_RID 0x00000014L
575 #define SECURITY_NT_NON_UNIQUE 0x00000015L
576 #define SECURITY_BUILTIN_DOMAIN_RID 0x00000020L
577
578 #define SECURITY_PACKAGE_BASE_RID 0x00000040L
579 #define SECURITY_PACKAGE_NTLM_RID 0x0000000AL
580 #define SECURITY_PACKAGE_SCHANNEL_RID 0x0000000EL
581 #define SECURITY_PACKAGE_DIGEST_RID 0x00000015L
582 #define SECURITY_OTHER_ORGANIZATION_RID 0x000003E8L
583
584 #define SECURITY_LOGON_IDS_RID_COUNT 0x3
585 #define SID_REVISION 1
586
587 #define FOREST_USER_RID_MAX 0x000001F3L
588 #define DOMAIN_USER_RID_ADMIN 0x000001F4L
589 #define DOMAIN_USER_RID_GUEST 0x000001F5L
590 #define DOMAIN_USER_RID_KRBTGT 0x000001F6L
591 #define DOMAIN_USER_RID_MAX 0x000003E7L
592
593 #define DOMAIN_GROUP_RID_ADMINS 0x00000200L
594 #define DOMAIN_GROUP_RID_USERS 0x00000201L
595 #define DOMAIN_GROUP_RID_GUESTS 0x00000202L
596 #define DOMAIN_GROUP_RID_COMPUTERS 0x00000203L
597 #define DOMAIN_GROUP_RID_CONTROLLERS 0x00000204L
598 #define DOMAIN_GROUP_RID_CERT_ADMINS 0x00000205L
599 #define DOMAIN_GROUP_RID_SCHEMA_ADMINS 0x00000206L
600 #define DOMAIN_GROUP_RID_ENTERPRISE_ADMINS 0x00000207L
601 #define DOMAIN_GROUP_RID_POLICY_ADMINS 0x00000208L
602
603 #define SECURITY_MANDATORY_LABEL_AUTHORITY {0,0,0,0,0,16}
604 #define SECURITY_MANDATORY_UNTRUSTED_RID 0x00000000L
605 #define SECURITY_MANDATORY_LOW_RID 0x00001000L
606 #define SECURITY_MANDATORY_MEDIUM_RID 0x00002000L
607 #define SECURITY_MANDATORY_HIGH_RID 0x00003000L
608 #define SECURITY_MANDATORY_SYSTEM_RID 0x00004000L
609 #define SECURITY_MANDATORY_PROTECTED_PROCESS_RID 0x00005000L
610
611 #define DOMAIN_ALIAS_RID_ADMINS 0x00000220L
612 #define DOMAIN_ALIAS_RID_USERS 0x00000221L
613 #define DOMAIN_ALIAS_RID_GUESTS 0x00000222L
614 #define DOMAIN_ALIAS_RID_POWER_USERS 0x00000223L
615
616 #define DOMAIN_ALIAS_RID_ACCOUNT_OPS 0x00000224L
617 #define DOMAIN_ALIAS_RID_SYSTEM_OPS 0x00000225L
618 #define DOMAIN_ALIAS_RID_PRINT_OPS 0x00000226L
619 #define DOMAIN_ALIAS_RID_BACKUP_OPS 0x00000227L
620
621 #define DOMAIN_ALIAS_RID_REPLICATOR 0x00000228L
622 #define DOMAIN_ALIAS_RID_RAS_SERVERS 0x00000229L
623 #define DOMAIN_ALIAS_RID_PREW2KCOMPACCESS 0x0000022AL
624 #define DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS 0x0000022BL
625 #define DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS 0x0000022CL
626 #define DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS 0x0000022DL
627
628 #define DOMAIN_ALIAS_RID_MONITORING_USERS 0x0000022EL
629 #define DOMAIN_ALIAS_RID_LOGGING_USERS 0x0000022FL
630 #define DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS 0x00000230L
631 #define DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS 0x00000231L
632 #define DOMAIN_ALIAS_RID_DCOM_USERS 0x00000232L
633
634 #define SECURITY_MANDATORY_LABEL_AUTHORITY {0,0,0,0,0,16}
635
636 typedef enum {
637 WinNullSid = 0,
638 WinWorldSid = 1,
639 WinLocalSid = 2,
640 WinCreatorOwnerSid = 3,
641 WinCreatorGroupSid = 4,
642 WinCreatorOwnerServerSid = 5,
643 WinCreatorGroupServerSid = 6,
644 WinNtAuthoritySid = 7,
645 WinDialupSid = 8,
646 WinNetworkSid = 9,
647 WinBatchSid = 10,
648 WinInteractiveSid = 11,
649 WinServiceSid = 12,
650 WinAnonymousSid = 13,
651 WinProxySid = 14,
652 WinEnterpriseControllersSid = 15,
653 WinSelfSid = 16,
654 WinAuthenticatedUserSid = 17,
655 WinRestrictedCodeSid = 18,
656 WinTerminalServerSid = 19,
657 WinRemoteLogonIdSid = 20,
658 WinLogonIdsSid = 21,
659 WinLocalSystemSid = 22,
660 WinLocalServiceSid = 23,
661 WinNetworkServiceSid = 24,
662 WinBuiltinDomainSid = 25,
663 WinBuiltinAdministratorsSid = 26,
664 WinBuiltinUsersSid = 27,
665 WinBuiltinGuestsSid = 28,
666 WinBuiltinPowerUsersSid = 29,
667 WinBuiltinAccountOperatorsSid = 30,
668 WinBuiltinSystemOperatorsSid = 31,
669 WinBuiltinPrintOperatorsSid = 32,
670 WinBuiltinBackupOperatorsSid = 33,
671 WinBuiltinReplicatorSid = 34,
672 WinBuiltinPreWindows2000CompatibleAccessSid = 35,
673 WinBuiltinRemoteDesktopUsersSid = 36,
674 WinBuiltinNetworkConfigurationOperatorsSid = 37,
675 WinAccountAdministratorSid = 38,
676 WinAccountGuestSid = 39,
677 WinAccountKrbtgtSid = 40,
678 WinAccountDomainAdminsSid = 41,
679 WinAccountDomainUsersSid = 42,
680 WinAccountDomainGuestsSid = 43,
681 WinAccountComputersSid = 44,
682 WinAccountControllersSid = 45,
683 WinAccountCertAdminsSid = 46,
684 WinAccountSchemaAdminsSid = 47,
685 WinAccountEnterpriseAdminsSid = 48,
686 WinAccountPolicyAdminsSid = 49,
687 WinAccountRasAndIasServersSid = 50,
688 WinNTLMAuthenticationSid = 51,
689 WinDigestAuthenticationSid = 52,
690 WinSChannelAuthenticationSid = 53,
691 WinThisOrganizationSid = 54,
692 WinOtherOrganizationSid = 55,
693 WinBuiltinIncomingForestTrustBuildersSid = 56,
694 WinBuiltinPerfMonitoringUsersSid = 57,
695 WinBuiltinPerfLoggingUsersSid = 58,
696 WinBuiltinAuthorizationAccessSid = 59,
697 WinBuiltinTerminalServerLicenseServersSid = 60,
698 WinBuiltinDCOMUsersSid = 61,
699 WinBuiltinIUsersSid = 62,
700 WinIUserSid = 63,
701 WinBuiltinCryptoOperatorsSid = 64,
702 WinUntrustedLabelSid = 65,
703 WinLowLabelSid = 66,
704 WinMediumLabelSid = 67,
705 WinHighLabelSid = 68,
706 WinSystemLabelSid = 69,
707 WinWriteRestrictedCodeSid = 70,
708 WinCreatorOwnerRightsSid = 71,
709 WinCacheablePrincipalsGroupSid = 72,
710 WinNonCacheablePrincipalsGroupSid = 73,
711 WinEnterpriseReadonlyControllersSid = 74,
712 WinAccountReadonlyControllersSid = 75,
713 WinBuiltinEventLogReadersGroup = 76,
714 WinNewEnterpriseReadonlyControllersSid = 77,
715 WinBuiltinCertSvcDComAccessGroup = 78,
716 WinMediumPlusLabelSid = 79,
717 WinLocalLogonSid = 80,
718 WinConsoleLogonSid = 81,
719 WinThisOrganizationCertificateSid = 82,
720 } WELL_KNOWN_SID_TYPE;
721
722 #define SE_CREATE_TOKEN_NAME TEXT("SeCreateTokenPrivilege")
723 #define SE_ASSIGNPRIMARYTOKEN_NAME TEXT("SeAssignPrimaryTokenPrivilege")
724 #define SE_LOCK_MEMORY_NAME TEXT("SeLockMemoryPrivilege")
725 #define SE_INCREASE_QUOTA_NAME TEXT("SeIncreaseQuotaPrivilege")
726 #define SE_UNSOLICITED_INPUT_NAME TEXT("SeUnsolicitedInputPrivilege")
727 #define SE_MACHINE_ACCOUNT_NAME TEXT("SeMachineAccountPrivilege")
728 #define SE_TCB_NAME TEXT("SeTcbPrivilege")
729 #define SE_SECURITY_NAME TEXT("SeSecurityPrivilege")
730 #define SE_TAKE_OWNERSHIP_NAME TEXT("SeTakeOwnershipPrivilege")
731 #define SE_LOAD_DRIVER_NAME TEXT("SeLoadDriverPrivilege")
732 #define SE_SYSTEM_PROFILE_NAME TEXT("SeSystemProfilePrivilege")
733 #define SE_SYSTEMTIME_NAME TEXT("SeSystemtimePrivilege")
734 #define SE_PROF_SINGLE_PROCESS_NAME TEXT("SeProfileSingleProcessPrivilege")
735 #define SE_INC_BASE_PRIORITY_NAME TEXT("SeIncreaseBasePriorityPrivilege")
736 #define SE_CREATE_PAGEFILE_NAME TEXT("SeCreatePagefilePrivilege")
737 #define SE_CREATE_PERMANENT_NAME TEXT("SeCreatePermanentPrivilege")
738 #define SE_BACKUP_NAME TEXT("SeBackupPrivilege")
739 #define SE_RESTORE_NAME TEXT("SeRestorePrivilege")
740 #define SE_SHUTDOWN_NAME TEXT("SeShutdownPrivilege")
741 #define SE_DEBUG_NAME TEXT("SeDebugPrivilege")
742 #define SE_AUDIT_NAME TEXT("SeAuditPrivilege")
743 #define SE_SYSTEM_ENVIRONMENT_NAME TEXT("SeSystemEnvironmentPrivilege")
744 #define SE_CHANGE_NOTIFY_NAME TEXT("SeChangeNotifyPrivilege")
745 #define SE_REMOTE_SHUTDOWN_NAME TEXT("SeRemoteShutdownPrivilege")
746 #define SE_UNDOCK_NAME TEXT("SeUndockPrivilege")
747 #define SE_SYNC_AGENT_NAME TEXT("SeSyncAgentPrivilege")
748 #define SE_ENABLE_DELEGATION_NAME TEXT("SeEnableDelegationPrivilege")
749 #define SE_MANAGE_VOLUME_NAME TEXT("SeManageVolumePrivilege")
750 #define SE_IMPERSONATE_NAME TEXT("SeImpersonatePrivilege")
751 #define SE_CREATE_GLOBAL_NAME TEXT("SeCreateGlobalPrivilege")
752 #define SE_GROUP_MANDATORY 1
753 #define SE_GROUP_ENABLED_BY_DEFAULT 2
754 #define SE_GROUP_ENABLED 4
755 #define SE_GROUP_OWNER 8
756 #define SE_GROUP_USE_FOR_DENY_ONLY 16
757 #define SE_GROUP_LOGON_ID 3221225472U
758 #define SE_GROUP_RESOURCE 536870912
759 #define LANG_NEUTRAL 0x00
760 #define LANG_INVARIANT 0x7f
761 #define LANG_AFRIKAANS 0x36
762 #define LANG_ALBANIAN 0x1c
763 #define LANG_ALSATIAN 0x84
764 #define LANG_AMHARIC 0x5e
765 #define LANG_ARABIC 0x01
766 #define LANG_ARMENIAN 0x2b
767 #define LANG_ASSAMESE 0x4d
768 #define LANG_AZERI 0x2c
769 #define LANG_BASHKIR 0x6d
770 #define LANG_BASQUE 0x2d
771 #define LANG_BELARUSIAN 0x23
772 #define LANG_BENGALI 0x45
773 #define LANG_BOSNIAN 0x1a
774 #define LANG_BRETON 0x7e
775 #define LANG_BULGARIAN 0x02
776 #define LANG_CATALAN 0x03
777 #define LANG_CHINESE 0x04
778 #define LANG_CHINESE_SIMPLIFIED 0x04
779 #define LANG_CORSICAN 0x83
780 #define LANG_CROATIAN 0x1a
781 #define LANG_CROATIAN 0x1a
782 #define LANG_CZECH 0x05
783 #define LANG_DANISH 0x06
784 #define LANG_DARI 0x8c
785 #define LANG_DIVEHI 0x65
786 #define LANG_DUTCH 0x13
787 #define LANG_ENGLISH 0x09
788 #define LANG_ESTONIAN 0x25
789 #define LANG_FAEROESE 0x38
790 #define LANG_FILIPINO 0x64
791 #define LANG_FINNISH 0x0b
792 #define LANG_FRENCH 0x0c
793 #define LANG_FRISIAN 0x62
794 #define LANG_GALICIAN 0x56
795 #define LANG_GEORGIAN 0x37
796 #define LANG_GERMAN 0x07
797 #define LANG_GREEK 0x08
798 #define LANG_GREENLANDIC 0x6f
799 #define LANG_GUJARATI 0x47
800 #define LANG_HAUSA 0x68
801 #define LANG_HEBREW 0x0d
802 #define LANG_HINDI 0x39
803 #define LANG_HUNGARIAN 0x0e
804 #define LANG_ICELANDIC 0x0f
805 #define LANG_IGBO 0x70
806 #define LANG_INDONESIAN 0x21
807 #define LANG_INUKTITUT 0x5d
808 #define LANG_IRISH 0x3c
809 #define LANG_ITALIAN 0x10
810 #define LANG_JAPANESE 0x11
811 #define LANG_KANNADA 0x4b
812 #define LANG_KASHMIRI 0x60
813 #define LANG_KAZAK 0x3f
814 #define LANG_KHMER 0x53
815 #define LANG_KICHE 0x86
816 #define LANG_KINYARWANDA 0x87
817 #define LANG_KONKANI 0x57
818 #define LANG_KOREAN 0x12
819 #define LANG_KYRGYZ 0x40
820 #define LANG_LAO 0x54
821 #define LANG_LATVIAN 0x26
822 #define LANG_LITHUANIAN 0x27
823 #define LANG_LOWER_SORBIAN 0x2e
824 #define LANG_LUXEMBOURGISH 0x6e
825 #define LANG_MACEDONIAN 0x2f
826 #define LANG_MALAY 0x3e
827 #define LANG_MALAYALAM 0x4c
828 #define LANG_MALTESE 0x3a
829 #define LANG_MANIPURI 0x58
830 #define LANG_MAORI 0x81
831 #define LANG_MAPUDUNGUN 0x7a
832 #define LANG_MARATHI 0x4e
833 #define LANG_MOHAWK 0x7c
834 #define LANG_MONGOLIAN 0x50
835 #define LANG_NEPALI 0x61
836 #define LANG_NORWEGIAN 0x14
837 #define LANG_OCCITAN 0x82
838 #define LANG_ORIYA 0x48
839 #define LANG_PASHTO 0x63
840 #define LANG_FARSI 0x29
841 #define LANG_POLISH 0x15
842 #define LANG_PORTUGUESE 0x16
843 #define LANG_PUNJABI 0x46
844 #define LANG_QUECHUA 0x6b
845 #define LANG_ROMANIAN 0x18
846 #define LANG_ROMANSH 0x17
847 #define LANG_RUSSIAN 0x19
848 #define LANG_SAMI 0x3b
849 #define LANG_SANSKRIT 0x4f
850 #define LANG_SERBIAN 0x1a
851 #define LANG_SOTHO 0x6c
852 #define LANG_TSWANA 0x32
853 #define LANG_SINDHI 0x59
854 #define LANG_SINHALESE 0x5b
855 #define LANG_SLOVAK 0x1b
856 #define LANG_SLOVENIAN 0x24
857 #define LANG_SPANISH 0x0a
858 #define LANG_SWAHILI 0x41
859 #define LANG_SWEDISH 0x1d
860 #define LANG_SYRIAC 0x5a
861 #define LANG_TAJIK 0x28
862 #define LANG_TAMAZIGHT 0x5f
863 #define LANG_TAMIL 0x49
864 #define LANG_TATAR 0x44
865 #define LANG_TELUGU 0x4a
866 #define LANG_THAI 0x1e
867 #define LANG_TIBETAN 0x51
868 #define LANG_TIGRIGNA 0x73
869 #define LANG_TURKISH 0x1f
870 #define LANG_TURKMEN 0x42
871 #define LANG_UIGHUR 0x80
872 #define LANG_UKRAINIAN 0x22
873 #define LANG_UPPER_SORBIAN 0x2e
874 #define LANG_URDU 0x20
875 #define LANG_UZBEK 0x43
876 #define LANG_VIETNAMESE 0x2a
877 #define LANG_WELSH 0x52
878 #define LANG_WOLOF 0x88
879 #define LANG_XHOSA 0x34
880 #define LANG_YAKUT 0x85
881 #define LANG_YI 0x78
882 #define LANG_YORUBA 0x6a
883 #define LANG_ZULU 0x35
884
885 /* FIXME: non-standard */
886 #define LANG_ESPERANTO 0x8f
887 #define LANG_WALON 0x90
888 #define LANG_CORNISH 0x91
889
890 /* FIXME: not present in the official headers */
891 #define LANG_GAELIC 0x94
892 #define LANG_SAAMI 0x3b
893 #define LANG_SUTU 0x30
894 #define LANG_TSONGA 0x31
895 #define LANG_VENDA 0x33
896
897 #define SUBLANG_CUSTOM_UNSPECIFIED 0x04
898 #define SUBLANG_CUSTOM_DEFAULT 0x03
899 #define SUBLANG_UI_CUSTOM_DEFAULT 0x05
900 #define SUBLANG_NEUTRAL 0x00
901 #define SUBLANG_SYS_DEFAULT 0x02
902 #define SUBLANG_DEFAULT 0x01
903 #define SUBLANG_AFRIKAANS_SOUTH_AFRICA 0x01
904 #define SUBLANG_ALBANIAN_ALBANIA 0x01
905 #define SUBLANG_ALSATIAN_FRANCE 0x01
906 #define SUBLANG_AMHARIC_ETHIOPIA 0x01
907 #define SUBLANG_ARABIC_ALGERIA 0x05
908 #define SUBLANG_ARABIC_BAHRAIN 0x0f
909 #define SUBLANG_ARABIC_EGYPT 0x03
910 #define SUBLANG_ARABIC_IRAQ 0x02
911 #define SUBLANG_ARABIC_JORDAN 0x0b
912 #define SUBLANG_ARABIC_KUWAIT 0x0d
913 #define SUBLANG_ARABIC_LEBANON 0x0c
914 #define SUBLANG_ARABIC_LIBYA 0x04
915 #define SUBLANG_ARABIC_MOROCCO 0x06
916 #define SUBLANG_ARABIC_OMAN 0x08
917 #define SUBLANG_ARABIC_QATAR 0x10
918 #define SUBLANG_ARABIC_SAUDI_ARABIA 0x01
919 #define SUBLANG_ARABIC_SYRIA 0x0a
920 #define SUBLANG_ARABIC_TUNISIA 0x07
921 #define SUBLANG_ARABIC_UAE 0x0e
922 #define SUBLANG_ARABIC_YEMEN 0x09
923 #define SUBLANG_ARMENIAN_ARMENIA 0x01
924 #define SUBLANG_ASSAMESE_INDIA 0x01
925 #define SUBLANG_AZERI_CYRILLIC 0x02
926 #define SUBLANG_AZERI_LATIN 0x01
927 #define SUBLANG_BASHKIR_RUSSIA 0x01
928 #define SUBLANG_BASQUE_BASQUE 0x01
929 #define SUBLANG_BELARUSIAN_BELARUS 0x01
930 #define SUBLANG_BENGALI_BANGLADESH 0x02
931 #define SUBLANG_BENGALI_INDIA 0x01
932 #define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x08
933 #define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN 0x05
934 #define SUBLANG_BRETON_FRANCE 0x01
935 #define SUBLANG_BULGARIAN_BULGARIA 0x01
936 #define SUBLANG_CATALAN_CATALAN 0x01
937 #define SUBLANG_CHINESE_HONGKONG 0x03
938 #define SUBLANG_CHINESE_MACAU 0x05
939 #define SUBLANG_CHINESE_SINGAPORE 0x04
940 #define SUBLANG_CHINESE_SIMPLIFIED 0x02
941 #define SUBLANG_CHINESE_TRADITIONAL 0x01
942 #define SUBLANG_CORSICAN_FRANCE 0x01
943 #define SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN 0x04
944 #define SUBLANG_CROATIAN_CROATIA 0x01
945 #define SUBLANG_CZECH_CZECH_REPUBLIC 0x01
946 #define SUBLANG_DANISH_DENMARK 0x01
947 #define SUBLANG_DARI_AFGHANISTAN 0x01
948 #define SUBLANG_DIVEHI_MALDIVES 0x01
949 #define SUBLANG_DUTCH_BELGIAN 0x02
950 #define SUBLANG_DUTCH 0x01
951 #define SUBLANG_ENGLISH_AUS 0x03
952 #define SUBLANG_ENGLISH_BELIZE 0x0a
953 #define SUBLANG_ENGLISH_CAN 0x04
954 #define SUBLANG_ENGLISH_CARIBBEAN 0x09
955 #define SUBLANG_ENGLISH_INDIA 0x10
956 #define SUBLANG_ENGLISH_EIRE 0x06
957 #define SUBLANG_ENGLISH_IRELAND 0x06
958 #define SUBLANG_ENGLISH_JAMAICA 0x08
959 #define SUBLANG_ENGLISH_MALAYSIA 0x11
960 #define SUBLANG_ENGLISH_NZ 0x05
961 #define SUBLANG_ENGLISH_PHILIPPINES 0x0d
962 #define SUBLANG_ENGLISH_SINGAPORE 0x12
963 #define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07
964 #define SUBLANG_ENGLISH_TRINIDAD 0x0b
965 #define SUBLANG_ENGLISH_UK 0x02
966 #define SUBLANG_ENGLISH_US 0x01
967 #define SUBLANG_ENGLISH_ZIMBABWE 0x0c
968 #define SUBLANG_ESTONIAN_ESTONIA 0x01
969 #define SUBLANG_FAEROESE_FAROE_ISLANDS 0x01
970 #define SUBLANG_FILIPINO_PHILIPPINES 0x01
971 #define SUBLANG_FINNISH_FINLAND 0x01
972 #define SUBLANG_FRENCH_BELGIAN 0x02
973 #define SUBLANG_FRENCH_CANADIAN 0x03
974 #define SUBLANG_FRENCH 0x01
975 #define SUBLANG_FRENCH_LUXEMBOURG 0x05
976 #define SUBLANG_FRENCH_MONACO 0x06
977 #define SUBLANG_FRENCH_SWISS 0x04
978 #define SUBLANG_FRISIAN_NETHERLANDS 0x01
979 #define SUBLANG_GALICIAN_GALICIAN 0x01
980 #define SUBLANG_GEORGIAN_GEORGIA 0x01
981 #define SUBLANG_GERMAN_AUSTRIAN 0x03
982 #define SUBLANG_GERMAN 0x01
983 #define SUBLANG_GERMAN_LIECHTENSTEIN 0x05
984 #define SUBLANG_GERMAN_LUXEMBOURG 0x04
985 #define SUBLANG_GERMAN_SWISS 0x02
986 #define SUBLANG_GREEK_GREECE 0x01
987 #define SUBLANG_GREENLANDIC_GREENLAND 0x01
988 #define SUBLANG_GUJARATI_INDIA 0x01
989 #define SUBLANG_HAUSA_NIGERIA_LATIN 0x01
990 #define SUBLANG_HAUSA_NIGERIA 0x01
991 #define SUBLANG_HEBREW_ISRAEL 0x01
992 #define SUBLANG_HINDI_INDIA 0x01
993 #define SUBLANG_HUNGARIAN_HUNGARY 0x01
994 #define SUBLANG_ICELANDIC_ICELAND 0x01
995 #define SUBLANG_IGBO_NIGERIA 0x01
996 #define SUBLANG_INDONESIAN_INDONESIA 0x01
997 #define SUBLANG_INUKTITUT_CANADA_LATIN 0x02
998 #define SUBLANG_INUKTITUT_CANADA 0x01
999 #define SUBLANG_IRISH_IRELAND 0x02
1000 #define SUBLANG_ITALIAN 0x01
1001 #define SUBLANG_ITALIAN_SWISS 0x02
1002 #define SUBLANG_JAPANESE_JAPAN 0x01
1003 #define SUBLANG_KANNADA_INDIA 0x01
1004 #define SUBLANG_KASHMIRI_INDIA 0x02
1005 #define SUBLANG_KASHMIRI_SASIA 0x02
1006 #define SUBLANG_KAZAK_KAZAKHSTAN 0x01
1007 #define SUBLANG_KHMER_CAMBODIA 0x01
1008 #define SUBLANG_KICHE_GUATEMALA 0x01
1009 #define SUBLANG_KINYARWANDA_RWANDA 0x01
1010 #define SUBLANG_KONKANI_INDIA 0x01
1011 #define SUBLANG_KOREAN 0x01
1012 #define SUBLANG_KYRGYZ_KYRGYZSTAN 0x01
1013 #define SUBLANG_LAO_LAO 0x01
1014 #define SUBLANG_LAO_LAO_PDR 0x01
1015 #define SUBLANG_LATVIAN_LATVIA 0x01
1016 #define SUBLANG_LITHUANIAN_LITHUANIA 0x01
1017 #define SUBLANG_LITHUANIAN 0x01
1018 #define SUBLANG_LOWER_SORBIAN_GERMANY 0x02
1019 #define SUBLANG_LUXEMBOURGISH_LUXEMBOURG 0x01
1020 #define SUBLANG_MACEDONIAN_MACEDONIA 0x01
1021 #define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02
1022 #define SUBLANG_MALAY_MALAYSIA 0x01
1023 #define SUBLANG_MALAYALAM_INDIA 0x01
1024 #define SUBLANG_MALTESE_MALTA 0x01
1025 #define SUBLANG_MAORI_NEW_ZEALAND 0x01
1026 #define SUBLANG_MAPUDUNGUN_CHILE 0x01
1027 #define SUBLANG_MARATHI_INDIA 0x01
1028 #define SUBLANG_MOHAWK_MOHAWK 0x01
1029 #define SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA 0x01
1030 #define SUBLANG_MONGOLIAN_PRC 0x02
1031 #define SUBLANG_NEPALI_NEPAL 0x01
1032 #define SUBLANG_NEPALI_INDIA 0x02
1033 #define SUBLANG_NORWEGIAN_BOKMAL 0x01
1034 #define SUBLANG_NORWEGIAN_NYNORSK 0x02
1035 #define SUBLANG_OCCITAN_FRANCE 0x01
1036 #define SUBLANG_ORIYA_INDIA 0x01
1037 #define SUBLANG_PASHTO_AFGHANISTAN 0x01
1038 #define SUBLANG_PERSIAN_IRAN 0x01
1039 #define SUBLANG_POLISH_POLAND 0x01
1040 #define SUBLANG_PORTUGUESE_BRAZILIAN 0x01
1041 #define SUBLANG_PORTUGUESE 0x02
1042 #define SUBLANG_PORTUGUESE_PORTUGAL 0x02
1043 #define SUBLANG_PUNJABI_INDIA 0x01
1044 #define SUBLANG_QUECHUA_BOLIVIA 0x01
1045 #define SUBLANG_QUECHUA_ECUADOR 0x02
1046 #define SUBLANG_QUECHUA_PERU 0x03
1047 #define SUBLANG_ROMANIAN_ROMANIA 0x01
1048 #define SUBLANG_ROMANSH_SWITZERLAND 0x01
1049 #define SUBLANG_RUSSIAN_RUSSIA 0x01
1050 #define SUBLANG_SAMI_INARI_FINLAND 0x09
1051 #define SUBLANG_SAMI_LULE_NORWAY 0x04
1052 #define SUBLANG_SAMI_LULE_SWEDEN 0x05
1053 #define SUBLANG_SAMI_NORTHERN_FINLAND 0x03
1054 #define SUBLANG_SAMI_NORTHERN_NORWAY 0x01
1055 #define SUBLANG_SAMI_NORTHERN_SWEDEN 0x02
1056 #define SUBLANG_SAMI_SKOLT_FINLAND 0x08
1057 #define SUBLANG_SAMI_SOUTHERN_NORWAY 0x06
1058 #define SUBLANG_SAMI_SOUTHERN_SWEDEN 0x07
1059 #define SUBLANG_SANSKRIT_INDIA 0x01
1060 #define SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x07
1061 #define SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_LATIN 0x06
1062 #define SUBLANG_SERBIAN_CROATIA 0x01
1063 #define SUBLANG_SERBIAN_CYRILLIC 0x03
1064 #define SUBLANG_SERBIAN_LATIN 0x02
1065 #define SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA 0x01
1066 #define SUBLANG_TSWANA_SOUTH_AFRICA 0x01
1067 #define SUBLANG_SINDHI_AFGHANISTAN 0x02
1068 #define SUBLANG_SINDHI_PAKISTAN 0x01
1069 #define SUBLANG_SINHALESE_SRI_LANKA 0x01
1070 #define SUBLANG_SLOVAK_SLOVAKIA 0x01
1071 #define SUBLANG_SLOVENIAN_SLOVENIA 0x01
1072 #define SUBLANG_SPANISH_ARGENTINA 0x0b
1073 #define SUBLANG_SPANISH_BOLIVIA 0x10
1074 #define SUBLANG_SPANISH_CHILE 0x0d
1075 #define SUBLANG_SPANISH_COLOMBIA 0x09
1076 #define SUBLANG_SPANISH_COSTA_RICA 0x05
1077 #define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07
1078 #define SUBLANG_SPANISH_ECUADOR 0x0c
1079 #define SUBLANG_SPANISH_EL_SALVADOR 0x11
1080 #define SUBLANG_SPANISH_GUATEMALA 0x04
1081 #define SUBLANG_SPANISH_HONDURAS 0x12
1082 #define SUBLANG_SPANISH_MEXICAN 0x02
1083 #define SUBLANG_SPANISH_MODERN 0x03
1084 #define SUBLANG_SPANISH_NICARAGUA 0x13
1085 #define SUBLANG_SPANISH_PANAMA 0x06
1086 #define SUBLANG_SPANISH_PARAGUAY 0x0f
1087 #define SUBLANG_SPANISH_PERU 0x0a
1088 #define SUBLANG_SPANISH_PUERTO_RICO 0x14
1089 #define SUBLANG_SPANISH 0x01
1090 #define SUBLANG_SPANISH_US 0x15
1091 #define SUBLANG_SPANISH_URUGUAY 0x0e
1092 #define SUBLANG_SPANISH_VENEZUELA 0x08
1093 #define SUBLANG_SWAHILI 0x01
1094 #define SUBLANG_SWAHILI_KENYA 0x01
1095 #define SUBLANG_SWEDISH_FINLAND 0x02
1096 #define SUBLANG_SWEDISH 0x01
1097 #define SUBLANG_SWEDISH_SWEDEN 0x01
1098 #define SUBLANG_SYRIAC 0x01
1099 #define SUBLANG_TAJIK_TAJIKISTAN 0x01
1100 #define SUBLANG_TAMAZIGHT_ALGERIA_LATIN 0x02
1101 #define SUBLANG_TAMIL_INDIA 0x01
1102 #define SUBLANG_TATAR_RUSSIA 0x01
1103 #define SUBLANG_TELUGU_INDIA 0x01
1104 #define SUBLANG_THAI_THAILAND 0x01
1105 #define SUBLANG_TIBETAN_PRC 0x01
1106 #define SUBLANG_TIGRIGNA_ERITREA 0x02
1107 #define SUBLANG_TURKISH_TURKEY 0x01
1108 #define SUBLANG_TURKMEN_TURKMENISTAN 0x01
1109 #define SUBLANG_UIGHUR_PRC 0x01
1110 #define SUBLANG_UKRAINIAN_UKRAINE 0x01
1111 #define SUBLANG_UPPER_SORBIAN_GERMANY 0x01
1112 #define SUBLANG_URDU_INDIA 0x02
1113 #define SUBLANG_URDU_PAKISTAN 0x01
1114 #define SUBLANG_UZBEK_CYRILLIC 0x02
1115 #define SUBLANG_UZBEK_LATIN 0x01
1116 #define SUBLANG_VIETNAMESE_VIETNAM 0x01
1117 #define SUBLANG_WELSH_UNITED_KINGDOM 0x01
1118 #define SUBLANG_WOLOF_SENEGAL 0x01
1119 #define SUBLANG_XHOSA_SOUTH_AFRICA 0x01
1120 #define SUBLANG_YAKUT_RUSSIA 0x01
1121 #define SUBLANG_YI_PRC 0x01
1122 #define SUBLANG_YORUBA_NIGERIA 0x01
1123 #define SUBLANG_ZULU_SOUTH_AFRICA 0x01
1124 #define NLS_VALID_LOCALE_MASK 1048575
1125 #define SORT_DEFAULT 0
1126 #define SORT_JAPANESE_XJIS 0
1127 #define SORT_JAPANESE_UNICODE 1
1128 #define SORT_CHINESE_BIG5 0
1129 #define SORT_CHINESE_PRCP 0
1130 #define SORT_CHINESE_UNICODE 1
1131 #define SORT_CHINESE_PRC 2
1132 #define SORT_CHINESE_BOPOMOFO 3
1133 #define SORT_KOREAN_KSC 0
1134 #define SORT_KOREAN_UNICODE 1
1135 #define SORT_GERMAN_PHONE_BOOK 1
1136 #define SORT_HUNGARIAN_DEFAULT 0
1137 #define SORT_HUNGARIAN_TECHNICAL 1
1138 #define SORT_GEORGIAN_TRADITIONAL 0
1139 #define SORT_GEORGIAN_MODERN 1
1140 #define MAKELANGID(p,s) ((((WORD)(s))<<10)|(WORD)(p))
1141 #define MAKELCID(l,s) ((DWORD)((((DWORD)((WORD)(s)))<<16)|((DWORD)((WORD)(l)))))
1142 #define PRIMARYLANGID(l) ((WORD)(l)&0x3ff)
1143 #define SORTIDFROMLCID(l) ((WORD)((((DWORD)(l))&NLS_VALID_LOCALE_MASK)>>16))
1144 #define SORTVERSIONFROMLCID(l) ((WORD)((((DWORD)(l))>>20)&0xf))
1145 #define SUBLANGID(l) ((WORD)(l)>>10)
1146 #define LANGIDFROMLCID(l) ((WORD)(l))
1147 #define LANG_SYSTEM_DEFAULT MAKELANGID(LANG_NEUTRAL,SUBLANG_SYS_DEFAULT)
1148 #define LANG_USER_DEFAULT MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT)
1149 #define LOCALE_NEUTRAL MAKELCID(MAKELANGID(LANG_NEUTRAL,SUBLANG_NEUTRAL),SORT_DEFAULT)
1150 #define LOCALE_INVARIANT MAKELCID(MAKELANGID(LANG_INVARIANT, SUBLANG_NEUTRAL), SORT_DEFAULT)
1151 #define ACL_REVISION 2
1152 #define ACL_REVISION_DS 4
1153 #define ACL_REVISION1 1
1154 #define ACL_REVISION2 2
1155 #define ACL_REVISION3 3
1156 #define ACL_REVISION4 4
1157 #define MIN_ACL_REVISION 2
1158 #define MAX_ACL_REVISION 4
1159 #define MINCHAR 0x80
1160 #define MAXCHAR 0x7f
1161 #define MINSHORT 0x8000
1162 #define MAXSHORT 0x7fff
1163 #define MINLONG 0x80000000
1164 #define MAXLONG 0x7fffffff
1165 #define MAXBYTE 0xff
1166 #define MAXWORD 0xffff
1167 #define MAXDWORD 0xffffffff
1168 #define PROCESSOR_INTEL_386 386
1169 #define PROCESSOR_INTEL_486 486
1170 #define PROCESSOR_INTEL_PENTIUM 586
1171 #define PROCESSOR_MIPS_R4000 4000
1172 #define PROCESSOR_ALPHA_21064 21064
1173 #define PROCESSOR_INTEL_IA64 2200
1174 #define PROCESSOR_PPC_601 601
1175 #define PROCESSOR_PPC_603 603
1176 #define PROCESSOR_PPC_604 604
1177 #define PROCESSOR_PPC_620 620
1178 #define PROCESSOR_INTEL_860 860
1179 #define PROCESSOR_AMD_X8664 8664
1180 #define PROCESSOR_MIPS_R2000 2000
1181 #define PROCESSOR_MIPS_R3000 3000
1182 #define PROCESSOR_HITACHI_SH3 10003
1183 #define PROCESSOR_HITACHI_SH3E 10004
1184 #define PROCESSOR_HITACHI_SH4 10005
1185 #define PROCESSOR_MOTOROLA_821 821
1186 #define PROCESSOR_SHx_SH3 103
1187 #define PROCESSOR_SHx_SH4 104
1188 #define PROCESSOR_STRONGARM 2577
1189 #define PROCESSOR_ARM720 1824
1190 #define PROCESSOR_ARM820 2080
1191 #define PROCESSOR_ARM920 2336
1192 #define PROCESSOR_ARM_7TDMI 70001
1193 #define PROCESSOR_ARCHITECTURE_INTEL 0
1194 #define PROCESSOR_ARCHITECTURE_MIPS 1
1195 #define PROCESSOR_ARCHITECTURE_ALPHA 2
1196 #define PROCESSOR_ARCHITECTURE_PPC 3
1197 #define PROCESSOR_ARCHITECTURE_SHX 4
1198 #define PROCESSOR_ARCHITECTURE_ARM 5
1199 #define PROCESSOR_ARCHITECTURE_IA64 6
1200 #define PROCESSOR_ARCHITECTURE_ALPHA64 7
1201 #define PROCESSOR_ARCHITECTURE_MSIL 8
1202 #define PROCESSOR_ARCHITECTURE_AMD64 9
1203 #define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF
1204 #define PF_FLOATING_POINT_PRECISION_ERRATA 0
1205 #define PF_FLOATING_POINT_EMULATED 1
1206 #define PF_COMPARE_EXCHANGE_DOUBLE 2
1207 #define PF_MMX_INSTRUCTIONS_AVAILABLE 3
1208 #define PF_PPC_MOVEMEM_64BIT_OK 4
1209 #define PF_ALPHA_BYTE_INSTRUCTIONS 5
1210 #define PF_XMMI_INSTRUCTIONS_AVAILABLE 6
1211 #define PF_3DNOW_INSTRUCTIONS_AVAILABLE 7
1212 #define PF_RDTSC_INSTRUCTION_AVAILABLE 8
1213 #define PF_PAE_ENABLED 9
1214 #define PF_XMMI64_INSTRUCTIONS_AVAILABLE 10
1215 /* also in ddk/ntifs.h */
1216 #define FILE_ACTION_ADDED 0x00000001
1217 #define FILE_ACTION_REMOVED 0x00000002
1218 #define FILE_ACTION_MODIFIED 0x00000003
1219 #define FILE_ACTION_RENAMED_OLD_NAME 0x00000004
1220 #define FILE_ACTION_RENAMED_NEW_NAME 0x00000005
1221 #define FILE_ACTION_ADDED_STREAM 0x00000006
1222 #define FILE_ACTION_REMOVED_STREAM 0x00000007
1223 #define FILE_ACTION_MODIFIED_STREAM 0x00000008
1224 #define FILE_ACTION_REMOVED_BY_DELETE 0x00000009
1225 #define FILE_ACTION_ID_NOT_TUNNELLED 0x0000000A
1226 #define FILE_ACTION_TUNNELLED_ID_COLLISION 0x0000000B
1227 /* end ntifs.h */
1228 #define HEAP_NO_SERIALIZE 1
1229 #define HEAP_GROWABLE 2
1230 #define HEAP_GENERATE_EXCEPTIONS 4
1231 #define HEAP_ZERO_MEMORY 8
1232 #define HEAP_REALLOC_IN_PLACE_ONLY 16
1233 #define HEAP_TAIL_CHECKING_ENABLED 32
1234 #define HEAP_FREE_CHECKING_ENABLED 64
1235 #define HEAP_DISABLE_COALESCE_ON_FREE 128
1236 #define HEAP_CREATE_ALIGN_16 0x10000
1237 #define HEAP_CREATE_ENABLE_TRACING 0x20000
1238 #define HEAP_CREATE_ENABLE_EXECUTE 0x00040000
1239 #define HEAP_MAXIMUM_TAG 0xFFF
1240 #define HEAP_PSEUDO_TAG_FLAG 0x8000
1241 #define HEAP_TAG_SHIFT 16
1242 #define HEAP_MAKE_TAG_FLAGS(b,o) ((DWORD)((b)+(o)<<16)))
1243
1244 #define KEY_QUERY_VALUE 1
1245 #define KEY_SET_VALUE 2
1246 #define KEY_CREATE_SUB_KEY 4
1247 #define KEY_ENUMERATE_SUB_KEYS 8
1248 #define KEY_NOTIFY 16
1249 #define KEY_CREATE_LINK 32
1250 #define KEY_WOW64_64KEY 0x00000100
1251 #define KEY_WOW64_32KEY 0x00000200
1252 #define KEY_WOW64_RES 0x00000300
1253
1254 #define KEY_WRITE 0x20006
1255 #define KEY_EXECUTE 0x20019
1256 #define KEY_READ 0x20019
1257 #define KEY_ALL_ACCESS 0xf003f
1258 #define REG_WHOLE_HIVE_VOLATILE 1
1259 #define REG_REFRESH_HIVE 2
1260 #define REG_NO_LAZY_FLUSH 4
1261 #define REG_OPTION_RESERVED 0
1262 #define REG_OPTION_NON_VOLATILE 0
1263 #define REG_OPTION_VOLATILE 1
1264 #define REG_OPTION_CREATE_LINK 2
1265 #define REG_OPTION_BACKUP_RESTORE 4
1266 #define REG_OPTION_OPEN_LINK 8
1267 #define REG_LEGAL_OPTION 15
1268 #define OWNER_SECURITY_INFORMATION 1
1269 #define GROUP_SECURITY_INFORMATION 2
1270 #define DACL_SECURITY_INFORMATION 4
1271 #define SACL_SECURITY_INFORMATION 8
1272 #define PROTECTED_DACL_SECURITY_INFORMATION 0x80000000
1273 #define PROTECTED_SACL_SECURITY_INFORMATION 0x40000000
1274 #define UNPROTECTED_DACL_SECURITY_INFORMATION 0x20000000
1275 #define UNPROTECTED_SACL_SECURITY_INFORMATION 0x10000000
1276 #define MAXIMUM_PROCESSORS 32
1277 #define PAGE_NOACCESS 0x0001
1278 #define PAGE_READONLY 0x0002
1279 #define PAGE_READWRITE 0x0004
1280 #define PAGE_WRITECOPY 0x0008
1281 #define PAGE_EXECUTE 0x0010
1282 #define PAGE_EXECUTE_READ 0x0020
1283 #define PAGE_EXECUTE_READWRITE 0x0040
1284 #define PAGE_EXECUTE_WRITECOPY 0x0080
1285 #define PAGE_GUARD 0x0100
1286 #define PAGE_NOCACHE 0x0200
1287 #define PAGE_WRITECOMBINE 0x0400
1288 #define MEM_COMMIT 0x1000
1289 #define MEM_RESERVE 0x2000
1290 #define MEM_DECOMMIT 0x4000
1291 #define MEM_RELEASE 0x8000
1292 #define MEM_FREE 0x10000
1293 #define MEM_PRIVATE 0x20000
1294 #define MEM_MAPPED 0x40000
1295 #define MEM_RESET 0x80000
1296 #define MEM_TOP_DOWN 0x100000
1297 #define MEM_WRITE_WATCH 0x200000 /* 98/Me */
1298 #define MEM_PHYSICAL 0x400000
1299 #define MEM_4MB_PAGES 0x80000000
1300 #define MEM_IMAGE SEC_IMAGE
1301 #define SEC_NO_CHANGE 0x00400000
1302 #define SEC_FILE 0x00800000
1303 #define SEC_IMAGE 0x01000000
1304 #define SEC_VLM 0x02000000
1305 #define SEC_RESERVE 0x04000000
1306 #define SEC_COMMIT 0x08000000
1307 #define SEC_NOCACHE 0x10000000
1308 #define SEC_WRITECOMBINE 0x40000000
1309 #define SEC_LARGE_PAGES 0x80000000
1310 #define SECTION_EXTEND_SIZE 16
1311 #define SECTION_MAP_READ 4
1312 #define SECTION_MAP_WRITE 2
1313 #define SECTION_QUERY 1
1314 #define SECTION_MAP_EXECUTE 8
1315 #define SECTION_ALL_ACCESS 0xf001f
1316 #define WRITE_WATCH_FLAG_RESET 0x01
1317 #define MESSAGE_RESOURCE_UNICODE 1
1318 #define RTL_CRITSECT_TYPE 0
1319 #define RTL_RESOURCE_TYPE 1
1320 /* Also in winddk.h */
1321 #if !defined(__GNUC__)
1322 #define FIELD_OFFSET(t,f) ((LONG)(LONG_PTR)&(((t*) 0)->f))
1323 #else
1324 #define FIELD_OFFSET(t,f) ((LONG)__builtin_offsetof(t,f))
1325 #endif
1326 #ifndef CONTAINING_RECORD
1327 #define CONTAINING_RECORD(address, type, field) \
1328 ((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field))))
1329 #endif
1330 /* end winddk.h */
1331 #define IMAGE_SIZEOF_FILE_HEADER 20
1332 #define IMAGE_FILE_RELOCS_STRIPPED 1
1333 #define IMAGE_FILE_EXECUTABLE_IMAGE 2
1334 #define IMAGE_FILE_LINE_NUMS_STRIPPED 4
1335 #define IMAGE_FILE_LOCAL_SYMS_STRIPPED 8
1336 #define IMAGE_FILE_AGGRESIVE_WS_TRIM 16
1337 #define IMAGE_FILE_LARGE_ADDRESS_AWARE 32
1338 #define IMAGE_FILE_BYTES_REVERSED_LO 128
1339 #define IMAGE_FILE_32BIT_MACHINE 256
1340 #define IMAGE_FILE_DEBUG_STRIPPED 512
1341 #define IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP 1024
1342 #define IMAGE_FILE_NET_RUN_FROM_SWAP 2048
1343 #define IMAGE_FILE_SYSTEM 4096
1344 #define IMAGE_FILE_DLL 8192
1345 #define IMAGE_FILE_UP_SYSTEM_ONLY 16384
1346 #define IMAGE_FILE_BYTES_REVERSED_HI 32768
1347 #define IMAGE_FILE_MACHINE_UNKNOWN 0
1348
1349 #define IMAGE_FILE_MACHINE_AM33 0x1d3
1350 #define IMAGE_FILE_MACHINE_AMD64 0x8664
1351 #define IMAGE_FILE_MACHINE_ARM 0x1c0
1352 #define IMAGE_FILE_MACHINE_EBC 0xebc
1353 #define IMAGE_FILE_MACHINE_I386 0x14c
1354 #define IMAGE_FILE_MACHINE_IA64 0x200
1355 #define IMAGE_FILE_MACHINE_M32R 0x9041
1356 #define IMAGE_FILE_MACHINE_MIPS16 0x266
1357 #define IMAGE_FILE_MACHINE_MIPSFPU 0x366
1358 #define IMAGE_FILE_MACHINE_MIPSFPU16 0x466
1359 #define IMAGE_FILE_MACHINE_POWERPC 0x1f0
1360 #define IMAGE_FILE_MACHINE_POWERPCFP 0x1f1
1361 #define IMAGE_FILE_MACHINE_R4000 0x166
1362 #define IMAGE_FILE_MACHINE_SH3 0x1a2
1363 #define IMAGE_FILE_MACHINE_SH3E 0x01a4
1364 #define IMAGE_FILE_MACHINE_SH3DSP 0x1a3
1365 #define IMAGE_FILE_MACHINE_SH4 0x1a6
1366 #define IMAGE_FILE_MACHINE_SH5 0x1a8
1367 #define IMAGE_FILE_MACHINE_THUMB 0x1c2
1368 #define IMAGE_FILE_MACHINE_WCEMIPSV2 0x169
1369 #define IMAGE_FILE_MACHINE_R3000 0x162
1370 #define IMAGE_FILE_MACHINE_R10000 0x168
1371 #define IMAGE_FILE_MACHINE_ALPHA 0x184
1372 #define IMAGE_FILE_MACHINE_ALPHA64 0x0284
1373 #define IMAGE_FILE_MACHINE_AXP64 IMAGE_FILE_MACHINE_ALPHA64
1374 #define IMAGE_FILE_MACHINE_CEE 0xC0EE
1375 #define IMAGE_FILE_MACHINE_TRICORE 0x0520
1376 #define IMAGE_FILE_MACHINE_CEF 0x0CEF
1377
1378 #define IMAGE_FILE_EXPORT_DIRECTORY 0
1379 #define IMAGE_FILE_IMPORT_DIRECTORY 1
1380 #define IMAGE_FILE_RESOURCE_DIRECTORY 2
1381 #define IMAGE_FILE_EXCEPTION_DIRECTORY 3
1382 #define IMAGE_FILE_SECURITY_DIRECTORY 4
1383 #define IMAGE_FILE_BASE_RELOCATION_TABLE 5
1384 #define IMAGE_FILE_DEBUG_DIRECTORY 6
1385 #define IMAGE_FILE_DESCRIPTION_STRING 7
1386 #define IMAGE_FILE_MACHINE_VALUE 8 /* Mips */
1387 #define IMAGE_FILE_THREAD_LOCAL_STORAGE 9
1388 #define IMAGE_FILE_CALLBACK_DIRECTORY 10
1389
1390 #define IMAGE_DOS_SIGNATURE 0x5A4D
1391 #define IMAGE_OS2_SIGNATURE 0x454E
1392 #define IMAGE_OS2_SIGNATURE_LE 0x454C
1393 #define IMAGE_VXD_SIGNATURE 0x454C
1394 #define IMAGE_NT_SIGNATURE 0x00004550
1395 #define IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b
1396 #define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b
1397 #ifdef _WIN64
1398 #define IMAGE_NT_OPTIONAL_HDR_MAGIC IMAGE_NT_OPTIONAL_HDR64_MAGIC
1399 #else
1400 #define IMAGE_NT_OPTIONAL_HDR_MAGIC IMAGE_NT_OPTIONAL_HDR32_MAGIC
1401 #endif
1402 #define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
1403 #define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4944
1404 #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
1405 #define IMAGE_SIZEOF_ROM_OPTIONAL_HEADER 56
1406 #define IMAGE_SIZEOF_STD_OPTIONAL_HEADER 28
1407 #define IMAGE_SIZEOF_NT_OPTIONAL_HEADER 224
1408 #define IMAGE_SIZEOF_SHORT_NAME 8
1409 #define IMAGE_SIZEOF_SECTION_HEADER 40
1410 #define IMAGE_SIZEOF_SYMBOL 18
1411 #define IMAGE_SIZEOF_AUX_SYMBOL 18
1412 #define IMAGE_SIZEOF_RELOCATION 10
1413 #define IMAGE_SIZEOF_BASE_RELOCATION 8
1414 #define IMAGE_SIZEOF_LINENUMBER 6
1415 #define IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60
1416 #define SIZEOF_RFPO_DATA 16
1417
1418 #define IMAGE_SUBSYSTEM_UNKNOWN 0
1419 #define IMAGE_SUBSYSTEM_NATIVE 1
1420 #define IMAGE_SUBSYSTEM_WINDOWS_GUI 2
1421 #define IMAGE_SUBSYSTEM_WINDOWS_CUI 3
1422 #define IMAGE_SUBSYSTEM_OS2_CUI 5
1423 #define IMAGE_SUBSYSTEM_POSIX_CUI 7
1424 #define IMAGE_SUBSYSTEM_NATIVE_WINDOWS 8
1425 #define IMAGE_SUBSYSTEM_WINDOWS_CE_GUI 9
1426 #define IMAGE_SUBSYSTEM_EFI_APPLICATION 10
1427 #define IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11
1428 #define IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12
1429 #define IMAGE_SUBSYSTEM_EFI_ROM 13
1430 #define IMAGE_SUBSYSTEM_XBOX 14
1431
1432 #define IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE 0x0040
1433 #define IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY 0x0080
1434 #define IMAGE_DLLCHARACTERISTICS_NX_COMPAT 0x0100
1435 #define IMAGE_DLLCHARACTERISTICS_NO_ISOLATION 0x0200
1436 #define IMAGE_DLLCHARACTERISTICS_NO_SEH 0x0400
1437 #define IMAGE_DLLCHARACTERISTICS_NO_BIND 0x0800
1438 #define IMAGE_DLLCHARACTERISTICS_WDM_DRIVER 0x2000
1439 #define IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE 0x8000
1440 #define IMAGE_FIRST_SECTION(h) ((PIMAGE_SECTION_HEADER) ((ULONG_PTR)h+FIELD_OFFSET(IMAGE_NT_HEADERS,OptionalHeader)+((PIMAGE_NT_HEADERS)(h))->FileHeader.SizeOfOptionalHeader))
1441 #define IMAGE_DIRECTORY_ENTRY_EXPORT 0
1442 #define IMAGE_DIRECTORY_ENTRY_IMPORT 1
1443 #define IMAGE_DIRECTORY_ENTRY_RESOURCE 2
1444 #define IMAGE_DIRECTORY_ENTRY_EXCEPTION 3
1445 #define IMAGE_DIRECTORY_ENTRY_SECURITY 4
1446 #define IMAGE_DIRECTORY_ENTRY_BASERELOC 5
1447 #define IMAGE_DIRECTORY_ENTRY_DEBUG 6
1448 #define IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7
1449 #define IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8
1450 #define IMAGE_DIRECTORY_ENTRY_TLS 9
1451 #define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10
1452 #define IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT 11
1453 #define IMAGE_DIRECTORY_ENTRY_IAT 12
1454 #define IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT 13
1455 #define IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR 14
1456 #define IMAGE_SCN_TYPE_REG 0
1457 #define IMAGE_SCN_TYPE_DSECT 1
1458 //#define IMAGE_SCN_TYPE_NOLOAD 2
1459 #define IMAGE_SCN_TYPE_GROUP 4
1460 #define IMAGE_SCN_TYPE_NO_PAD 8
1461 #define IMAGE_SCN_CNT_CODE 32
1462 #define IMAGE_SCN_CNT_INITIALIZED_DATA 64
1463 #define IMAGE_SCN_CNT_UNINITIALIZED_DATA 128
1464 #define IMAGE_SCN_LNK_OTHER 256
1465 #define IMAGE_SCN_LNK_INFO 512
1466 #define IMAGE_SCN_LNK_REMOVE 2048
1467 #define IMAGE_SCN_LNK_COMDAT 4096
1468 #define IMAGE_SCN_MEM_FARDATA 0x8000
1469 #define IMAGE_SCN_MEM_PURGEABLE 0x20000
1470 #define IMAGE_SCN_MEM_16BIT 0x20000
1471 #define IMAGE_SCN_MEM_LOCKED 0x40000
1472 #define IMAGE_SCN_MEM_PRELOAD 0x80000
1473 #define IMAGE_SCN_ALIGN_1BYTES 0x100000
1474 #define IMAGE_SCN_ALIGN_2BYTES 0x200000
1475 #define IMAGE_SCN_ALIGN_4BYTES 0x300000
1476 #define IMAGE_SCN_ALIGN_8BYTES 0x400000
1477 #define IMAGE_SCN_ALIGN_16BYTES 0x500000
1478 #define IMAGE_SCN_ALIGN_32BYTES 0x600000
1479 #define IMAGE_SCN_ALIGN_64BYTES 0x700000
1480 #define IMAGE_SCN_LNK_NRELOC_OVFL 0x1000000
1481 #define IMAGE_SCN_MEM_DISCARDABLE 0x2000000
1482 #define IMAGE_SCN_MEM_NOT_CACHED 0x4000000
1483 #define IMAGE_SCN_MEM_NOT_PAGED 0x8000000
1484 #define IMAGE_SCN_MEM_SHARED 0x10000000
1485 #define IMAGE_SCN_MEM_EXECUTE 0x20000000
1486 #define IMAGE_SCN_MEM_READ 0x40000000
1487 #define IMAGE_SCN_MEM_WRITE 0x80000000
1488 #define IMAGE_SYM_UNDEFINED 0
1489 #define IMAGE_SYM_ABSOLUTE (-1)
1490 #define IMAGE_SYM_DEBUG (-2)
1491 #define IMAGE_SYM_TYPE_NULL 0
1492 #define IMAGE_SYM_TYPE_VOID 1
1493 #define IMAGE_SYM_TYPE_CHAR 2
1494 #define IMAGE_SYM_TYPE_SHORT 3
1495 #define IMAGE_SYM_TYPE_INT 4
1496 #define IMAGE_SYM_TYPE_LONG 5
1497 #define IMAGE_SYM_TYPE_FLOAT 6
1498 #define IMAGE_SYM_TYPE_DOUBLE 7
1499 #define IMAGE_SYM_TYPE_STRUCT 8
1500 #define IMAGE_SYM_TYPE_UNION 9
1501 #define IMAGE_SYM_TYPE_ENUM 10
1502 #define IMAGE_SYM_TYPE_MOE 11
1503 #define IMAGE_SYM_TYPE_BYTE 12
1504 #define IMAGE_SYM_TYPE_WORD 13
1505 #define IMAGE_SYM_TYPE_UINT 14
1506 #define IMAGE_SYM_TYPE_DWORD 15
1507 #define IMAGE_SYM_TYPE_PCODE 32768
1508 #define IMAGE_SYM_DTYPE_NULL 0
1509 #define IMAGE_SYM_DTYPE_POINTER 1
1510 #define IMAGE_SYM_DTYPE_FUNCTION 2
1511 #define IMAGE_SYM_DTYPE_ARRAY 3
1512 #define IMAGE_SYM_CLASS_END_OF_FUNCTION (-1)
1513 #define IMAGE_SYM_CLASS_NULL 0
1514 #define IMAGE_SYM_CLASS_AUTOMATIC 1
1515 #define IMAGE_SYM_CLASS_EXTERNAL 2
1516 #define IMAGE_SYM_CLASS_STATIC 3
1517 #define IMAGE_SYM_CLASS_REGISTER 4
1518 #define IMAGE_SYM_CLASS_EXTERNAL_DEF 5
1519 #define IMAGE_SYM_CLASS_LABEL 6
1520 #define IMAGE_SYM_CLASS_UNDEFINED_LABEL 7
1521 #define IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 8
1522 #define IMAGE_SYM_CLASS_ARGUMENT 9
1523 #define IMAGE_SYM_CLASS_STRUCT_TAG 10
1524 #define IMAGE_SYM_CLASS_MEMBER_OF_UNION 11
1525 #define IMAGE_SYM_CLASS_UNION_TAG 12
1526 #define IMAGE_SYM_CLASS_TYPE_DEFINITION 13
1527 #define IMAGE_SYM_CLASS_UNDEFINED_STATIC 14
1528 #define IMAGE_SYM_CLASS_ENUM_TAG 15
1529 #define IMAGE_SYM_CLASS_MEMBER_OF_ENUM 16
1530 #define IMAGE_SYM_CLASS_REGISTER_PARAM 17
1531 #define IMAGE_SYM_CLASS_BIT_FIELD 18
1532 #define IMAGE_SYM_CLASS_FAR_EXTERNAL 68
1533 #define IMAGE_SYM_CLASS_BLOCK 100
1534 #define IMAGE_SYM_CLASS_FUNCTION 101
1535 #define IMAGE_SYM_CLASS_END_OF_STRUCT 102
1536 #define IMAGE_SYM_CLASS_FILE 103
1537 #define IMAGE_SYM_CLASS_SECTION 104
1538 #define IMAGE_SYM_CLASS_WEAK_EXTERNAL 105
1539 #define IMAGE_COMDAT_SELECT_NODUPLICATES 1
1540 #define IMAGE_COMDAT_SELECT_ANY 2
1541 #define IMAGE_COMDAT_SELECT_SAME_SIZE 3
1542 #define IMAGE_COMDAT_SELECT_EXACT_MATCH 4
1543 #define IMAGE_COMDAT_SELECT_ASSOCIATIVE 5
1544 #define IMAGE_COMDAT_SELECT_LARGEST 6
1545 #define IMAGE_COMDAT_SELECT_NEWEST 7
1546 #define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1
1547 #define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2
1548 #define IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3
1549 #define IMAGE_REL_I386_ABSOLUTE 0
1550 #define IMAGE_REL_I386_DIR16 1
1551 #define IMAGE_REL_I386_REL16 2
1552 #define IMAGE_REL_I386_DIR32 6
1553 #define IMAGE_REL_I386_DIR32NB 7
1554 #define IMAGE_REL_I386_SEG12 9
1555 #define IMAGE_REL_I386_SECTION 10
1556 #define IMAGE_REL_I386_SECREL 11
1557 #define IMAGE_REL_I386_REL32 20
1558 #define IMAGE_REL_MIPS_ABSOLUTE 0
1559 #define IMAGE_REL_MIPS_REFHALF 1
1560 #define IMAGE_REL_MIPS_REFWORD 2
1561 #define IMAGE_REL_MIPS_JMPADDR 3
1562 #define IMAGE_REL_MIPS_REFHI 4
1563 #define IMAGE_REL_MIPS_REFLO 5
1564 #define IMAGE_REL_MIPS_GPREL 6
1565 #define IMAGE_REL_MIPS_LITERAL 7
1566 #define IMAGE_REL_MIPS_SECTION 10
1567 #define IMAGE_REL_MIPS_SECREL 11
1568 #define IMAGE_REL_MIPS_SECRELLO 12
1569 #define IMAGE_REL_MIPS_SECRELHI 13
1570 #define IMAGE_REL_MIPS_REFWORDNB 34
1571 #define IMAGE_REL_MIPS_PAIR 35
1572 #define IMAGE_REL_ALPHA_ABSOLUTE 0
1573 #define IMAGE_REL_ALPHA_REFLONG 1
1574 #define IMAGE_REL_ALPHA_REFQUAD 2
1575 #define IMAGE_REL_ALPHA_GPREL32 3
1576 #define IMAGE_REL_ALPHA_LITERAL 4
1577 #define IMAGE_REL_ALPHA_LITUSE 5
1578 #define IMAGE_REL_ALPHA_GPDISP 6
1579 #define IMAGE_REL_ALPHA_BRADDR 7
1580 #define IMAGE_REL_ALPHA_HINT 8
1581 #define IMAGE_REL_ALPHA_INLINE_REFLONG 9
1582 #define IMAGE_REL_ALPHA_REFHI 10
1583 #define IMAGE_REL_ALPHA_REFLO 11
1584 #define IMAGE_REL_ALPHA_PAIR 12
1585 #define IMAGE_REL_ALPHA_MATCH 13
1586 #define IMAGE_REL_ALPHA_SECTION 14
1587 #define IMAGE_REL_ALPHA_SECREL 15
1588 #define IMAGE_REL_ALPHA_REFLONGNB 16
1589 #define IMAGE_REL_ALPHA_SECRELLO 17
1590 #define IMAGE_REL_ALPHA_SECRELHI 18
1591 #define IMAGE_REL_PPC_ABSOLUTE 0
1592 #define IMAGE_REL_PPC_ADDR64 1
1593 #define IMAGE_REL_PPC_ADDR32 2
1594 #define IMAGE_REL_PPC_ADDR24 3
1595 #define IMAGE_REL_PPC_ADDR16 4
1596 #define IMAGE_REL_PPC_ADDR14 5
1597 #define IMAGE_REL_PPC_REL24 6
1598 #define IMAGE_REL_PPC_REL14 7
1599 #define IMAGE_REL_PPC_TOCREL16 8
1600 #define IMAGE_REL_PPC_TOCREL14 9
1601 #define IMAGE_REL_PPC_ADDR32NB 10
1602 #define IMAGE_REL_PPC_SECREL 11
1603 #define IMAGE_REL_PPC_SECTION 12
1604 #define IMAGE_REL_PPC_IFGLUE 13
1605 #define IMAGE_REL_PPC_IMGLUE 14
1606 #define IMAGE_REL_PPC_SECREL16 15
1607 #define IMAGE_REL_PPC_REFHI 16
1608 #define IMAGE_REL_PPC_REFLO 17
1609 #define IMAGE_REL_PPC_PAIR 18
1610 #define IMAGE_REL_PPC_TYPEMASK 255
1611 #define IMAGE_REL_PPC_NEG 256
1612 #define IMAGE_REL_PPC_BRTAKEN 512
1613 #define IMAGE_REL_PPC_BRNTAKEN 1024
1614 #define IMAGE_REL_PPC_TOCDEFN 2048
1615 #define IMAGE_REL_BASED_ABSOLUTE 0
1616 #define IMAGE_REL_BASED_HIGH 1
1617 #define IMAGE_REL_BASED_LOW 2
1618 #define IMAGE_REL_BASED_HIGHLOW 3
1619 #define IMAGE_REL_BASED_HIGHADJ 4
1620 #define IMAGE_REL_BASED_MIPS_JMPADDR 5
1621 #define IMAGE_REL_BASED_MIPS_JMPADDR16 9
1622 #define IMAGE_REL_BASED_IA64_IMM64 9
1623 #define IMAGE_REL_BASED_DIR64 10
1624 #define IMAGE_ARCHIVE_START_SIZE 8
1625 #define IMAGE_ARCHIVE_START "!<arch>\n"
1626 #define IMAGE_ARCHIVE_END "`\n"
1627 #define IMAGE_ARCHIVE_PAD "\n"
1628 #define IMAGE_ARCHIVE_LINKER_MEMBER "/ "
1629 #define IMAGE_ARCHIVE_LONGNAMES_MEMBER "// "
1630 #define IMAGE_RESOURCE_NAME_IS_STRING 0x80000000
1631 #define IMAGE_RESOURCE_DATA_IS_DIRECTORY 0x80000000
1632 #define IMAGE_DEBUG_TYPE_UNKNOWN 0
1633 #define IMAGE_DEBUG_TYPE_COFF 1
1634 #define IMAGE_DEBUG_TYPE_CODEVIEW 2
1635 #define IMAGE_DEBUG_TYPE_FPO 3
1636 #define IMAGE_DEBUG_TYPE_MISC 4
1637 #define IMAGE_DEBUG_TYPE_EXCEPTION 5
1638 #define IMAGE_DEBUG_TYPE_FIXUP 6
1639 #define IMAGE_DEBUG_TYPE_OMAP_TO_SRC 7
1640 #define IMAGE_DEBUG_TYPE_OMAP_FROM_SRC 8
1641 #define FRAME_FPO 0
1642 #define FRAME_TRAP 1
1643 #define FRAME_TSS 2
1644 #define FRAME_NONFPO 3
1645 #define IMAGE_DEBUG_MISC_EXENAME 1
1646 #define N_BTMASK 0x000F
1647 #define N_TMASK 0x0030
1648 #define N_TMASK1 0x00C0
1649 #define N_TMASK2 0x00F0
1650 #define N_BTSHFT 4
1651 #define N_TSHIFT 2
1652 #define IS_TEXT_UNICODE_ASCII16 1
1653 #define IS_TEXT_UNICODE_REVERSE_ASCII16 16
1654 #define IS_TEXT_UNICODE_STATISTICS 2
1655 #define IS_TEXT_UNICODE_REVERSE_STATISTICS 32
1656 #define IS_TEXT_UNICODE_CONTROLS 4
1657 #define IS_TEXT_UNICODE_REVERSE_CONTROLS 64
1658 #define IS_TEXT_UNICODE_SIGNATURE 8
1659 #define IS_TEXT_UNICODE_REVERSE_SIGNATURE 128
1660 #define IS_TEXT_UNICODE_ILLEGAL_CHARS 256
1661 #define IS_TEXT_UNICODE_ODD_LENGTH 512
1662 #define IS_TEXT_UNICODE_NULL_BYTES 4096
1663 #define IS_TEXT_UNICODE_UNICODE_MASK 15
1664 #define IS_TEXT_UNICODE_REVERSE_MASK 240
1665 #define IS_TEXT_UNICODE_NOT_UNICODE_MASK 3840
1666 #define IS_TEXT_UNICODE_NOT_ASCII_MASK 61440
1667 #define SERVICE_KERNEL_DRIVER 1
1668 #define SERVICE_FILE_SYSTEM_DRIVER 2
1669 #define SERVICE_ADAPTER 4
1670 #define SERVICE_RECOGNIZER_DRIVER 8
1671 #define SERVICE_DRIVER (SERVICE_KERNEL_DRIVER|SERVICE_FILE_SYSTEM_DRIVER|SERVICE_RECOGNIZER_DRIVER)
1672 #define SERVICE_WIN32_OWN_PROCESS 16
1673 #define SERVICE_WIN32_SHARE_PROCESS 32
1674 #define SERVICE_WIN32 (SERVICE_WIN32_OWN_PROCESS|SERVICE_WIN32_SHARE_PROCESS)
1675 #define SERVICE_INTERACTIVE_PROCESS 256
1676 #define SERVICE_TYPE_ALL (SERVICE_WIN32|SERVICE_ADAPTER|SERVICE_DRIVER|SERVICE_INTERACTIVE_PROCESS)
1677 #define SERVICE_BOOT_START 0
1678 #define SERVICE_SYSTEM_START 1
1679 #define SERVICE_AUTO_START 2
1680 #define SERVICE_DEMAND_START 3
1681 #define SERVICE_DISABLED 4
1682 #define SERVICE_ERROR_IGNORE 0
1683 #define SERVICE_ERROR_NORMAL 1
1684 #define SERVICE_ERROR_SEVERE 2
1685 #define SERVICE_ERROR_CRITICAL 3
1686 #define SE_OWNER_DEFAULTED 1
1687 #define SE_GROUP_DEFAULTED 2
1688 #define SE_DACL_PRESENT 4
1689 #define SE_DACL_DEFAULTED 8
1690 #define SE_SACL_PRESENT 16
1691 #define SE_SACL_DEFAULTED 32
1692 #define SE_DACL_AUTO_INHERIT_REQ 256
1693 #define SE_SACL_AUTO_INHERIT_REQ 512
1694 #define SE_DACL_AUTO_INHERITED 1024
1695 #define SE_SACL_AUTO_INHERITED 2048
1696 #define SE_DACL_PROTECTED 4096
1697 #define SE_SACL_PROTECTED 8192
1698 #define SE_RM_CONTROL_VALID 0x4000
1699 #define SE_SELF_RELATIVE 0x8000
1700 #define SECURITY_DESCRIPTOR_MIN_LENGTH 20
1701 #define SECURITY_DESCRIPTOR_REVISION 1
1702 #define SECURITY_DESCRIPTOR_REVISION1 1
1703 #define SE_PRIVILEGE_ENABLED_BY_DEFAULT 1
1704 #define SE_PRIVILEGE_ENABLED 2
1705 #define SE_PRIVILEGE_USED_FOR_ACCESS 0x80000000
1706 #define PRIVILEGE_SET_ALL_NECESSARY 1
1707 #define SECURITY_MAX_IMPERSONATION_LEVEL SecurityDelegation
1708 #define DEFAULT_IMPERSONATION_LEVEL SecurityImpersonation
1709 #define SECURITY_DYNAMIC_TRACKING TRUE
1710 #define SECURITY_STATIC_TRACKING FALSE
1711 /* also in ddk/ntifs.h */
1712 #define TOKEN_ASSIGN_PRIMARY (0x0001)
1713 #define TOKEN_DUPLICATE (0x0002)
1714 #define TOKEN_IMPERSONATE (0x0004)
1715 #define TOKEN_QUERY (0x0008)
1716 #define TOKEN_QUERY_SOURCE (0x0010)
1717 #define TOKEN_ADJUST_PRIVILEGES (0x0020)
1718 #define TOKEN_ADJUST_GROUPS (0x0040)
1719 #define TOKEN_ADJUST_DEFAULT (0x0080)
1720 #define TOKEN_ADJUST_SESSIONID (0x0100)
1721 #define TOKEN_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\
1722 TOKEN_ASSIGN_PRIMARY |\
1723 TOKEN_DUPLICATE |\
1724 TOKEN_IMPERSONATE |\
1725 TOKEN_QUERY |\
1726 TOKEN_QUERY_SOURCE |\
1727 TOKEN_ADJUST_PRIVILEGES |\
1728 TOKEN_ADJUST_GROUPS |\
1729 TOKEN_ADJUST_DEFAULT |\
1730 TOKEN_ADJUST_SESSIONID)
1731 #define TOKEN_READ (STANDARD_RIGHTS_READ |\
1732 TOKEN_QUERY)
1733 #define TOKEN_WRITE (STANDARD_RIGHTS_WRITE |\
1734 TOKEN_ADJUST_PRIVILEGES |\
1735 TOKEN_ADJUST_GROUPS |\
1736 TOKEN_ADJUST_DEFAULT)
1737
1738 #define TOKEN_EXECUTE (STANDARD_RIGHTS_EXECUTE)
1739 #define TOKEN_SOURCE_LENGTH 8
1740 /* end ddk/ntifs.h */
1741 #define DLL_PROCESS_DETACH 0
1742 #define DLL_PROCESS_ATTACH 1
1743 #define DLL_THREAD_ATTACH 2
1744 #define DLL_THREAD_DETACH 3
1745 #ifdef __WINESRC__
1746 #define DLL_WINE_PREATTACH 8 /* Never called, but defined for compatibility with Wine source */
1747 #endif
1748 #define TAPE_ABSOLUTE_POSITION 0
1749 #define TAPE_LOGICAL_POSITION 1
1750 #define TAPE_PSEUDO_LOGICAL_POSITION 2
1751 #define TAPE_REWIND 0
1752 #define TAPE_ABSOLUTE_BLOCK 1
1753 #define TAPE_LOGICAL_BLOCK 2
1754 #define TAPE_PSEUDO_LOGICAL_BLOCK 3
1755 #define TAPE_SPACE_END_OF_DATA 4
1756 #define TAPE_SPACE_RELATIVE_BLOCKS 5
1757 #define TAPE_SPACE_FILEMARKS 6
1758 #define TAPE_SPACE_SEQUENTIAL_FMKS 7
1759 #define TAPE_SPACE_SETMARKS 8
1760 #define TAPE_SPACE_SEQUENTIAL_SMKS 9
1761 #define TAPE_DRIVE_FIXED 1
1762 #define TAPE_DRIVE_SELECT 2
1763 #define TAPE_DRIVE_INITIATOR 4
1764 #define TAPE_DRIVE_ERASE_SHORT 16
1765 #define TAPE_DRIVE_ERASE_LONG 32
1766 #define TAPE_DRIVE_ERASE_BOP_ONLY 64
1767 #define TAPE_DRIVE_ERASE_IMMEDIATE 128
1768 #define TAPE_DRIVE_TAPE_CAPACITY 256
1769 #define TAPE_DRIVE_TAPE_REMAINING 512
1770 #define TAPE_DRIVE_FIXED_BLOCK 1024
1771 #define TAPE_DRIVE_VARIABLE_BLOCK 2048
1772 #define TAPE_DRIVE_WRITE_PROTECT 4096
1773 #define TAPE_DRIVE_EOT_WZ_SIZE 8192
1774 #define TAPE_DRIVE_ECC 0x10000
1775 #define TAPE_DRIVE_COMPRESSION 0x20000
1776 #define TAPE_DRIVE_PADDING 0x40000
1777 #define TAPE_DRIVE_REPORT_SMKS 0x80000
1778 #define TAPE_DRIVE_GET_ABSOLUTE_BLK 0x100000
1779 #define TAPE_DRIVE_GET_LOGICAL_BLK 0x200000
1780 #define TAPE_DRIVE_SET_EOT_WZ_SIZE 0x400000
1781 #define TAPE_DRIVE_EJECT_MEDIA 0x1000000
1782 #define TAPE_DRIVE_CLEAN_REQUESTS 0x2000000
1783 #define TAPE_DRIVE_SET_CMP_BOP_ONLY 0x4000000
1784 #define TAPE_DRIVE_RESERVED_BIT 0x80000000
1785 #define TAPE_DRIVE_LOAD_UNLOAD 0x80000001
1786 #define TAPE_DRIVE_TENSION 0x80000002
1787 #define TAPE_DRIVE_LOCK_UNLOCK 0x80000004
1788 #define TAPE_DRIVE_REWIND_IMMEDIATE 0x80000008
1789 #define TAPE_DRIVE_SET_BLOCK_SIZE 0x80000010
1790 #define TAPE_DRIVE_LOAD_UNLD_IMMED 0x80000020
1791 #define TAPE_DRIVE_TENSION_IMMED 0x80000040
1792 #define TAPE_DRIVE_LOCK_UNLK_IMMED 0x80000080
1793 #define TAPE_DRIVE_SET_ECC 0x80000100
1794 #define TAPE_DRIVE_SET_COMPRESSION 0x80000200
1795 #define TAPE_DRIVE_SET_PADDING 0x80000400
1796 #define TAPE_DRIVE_SET_REPORT_SMKS 0x80000800
1797 #define TAPE_DRIVE_ABSOLUTE_BLK 0x80001000
1798 #define TAPE_DRIVE_ABS_BLK_IMMED 0x80002000
1799 #define TAPE_DRIVE_LOGICAL_BLK 0x80004000
1800 #define TAPE_DRIVE_LOG_BLK_IMMED 0x80008000
1801 #define TAPE_DRIVE_END_OF_DATA 0x80010000
1802 #define TAPE_DRIVE_RELATIVE_BLKS 0x80020000
1803 #define TAPE_DRIVE_FILEMARKS 0x80040000
1804 #define TAPE_DRIVE_SEQUENTIAL_FMKS 0x80080000
1805 #define TAPE_DRIVE_SETMARKS 0x80100000
1806 #define TAPE_DRIVE_SEQUENTIAL_SMKS 0x80200000
1807 #define TAPE_DRIVE_REVERSE_POSITION 0x80400000
1808 #define TAPE_DRIVE_SPACE_IMMEDIATE 0x80800000
1809 #define TAPE_DRIVE_WRITE_SETMARKS 0x81000000
1810 #define TAPE_DRIVE_WRITE_FILEMARKS 0x82000000
1811 #define TAPE_DRIVE_WRITE_SHORT_FMKS 0x84000000
1812 #define TAPE_DRIVE_WRITE_LONG_FMKS 0x88000000
1813 #define TAPE_DRIVE_WRITE_MARK_IMMED 0x90000000
1814 #define TAPE_DRIVE_FORMAT 0xA0000000
1815 #define TAPE_DRIVE_FORMAT_IMMEDIATE 0xC0000000
1816 #define TAPE_DRIVE_HIGH_FEATURES 0x80000000
1817 #define TAPE_FIXED_PARTITIONS 0
1818 #define TAPE_INITIATOR_PARTITIONS 2
1819 #define TAPE_SELECT_PARTITIONS 1
1820 #define TAPE_FILEMARKS 1
1821 #define TAPE_LONG_FILEMARKS 3
1822 #define TAPE_SETMARKS 0
1823 #define TAPE_SHORT_FILEMARKS 2
1824 #define TAPE_ERASE_LONG 1
1825 #define TAPE_ERASE_SHORT 0
1826 #define TAPE_LOAD 0
1827 #define TAPE_UNLOAD 1
1828 #define TAPE_TENSION 2
1829 #define TAPE_LOCK 3
1830 #define TAPE_UNLOCK 4
1831 #define TAPE_FORMAT 5
1832 #if (_WIN32_WINNT >= 0x0500)
1833 #define VER_MINORVERSION 0x0000001
1834 #define VER_MAJORVERSION 0x0000002
1835 #define VER_BUILDNUMBER 0x0000004
1836 #define VER_PLATFORMID 0x0000008
1837 #define VER_SERVICEPACKMINOR 0x0000010
1838 #define VER_SERVICEPACKMAJOR 0x0000020
1839 #define VER_SUITENAME 0x0000040
1840 #define VER_PRODUCT_TYPE 0x0000080
1841 #define VER_EQUAL 1
1842 #define VER_GREATER 2
1843 #define VER_GREATER_EQUAL 3
1844 #define VER_LESS 4
1845 #define VER_LESS_EQUAL 5
1846 #define VER_AND 6
1847 #define VER_OR 7
1848 #endif
1849 #define VER_SERVER_NT 0x80000000
1850 #define VER_WORKSTATION_NT 0x40000000
1851 #define VER_PLATFORM_WIN32s 0
1852 #define VER_PLATFORM_WIN32_WINDOWS 1
1853 #define VER_PLATFORM_WIN32_NT 2
1854 #define VER_NT_WORKSTATION 1
1855 #define VER_NT_DOMAIN_CONTROLLER 2
1856 #define VER_NT_SERVER 3
1857 #define VER_SUITE_SMALLBUSINESS 1
1858 #define VER_SUITE_ENTERPRISE 2
1859 #define VER_SUITE_BACKOFFICE 4
1860 #define VER_SUITE_COMMUNICATIONS 8
1861 #define VER_SUITE_TERMINAL 16
1862 #define VER_SUITE_SMALLBUSINESS_RESTRICTED 32
1863 #define VER_SUITE_EMBEDDEDNT 64
1864 #define VER_SUITE_DATACENTER 128
1865 #define VER_SUITE_SINGLEUSERTS 256
1866 #define VER_SUITE_PERSONAL 512
1867 #define VER_SUITE_BLADE 1024
1868 #define VER_SUITE_EMBEDDED_RESTRICTED 2048
1869 #define VER_SUITE_SECURITY_APPLIANCE 4096
1870 #define VER_SUITE_STORAGE_SERVER 8192
1871 #define VER_SUITE_COMPUTE_SERVER 16384
1872 #define VER_SUITE_WH_SERVER 32768
1873 #define WT_EXECUTEDEFAULT 0x00000000
1874 #define WT_EXECUTEINIOTHREAD 0x00000001
1875 #define WT_EXECUTEINUITHREAD 0x00000002
1876 #define WT_EXECUTEINWAITTHREAD 0x00000004
1877 #define WT_EXECUTEONLYONCE 0x00000008
1878 #define WT_EXECUTELONGFUNCTION 0x00000010
1879 #define WT_EXECUTEINTIMERTHREAD 0x00000020
1880 #define WT_EXECUTEINPERSISTENTIOTHREAD 0x00000040
1881 #define WT_EXECUTEINPERSISTENTTHREAD 0x00000080
1882 #define WT_TRANSFER_IMPERSONATION 0x00000100
1883 #define WT_SET_MAX_THREADPOOL_THREADS(flags,limit) ((flags)|=(limit)<<16)
1884 typedef VOID (NTAPI *WORKERCALLBACKFUNC)(PVOID);
1885 #if (_WIN32_WINNT >= 0x0501)
1886 #define ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION 1
1887 #define ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION 2
1888 #define ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION 3
1889 #define ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION 4
1890 #define ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION 5
1891 #define ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION 6
1892 #define ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION 7
1893 #define ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES 9
1894 #endif /* (_WIN32_WINNT >= 0x0501) */
1895 #define BTYPE(x) ((x)&N_BTMASK)
1896 #define ISPTR(x) (((x)&N_TMASK)==(IMAGE_SYM_DTYPE_POINTER<<N_BTSHFT))
1897 #define ISFCN(x) (((x)&N_TMASK)==(IMAGE_SYM_DTYPE_FUNCTION<<N_BTSHFT))
1898 #define ISARY(x) (((x)&N_TMASK)==(IMAGE_SYM_DTYPE_ARRAY<<N_BTSHFT))
1899 #define ISTAG(x) ((x)==IMAGE_SYM_CLASS_STRUCT_TAG||(x)==IMAGE_SYM_CLASS_UNION_TAG||(x)==IMAGE_SYM_CLASS_ENUM_TAG)
1900 #define INCREF(x) ((((x)&~N_BTMASK)<<N_TSHIFT)|(IMAGE_SYM_DTYPE_POINTER<<N_BTSHFT)|((x)&N_BTMASK))
1901 #define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
1902 #define TLS_MINIMUM_AVAILABLE 64
1903 #define FLS_MAXIMUM_AVAILABLE 128
1904 #define REPARSE_GUID_DATA_BUFFER_HEADER_SIZE FIELD_OFFSET(REPARSE_GUID_DATA_BUFFER, GenericReparseBuffer)
1905 #define MAXIMUM_REPARSE_DATA_BUFFER_SIZE 16384
1906 #define IO_REPARSE_TAG_RESERVED_ZERO 0
1907 #define IO_REPARSE_TAG_RESERVED_ONE 1
1908 #define IO_REPARSE_TAG_RESERVED_RANGE IO_REPARSE_TAG_RESERVED_ONE
1909 #define IsReparseTagMicrosoft(x) ((x)&0x80000000)
1910 #define IsReparseTagHighLatency(x) ((x)&0x40000000)
1911 #define IsReparseTagNameSurrogate(x) ((x)&0x20000000)
1912 #define IO_REPARSE_TAG_VALID_VALUES 0xE000FFFF
1913 #define IsReparseTagValid(x) (!((x)&~IO_REPARSE_TAG_VALID_VALUES)&&((x)>IO_REPARSE_TAG_RESERVED_RANGE))
1914 #define IO_REPARSE_TAG_SYMBOLIC_LINK IO_REPARSE_TAG_RESERVED_ZERO
1915 #define IO_REPARSE_TAG_MOUNT_POINT 0xA0000003
1916 #define IO_REPARSE_TAG_SYMLINK 0xA000000CL
1917 #ifndef RC_INVOKED
1918 typedef DWORD ACCESS_MASK, *PACCESS_MASK;
1919
1920 #ifdef _GUID_DEFINED
1921 # warning _GUID_DEFINED is deprecated, use GUID_DEFINED instead
1922 #endif
1923
1924 #if ! (defined _GUID_DEFINED || defined GUID_DEFINED) /* also defined in basetyps.h */
1925 #define GUID_DEFINED
1926 typedef struct _GUID {
1927 unsigned long Data1;
1928 unsigned short Data2;
1929 unsigned short Data3;
1930 unsigned char Data4[8];
1931 } GUID, *REFGUID, *LPGUID;
1932 #endif /* GUID_DEFINED */
1933
1934 #define SYSTEM_LUID { 0x3E7, 0x0 }
1935
1936 /* ACE Access Types, also in ntifs.h */
1937 #define ACCESS_MIN_MS_ACE_TYPE (0x0)
1938 #define ACCESS_ALLOWED_ACE_TYPE (0x0)
1939 #define ACCESS_DENIED_ACE_TYPE (0x1)
1940 #define SYSTEM_AUDIT_ACE_TYPE (0x2)
1941 #define SYSTEM_ALARM_ACE_TYPE (0x3)
1942 #define ACCESS_MAX_MS_V2_ACE_TYPE (0x3)
1943 #define ACCESS_ALLOWED_COMPOUND_ACE_TYPE (0x4)
1944 #define ACCESS_MAX_MS_V3_ACE_TYPE (0x4)
1945 #define ACCESS_MIN_MS_OBJECT_ACE_TYPE (0x5)
1946 #define ACCESS_ALLOWED_OBJECT_ACE_TYPE (0x5)
1947 #define ACCESS_DENIED_OBJECT_ACE_TYPE (0x6)
1948 #define SYSTEM_AUDIT_OBJECT_ACE_TYPE (0x7)
1949 #define SYSTEM_ALARM_OBJECT_ACE_TYPE (0x8)
1950 #define ACCESS_MAX_MS_OBJECT_ACE_TYPE (0x8)
1951 #define ACCESS_MAX_MS_V4_ACE_TYPE (0x8)
1952 #define ACCESS_MAX_MS_ACE_TYPE (0x8)
1953 #define ACCESS_ALLOWED_CALLBACK_ACE_TYPE (0x9)
1954 #define ACCESS_DENIED_CALLBACK_ACE_TYPE (0xA)
1955 #define ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE (0xB)
1956 #define ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE (0xC)
1957 #define SYSTEM_AUDIT_CALLBACK_ACE_TYPE (0xD)
1958 #define SYSTEM_ALARM_CALLBACK_ACE_TYPE (0xE)
1959 #define SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE (0xF)
1960 #define SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE (0x10)
1961 #define SYSTEM_MANDATORY_LABEL_ACE_TYPE (0x11)
1962 #define ACCESS_MAX_MS_V5_ACE_TYPE (0x11)
1963 /* end ntifs.h */
1964
1965 typedef struct _GENERIC_MAPPING {
1966 ACCESS_MASK GenericRead;
1967 ACCESS_MASK GenericWrite;
1968 ACCESS_MASK GenericExecute;
1969 ACCESS_MASK GenericAll;
1970 } GENERIC_MAPPING, *PGENERIC_MAPPING;
1971
1972 typedef struct _ACE_HEADER {
1973 BYTE AceType;
1974 BYTE AceFlags;
1975 WORD AceSize;
1976 } ACE_HEADER, *PACE_HEADER;
1977
1978 typedef struct _ACCESS_ALLOWED_ACE {
1979 ACE_HEADER Header;
1980 ACCESS_MASK Mask;
1981 DWORD SidStart;
1982 } ACCESS_ALLOWED_ACE, *PACCESS_ALLOWED_ACE;
1983
1984 typedef struct _ACCESS_DENIED_ACE {
1985 ACE_HEADER Header;
1986 ACCESS_MASK Mask;
1987 DWORD SidStart;
1988 } ACCESS_DENIED_ACE, *PACCESS_DENIED_ACE;
1989
1990 typedef struct _SYSTEM_AUDIT_ACE {
1991 ACE_HEADER Header;
1992 ACCESS_MASK Mask;
1993 DWORD SidStart;
1994 } SYSTEM_AUDIT_ACE, *PSYSTEM_AUDIT_ACE;
1995
1996 typedef struct _SYSTEM_ALARM_ACE {
1997 ACE_HEADER Header;
1998 ACCESS_MASK Mask;
1999 DWORD SidStart;
2000 } SYSTEM_ALARM_ACE,*PSYSTEM_ALARM_ACE;
2001
2002 typedef struct _SYSTEM_MANDATORY_LABEL_ACE {
2003 ACE_HEADER Header;
2004 ACCESS_MASK Mask;
2005 DWORD SidStart;
2006 } SYSTEM_MANDATORY_LABEL_ACE, *PSYSTEM_MANDATORY_LABEL_ACE;
2007
2008 #define SYSTEM_MANDATORY_LABEL_NO_WRITE_UP 0x1
2009 #define SYSTEM_MANDATORY_LABEL_NO_READ_UP 0x2
2010 #define SYSTEM_MANDATORY_LABEL_NO_EXECUTE_UP 0x4
2011 #define SYSTEM_MANDATORY_LABEL_VALID_MASK (SYSTEM_MANDATORY_LABEL_NO_WRITE_UP | SYSTEM_MANDATORY_LABEL_NO_READ_UP | SYSTEM_MANDATORY_LABEL_NO_EXECUTE_UP)
2012
2013 typedef struct _ACCESS_ALLOWED_OBJECT_ACE {
2014 ACE_HEADER Header;
2015 ACCESS_MASK Mask;
2016 DWORD Flags;
2017 GUID ObjectType;
2018 GUID InheritedObjectType;
2019 DWORD SidStart;
2020 } ACCESS_ALLOWED_OBJECT_ACE,*PACCESS_ALLOWED_OBJECT_ACE;
2021
2022 typedef struct _ACCESS_DENIED_OBJECT_ACE {
2023 ACE_HEADER Header;
2024 ACCESS_MASK Mask;
2025 DWORD Flags;
2026 GUID ObjectType;
2027 GUID InheritedObjectType;
2028 DWORD SidStart;
2029 } ACCESS_DENIED_OBJECT_ACE,*PACCESS_DENIED_OBJECT_ACE;
2030
2031 typedef struct _SYSTEM_AUDIT_OBJECT_ACE {
2032 ACE_HEADER Header;
2033 ACCESS_MASK Mask;
2034 DWORD Flags;
2035 GUID ObjectType;
2036 GUID InheritedObjectType;
2037 DWORD SidStart;
2038 } SYSTEM_AUDIT_OBJECT_ACE,*PSYSTEM_AUDIT_OBJECT_ACE;
2039
2040 typedef struct _SYSTEM_ALARM_OBJECT_ACE {
2041 ACE_HEADER Header;
2042 ACCESS_MASK Mask;
2043 DWORD Flags;
2044 GUID ObjectType;
2045 GUID InheritedObjectType;
2046 DWORD SidStart;
2047 } SYSTEM_ALARM_OBJECT_ACE,*PSYSTEM_ALARM_OBJECT_ACE;
2048
2049 typedef struct _ACCESS_ALLOWED_CALLBACK_ACE {
2050 ACE_HEADER Header;
2051 ACCESS_MASK Mask;
2052 DWORD SidStart;
2053 } ACCESS_ALLOWED_CALLBACK_ACE, *PACCESS_ALLOWED_CALLBACK_ACE;
2054
2055 typedef struct _ACCESS_DENIED_CALLBACK_ACE {
2056 ACE_HEADER Header;
2057 ACCESS_MASK Mask;
2058 DWORD SidStart;
2059 } ACCESS_DENIED_CALLBACK_ACE, *PACCESS_DENIED_CALLBACK_ACE;
2060
2061 typedef struct _SYSTEM_AUDIT_CALLBACK_ACE {
2062 ACE_HEADER Header;
2063 ACCESS_MASK Mask;
2064 DWORD SidStart;
2065 } SYSTEM_AUDIT_CALLBACK_ACE, *PSYSTEM_AUDIT_CALLBACK_ACE;
2066
2067 typedef struct _SYSTEM_ALARM_CALLBACK_ACE {
2068 ACE_HEADER Header;
2069 ACCESS_MASK Mask;
2070 DWORD SidStart;
2071 } SYSTEM_ALARM_CALLBACK_ACE, *PSYSTEM_ALARM_CALLBACK_ACE;
2072
2073 typedef struct _ACCESS_ALLOWED_CALLBACK_OBJECT_ACE {
2074 ACE_HEADER Header;
2075 ACCESS_MASK Mask;
2076 DWORD Flags;
2077 GUID ObjectType;
2078 GUID InheritedObjectType;
2079 DWORD SidStart;
2080 } ACCESS_ALLOWED_CALLBACK_OBJECT_ACE, *PACCESS_ALLOWED_CALLBACK_OBJECT_ACE;
2081
2082 typedef struct _ACCESS_DENIED_CALLBACK_OBJECT_ACE {
2083 ACE_HEADER Header;
2084 ACCESS_MASK Mask;
2085 DWORD Flags;
2086 GUID ObjectType;
2087 GUID InheritedObjectType;
2088 DWORD SidStart;
2089 } ACCESS_DENIED_CALLBACK_OBJECT_ACE, *PACCESS_DENIED_CALLBACK_OBJECT_ACE;
2090
2091 typedef struct _SYSTEM_AUDIT_CALLBACK_OBJECT_ACE {
2092 ACE_HEADER Header;
2093 ACCESS_MASK Mask;
2094 DWORD Flags;
2095 GUID ObjectType;
2096 GUID InheritedObjectType;
2097 DWORD SidStart;
2098 } SYSTEM_AUDIT_CALLBACK_OBJECT_ACE, *PSYSTEM_AUDIT_CALLBACK_OBJECT_ACE;
2099
2100 typedef struct _SYSTEM_ALARM_CALLBACK_OBJECT_ACE {
2101 ACE_HEADER Header;
2102 ACCESS_MASK Mask;
2103 DWORD Flags;
2104 GUID ObjectType;
2105 GUID InheritedObjectType;
2106 DWORD SidStart;
2107 } SYSTEM_ALARM_CALLBACK_OBJECT_ACE, *PSYSTEM_ALARM_CALLBACK_OBJECT_ACE;
2108
2109 typedef struct _ACL {
2110 BYTE AclRevision;
2111 BYTE Sbz1;
2112 WORD AclSize;
2113 WORD AceCount;
2114 WORD Sbz2;
2115 } ACL,*PACL;
2116
2117 typedef enum _ACL_INFORMATION_CLASS {
2118 AclRevisionInformation = 1,
2119 AclSizeInformation
2120 } ACL_INFORMATION_CLASS;
2121
2122 typedef struct _ACL_REVISION_INFORMATION {
2123 DWORD AclRevision;
2124 } ACL_REVISION_INFORMATION, *PACL_REVISION_INFORMATION;
2125
2126 typedef struct _ACL_SIZE_INFORMATION {
2127 DWORD AceCount;
2128 DWORD AclBytesInUse;
2129 DWORD AclBytesFree;
2130 } ACL_SIZE_INFORMATION, *PACL_SIZE_INFORMATION;
2131
2132 #ifndef _LDT_ENTRY_DEFINED
2133 #define _LDT_ENTRY_DEFINED
2134
2135 typedef struct _LDT_ENTRY {
2136 WORD LimitLow;
2137 WORD BaseLow;
2138 union {
2139 struct {
2140 BYTE BaseMid;
2141 BYTE Flags1;
2142 BYTE Flags2;
2143 BYTE BaseHi;
2144 } Bytes;
2145 struct {
2146 DWORD BaseMid:8;
2147 DWORD Type:5;
2148 DWORD Dpl:2;
2149 DWORD Pres:1;
2150 DWORD LimitHi:4;
2151 DWORD Sys:1;
2152 DWORD Reserved_0:1;
2153 DWORD Default_Big:1;
2154 DWORD Granularity:1;
2155 DWORD BaseHi:8;
2156 } Bits;
2157 } HighWord;
2158 } LDT_ENTRY, *PLDT_ENTRY, *LPLDT_ENTRY;
2159
2160 #endif /* _LDT_ENTRY_DEFINED */
2161
2162 /* FIXME: add more machines */
2163 #if defined(_X86_) && !defined(__PowerPC__)
2164 #define SIZE_OF_80387_REGISTERS 80
2165 #define CONTEXT_i386 0x10000
2166 #define CONTEXT_i486 0x10000
2167 #define CONTEXT_CONTROL (CONTEXT_i386|0x00000001L)
2168 #define CONTEXT_INTEGER (CONTEXT_i386|0x00000002L)
2169 #define CONTEXT_SEGMENTS (CONTEXT_i386|0x00000004L)
2170 #define CONTEXT_FLOATING_POINT (CONTEXT_i386|0x00000008L)
2171 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386|0x00000010L)
2172 #define CONTEXT_EXTENDED_REGISTERS (CONTEXT_i386|0x00000020L)
2173 #define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_INTEGER|CONTEXT_SEGMENTS)
2174 #define MAXIMUM_SUPPORTED_EXTENSION 512
2175
2176 #define EXCEPTION_READ_FAULT 0
2177 #define EXCEPTION_WRITE_FAULT 1
2178 #define EXCEPTION_EXECUTE_FAULT 8
2179
2180 typedef struct _FLOATING_SAVE_AREA {
2181 DWORD ControlWord;
2182 DWORD StatusWord;
2183 DWORD TagWord;
2184 DWORD ErrorOffset;
2185 DWORD ErrorSelector;
2186 DWORD DataOffset;
2187 DWORD DataSelector;
2188 BYTE RegisterArea[80];
2189 DWORD Cr0NpxState;
2190 } FLOATING_SAVE_AREA, *PFLOATING_SAVE_AREA;
2191
2192 typedef struct _CONTEXT {
2193 DWORD ContextFlags;
2194 DWORD Dr0;
2195 DWORD Dr1;
2196 DWORD Dr2;
2197 DWORD Dr3;
2198 DWORD Dr6;
2199 DWORD Dr7;
2200 FLOATING_SAVE_AREA FloatSave;
2201 DWORD SegGs;
2202 DWORD SegFs;
2203 DWORD SegEs;
2204 DWORD SegDs;
2205 DWORD Edi;
2206 DWORD Esi;
2207 DWORD Ebx;
2208 DWORD Edx;
2209 DWORD Ecx;
2210 DWORD Eax;
2211 DWORD Ebp;
2212 DWORD Eip;
2213 DWORD SegCs;
2214 DWORD EFlags;
2215 DWORD Esp;
2216 DWORD SegSs;
2217 BYTE ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION];
2218 } CONTEXT;
2219 #elif defined(__x86_64__)
2220
2221 #define CONTEXT_AMD64 0x100000
2222
2223 #if !defined(RC_INVOKED)
2224 #define CONTEXT_CONTROL (CONTEXT_AMD64 | 0x1L)
2225 #define CONTEXT_INTEGER (CONTEXT_AMD64 | 0x2L)
2226 #define CONTEXT_SEGMENTS (CONTEXT_AMD64 | 0x4L)
2227 #define CONTEXT_FLOATING_POINT (CONTEXT_AMD64 | 0x8L)
2228 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_AMD64 | 0x10L)
2229
2230 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT)
2231 #define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS | CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS)
2232
2233 #define CONTEXT_EXCEPTION_ACTIVE 0x8000000
2234 #define CONTEXT_SERVICE_ACTIVE 0x10000000
2235 #define CONTEXT_EXCEPTION_REQUEST 0x40000000
2236 #define CONTEXT_EXCEPTION_REPORTING 0x80000000
2237 #endif
2238
2239 #define INITIAL_MXCSR 0x1f80
2240 #define INITIAL_FPCSR 0x027f
2241 #define EXCEPTION_READ_FAULT 0
2242 #define EXCEPTION_WRITE_FAULT 1
2243 #define EXCEPTION_EXECUTE_FAULT 8
2244
2245 typedef struct DECLSPEC_ALIGN(16) _M128A {
2246 ULONGLONG Low;
2247 LONGLONG High;
2248 } M128A, *PM128A;
2249
2250 typedef struct _XMM_SAVE_AREA32 {
2251 WORD ControlWord;
2252 WORD StatusWord;
2253 BYTE TagWord;
2254 BYTE Reserved1;
2255 WORD ErrorOpcode;
2256 DWORD ErrorOffset;
2257 WORD ErrorSelector;
2258 WORD Reserved2;
2259 DWORD DataOffset;
2260 WORD DataSelector;
2261 WORD Reserved3;
2262 DWORD MxCsr;
2263 DWORD MxCsr_Mask;
2264 M128A FloatRegisters[8];
2265 M128A XmmRegisters[16];
2266 BYTE Reserved4[96];
2267 } XMM_SAVE_AREA32, *PXMM_SAVE_AREA32;
2268
2269 typedef struct DECLSPEC_ALIGN(16) _CONTEXT {
2270 DWORD64 P1Home;
2271 DWORD64 P2Home;
2272 DWORD64 P3Home;
2273 DWORD64 P4Home;
2274 DWORD64 P5Home;
2275 DWORD64 P6Home;
2276
2277 /* Control flags */
2278 DWORD ContextFlags;
2279 DWORD MxCsr;
2280
2281 /* Segment */
2282 WORD SegCs;
2283 WORD SegDs;
2284 WORD SegEs;
2285 WORD SegFs;
2286 WORD SegGs;
2287 WORD SegSs;
2288 DWORD EFlags;
2289
2290 /* Debug */
2291 DWORD64 Dr0;
2292 DWORD64 Dr1;
2293 DWORD64 Dr2;
2294 DWORD64 Dr3;
2295 DWORD64 Dr6;
2296 DWORD64 Dr7;
2297
2298 /* Integer */
2299 DWORD64 Rax;
2300 DWORD64 Rcx;
2301 DWORD64 Rdx;
2302 DWORD64 Rbx;
2303 DWORD64 Rsp;
2304 DWORD64 Rbp;
2305 DWORD64 Rsi;
2306 DWORD64 Rdi;
2307 DWORD64 R8;
2308 DWORD64 R9;
2309 DWORD64 R10;
2310 DWORD64 R11;
2311 DWORD64 R12;
2312 DWORD64 R13;
2313 DWORD64 R14;
2314 DWORD64 R15;
2315
2316 /* Counter */
2317 DWORD64 Rip;
2318
2319 /* Floating point */
2320 union {
2321 XMM_SAVE_AREA32 FltSave;
2322 struct {
2323 M128A Header[2];
2324 M128A Legacy[8];
2325 M128A Xmm0;
2326 M128A Xmm1;
2327 M128A Xmm2;
2328 M128A Xmm3;
2329 M128A Xmm4;
2330 M128A Xmm5;
2331 M128A Xmm6;
2332 M128A Xmm7;
2333 M128A Xmm8;
2334 M128A Xmm9;
2335 M128A Xmm10;
2336 M128A Xmm11;
2337 M128A Xmm12;
2338 M128A Xmm13;
2339 M128A Xmm14;
2340 M128A Xmm15;
2341 } DUMMYSTRUCTNAME;
2342 } DUMMYUNIONNAME;
2343
2344 /* Vector */
2345 M128A VectorRegister[26];
2346 DWORD64 VectorControl;
2347
2348 /* Debug control */
2349 DWORD64 DebugControl;
2350 DWORD64 LastBranchToRip;
2351 DWORD64 LastBranchFromRip;
2352 DWORD64 LastExceptionToRip;
2353 DWORD64 LastExceptionFromRip;
2354 } CONTEXT;
2355
2356
2357 typedef struct _KNONVOLATILE_CONTEXT_POINTERS {
2358 union {
2359 PM128A FloatingContext[16];
2360 struct {
2361 PM128A Xmm0;
2362 PM128A Xmm1;
2363 PM128A Xmm2;
2364 PM128A Xmm3;
2365 PM128A Xmm4;
2366 PM128A Xmm5;
2367 PM128A Xmm6;
2368 PM128A Xmm7;
2369 PM128A Xmm8;
2370 PM128A Xmm9;
2371 PM128A Xmm10;
2372 PM128A Xmm11;
2373 PM128A Xmm12;
2374 PM128A Xmm13;
2375 PM128A Xmm14;
2376 PM128A Xmm15;
2377 } DUMMYSTRUCTNAME;
2378 } DUMMYUNIONNAME;
2379
2380 union {
2381 PULONG64 IntegerContext[16];
2382 struct {
2383 PULONG64 Rax;
2384 PULONG64 Rcx;
2385 PULONG64 Rdx;
2386 PULONG64 Rbx;
2387 PULONG64 Rsp;
2388 PULONG64 Rbp;
2389 PULONG64 Rsi;
2390 PULONG64 Rdi;
2391 PULONG64 R8;
2392 PULONG64 R9;
2393 PULONG64 R10;
2394 PULONG64 R11;
2395 PULONG64 R12;
2396 PULONG64 R13;
2397 PULONG64 R14;
2398 PULONG64 R15;
2399 } DUMMYSTRUCTNAME;
2400 } DUMMYUNIONNAME2;
2401 } KNONVOLATILE_CONTEXT_POINTERS, *PKNONVOLATILE_CONTEXT_POINTERS;
2402
2403 #define RUNTIME_FUNCTION_INDIRECT 0x1
2404
2405 typedef struct _RUNTIME_FUNCTION {
2406 DWORD BeginAddress;
2407 DWORD EndAddress;
2408 DWORD UnwindData;
2409 } RUNTIME_FUNCTION,*PRUNTIME_FUNCTION;
2410
2411 #define UNWIND_HISTORY_TABLE_SIZE 12
2412
2413 typedef struct _UNWIND_HISTORY_TABLE_ENTRY
2414 {
2415 ULONG64 ImageBase;
2416 PRUNTIME_FUNCTION FunctionEntry;
2417 } UNWIND_HISTORY_TABLE_ENTRY, *PUNWIND_HISTORY_TABLE_ENTRY;
2418
2419 typedef struct _UNWIND_HISTORY_TABLE
2420 {
2421 ULONG Count;
2422 UCHAR Search;
2423 ULONG64 LowAddress;
2424 ULONG64 HighAddress;
2425 UNWIND_HISTORY_TABLE_ENTRY Entry[UNWIND_HISTORY_TABLE_SIZE];
2426 } UNWIND_HISTORY_TABLE, *PUNWIND_HISTORY_TABLE;
2427
2428 typedef PRUNTIME_FUNCTION (*PGET_RUNTIME_FUNCTION_CALLBACK)(DWORD64 ControlPc,PVOID Context);
2429 typedef DWORD (*POUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK)(HANDLE Process,PVOID TableAddress,PDWORD Entries,PRUNTIME_FUNCTION *Functions);
2430
2431 #define OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK_EXPORT_NAME "OutOfProcessFunctionTableCallback"
2432
2433 NTSYSAPI
2434 VOID
2435 __cdecl
2436 RtlRestoreContext(struct _CONTEXT *ContextRecord,
2437 struct _EXCEPTION_RECORD *ExceptionRecord);
2438
2439 NTSYSAPI
2440 BOOLEAN
2441 __cdecl
2442 RtlAddFunctionTable(PRUNTIME_FUNCTION FunctionTable,
2443 DWORD EntryCount,
2444 DWORD64 BaseAddress);
2445
2446 NTSYSAPI
2447 BOOLEAN
2448 __cdecl
2449 RtlInstallFunctionTableCallback(DWORD64 TableIdentifier,
2450 DWORD64 BaseAddress,
2451 DWORD Length,
2452 PGET_RUNTIME_FUNCTION_CALLBACK Callback,
2453 PVOID Context,
2454 PCWSTR OutOfProcessCallbackDll);
2455
2456 NTSYSAPI
2457 BOOLEAN
2458 __cdecl
2459 RtlDeleteFunctionTable(PRUNTIME_FUNCTION FunctionTable);
2460
2461 #elif defined(_PPC_)
2462 #define CONTEXT_CONTROL 1L
2463 #define CONTEXT_FLOATING_POINT 2L
2464 #define CONTEXT_INTEGER 4L
2465 #define CONTEXT_DEBUG_REGISTERS 8L
2466 #define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_FLOATING_POINT|CONTEXT_INTEGER)
2467 typedef struct _FLOATING_SAVE_AREA
2468 {
2469 double Fpr0;
2470 double Fpr1;
2471 double Fpr2;
2472 double Fpr3;
2473 double Fpr4;
2474 double Fpr5;
2475 double Fpr6;
2476 double Fpr7;
2477 double Fpr8;
2478 double Fpr9;
2479 double Fpr10;
2480 double Fpr11;
2481 double Fpr12;
2482 double Fpr13;
2483 double Fpr14;
2484 double Fpr15;
2485 double Fpr16;
2486 double Fpr17;
2487 double Fpr18;
2488 double Fpr19;
2489 double Fpr20;
2490 double Fpr21;
2491 double Fpr22;
2492 double Fpr23;
2493 double Fpr24;
2494 double Fpr25;
2495 double Fpr26;
2496 double Fpr27;
2497 double Fpr28;
2498 double Fpr29;
2499 double Fpr30;
2500 double Fpr31;
2501 double Fpscr;
2502 } FLOATING_SAVE_AREA;
2503
2504 typedef struct _CONTEXT {
2505 FLOATING_SAVE_AREA FloatSave;
2506 DWORD Gpr0;
2507 DWORD Gpr1;
2508 DWORD Gpr2;
2509 DWORD Gpr3;
2510 DWORD Gpr4;
2511 DWORD Gpr5;
2512 DWORD Gpr6;
2513 DWORD Gpr7;
2514 DWORD Gpr8;
2515 DWORD Gpr9;
2516 DWORD Gpr10;
2517 DWORD Gpr11;
2518 DWORD Gpr12;
2519 DWORD Gpr13;
2520 DWORD Gpr14;
2521 DWORD Gpr15;
2522 DWORD Gpr16;
2523 DWORD Gpr17;
2524 DWORD Gpr18;
2525 DWORD Gpr19;
2526 DWORD Gpr20;
2527 DWORD Gpr21;
2528 DWORD Gpr22;
2529 DWORD Gpr23;
2530 DWORD Gpr24;
2531 DWORD Gpr25;
2532 DWORD Gpr26;
2533 DWORD Gpr27;
2534 DWORD Gpr28;
2535 DWORD Gpr29;
2536 DWORD Gpr30;
2537 DWORD Gpr31;
2538 DWORD Cr;
2539 DWORD Xer;
2540 DWORD Msr;
2541 DWORD Iar;
2542 DWORD Lr;
2543 DWORD Ctr;
2544 DWORD ContextFlags;
2545 DWORD Fill[3];
2546 DWORD Dr0;
2547 DWORD Dr1;
2548 DWORD Dr2;
2549 DWORD Dr3;
2550 DWORD Dr4;
2551 DWORD Dr5;
2552 DWORD Dr6;
2553 DWORD Dr7;
2554 } CONTEXT;
2555 #elif defined(_ALPHA_)
2556 #define CONTEXT_ALPHA 0x20000
2557 #define CONTEXT_CONTROL (CONTEXT_ALPHA|1L)
2558 #define CONTEXT_FLOATING_POINT (CONTEXT_ALPHA|2L)
2559 #define CONTEXT_INTEGER (CONTEXT_ALPHA|4L)
2560 #define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_FLOATING_POINT|CONTEXT_INTEGER)
2561 typedef struct _CONTEXT {
2562 ULONGLONG FltF0;
2563 ULONGLONG FltF1;
2564 ULONGLONG FltF2;
2565 ULONGLONG FltF3;
2566 ULONGLONG FltF4;
2567 ULONGLONG FltF5;
2568 ULONGLONG FltF6;
2569 ULONGLONG FltF7;
2570 ULONGLONG FltF8;
2571 ULONGLONG FltF9;
2572 ULONGLONG FltF10;
2573 ULONGLONG FltF11;
2574 ULONGLONG FltF12;
2575 ULONGLONG FltF13;
2576 ULONGLONG FltF14;
2577 ULONGLONG FltF15;
2578 ULONGLONG FltF16;
2579 ULONGLONG FltF17;
2580 ULONGLONG FltF18;
2581 ULONGLONG FltF19;
2582 ULONGLONG FltF20;
2583 ULONGLONG FltF21;
2584 ULONGLONG FltF22;
2585 ULONGLONG FltF23;
2586 ULONGLONG FltF24;
2587 ULONGLONG FltF25;
2588 ULONGLONG FltF26;
2589 ULONGLONG FltF27;
2590 ULONGLONG FltF28;
2591 ULONGLONG FltF29;
2592 ULONGLONG FltF30;
2593 ULONGLONG FltF31;
2594 ULONGLONG IntV0;
2595 ULONGLONG IntT0;
2596 ULONGLONG IntT1;
2597 ULONGLONG IntT2;
2598 ULONGLONG IntT3;
2599 ULONGLONG IntT4;
2600 ULONGLONG IntT5;
2601 ULONGLONG IntT6;
2602 ULONGLONG IntT7;
2603 ULONGLONG IntS0;
2604 ULONGLONG IntS1;
2605 ULONGLONG IntS2;
2606 ULONGLONG IntS3;
2607 ULONGLONG IntS4;
2608 ULONGLONG IntS5;
2609 ULONGLONG IntFp;
2610 ULONGLONG IntA0;
2611 ULONGLONG IntA1;
2612 ULONGLONG IntA2;
2613 ULONGLONG IntA3;
2614 ULONGLONG IntA4;
2615 ULONGLONG IntA5;
2616 ULONGLONG IntT8;
2617 ULONGLONG IntT9;
2618 ULONGLONG IntT10;
2619 ULONGLONG IntT11;
2620 ULONGLONG IntRa;
2621 ULONGLONG IntT12;
2622 ULONGLONG IntAt;
2623 ULONGLONG IntGp;
2624 ULONGLONG IntSp;
2625 ULONGLONG IntZero;
2626 ULONGLONG Fpcr;
2627 ULONGLONG SoftFpcr;
2628 ULONGLONG Fir;
2629 DWORD Psr;
2630 DWORD ContextFlags;
2631 DWORD Fill[4];
2632 } CONTEXT;
2633 #elif defined(SHx)
2634
2635 /* These are the debug or break registers on the SH3 */
2636 typedef struct _DEBUG_REGISTERS {
2637 ULONG BarA;
2638 UCHAR BasrA;
2639 UCHAR BamrA;
2640 USHORT BbrA;
2641 ULONG BarB;
2642 UCHAR BasrB;
2643 UCHAR BamrB;
2644 USHORT BbrB;
2645 ULONG BdrB;
2646 ULONG BdmrB;
2647 USHORT Brcr;
2648 USHORT Align;
2649 } DEBUG_REGISTERS, *PDEBUG_REGISTERS;
2650
2651 /* The following flags control the contents of the CONTEXT structure. */
2652
2653 #define CONTEXT_SH3 0x00000040
2654 #define CONTEXT_SH4 0x000000c0 /* CONTEXT_SH3 | 0x80 - must contain the SH3 bits */
2655
2656 #ifdef SH3
2657 #define CONTEXT_CONTROL (CONTEXT_SH3 | 0x00000001L)
2658 #define CONTEXT_INTEGER (CONTEXT_SH3 | 0x00000002L)
2659 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_SH3 | 0x00000008L)
2660 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_DEBUG_REGISTERS)
2661 #else /* SH4 */
2662 #define CONTEXT_CONTROL (CONTEXT_SH4 | 0x00000001L)
2663 #define CONTEXT_INTEGER (CONTEXT_SH4 | 0x00000002L)
2664 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_SH4 | 0x00000008L)
2665 #define CONTEXT_FLOATING_POINT (CONTEXT_SH4 | 0x00000004L)
2666 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_DEBUG_REGISTERS | CONTEXT_FLOATING_POINT)
2667 #endif
2668
2669 /* Context Frame */
2670
2671 /* This frame is used to store a limited processor context into the */
2672 /* Thread structure for CPUs which have no floating point support. */
2673
2674 typedef struct _CONTEXT {
2675 /* The flags values within this flag control the contents of */
2676 /* a CONTEXT record. */
2677
2678 /* If the context record is used as an input parameter, then */
2679 /* for each portion of the context record controlled by a flag */
2680 /* whose value is set, it is assumed that that portion of the */
2681 /* context record contains valid context. If the context record */
2682 /* is being used to modify a thread's context, then only that */
2683 /* portion of the threads context will be modified. */
2684
2685 /* If the context record is used as an IN OUT parameter to capture */
2686 /* the context of a thread, then only those portions of the thread's */
2687 /* context corresponding to set flags will be returned. */
2688
2689 /* The context record is never used as an OUT only parameter. */
2690
2691
2692 ULONG ContextFlags;
2693
2694 /* This section is specified/returned if the ContextFlags word contains */
2695 /* the flag CONTEXT_INTEGER. */
2696
2697 /* N.B. The registers RA and R15 are defined in this section, but are */
2698 /* considered part of the control context rather than part of the integer */
2699 /* context. */
2700
2701 ULONG PR;
2702 ULONG MACH;
2703 ULONG MACL;
2704 ULONG GBR;
2705 ULONG R0;
2706 ULONG R1;
2707 ULONG R2;
2708 ULONG R3;
2709 ULONG R4;
2710 ULONG R5;
2711 ULONG R6;
2712 ULONG R7;
2713 ULONG R8;
2714 ULONG R9;
2715 ULONG R10;
2716 ULONG R11;
2717 ULONG R12;
2718 ULONG R13;
2719 ULONG R14;
2720 ULONG R15;
2721
2722 /* This section is specified/returned if the ContextFlags word contains */
2723 /* the flag CONTEXT_CONTROL. */
2724
2725 /* N.B. The registers r15 and ra are defined in the integer section, */
2726 /* but are considered part of the control context rather than part of */
2727 /* the integer context. */
2728
2729 ULONG Fir;
2730 ULONG Psr;
2731
2732 #if !defined(SH3e) && !defined(SH4)
2733 ULONG OldStuff[2];
2734 DEBUG_REGISTERS DebugRegisters;
2735 #else
2736 ULONG Fpscr;
2737 ULONG Fpul;
2738 ULONG FRegs[16];
2739 #if defined(SH4)
2740 ULONG xFRegs[16];
2741 #endif
2742 #endif
2743 } CONTEXT;
2744
2745 #elif defined(_MIPS_)
2746
2747 /* The following flags control the contents of the CONTEXT structure. */
2748
2749 #define CONTEXT_R4000 0x00010000 /* r4000 context */
2750
2751 #define CONTEXT_CONTROL (CONTEXT_R4000 | 0x00000001L)
2752 #define CONTEXT_FLOATING_POINT (CONTEXT_R4000 | 0x00000002L)
2753 #define CONTEXT_INTEGER (CONTEXT_R4000 | 0x00000004L)
2754
2755 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER)
2756
2757 /* Context Frame */
2758
2759 /* N.B. This frame must be exactly a multiple of 16 bytes in length. */
2760
2761 /* This frame has a several purposes: 1) it is used as an argument to */
2762 /* NtContinue, 2) it is used to constuct a call frame for APC delivery, */
2763 /* 3) it is used to construct a call frame for exception dispatching */
2764 /* in user mode, and 4) it is used in the user level thread creation */
2765 /* routines. */
2766
2767 /* The layout of the record conforms to a standard call frame. */
2768
2769
2770 typedef struct _CONTEXT {
2771
2772 /* This section is always present and is used as an argument build */
2773 /* area. */
2774
2775 DWORD Argument[4];
2776
2777 /* This section is specified/returned if the ContextFlags word contains */
2778 /* the flag CONTEXT_FLOATING_POINT. */
2779
2780 DWORD FltF0;
2781 DWORD FltF1;
2782 DWORD FltF2;
2783 DWORD FltF3;
2784 DWORD FltF4;
2785 DWORD FltF5;
2786 DWORD FltF6;
2787 DWORD FltF7;
2788 DWORD FltF8;
2789 DWORD FltF9;
2790 DWORD FltF10;
2791 DWORD FltF11;
2792 DWORD FltF12;
2793 DWORD FltF13;
2794 DWORD FltF14;
2795 DWORD FltF15;
2796 DWORD FltF16;
2797 DWORD FltF17;
2798 DWORD FltF18;
2799 DWORD FltF19;
2800 DWORD FltF20;
2801 DWORD FltF21;
2802 DWORD FltF22;
2803 DWORD FltF23;
2804 DWORD FltF24;
2805 DWORD FltF25;
2806 DWORD FltF26;
2807 DWORD FltF27;
2808 DWORD FltF28;
2809 DWORD FltF29;
2810 DWORD FltF30;
2811 DWORD FltF31;
2812
2813 /* This section is specified/returned if the ContextFlags word contains */
2814 /* the flag CONTEXT_INTEGER. */
2815
2816 /* N.B. The registers gp, sp, and ra are defined in this section, but are */
2817 /* considered part of the control context rather than part of the integer */
2818 /* context. */
2819
2820 /* N.B. Register zero is not stored in the frame. */
2821
2822 DWORD IntZero;
2823 DWORD IntAt;
2824 DWORD IntV0;
2825 DWORD IntV1;
2826 DWORD IntA0;
2827 DWORD IntA1;
2828 DWORD IntA2;
2829 DWORD IntA3;
2830 DWORD IntT0;
2831 DWORD IntT1;
2832 DWORD IntT2;
2833 DWORD IntT3;
2834 DWORD IntT4;
2835 DWORD IntT5;
2836 DWORD IntT6;
2837 DWORD IntT7;
2838 DWORD IntS0;
2839 DWORD IntS1;
2840 DWORD IntS2;
2841 DWORD IntS3;
2842 DWORD IntS4;
2843 DWORD IntS5;
2844 DWORD IntS6;
2845 DWORD IntS7;
2846 DWORD IntT8;
2847 DWORD IntT9;
2848 DWORD IntK0;
2849 DWORD IntK1;
2850 DWORD IntGp;
2851 DWORD IntSp;
2852 DWORD IntS8;
2853 DWORD IntRa;
2854 DWORD IntLo;
2855 DWORD IntHi;
2856
2857 /* This section is specified/returned if the ContextFlags word contains */
2858 /* the flag CONTEXT_FLOATING_POINT. */
2859
2860 DWORD Fsr;
2861
2862 /* This section is specified/returned if the ContextFlags word contains */
2863 /* the flag CONTEXT_CONTROL. */
2864
2865 /* N.B. The registers gp, sp, and ra are defined in the integer section, */
2866 /* but are considered part of the control context rather than part of */
2867 /* the integer context. */
2868
2869 DWORD Fir;
2870 DWORD Psr;
2871
2872 /* The flags values within this flag control the contents of */
2873 /* a CONTEXT record. */
2874
2875 /* If the context record is used as an input parameter, then */
2876 /* for each portion of the context record controlled by a flag */
2877 /* whose value is set, it is assumed that that portion of the */
2878 /* context record contains valid context. If the context record */
2879 /* is being used to modify a thread's context, then only that */
2880 /* portion of the threads context will be modified. */
2881
2882 /* If the context record is used as an IN OUT parameter to capture */
2883 /* the context of a thread, then only those portions of the thread's */
2884 /* context corresponding to set flags will be returned. */
2885
2886 /* The context record is never used as an OUT only parameter. */
2887
2888 DWORD ContextFlags;
2889
2890 DWORD Fill[2];
2891
2892 } CONTEXT;
2893 #elif defined(ARM)
2894
2895 #ifndef PAGE_SIZE
2896 #define PAGE_SIZE 0x1000 // FIXME: This should probably go elsewhere
2897 #endif
2898
2899 /* The following flags control the contents of the CONTEXT structure. */
2900
2901 #define CONTEXT_ARM 0x0000040
2902 #define CONTEXT_CONTROL (CONTEXT_ARM | 0x00000001L)
2903 #define CONTEXT_INTEGER (CONTEXT_ARM | 0x00000002L)
2904
2905 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER)
2906
2907 typedef struct _CONTEXT {
2908 /* The flags values within this flag control the contents of
2909 a CONTEXT record.
2910
2911 If the context record is used as an input parameter, then
2912 for each portion of the context record controlled by a flag
2913 whose value is set, it is assumed that that portion of the
2914 context record contains valid context. If the context record
2915 is being used to modify a thread's context, then only that
2916 portion of the threads context will be modified.
2917
2918 If the context record is used as an IN OUT parameter to capture
2919 the context of a thread, then only those portions of the thread's
2920 context corresponding to set flags will be returned.
2921
2922 The context record is never used as an OUT only parameter. */
2923
2924 ULONG ContextFlags;
2925
2926 /* This section is specified/returned if the ContextFlags word contains
2927 the flag CONTEXT_INTEGER. */
2928 ULONG R0;
2929 ULONG R1;
2930 ULONG R2;
2931 ULONG R3;
2932 ULONG R4;
2933 ULONG R5;
2934 ULONG R6;
2935 ULONG R7;
2936 ULONG R8;
2937 ULONG R9;
2938 ULONG R10;
2939 ULONG R11;
2940 ULONG R12;
2941
2942 ULONG Sp;
2943 ULONG Lr;
2944 ULONG Pc;
2945 ULONG Psr;
2946 } CONTEXT;
2947
2948 #else
2949 #error "undefined processor type"
2950 #endif
2951 typedef CONTEXT *PCONTEXT,*LPCONTEXT;
2952
2953 #define EXCEPTION_NONCONTINUABLE 1
2954 #define EXCEPTION_MAXIMUM_PARAMETERS 15
2955
2956 typedef struct _EXCEPTION_RECORD {
2957 DWORD ExceptionCode;
2958 DWORD ExceptionFlags;
2959 struct _EXCEPTION_RECORD *ExceptionRecord;
2960 PVOID ExceptionAddress;
2961 DWORD NumberParameters;
2962 ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
2963 } EXCEPTION_RECORD, *PEXCEPTION_RECORD;
2964
2965 typedef struct _EXCEPTION_RECORD32 {
2966 DWORD ExceptionCode;
2967 DWORD ExceptionFlags;
2968 DWORD ExceptionRecord;
2969 DWORD ExceptionAddress;
2970 DWORD NumberParameters;
2971 DWORD ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
2972 } EXCEPTION_RECORD32,*PEXCEPTION_RECORD32;
2973
2974 typedef struct _EXCEPTION_RECORD64 {
2975 DWORD ExceptionCode;
2976 DWORD ExceptionFlags;
2977 DWORD64 ExceptionRecord;
2978 DWORD64 ExceptionAddress;
2979 DWORD NumberParameters;
2980 DWORD __unusedAlignment;
2981 DWORD64 ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
2982 } EXCEPTION_RECORD64,*PEXCEPTION_RECORD64;
2983
2984 typedef struct _EXCEPTION_POINTERS {
2985 PEXCEPTION_RECORD ExceptionRecord;
2986 PCONTEXT ContextRecord;
2987 } EXCEPTION_POINTERS,*PEXCEPTION_POINTERS, *LPEXCEPTION_POINTERS;
2988
2989 #ifdef _M_PPC
2990 #define LARGE_INTEGER_ORDER(x) x HighPart; DWORD LowPart;
2991 #else
2992 #define LARGE_INTEGER_ORDER(x) DWORD LowPart; x HighPart;
2993 #endif
2994
2995 typedef union _LARGE_INTEGER {
2996 #if ! defined(NONAMELESSUNION) || defined(__cplusplus)
2997 _ANONYMOUS_STRUCT struct {
2998 LARGE_INTEGER_ORDER(LONG)
2999 };
3000 #endif /* NONAMELESSUNION */
3001 struct {
3002 LARGE_INTEGER_ORDER(LONG)
3003 } u;
3004 LONGLONG QuadPart;
3005 } LARGE_INTEGER, *PLARGE_INTEGER;
3006 typedef union _ULARGE_INTEGER {
3007 #if ! defined(NONAMELESSUNION) || defined(__cplusplus)
3008 _ANONYMOUS_STRUCT struct {
3009 LARGE_INTEGER_ORDER(DWORD)
3010 };
3011 #endif /* NONAMELESSUNION */
3012 struct {
3013 LARGE_INTEGER_ORDER(DWORD)
3014 } u;
3015 ULONGLONG QuadPart;
3016 } ULARGE_INTEGER, *PULARGE_INTEGER;
3017 typedef struct _LUID {
3018 LARGE_INTEGER_ORDER(LONG)
3019 } LUID, *PLUID;
3020
3021 #include <pshpack4.h>
3022
3023 typedef struct _LUID_AND_ATTRIBUTES {
3024 LUID Luid;
3025 DWORD Attributes;
3026 } LUID_AND_ATTRIBUTES, *PLUID_AND_ATTRIBUTES;
3027 typedef LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES_ARRAY[ANYSIZE_ARRAY];
3028 typedef LUID_AND_ATTRIBUTES_ARRAY *PLUID_AND_ATTRIBUTES_ARRAY;
3029
3030 #include <poppack.h>
3031
3032 typedef struct _PRIVILEGE_SET {
3033 DWORD PrivilegeCount;
3034 DWORD Control;
3035 LUID_AND_ATTRIBUTES Privilege[ANYSIZE_ARRAY];
3036 } PRIVILEGE_SET,*PPRIVILEGE_SET;
3037
3038 typedef struct _SECURITY_ATTRIBUTES {
3039 DWORD nLength;
3040 LPVOID lpSecurityDescriptor;
3041 BOOL bInheritHandle;
3042 } SECURITY_ATTRIBUTES,*PSECURITY_ATTRIBUTES,*LPSECURITY_ATTRIBUTES;
3043
3044 typedef enum _SECURITY_IMPERSONATION_LEVEL {
3045 SecurityAnonymous,
3046 SecurityIdentification,
3047 SecurityImpersonation,
3048 SecurityDelegation
3049 } SECURITY_IMPERSONATION_LEVEL,*PSECURITY_IMPERSONATION_LEVEL;
3050
3051 typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE,*PSECURITY_CONTEXT_TRACKING_MODE;
3052
3053 typedef struct _SECURITY_QUALITY_OF_SERVICE {
3054 DWORD Length;
3055 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
3056 SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode;
3057 BOOLEAN EffectiveOnly;
3058 } SECURITY_QUALITY_OF_SERVICE,*PSECURITY_QUALITY_OF_SERVICE;
3059
3060 typedef PVOID PACCESS_TOKEN;
3061
3062 typedef struct _SE_IMPERSONATION_STATE {
3063 PACCESS_TOKEN Token;
3064 BOOLEAN CopyOnOpen;
3065 BOOLEAN EffectiveOnly;
3066 SECURITY_IMPERSONATION_LEVEL Level;
3067 } SE_IMPERSONATION_STATE,*PSE_IMPERSONATION_STATE;
3068
3069 typedef struct _SID_IDENTIFIER_AUTHORITY {
3070 BYTE Value[6];
3071 } SID_IDENTIFIER_AUTHORITY,*PSID_IDENTIFIER_AUTHORITY,*LPSID_IDENTIFIER_AUTHORITY;
3072
3073 typedef PVOID PSID;
3074
3075 typedef struct _SID {
3076 BYTE Revision;
3077 BYTE SubAuthorityCount;
3078 SID_IDENTIFIER_AUTHORITY IdentifierAuthority;
3079 DWORD SubAuthority[ANYSIZE_ARRAY];
3080 } SID, *PISID;
3081
3082 #define SECURITY_MIN_SID_SIZE (sizeof(SID))
3083 #define SECURITY_MAX_SID_SIZE (FIELD_OFFSET(SID, SubAuthority) + SID_MAX_SUB_AUTHORITIES * sizeof(DWORD))
3084
3085 typedef struct _SID_AND_ATTRIBUTES {
3086 PSID Sid;
3087 DWORD Attributes;
3088 } SID_AND_ATTRIBUTES, *PSID_AND_ATTRIBUTES;
3089 typedef SID_AND_ATTRIBUTES SID_AND_ATTRIBUTES_ARRAY[ANYSIZE_ARRAY];
3090 typedef SID_AND_ATTRIBUTES_ARRAY *PSID_AND_ATTRIBUTES_ARRAY;
3091
3092 typedef struct _TOKEN_SOURCE {
3093 CHAR SourceName[TOKEN_SOURCE_LENGTH];
3094 LUID SourceIdentifier;
3095 } TOKEN_SOURCE,*PTOKEN_SOURCE;
3096
3097 typedef struct _TOKEN_CONTROL {
3098 LUID TokenId;
3099 LUID AuthenticationId;
3100 LUID ModifiedId;
3101 TOKEN_SOURCE TokenSource;
3102 } TOKEN_CONTROL,*PTOKEN_CONTROL;
3103
3104 typedef struct _TOKEN_DEFAULT_DACL {
3105 PACL DefaultDacl;
3106 } TOKEN_DEFAULT_DACL,*PTOKEN_DEFAULT_DACL;
3107
3108 typedef struct _TOKEN_GROUPS {
3109 DWORD GroupCount;
3110 SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY];
3111 } TOKEN_GROUPS,*PTOKEN_GROUPS,*LPTOKEN_GROUPS;
3112
3113 typedef struct _TOKEN_GROUPS_AND_PRIVILEGES {
3114 DWORD SidCount;
3115 DWORD SidLength;
3116 PSID_AND_ATTRIBUTES Sids;
3117 DWORD RestrictedSidCount;
3118 DWORD RestrictedSidLength;
3119 PSID_AND_ATTRIBUTES RestrictedSids;
3120 DWORD PrivilegeCount;
3121 DWORD PrivilegeLength;
3122 PLUID_AND_ATTRIBUTES Privileges;
3123 LUID AuthenticationId;
3124 } TOKEN_GROUPS_AND_PRIVILEGES, *PTOKEN_GROUPS_AND_PRIVILEGES;
3125
3126 typedef struct _TOKEN_ORIGIN {
3127 LUID OriginatingLogonSession;
3128 } TOKEN_ORIGIN, *PTOKEN_ORIGIN;
3129
3130 typedef struct _TOKEN_OWNER {
3131 PSID Owner;
3132 } TOKEN_OWNER,*PTOKEN_OWNER;
3133
3134 typedef struct _TOKEN_PRIMARY_GROUP {
3135 PSID PrimaryGroup;
3136 } TOKEN_PRIMARY_GROUP,*PTOKEN_PRIMARY_GROUP;
3137
3138 typedef struct _TOKEN_PRIVILEGES {
3139 DWORD PrivilegeCount;
3140 LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY];
3141 } TOKEN_PRIVILEGES,*PTOKEN_PRIVILEGES,*LPTOKEN_PRIVILEGES;
3142
3143 typedef enum tagTOKEN_TYPE {
3144 TokenPrimary = 1,
3145 TokenImpersonation
3146 } TOKEN_TYPE,*PTOKEN_TYPE;
3147
3148 #include <pshpack4.h>
3149 typedef struct _TOKEN_STATISTICS {
3150 LUID TokenId;
3151 LUID AuthenticationId;
3152 LARGE_INTEGER ExpirationTime;
3153 TOKEN_TYPE TokenType;
3154 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
3155 DWORD DynamicCharged;
3156 DWORD DynamicAvailable;
3157 DWORD GroupCount;
3158 DWORD PrivilegeCount;
3159 LUID ModifiedId;
3160 } TOKEN_STATISTICS, *PTOKEN_STATISTICS;
3161 #include <poppack.h>
3162
3163 typedef struct _TOKEN_USER {
3164 SID_AND_ATTRIBUTES User;
3165 } TOKEN_USER, *PTOKEN_USER;
3166
3167 typedef DWORD SECURITY_INFORMATION,*PSECURITY_INFORMATION;
3168 typedef WORD SECURITY_DESCRIPTOR_CONTROL,*PSECURITY_DESCRIPTOR_CONTROL;
3169
3170 #ifndef _SECURITY_ATTRIBUTES_
3171 #define _SECURITY_ATTRIBUTES_
3172 typedef struct _SECURITY_DESCRIPTOR {
3173 BYTE Revision;
3174 BYTE Sbz1;
3175 SECURITY_DESCRIPTOR_CONTROL Control;
3176 PSID Owner;
3177 PSID Group;
3178 PACL Sacl;
3179 PACL Dacl;
3180 } SECURITY_DESCRIPTOR, *PISECURITY_DESCRIPTOR;
3181 typedef PVOID PSECURITY_DESCRIPTOR;
3182 #endif
3183
3184 typedef struct _SECURITY_DESCRIPTOR_RELATIVE {
3185 BYTE Revision;
3186 BYTE Sbz1;
3187 SECURITY_DESCRIPTOR_CONTROL Control;
3188 DWORD Owner;
3189 DWORD Group;
3190 DWORD Sacl;
3191 DWORD Dacl;
3192 } SECURITY_DESCRIPTOR_RELATIVE, *PISECURITY_DESCRIPTOR_RELATIVE;
3193
3194 typedef enum _TOKEN_INFORMATION_CLASS {
3195 TokenUser = 1,
3196 TokenGroups,
3197 TokenPrivileges,
3198 TokenOwner,
3199 TokenPrimaryGroup,
3200 TokenDefaultDacl,
3201 TokenSource,
3202 TokenType,
3203 TokenImpersonationLevel,
3204 TokenStatistics,
3205 TokenRestrictedSids,
3206 TokenSessionId,
3207 TokenGroupsAndPrivileges,
3208 TokenSessionReference,
3209 TokenSandBoxInert,
3210 TokenAuditPolicy,
3211 TokenOrigin,
3212 TokenElevationType,
3213 TokenLinkedToken,
3214 TokenElevation,
3215 TokenHasRestrictions,
3216 TokenAccessInformation,
3217 TokenVirtualizationAllowed,
3218 TokenVirtualizationEnabled,
3219 TokenIntegrityLevel,
3220 TokenUIAccess,
3221 TokenMandatoryPolicy,
3222 TokenLogonSid,
3223 MaxTokenInfoClass
3224 } TOKEN_INFORMATION_CLASS;
3225
3226 typedef enum _SID_NAME_USE {
3227 SidTypeUser=1,
3228 SidTypeGroup,
3229 SidTypeDomain,
3230 SidTypeAlias,
3231 SidTypeWellKnownGroup,
3232 SidTypeDeletedAccount,
3233 SidTypeInvalid,
3234 SidTypeUnknown,
3235 SidTypeComputer,
3236 SidTypeLabel
3237 } SID_NAME_USE,*PSID_NAME_USE;
3238
3239 typedef struct _QUOTA_LIMITS {
3240 SIZE_T PagedPoolLimit;
3241 SIZE_T NonPagedPoolLimit;
3242 SIZE_T MinimumWorkingSetSize;
3243 SIZE_T MaximumWorkingSetSize;
3244 SIZE_T PagefileLimit;
3245 LARGE_INTEGER TimeLimit;
3246 } QUOTA_LIMITS,*PQUOTA_LIMITS;
3247
3248 typedef struct _IO_COUNTERS {
3249 ULONGLONG ReadOperationCount;
3250 ULONGLONG WriteOperationCount;
3251 ULONGLONG OtherOperationCount;
3252 ULONGLONG ReadTransferCount;
3253 ULONGLONG WriteTransferCount;
3254 ULONGLONG OtherTransferCount;
3255 } IO_COUNTERS, *PIO_COUNTERS;
3256
3257 typedef struct _FILE_NOTIFY_INFORMATION {
3258 DWORD NextEntryOffset;
3259 DWORD Action;
3260 DWORD FileNameLength;
3261 WCHAR FileName[1];
3262 } FILE_NOTIFY_INFORMATION,*PFILE_NOTIFY_INFORMATION;
3263
3264 typedef struct _TAPE_ERASE {
3265 DWORD Type;
3266 BOOLEAN Immediate;
3267 } TAPE_ERASE, *PTAPE_ERASE;
3268
3269 typedef struct _TAPE_GET_DRIVE_PARAMETERS {
3270 BOOLEAN ECC;
3271 BOOLEAN Compression;
3272 BOOLEAN DataPadding;
3273 BOOLEAN ReportSetmarks;
3274 DWORD DefaultBlockSize;
3275 DWORD MaximumBlockSize;
3276 DWORD MinimumBlockSize;
3277 DWORD MaximumPartitionCount;
3278 DWORD FeaturesLow;
3279 DWORD FeaturesHigh;
3280 DWORD EOTWarningZoneSize;
3281 } TAPE_GET_DRIVE_PARAMETERS, *PTAPE_GET_DRIVE_PARAMETERS;
3282
3283 typedef struct _TAPE_GET_MEDIA_PARAMETERS {
3284 LARGE_INTEGER Capacity;
3285 LARGE_INTEGER Remaining;
3286 DWORD BlockSize;
3287 DWORD PartitionCount;
3288 BOOLEAN WriteProtected;
3289 } TAPE_GET_MEDIA_PARAMETERS, *PTAPE_GET_MEDIA_PARAMETERS;
3290
3291 typedef struct _TAPE_GET_POSITION {
3292 ULONG Type;
3293 ULONG Partition;
3294 LARGE_INTEGER Offset;
3295 } TAPE_GET_POSITION, *PTAPE_GET_POSITION;
3296
3297 typedef struct _TAPE_PREPARE {
3298 DWORD Operation;
3299 BOOLEAN Immediate;
3300 } TAPE_PREPARE, *PTAPE_PREPARE;
3301
3302 typedef struct _TAPE_SET_DRIVE_PARAMETERS {
3303 BOOLEAN ECC;
3304 BOOLEAN Compression;
3305 BOOLEAN DataPadding;
3306 BOOLEAN ReportSetmarks;
3307 DWORD EOTWarningZoneSize;
3308 } TAPE_SET_DRIVE_PARAMETERS, *PTAPE_SET_DRIVE_PARAMETERS;
3309
3310 typedef struct _TAPE_SET_MEDIA_PARAMETERS {
3311 DWORD BlockSize;
3312 } TAPE_SET_MEDIA_PARAMETERS,*PTAPE_SET_MEDIA_PARAMETERS;
3313
3314 typedef struct _TAPE_SET_POSITION {
3315 DWORD Method;
3316 DWORD Partition;
3317 LARGE_INTEGER Offset;
3318 BOOLEAN Immediate;
3319 } TAPE_SET_POSITION, *PTAPE_SET_POSITION;
3320
3321 typedef struct _TAPE_WRITE_MARKS {
3322 DWORD Type;
3323 DWORD Count;
3324 BOOLEAN Immediate;
3325 } TAPE_WRITE_MARKS, *PTAPE_WRITE_MARKS;
3326
3327 typedef struct _TAPE_CREATE_PARTITION {
3328 DWORD Method;
3329 DWORD Count;
3330 DWORD Size;
3331 } TAPE_CREATE_PARTITION, *PTAPE_CREATE_PARTITION;
3332
3333 typedef struct _MEMORY_BASIC_INFORMATION {
3334 PVOID BaseAddress;
3335 PVOID AllocationBase;
3336 DWORD AllocationProtect;
3337 SIZE_T RegionSize;
3338 DWORD State;
3339 DWORD Protect;
3340 DWORD Type;
3341 } MEMORY_BASIC_INFORMATION, *PMEMORY_BASIC_INFORMATION;
3342
3343 typedef struct _MESSAGE_RESOURCE_ENTRY {
3344 WORD Length;
3345 WORD Flags;
3346 BYTE Text[1];
3347 } MESSAGE_RESOURCE_ENTRY, *PMESSAGE_RESOURCE_ENTRY;
3348
3349 typedef struct _MESSAGE_RESOURCE_BLOCK {
3350 DWORD LowId;
3351 DWORD HighId;
3352 DWORD OffsetToEntries;
3353 } MESSAGE_RESOURCE_BLOCK, *PMESSAGE_RESOURCE_BLOCK;
3354
3355 typedef struct _MESSAGE_RESOURCE_DATA {
3356 DWORD NumberOfBlocks;
3357 MESSAGE_RESOURCE_BLOCK Blocks[1];
3358 } MESSAGE_RESOURCE_DATA,*PMESSAGE_RESOURCE_DATA;
3359
3360 typedef struct _LIST_ENTRY {
3361 struct _LIST_ENTRY *Flink;
3362 struct _LIST_ENTRY *Blink;
3363 } LIST_ENTRY, *PLIST_ENTRY, *RESTRICTED_POINTER PRLIST_ENTRY;
3364
3365 typedef struct _LIST_ENTRY32 {
3366 DWORD Flink;
3367 DWORD Blink;
3368 } LIST_ENTRY32,*PLIST_ENTRY32;
3369
3370 typedef struct _LIST_ENTRY64 {
3371 ULONGLONG Flink;
3372 ULONGLONG Blink;
3373 } LIST_ENTRY64,*PLIST_ENTRY64;
3374
3375 typedef struct _SINGLE_LIST_ENTRY {
3376 struct _SINGLE_LIST_ENTRY *Next;
3377 } SINGLE_LIST_ENTRY,*PSINGLE_LIST_ENTRY;
3378
3379 //
3380 // Slist Header
3381 //
3382 #ifndef _SLIST_HEADER_
3383 #define _SLIST_HEADER_
3384
3385 #if defined(_WIN64)
3386
3387 typedef struct DECLSPEC_ALIGN(16) _SLIST_ENTRY {
3388 struct _SLIST_ENTRY *Next;
3389 } SLIST_ENTRY, *PSLIST_ENTRY;
3390
3391 typedef struct _SLIST_ENTRY32 {
3392 DWORD Next;
3393 } SLIST_ENTRY32, *PSLIST_ENTRY32;
3394
3395 typedef union DECLSPEC_ALIGN(16) _SLIST_HEADER {
3396 _ANONYMOUS_STRUCT struct {
3397 ULONGLONG Alignment;
3398 ULONGLONG Region;
3399 } DUMMYSTRUCTNAME;
3400 struct {
3401 ULONGLONG Depth:16;
3402 ULONGLONG Sequence:9;
3403 ULONGLONG NextEntry:39;
3404 ULONGLONG HeaderType:1;
3405 ULONGLONG Init:1;
3406 ULONGLONG Reserved:59;
3407 ULONGLONG Region:3;
3408 } Header8;
3409 struct {
3410 ULONGLONG Depth:16;
3411 ULONGLONG Sequence:48;
3412 ULONGLONG HeaderType:1;
3413 ULONGLONG Init:1;
3414 ULONGLONG Reserved:2;
3415 ULONGLONG NextEntry:60;
3416 } Header16;
3417 struct {
3418 ULONGLONG Depth:16;
3419 ULONGLONG Sequence:48;
3420 ULONGLONG HeaderType:1;
3421 ULONGLONG Reserved:3;
3422 ULONGLONG NextEntry:60;
3423 } HeaderX64;
3424 } SLIST_HEADER, *PSLIST_HEADER;
3425
3426 typedef union _SLIST_HEADER32{
3427 ULONGLONG Alignment;
3428 _ANONYMOUS_STRUCT struct {
3429 SLIST_ENTRY32 Next;
3430 WORD Depth;
3431 WORD Sequence;
3432 } DUMMYSTRUCTNAME;
3433 } SLIST_HEADER32, *PSLIST_HEADER32;
3434
3435 #else
3436
3437 #define SLIST_ENTRY SINGLE_LIST_ENTRY
3438 #define _SLIST_ENTRY _SINGLE_LIST_ENTRY
3439 #define PSLIST_ENTRY PSINGLE_LIST_ENTRY
3440
3441 typedef SLIST_ENTRY SLIST_ENTRY32, *PSLIST_ENTRY32;
3442
3443 typedef union _SLIST_HEADER {
3444 ULONGLONG Alignment;
3445 _ANONYMOUS_STRUCT struct {
3446 SLIST_ENTRY Next;
3447 WORD Depth;
3448 WORD Sequence;
3449 } DUMMYSTRUCTNAME;
3450 } SLIST_HEADER, *PSLIST_HEADER;
3451
3452 typedef SLIST_HEADER SLIST_HEADER32, *PSLIST_HEADER32;
3453
3454 #endif /* defined(_WIN64) */
3455
3456 #endif /* _SLIST_HEADER_ */
3457
3458 NTSYSAPI
3459 VOID
3460 NTAPI
3461 RtlInitializeSListHead (
3462 IN PSLIST_HEADER ListHead
3463 );
3464
3465 NTSYSAPI
3466 PSLIST_ENTRY
3467 NTAPI
3468 RtlFirstEntrySList (
3469 IN const SLIST_HEADER *ListHead
3470 );
3471
3472 NTSYSAPI
3473 PSLIST_ENTRY
3474 NTAPI
3475 RtlInterlockedPopEntrySList (
3476 IN PSLIST_HEADER ListHead
3477 );
3478
3479 NTSYSAPI
3480 PSLIST_ENTRY
3481 NTAPI
3482 RtlInterlockedPushEntrySList (
3483 IN PSLIST_HEADER ListHead,
3484 IN PSLIST_ENTRY ListEntry
3485 );
3486
3487 NTSYSAPI
3488 PSLIST_ENTRY
3489 NTAPI
3490 RtlInterlockedFlushSList (
3491 IN PSLIST_HEADER ListHead
3492 );
3493
3494 NTSYSAPI
3495 WORD
3496 NTAPI
3497 RtlQueryDepthSList (
3498 IN PSLIST_HEADER ListHead
3499 );
3500
3501 typedef struct _RTL_CRITICAL_SECTION_DEBUG {
3502 WORD Type;
3503 WORD CreatorBackTraceIndex;
3504 struct _RTL_CRITICAL_SECTION *CriticalSection;
3505 LIST_ENTRY ProcessLocksList;
3506 DWORD EntryCount;
3507 DWORD ContentionCount;
3508 DWORD Flags;
3509 WORD CreatorBackTraceIndexHigh;
3510 WORD SpareWORD;
3511 } RTL_CRITICAL_SECTION_DEBUG, *PRTL_CRITICAL_SECTION_DEBUG, RTL_RESOURCE_DEBUG, *PRTL_RESOURCE_DEBUG;
3512
3513 #include "pshpack8.h"
3514 typedef struct _RTL_CRITICAL_SECTION {
3515 PRTL_CRITICAL_SECTION_DEBUG DebugInfo;
3516 LONG LockCount;
3517 LONG RecursionCount;
3518 HANDLE OwningThread;
3519 HANDLE LockSemaphore;
3520 ULONG_PTR SpinCount;
3521 } RTL_CRITICAL_SECTION, *PRTL_CRITICAL_SECTION;
3522 #include "poppack.h"
3523
3524 NTSYSAPI
3525 WORD
3526 NTAPI
3527 RtlCaptureStackBackTrace(
3528 IN DWORD FramesToSkip,
3529 IN DWORD FramesToCapture,
3530 OUT PVOID *BackTrace,
3531 OUT PDWORD BackTraceHash OPTIONAL
3532 );
3533
3534 NTSYSAPI
3535 VOID
3536 NTAPI
3537 RtlCaptureContext(
3538 PCONTEXT ContextRecord
3539 );
3540
3541 NTSYSAPI
3542 PVOID
3543 NTAPI
3544 RtlPcToFileHeader(
3545 IN PVOID PcValue,
3546 PVOID* BaseOfImage
3547 );
3548
3549 NTSYSAPI
3550 VOID
3551 NTAPI
3552 RtlUnwind (
3553 IN PVOID TargetFrame OPTIONAL,
3554 IN PVOID TargetIp OPTIONAL,
3555 IN PEXCEPTION_RECORD ExceptionRecord OPTIONAL,
3556 IN PVOID ReturnValue
3557 );
3558
3559 #define RTL_SRWLOCK_INIT {0}
3560
3561 typedef struct _RTL_SRWLOCK {
3562 PVOID Ptr;
3563 } RTL_SRWLOCK, *PRTL_SRWLOCK;
3564
3565 #define RTL_CONDITION_VARIABLE_INIT {0}
3566 #define RTL_CONDITION_VARIABLE_LOCKMODE_SHARED 0x1
3567
3568 typedef struct _RTL_CONDITION_VARIABLE {
3569 PVOID Ptr;
3570 } RTL_CONDITION_VARIABLE, *PRTL_CONDITION_VARIABLE;
3571
3572 typedef LONG
3573 (NTAPI *PVECTORED_EXCEPTION_HANDLER)(
3574 struct _EXCEPTION_POINTERS *ExceptionInfo
3575 );
3576
3577 typedef struct _PROCESSOR_NUMBER {
3578 WORD Group;
3579 BYTE Number;
3580 BYTE Reserved;
3581 } PROCESSOR_NUMBER, *PPROCESSOR_NUMBER;
3582
3583 typedef struct _GROUP_AFFINITY {
3584 KAFFINITY Mask;
3585 WORD Group;
3586 WORD Reserved[3];
3587 } GROUP_AFFINITY, *PGROUP_AFFINITY;
3588
3589 typedef struct _EVENTLOGRECORD {
3590 DWORD Length;
3591 DWORD Reserved;
3592 DWORD RecordNumber;
3593 DWORD TimeGenerated;
3594 DWORD TimeWritten;
3595 DWORD EventID;
3596 WORD EventType;
3597 WORD NumStrings;
3598 WORD EventCategory;
3599 WORD ReservedFlags;
3600 DWORD ClosingRecordNumber;
3601 DWORD StringOffset;
3602 DWORD UserSidLength;
3603 DWORD UserSidOffset;
3604 DWORD DataLength;
3605 DWORD DataOffset;
3606 } EVENTLOGRECORD, *PEVENTLOGRECORD;
3607
3608 typedef struct _OSVERSIONINFOA {
3609 DWORD dwOSVersionInfoSize;
3610 DWORD dwMajorVersion;
3611 DWORD dwMinorVersion;
3612 DWORD dwBuildNumber;
3613 DWORD dwPlatformId;
3614 CHAR szCSDVersion[128];
3615 } OSVERSIONINFOA, *POSVERSIONINFOA, *LPOSVERSIONINFOA;
3616
3617 typedef struct _OSVERSIONINFOW {
3618 DWORD dwOSVersionInfoSize;
3619 DWORD dwMajorVersion;
3620 DWORD dwMinorVersion;
3621 DWORD dwBuildNumber;
3622 DWORD dwPlatformId;
3623 WCHAR szCSDVersion[128];
3624 } OSVERSIONINFOW, *POSVERSIONINFOW, *LPOSVERSIONINFOW, RTL_OSVERSIONINFOW, *PRTL_OSVERSIONINFOW;
3625
3626 typedef struct _OSVERSIONINFOEXA {
3627 DWORD dwOSVersionInfoSize;
3628 DWORD dwMajorVersion;
3629 DWORD dwMinorVersion;
3630 DWORD dwBuildNumber;
3631 DWORD dwPlatformId;
3632 CHAR szCSDVersion[128];
3633 WORD wServicePackMajor;
3634 WORD wServicePackMinor;
3635 WORD wSuiteMask;
3636 BYTE wProductType;
3637 BYTE wReserved;
3638 } OSVERSIONINFOEXA, *POSVERSIONINFOEXA, *LPOSVERSIONINFOEXA;
3639
3640 typedef struct _OSVERSIONINFOEXW {
3641 DWORD dwOSVersionInfoSize;
3642 DWORD dwMajorVersion;
3643 DWORD dwMinorVersion;
3644 DWORD dwBuildNumber;
3645 DWORD dwPlatformId;
3646 WCHAR szCSDVersion[128];
3647 WORD wServicePackMajor;
3648 WORD wServicePackMinor;
3649 WORD wSuiteMask;
3650 BYTE wProductType;
3651 BYTE wReserved;
3652 } OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW, RTL_OSVERSIONINFOEXW, *PRTL_OSVERSIONINFOEXW;
3653
3654 #include <pshpack2.h>
3655
3656 typedef struct _IMAGE_VXD_HEADER {
3657 WORD e32_magic;
3658 BYTE e32_border;
3659 BYTE e32_worder;
3660 DWORD e32_level;
3661 WORD e32_cpu;
3662 WORD e32_os;
3663 DWORD e32_ver;
3664 DWORD e32_mflags;
3665 DWORD e32_mpages;
3666 DWORD e32_startobj;
3667 DWORD e32_eip;
3668 DWORD e32_stackobj;
3669 DWORD e32_esp;
3670 DWORD e32_pagesize;
3671 DWORD e32_lastpagesize;
3672 DWORD e32_fixupsize;
3673 DWORD e32_fixupsum;
3674 DWORD e32_ldrsize;
3675 DWORD e32_ldrsum;
3676 DWORD e32_objtab;
3677 DWORD e32_objcnt;
3678 DWORD e32_objmap;
3679 DWORD e32_itermap;
3680 DWORD e32_rsrctab;
3681 DWORD e32_rsrccnt;
3682 DWORD e32_restab;
3683 DWORD e32_enttab;
3684 DWORD e32_dirtab;
3685 DWORD e32_dircnt;
3686 DWORD e32_fpagetab;
3687 DWORD e32_frectab;
3688 DWORD e32_impmod;
3689 DWORD e32_impmodcnt;
3690 DWORD e32_impproc;
3691 DWORD e32_pagesum;
3692 DWORD e32_datapage;
3693 DWORD e32_preload;
3694 DWORD e32_nrestab;
3695 DWORD e32_cbnrestab;
3696 DWORD e32_nressum;
3697 DWORD e32_autodata;
3698 DWORD e32_debuginfo;
3699 DWORD e32_debuglen;
3700 DWORD e32_instpreload;
3701 DWORD e32_instdemand;
3702 DWORD e32_heapsize;
3703 BYTE e32_res3[12];
3704 DWORD e32_winresoff;
3705 DWORD e32_winreslen;
3706 WORD e32_devid;
3707 WORD e32_ddkver;
3708 } IMAGE_VXD_HEADER, *PIMAGE_VXD_HEADER;
3709
3710 typedef struct _IMAGE_DOS_HEADER {
3711 WORD e_magic;
3712 WORD e_cblp;
3713 WORD e_cp;
3714 WORD e_crlc;
3715 WORD e_cparhdr;
3716 WORD e_minalloc;
3717 WORD e_maxalloc;
3718 WORD e_ss;
3719 WORD e_sp;
3720 WORD e_csum;
3721 WORD e_ip;
3722 WORD e_cs;
3723 WORD e_lfarlc;
3724 WORD e_ovno;
3725 WORD e_res[4];
3726 WORD e_oemid;
3727 WORD e_oeminfo;
3728 WORD e_res2[10];
3729 LONG e_lfanew;
3730 } IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER;
3731
3732 typedef struct _IMAGE_OS2_HEADER {
3733 WORD ne_magic;
3734 CHAR ne_ver;
3735 CHAR ne_rev;
3736 WORD ne_enttab;
3737 WORD ne_cbenttab;
3738 LONG ne_crc;
3739 WORD ne_flags;
3740 WORD ne_autodata;
3741 WORD ne_heap;
3742 WORD ne_stack;
3743 LONG ne_csip;
3744 LONG ne_sssp;
3745 WORD ne_cseg;
3746 WORD ne_cmod;
3747 WORD ne_cbnrestab;
3748 WORD ne_segtab;
3749 WORD ne_rsrctab;
3750 WORD ne_restab;
3751 WORD ne_modtab;
3752 WORD ne_imptab;
3753 LONG ne_nrestab;
3754 WORD ne_cmovent;
3755 WORD ne_align;
3756 WORD ne_cres;
3757 BYTE ne_exetyp;
3758 BYTE ne_flagsothers;
3759 WORD ne_pretthunks;
3760 WORD ne_psegrefbytes;
3761 WORD ne_swaparea;
3762 WORD ne_expver;
3763 } IMAGE_OS2_HEADER, *PIMAGE_OS2_HEADER;
3764
3765 #include <poppack.h>
3766
3767 typedef struct _IMAGE_FILE_HEADER {
3768 WORD Machine;
3769 WORD NumberOfSections;
3770 DWORD TimeDateStamp;
3771 DWORD PointerToSymbolTable;
3772 DWORD NumberOfSymbols;
3773 WORD SizeOfOptionalHeader;
3774 WORD Characteristics;
3775 } IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER;
3776
3777 typedef struct _IMAGE_DATA_DIRECTORY {
3778 DWORD VirtualAddress;
3779 DWORD Size;
3780 } IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY;
3781
3782 typedef struct _IMAGE_OPTIONAL_HEADER32 {
3783 WORD Magic;
3784 BYTE MajorLinkerVersion;
3785 BYTE MinorLinkerVersion;
3786 DWORD SizeOfCode;
3787 DWORD SizeOfInitializedData;
3788 DWORD SizeOfUninitializedData;
3789 DWORD AddressOfEntryPoint;
3790 DWORD BaseOfCode;
3791 DWORD BaseOfData;
3792 DWORD ImageBase;
3793 DWORD SectionAlignment;
3794 DWORD FileAlignment;
3795 WORD MajorOperatingSystemVersion;
3796 WORD MinorOperatingSystemVersion;
3797 WORD MajorImageVersion;
3798 WORD MinorImageVersion;
3799 WORD MajorSubsystemVersion;
3800 WORD MinorSubsystemVersion;
3801 DWORD Win32VersionValue;
3802 DWORD SizeOfImage;
3803 DWORD SizeOfHeaders;
3804 DWORD CheckSum;
3805 WORD Subsystem;
3806 WORD DllCharacteristics;
3807 DWORD SizeOfStackReserve;
3808 DWORD SizeOfStackCommit;
3809 DWORD SizeOfHeapReserve;
3810 DWORD SizeOfHeapCommit;
3811 DWORD LoaderFlags;
3812 DWORD NumberOfRvaAndSizes;
3813 IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES];
3814 } IMAGE_OPTIONAL_HEADER32, *PIMAGE_OPTIONAL_HEADER32;
3815
3816 typedef struct _IMAGE_OPTIONAL_HEADER64 {
3817 WORD Magic;
3818 BYTE MajorLinkerVersion;
3819 BYTE MinorLinkerVersion;
3820 DWORD SizeOfCode;
3821 DWORD SizeOfInitializedData;
3822 DWORD SizeOfUninitializedData;
3823 DWORD AddressOfEntryPoint;
3824 DWORD BaseOfCode;
3825 ULONGLONG ImageBase;
3826 DWORD SectionAlignment;
3827 DWORD FileAlignment;
3828 WORD MajorOperatingSystemVersion;
3829 WORD MinorOperatingSystemVersion;
3830 WORD MajorImageVersion;
3831 WORD MinorImageVersion;
3832 WORD MajorSubsystemVersion;
3833 WORD MinorSubsystemVersion;
3834 DWORD Win32VersionValue;
3835 DWORD SizeOfImage;
3836 DWORD SizeOfHeaders;