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