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