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