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