4 * Windows NT native definitions for user mode
6 * This file is part of the ReactOS PSDK package.
8 * This file is auto-generated from ReactOS XDK.
10 * THIS SOFTWARE IS NOT COPYRIGHTED
12 * This source code is offered for use in the public domain. You may
13 * use, modify or distribute it freely.
15 * This code is distributed in the hope that it will be useful but
16 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
17 * DISCLAIMED. This includes but is not limited to warranties of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
26 /* We require WDK / VS 2008 or newer */
27 #if defined(_MSC_VER) && (_MSC_VER < 1500)
28 #error Compiler too old!
31 /* HACK for wine code */
32 #if !defined(__ROS_LONG64__)
34 #define __ROS_LONG64__
39 //#include <winapifamily.h>
40 #include <msvctarget.h>
41 #include <specstrings.h>
42 #include <kernelspecs.h>
52 #include <sdkddkver.h>
57 /* Silence some MSVC warnings */
60 #pragma warning(disable:4201)
61 #pragma warning(disable:4214)
68 /* Defines the "size" of an any-size array */
70 #define ANYSIZE_ARRAY 1
73 /* Helper macro to enable gcc's extension. */
74 #ifndef __GNU_EXTENSION
76 #define __GNU_EXTENSION __extension__
78 #define __GNU_EXTENSION
80 #endif /* __GNU_EXTENSION */
82 #ifndef DUMMYUNIONNAME
83 #if defined(NONAMELESSUNION)// || !defined(_MSC_EXTENSIONS)
84 #define _ANONYMOUS_UNION
85 #define _UNION_NAME(x) x
86 #define DUMMYUNIONNAME u
87 #define DUMMYUNIONNAME1 u1
88 #define DUMMYUNIONNAME2 u2
89 #define DUMMYUNIONNAME3 u3
90 #define DUMMYUNIONNAME4 u4
91 #define DUMMYUNIONNAME5 u5
92 #define DUMMYUNIONNAME6 u6
93 #define DUMMYUNIONNAME7 u7
94 #define DUMMYUNIONNAME8 u8
95 #define DUMMYUNIONNAME9 u9
97 #define _ANONYMOUS_UNION __GNU_EXTENSION
98 #define _UNION_NAME(x)
99 #define DUMMYUNIONNAME
100 #define DUMMYUNIONNAME1
101 #define DUMMYUNIONNAME2
102 #define DUMMYUNIONNAME3
103 #define DUMMYUNIONNAME4
104 #define DUMMYUNIONNAME5
105 #define DUMMYUNIONNAME6
106 #define DUMMYUNIONNAME7
107 #define DUMMYUNIONNAME8
108 #define DUMMYUNIONNAME9
109 #endif /* NONAMELESSUNION */
110 #endif /* !DUMMYUNIONNAME */
112 #ifndef DUMMYSTRUCTNAME
113 #if defined(NONAMELESSUNION)// || !defined(_MSC_EXTENSIONS)
114 #define _ANONYMOUS_STRUCT
115 #define _STRUCT_NAME(x) x
116 #define DUMMYSTRUCTNAME s
117 #define DUMMYSTRUCTNAME1 s1
118 #define DUMMYSTRUCTNAME2 s2
119 #define DUMMYSTRUCTNAME3 s3
120 #define DUMMYSTRUCTNAME4 s4
121 #define DUMMYSTRUCTNAME5 s5
123 #define _ANONYMOUS_STRUCT __GNU_EXTENSION
124 #define _STRUCT_NAME(x)
125 #define DUMMYSTRUCTNAME
126 #define DUMMYSTRUCTNAME1
127 #define DUMMYSTRUCTNAME2
128 #define DUMMYSTRUCTNAME3
129 #define DUMMYSTRUCTNAME4
130 #define DUMMYSTRUCTNAME5
131 #endif /* NONAMELESSUNION */
132 #endif /* DUMMYSTRUCTNAME */
134 #if defined(STRICT_GS_ENABLED)
135 #pragma strict_gs_check(push, on)
138 #if defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) || defined(_M_AMD64) || defined(_M_ARM)
139 #define ALIGNMENT_MACHINE
140 #define UNALIGNED __unaligned
142 #define UNALIGNED64 __unaligned
147 #undef ALIGNMENT_MACHINE
152 #if defined(_WIN64) || defined(_M_ALPHA)
153 #define MAX_NATURAL_ALIGNMENT sizeof(ULONGLONG)
154 #define MEMORY_ALLOCATION_ALIGNMENT 16
156 #define MAX_NATURAL_ALIGNMENT sizeof(DWORD)
157 #define MEMORY_ALLOCATION_ALIGNMENT 8
160 /* C99 restrict support */
161 #if defined(ENABLE_RESTRICTED) && defined(_M_MRX000) && !defined(MIDL_PASS) && !defined(RC_INVOKED)
162 #define RESTRICTED_POINTER __restrict
164 #define RESTRICTED_POINTER
167 /* Returns the base address of a structure from a structure member */
168 #ifndef CONTAINING_RECORD
169 #define CONTAINING_RECORD(address, type, field) \
170 ((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field))))
173 /* Returns the byte offset of the specified structure's member */
175 #define FIELD_OFFSET(Type, Field) ((LONG)(LONG_PTR)&(((Type*) 0)->Field))
177 #define FIELD_OFFSET(Type, Field) ((LONG)__builtin_offsetof(Type, Field))
178 #endif /* __GNUC__ */
180 /* Returns the type's alignment */
181 #if defined(_MSC_VER)
182 #define TYPE_ALIGNMENT(t) __alignof(t)
184 #define TYPE_ALIGNMENT(t) FIELD_OFFSET(struct { char x; t test; }, test)
185 #endif /* _MSC_VER */
187 #if defined(_AMD64_) || defined(_X86_)
188 #define PROBE_ALIGNMENT(_s) TYPE_ALIGNMENT(DWORD)
189 #elif defined(_IA64_) || defined(_ARM_)
190 #define PROBE_ALIGNMENT(_s) max((TYPE_ALIGNMENT(_s), TYPE_ALIGNMENT(DWORD))
192 #error "unknown architecture"
196 #define PROBE_ALIGNMENT32(_s) TYPE_ALIGNMENT(DWORD)
200 #define EXTERN_C extern "C"
202 #define EXTERN_C extern
203 #endif /* __cplusplus */
205 #define NTAPI __stdcall
207 #ifndef STDMETHODCALLTYPE
208 #define STDMETHODCALLTYPE __stdcall
209 #define STDMETHODVCALLTYPE __cdecl
210 #define STDAPICALLTYPE __stdcall
211 #define STDAPIVCALLTYPE __cdecl
212 #define STDAPI EXTERN_C HRESULT STDAPICALLTYPE
213 #define STDAPI_(t) EXTERN_C t STDAPICALLTYPE
214 #define STDMETHODIMP HRESULT STDMETHODCALLTYPE
215 #define STDMETHODIMP_(t) t STDMETHODCALLTYPE
216 #define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE
217 #define STDAPIV_(t) EXTERN_C t STDAPIVCALLTYPE
218 #define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE
219 #define STDMETHODIMPV_(t) t STDMETHODVCALLTYPE
220 #endif /* !STDMETHODCALLTYPE */
222 #define STDOVERRIDEMETHODIMP __override STDMETHODIMP
223 #define STDOVERRIDEMETHODIMP_(t) __override STDMETHODIMP_(t)
224 #define IFACEMETHODIMP __override STDMETHODIMP
225 #define IFACEMETHODIMP_(t) __override STDMETHODIMP_(t)
226 #define STDOVERRIDEMETHODIMPV __override STDMETHODIMPV
227 #define STDOVERRIDEMETHODIMPV_(t) __override STDMETHODIMPV_(t)
228 #define IFACEMETHODIMPV __override STDMETHODIMPV
229 #define IFACEMETHODIMPV_(t) __override STDMETHODIMPV_(t)
231 /* Import and Export Specifiers */
233 /* Done the same way as in windef.h for now */
234 #define DECLSPEC_IMPORT __declspec(dllimport) // MIDL?
235 #define DECLSPEC_NORETURN __declspec(noreturn)
237 #ifndef DECLSPEC_ADDRSAFE
238 #if defined(_MSC_VER) && (defined(_M_ALPHA) || defined(_M_AXP64))
239 #define DECLSPEC_ADDRSAFE __declspec(address_safe)
241 #define DECLSPEC_ADDRSAFE
243 #endif /* DECLSPEC_ADDRSAFE */
245 #ifndef DECLSPEC_NOTHROW
246 #if !defined(MIDL_PASS)
247 #define DECLSPEC_NOTHROW __declspec(nothrow)
249 #define DECLSPEC_NOTHROW
251 #endif /* DECLSPEC_NOTHROW */
254 #if defined(_MSC_VER)
255 #define NOP_FUNCTION __noop
257 #define NOP_FUNCTION (void)0
259 #endif /* NOP_FUNCTION */
261 #if !defined(_NTSYSTEM_)
262 #define NTSYSAPI DECLSPEC_IMPORT
263 #define NTSYSCALLAPI DECLSPEC_IMPORT
266 #if defined(_NTDLLBUILD_)
269 #define NTSYSCALLAPI DECLSPEC_ADDRSAFE
271 #endif /* _NTSYSTEM_ */
275 #if defined(_MSC_VER)
276 #define FORCEINLINE __forceinline
277 #elif ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L)
278 #define FORCEINLINE extern inline __attribute__((__always_inline__,__gnu_inline__))
280 #define FORCEINLINE extern __inline__ __attribute__((__always_inline__))
282 #endif /* FORCEINLINE */
284 #ifndef DECLSPEC_NOINLINE
285 #if (_MSC_VER >= 1300)
286 #define DECLSPEC_NOINLINE __declspec(noinline)
287 #elif defined(__GNUC__)
288 #define DECLSPEC_NOINLINE __attribute__((noinline))
290 #define DECLSPEC_NOINLINE
292 #endif /* DECLSPEC_NOINLINE */
294 #if !defined(_M_CEE_PURE)
295 #define NTAPI_INLINE NTAPI
298 #endif /* _M_CEE_PURE */
300 /* Use to specify structure alignment. Note: VS and GCC behave slightly
301 different. Therefore it is important to stick to the following rules:
302 - If you want a struct to be aligned, put DECLSPEC_ALIGN after "struct":
303 "typedef struct DECLSPEC_ALIGN(16) _FOO { ... } FOO, *PFOO;"
304 _alignof(PFOO) is sizeof(void*) here as usual.
305 - If you don't want the struct, but only the typedef to be aligned,
306 use an extra typedef.
308 typedef DECLSPEC_ALIGN(16) struct _BAR BAR, *ALIGNEDPBAR;
309 _alignof(ALIGNEDPBAR) is 16 now! */
310 #ifndef DECLSPEC_ALIGN
311 #if defined(_MSC_VER) && !defined(MIDL_PASS)
312 #define DECLSPEC_ALIGN(x) __declspec(align(x))
313 #elif defined(__GNUC__)
314 #define DECLSPEC_ALIGN(x) __attribute__((aligned(x)))
316 #define DECLSPEC_ALIGN(x)
318 #endif /* DECLSPEC_ALIGN */
320 #ifndef SYSTEM_CACHE_ALIGNMENT_SIZE
321 #if defined(_AMD64_) || defined(_X86_)
322 #define SYSTEM_CACHE_ALIGNMENT_SIZE 64
324 #define SYSTEM_CACHE_ALIGNMENT_SIZE 128
326 #endif /* SYSTEM_CACHE_ALIGNMENT_SIZE */
328 #ifndef DECLSPEC_CACHEALIGN
329 #define DECLSPEC_CACHEALIGN DECLSPEC_ALIGN(SYSTEM_CACHE_ALIGNMENT_SIZE)
330 #endif /* DECLSPEC_CACHEALIGN */
332 #ifndef DECLSPEC_UUID
333 #if defined(_MSC_VER) && defined(__cplusplus)
334 #define DECLSPEC_UUID(x) __declspec(uuid(x))
336 #define DECLSPEC_UUID(x)
338 #endif /* DECLSPEC_UUID */
340 #ifndef DECLSPEC_NOVTABLE
341 #if defined(_MSC_VER) && defined(__cplusplus)
342 #define DECLSPEC_NOVTABLE __declspec(novtable)
344 #define DECLSPEC_NOVTABLE
346 #endif /* DECLSPEC_NOVTABLE */
348 #ifndef DECLSPEC_SELECTANY
349 #if defined(_MSC_VER) || defined(__GNUC__)
350 #define DECLSPEC_SELECTANY __declspec(selectany)
352 #define DECLSPEC_SELECTANY
354 #endif /* DECLSPEC_SELECTANY */
356 #ifndef DECLSPEC_DEPRECATED
357 #if (defined(_MSC_VER) || defined(__GNUC__)) && !defined(MIDL_PASS)
358 #define DECLSPEC_DEPRECATED __declspec(deprecated)
359 #define DEPRECATE_SUPPORTED
361 #define DECLSPEC_DEPRECATED
362 #undef DEPRECATE_SUPPORTED
364 #endif /* DECLSPEC_DEPRECATED */
366 #ifdef DEPRECATE_DDK_FUNCTIONS
368 #define DECLSPEC_DEPRECATED_DDK DECLSPEC_DEPRECATED
369 #ifdef DEPRECATE_SUPPORTED
370 #define PRAGMA_DEPRECATED_DDK 1
373 #define DECLSPEC_DEPRECATED_DDK
374 #define PRAGMA_DEPRECATED_DDK 1
377 #define DECLSPEC_DEPRECATED_DDK
378 #define PRAGMA_DEPRECATED_DDK 0
379 #endif /* DEPRECATE_DDK_FUNCTIONS */
381 /* Use to silence unused variable warnings when it is intentional */
382 #define UNREFERENCED_PARAMETER(P) {(P)=(P);}
383 #define UNREFERENCED_LOCAL_VARIABLE(L) ((void)(L))
384 #define DBG_UNREFERENCED_PARAMETER(P) {(P)=(P);}
385 #define DBG_UNREFERENCED_LOCAL_VARIABLE(L) ((void)(L))
389 typedef void * POINTER_64 PVOID64
;
392 typedef void *HANDLE
, **PHANDLE
;;
394 #define DECLARE_HANDLE(n) typedef struct n##__{int unused;} *n
396 #define DECLARE_HANDLE(n) typedef HANDLE n
399 /* Upper-Case Versions of Some Standard C Types */
405 #if defined(__ROS_LONG64__) && !defined(_M_AMD64)
411 #if !defined(MIDL_PASS)
413 #endif /* !MIDL_PASS */
418 typedef SHORT
*PSHORT
;
422 typedef unsigned char FCHAR
;
423 typedef unsigned short FSHORT
;
424 typedef unsigned long FLONG
;
426 typedef unsigned char BOOLEAN
, *PBOOLEAN
;
428 #ifndef _HRESULT_DEFINED
429 #define _HRESULT_DEFINED
430 typedef _Return_type_success_(return >= 0) LONG HRESULT
;
431 #endif /* _HRESULT_DEFINED */
435 __GNU_EXTENSION
typedef __int64 LONGLONG
, *PLONGLONG
;
436 __GNU_EXTENSION
typedef unsigned __int64 ULONGLONG
, *PULONGLONG
;
438 typedef ULONGLONG DWORDLONG
, *PDWORDLONG
;
440 /* Update Sequence Number */
441 typedef LONGLONG USN
;
443 /* ANSI (Multi-byte Character) types */
444 typedef CHAR
*PCHAR
, *LPCH
, *PCH
, *PNZCH
;
445 typedef CONST CHAR
*LPCCH
, *PCCH
, *PCNZCH
;
446 typedef _Null_terminated_ CHAR
*NPSTR
, *LPSTR
, *PSTR
;
447 typedef _Null_terminated_ PSTR
*PZPSTR
;
448 typedef _Null_terminated_ CONST PSTR
*PCZPSTR
;
449 typedef _Null_terminated_ CONST CHAR
*LPCSTR
, *PCSTR
;
450 typedef _Null_terminated_ PCSTR
*PZPCSTR
;
452 typedef _NullNull_terminated_ CHAR
*PZZSTR
;
453 typedef _NullNull_terminated_ CONST CHAR
*PCZZSTR
;
456 /* UNICODE (Wide Character) types */
457 typedef wchar_t WCHAR
;
458 typedef WCHAR
*PWCHAR
, *LPWCH
, *PWCH
;
459 typedef CONST WCHAR
*LPCWCH
, *PCWCH
;
460 typedef _Null_terminated_ WCHAR
*NWPSTR
, *LPWSTR
, *PWSTR
;
461 typedef _Null_terminated_ PWSTR
*PZPWSTR
;
462 typedef _Null_terminated_ CONST PWSTR
*PCZPWSTR
;
463 typedef _Null_terminated_ WCHAR UNALIGNED
*LPUWSTR
, *PUWSTR
;
464 typedef _Null_terminated_ CONST WCHAR
*LPCWSTR
, *PCWSTR
;
465 typedef _Null_terminated_ PCWSTR
*PZPCWSTR
;
466 typedef _Null_terminated_ CONST WCHAR UNALIGNED
*LPCUWSTR
, *PCUWSTR
;
468 typedef _NullNull_terminated_ WCHAR
*PZZWSTR
;
469 typedef _NullNull_terminated_ CONST WCHAR
*PCZZWSTR
;
470 typedef _NullNull_terminated_ WCHAR UNALIGNED
*PUZZWSTR
;
471 typedef _NullNull_terminated_ CONST WCHAR UNALIGNED
*PCUZZWSTR
;
473 typedef WCHAR
*PNZWCH
;
474 typedef CONST WCHAR
*PCNZWCH
;
475 typedef WCHAR UNALIGNED
*PUNZWCH
;
476 typedef CONST WCHAR UNALIGNED
*PCUNZWCH
;
478 #if (_WIN32_WINNT >= 0x0600) || (defined(__cplusplus) && defined(WINDOWS_ENABLE_CPLUSPLUS))
479 typedef CONST WCHAR
*LPCWCHAR
, *PCWCHAR
;
480 typedef CONST WCHAR UNALIGNED
*LPCUWCHAR
, *PCUWCHAR
;
481 typedef unsigned long UCSCHAR
, *PUCSCHAR
, *PUCSSTR
;
482 typedef const UCSCHAR
*PCUCSCHAR
, *PCUCSSTR
;
483 typedef UCSCHAR UNALIGNED
*PUUCSCHAR
, *PUUCSSTR
;
484 typedef const UCSCHAR UNALIGNED
*PCUUCSCHAR
, *PCUUCSSTR
;
485 #define UCSCHAR_INVALID_CHARACTER (0xffffffff)
486 #define MIN_UCSCHAR (0)
487 #define MAX_UCSCHAR (0x0010FFFF)
488 #endif /* _WIN32_WINNT >= 0x0600 */
492 #ifndef _TCHAR_DEFINED
493 typedef WCHAR TCHAR
, *PTCHAR
;
494 typedef WCHAR TBYTE
, *PTBYTE
;
495 #define _TCHAR_DEFINED
496 #endif /* !_TCHAR_DEFINED */
498 typedef LPWCH LPTCH
, PTCH
;
499 typedef LPCWCH LPCTCH
, PCTCH
;
500 typedef LPWSTR PTSTR
, LPTSTR
;
501 typedef LPCWSTR PCTSTR
, LPCTSTR
;
502 typedef LPUWSTR PUTSTR
, LPUTSTR
;
503 typedef LPCUWSTR PCUTSTR
, LPCUTSTR
;
505 typedef PZZWSTR PZZTSTR
;
506 typedef PCZZWSTR PCZZTSTR
;
507 typedef PUZZWSTR PUZZTSTR
;
508 typedef PCUZZWSTR PCUZZTSTR
;
509 typedef PZPWSTR PZPTSTR
;
510 typedef PNZWCH PNZTCH
;
511 typedef PCNZWCH PCNZTCH
;
512 typedef PUNZWCH PUNZTCH
;
513 typedef PCUNZWCH PCUNZTCH
;
514 #define __TEXT(quote) L##quote
518 #ifndef _TCHAR_DEFINED
519 typedef char TCHAR
, *PTCHAR
;
520 typedef unsigned char TBYTE
, *PTBYTE
;
521 #define _TCHAR_DEFINED
522 #endif /* !_TCHAR_DEFINED */
523 typedef LPCH LPTCH
, PTCH
;
524 typedef LPCCH LPCTCH
, PCTCH
;
525 typedef LPSTR PTSTR
, LPTSTR
, PUTSTR
, LPUTSTR
;
526 typedef LPCSTR PCTSTR
, LPCTSTR
, PCUTSTR
, LPCUTSTR
;
527 typedef PZZSTR PZZTSTR
, PUZZTSTR
;
528 typedef PCZZSTR PCZZTSTR
, PCUZZTSTR
;
529 typedef PZPSTR PZPTSTR
;
530 typedef PNZCH PNZTCH
, PUNZTCH
;
531 typedef PCNZCH PCNZTCH
, PCUNZTCH
;
532 #define __TEXT(quote) quote
536 #define TEXT(quote) __TEXT(quote)
538 /* Cardinal Data Types */
541 /* NLS basics (Locale and Language Ids) */
542 typedef DWORD LCID
, *PLCID
;
545 #ifndef __COMPARTMENT_ID_DEFINED__
546 #define __COMPARTMENT_ID_DEFINED__
549 UNSPECIFIED_COMPARTMENT_ID
= 0,
550 DEFAULT_COMPARTMENT_ID
551 } COMPARTMENT_ID
, *PCOMPARTMENT_ID
;
552 #endif /* __COMPARTMENT_ID_DEFINED__ */
554 #ifndef __OBJECTID_DEFINED
555 #define __OBJECTID_DEFINED
556 typedef struct _OBJECTID
{
560 #endif /* __OBJECTID_DEFINED */
563 #pragma warning(push)
564 #pragma warning(disable:4201) // nameless struct / union
575 typedef FLOAT128
*PFLOAT128
;
577 /* Large Integer Unions */
578 #if defined(MIDL_PASS)
579 typedef struct _LARGE_INTEGER
{
581 typedef union _LARGE_INTEGER
{
582 _ANONYMOUS_STRUCT
struct
592 #endif /* MIDL_PASS */
594 } LARGE_INTEGER
, *PLARGE_INTEGER
;
596 #if defined(MIDL_PASS)
597 typedef struct _ULARGE_INTEGER
{
599 typedef union _ULARGE_INTEGER
{
600 _ANONYMOUS_STRUCT
struct
610 #endif /* MIDL_PASS */
612 } ULARGE_INTEGER
, *PULARGE_INTEGER
;
615 #pragma warning(pop) /* disable:4201 */
618 /* Locally Unique Identifier */
625 #define APPLICATION_ERROR_MASK 0x20000000
626 #define ERROR_SEVERITY_SUCCESS 0x00000000
627 #define ERROR_SEVERITY_INFORMATIONAL 0x40000000
628 #define ERROR_SEVERITY_WARNING 0x80000000
629 #define ERROR_SEVERITY_ERROR 0xC0000000
632 #define ANSI_NULL ((CHAR)0)
633 #define UNICODE_NULL ((WCHAR)0)
634 #define UNICODE_STRING_MAX_BYTES ((USHORT) 65534)
635 #define UNICODE_STRING_MAX_CHARS (32767)
637 /* Doubly Linked Lists */
638 typedef struct _LIST_ENTRY
{
639 struct _LIST_ENTRY
*Flink
;
640 struct _LIST_ENTRY
*Blink
;
641 } LIST_ENTRY
, *PLIST_ENTRY
, *RESTRICTED_POINTER PRLIST_ENTRY
;
643 typedef struct LIST_ENTRY32
{
646 } LIST_ENTRY32
, *PLIST_ENTRY32
;
648 typedef struct LIST_ENTRY64
{
651 } LIST_ENTRY64
, *PLIST_ENTRY64
;
653 /* Singly Linked Lists */
654 typedef struct _SINGLE_LIST_ENTRY
{
655 struct _SINGLE_LIST_ENTRY
*Next
;
656 } SINGLE_LIST_ENTRY
, *PSINGLE_LIST_ENTRY
;
659 typedef struct _PROCESSOR_NUMBER
{
663 } PROCESSOR_NUMBER
, *PPROCESSOR_NUMBER
;
665 #define ALL_PROCESSOR_GROUPS 0xffff
669 _Function_class_(EXCEPTION_ROUTINE
)
670 EXCEPTION_DISPOSITION
673 _Inout_
struct _EXCEPTION_RECORD
*ExceptionRecord
,
674 _In_ PVOID EstablisherFrame
,
675 _Inout_
struct _CONTEXT
*ContextRecord
,
676 _In_ PVOID DispatcherContext
);
678 typedef EXCEPTION_ROUTINE
*PEXCEPTION_ROUTINE
;
680 typedef struct _GROUP_AFFINITY
{
684 } GROUP_AFFINITY
, *PGROUP_AFFINITY
;
688 #define RTL_FIELD_TYPE(type, field) (((type*)0)->field)
689 #define RTL_BITS_OF(sizeOfArg) (sizeof(sizeOfArg) * 8)
690 #define RTL_BITS_OF_FIELD(type, field) (RTL_BITS_OF(RTL_FIELD_TYPE(type, field)))
691 #define RTL_FIELD_SIZE(type, field) (sizeof(((type *)0)->field))
693 #define RTL_SIZEOF_THROUGH_FIELD(type, field) \
694 (FIELD_OFFSET(type, field) + RTL_FIELD_SIZE(type, field))
696 #define RTL_CONTAINS_FIELD(Struct, Size, Field) \
697 ( (((PCHAR)(&(Struct)->Field)) + sizeof((Struct)->Field)) <= (((PCHAR)(Struct))+(Size)) )
699 #define RTL_NUMBER_OF_V1(A) (sizeof(A)/sizeof((A)[0]))
702 #define RTL_NUMBER_OF_V2(A) \
703 (({ int _check_array_type[__builtin_types_compatible_p(typeof(A), typeof(&A[0])) ? -1 : 1]; (void)_check_array_type; }), \
706 /// \todo implement security checks for cplusplus / MSVC
707 #define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A)
710 #ifdef ENABLE_RTL_NUMBER_OF_V2
711 #define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V2(A)
713 #define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V1(A)
716 #define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)
717 #define _ARRAYSIZE(A) RTL_NUMBER_OF_V1(A)
719 #define RTL_NUMBER_OF_FIELD(type, field) \
720 (RTL_NUMBER_OF(RTL_FIELD_TYPE(type, field)))
722 #define RTL_PADDING_BETWEEN_FIELDS(type, field1, field2) \
723 ((FIELD_OFFSET(type, field2) > FIELD_OFFSET(type, field1)) \
724 ? (FIELD_OFFSET(type, field2) - FIELD_OFFSET(type, field1) - RTL_FIELD_SIZE(type, field1)) \
725 : (FIELD_OFFSET(type, field1) - FIELD_OFFSET(type, field2) - RTL_FIELD_SIZE(type, field2)))
727 #if defined(__cplusplus)
728 #define RTL_CONST_CAST(type) const_cast<type>
730 #define RTL_CONST_CAST(type) (type)
734 #define DEFINE_ENUM_FLAG_OPERATORS(_ENUMTYPE) \
736 inline _ENUMTYPE operator|(_ENUMTYPE a, _ENUMTYPE b) { return _ENUMTYPE(((int)a) | ((int)b)); } \
737 inline _ENUMTYPE &operator|=(_ENUMTYPE &a, _ENUMTYPE b) { return (_ENUMTYPE &)(((int &)a) |= ((int)b)); } \
738 inline _ENUMTYPE operator&(_ENUMTYPE a, _ENUMTYPE b) { return _ENUMTYPE(((int)a) & ((int)b)); } \
739 inline _ENUMTYPE &operator&=(_ENUMTYPE &a, _ENUMTYPE b) { return (_ENUMTYPE &)(((int &)a) &= ((int)b)); } \
740 inline _ENUMTYPE operator~(_ENUMTYPE a) { return _ENUMTYPE(~((int)a)); } \
741 inline _ENUMTYPE operator^(_ENUMTYPE a, _ENUMTYPE b) { return _ENUMTYPE(((int)a) ^ ((int)b)); } \
742 inline _ENUMTYPE &operator^=(_ENUMTYPE &a, _ENUMTYPE b) { return (_ENUMTYPE &)(((int &)a) ^= ((int)b)); } \
745 #define DEFINE_ENUM_FLAG_OPERATORS(_ENUMTYPE)
748 #define COMPILETIME_OR_2FLAGS(a,b) ((UINT)(a)|(UINT)(b))
749 #define COMPILETIME_OR_3FLAGS(a,b,c) ((UINT)(a)|(UINT)(b)|(UINT)(c))
750 #define COMPILETIME_OR_4FLAGS(a,b,c,d) ((UINT)(a)|(UINT)(b)|(UINT)(c)|(UINT)(d))
751 #define COMPILETIME_OR_5FLAGS(a,b,c,d,e) ((UINT)(a)|(UINT)(b)|(UINT)(c)|(UINT)(d)|(UINT)(e))
756 #define MINSHORT 0x8000
757 #define MAXSHORT 0x7fff
758 #define MINLONG 0x80000000
759 #define MAXLONG 0x7fffffff
761 #define MAXWORD 0xffff
762 #define MAXDWORD 0xffffffff
763 #define MAXLONGLONG (0x7fffffffffffffffLL)
765 /* 32 to 64 bit multiplication. GCC is really bad at optimizing the native math */
766 #if defined(_M_IX86) && defined(__GNUC__) && \
767 !defined(MIDL_PASS)&& !defined(RC_INVOKED) && !defined(_M_CEE_PURE)
768 #define Int32x32To64(a,b) __emul(a,b)
769 #define UInt32x32To64(a,b) __emulu(a,b)
771 #define Int32x32To64(a,b) (((__int64)(long)(a))*((__int64)(long)(b)))
772 #define UInt32x32To64(a,b) ((unsigned __int64)(unsigned int)(a)*(unsigned __int64)(unsigned int)(b))
775 #if defined(MIDL_PASS)|| defined(RC_INVOKED) || defined(_M_CEE_PURE) || defined(_M_ARM)
776 /* Use native math */
777 #define Int64ShllMod32(a,b) ((unsigned __int64)(a)<<(b))
778 #define Int64ShraMod32(a,b) (((__int64)(a))>>(b))
779 #define Int64ShrlMod32(a,b) (((unsigned __int64)(a))>>(b))
782 #define Int64ShllMod32(a,b) __ll_lshift(a,b)
783 #define Int64ShraMod32(a,b) __ll_rshift(a,b)
784 #define Int64ShrlMod32(a,b) __ull_rshift(a,b)
787 #define RotateLeft32 _rotl
788 #define RotateLeft64 _rotl64
789 #define RotateRight32 _rotr
790 #define RotateRight64 _rotr64
792 #if defined(_M_AMD64)
793 #define RotateLeft8 _rotl8
794 #define RotateLeft16 _rotl16
795 #define RotateRight8 _rotr8
796 #define RotateRight16 _rotr16
797 #endif /* _M_AMD64 */
799 /* C_ASSERT Definition */
800 #define C_ASSERT(expr) extern char (*c_assert(void)) [(expr) ? 1 : -1]
802 /* Eliminate Microsoft C/C++ compiler warning 4715 */
803 #if defined(_MSC_VER)
804 #define DEFAULT_UNREACHABLE default: __assume(0)
805 #elif defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5))))
806 #define DEFAULT_UNREACHABLE default: __builtin_unreachable()
808 #define DEFAULT_UNREACHABLE default: break
811 #define VER_WORKSTATION_NT 0x40000000
812 #define VER_SERVER_NT 0x80000000
813 #define VER_SUITE_SMALLBUSINESS 0x00000001
814 #define VER_SUITE_ENTERPRISE 0x00000002
815 #define VER_SUITE_BACKOFFICE 0x00000004
816 #define VER_SUITE_COMMUNICATIONS 0x00000008
817 #define VER_SUITE_TERMINAL 0x00000010
818 #define VER_SUITE_SMALLBUSINESS_RESTRICTED 0x00000020
819 #define VER_SUITE_EMBEDDEDNT 0x00000040
820 #define VER_SUITE_DATACENTER 0x00000080
821 #define VER_SUITE_SINGLEUSERTS 0x00000100
822 #define VER_SUITE_PERSONAL 0x00000200
823 #define VER_SUITE_BLADE 0x00000400
824 #define VER_SUITE_EMBEDDED_RESTRICTED 0x00000800
825 #define VER_SUITE_SECURITY_APPLIANCE 0x00001000
826 #define VER_SUITE_STORAGE_SERVER 0x00002000
827 #define VER_SUITE_COMPUTE_SERVER 0x00004000
828 #define VER_SUITE_WH_SERVER 0x00008000
831 #define PRODUCT_UNDEFINED 0x00000000
832 #define PRODUCT_ULTIMATE 0x00000001
833 #define PRODUCT_HOME_BASIC 0x00000002
834 #define PRODUCT_HOME_PREMIUM 0x00000003
835 #define PRODUCT_ENTERPRISE 0x00000004
836 #define PRODUCT_HOME_BASIC_N 0x00000005
837 #define PRODUCT_BUSINESS 0x00000006
838 #define PRODUCT_STANDARD_SERVER 0x00000007
839 #define PRODUCT_DATACENTER_SERVER 0x00000008
840 #define PRODUCT_SMALLBUSINESS_SERVER 0x00000009
841 #define PRODUCT_ENTERPRISE_SERVER 0x0000000A
842 #define PRODUCT_STARTER 0x0000000B
843 #define PRODUCT_DATACENTER_SERVER_CORE 0x0000000C
844 #define PRODUCT_STANDARD_SERVER_CORE 0x0000000D
845 #define PRODUCT_ENTERPRISE_SERVER_CORE 0x0000000E
846 #define PRODUCT_ENTERPRISE_SERVER_IA64 0x0000000F
847 #define PRODUCT_BUSINESS_N 0x00000010
848 #define PRODUCT_WEB_SERVER 0x00000011
849 #define PRODUCT_CLUSTER_SERVER 0x00000012
850 #define PRODUCT_HOME_SERVER 0x00000013
851 #define PRODUCT_STORAGE_EXPRESS_SERVER 0x00000014
852 #define PRODUCT_STORAGE_STANDARD_SERVER 0x00000015
853 #define PRODUCT_STORAGE_WORKGROUP_SERVER 0x00000016
854 #define PRODUCT_STORAGE_ENTERPRISE_SERVER 0x00000017
855 #define PRODUCT_SERVER_FOR_SMALLBUSINESS 0x00000018
856 #define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM 0x00000019
857 #define PRODUCT_HOME_PREMIUM_N 0x0000001A
858 #define PRODUCT_ENTERPRISE_N 0x0000001B
859 #define PRODUCT_ULTIMATE_N 0x0000001C
860 #define PRODUCT_WEB_SERVER_CORE 0x0000001D
861 #define PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT 0x0000001E
862 #define PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY 0x0000001F
863 #define PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING 0x00000020
864 #define PRODUCT_SERVER_FOUNDATION 0x00000021
865 #define PRODUCT_HOME_PREMIUM_SERVER 0x00000022
866 #define PRODUCT_SERVER_FOR_SMALLBUSINESS_V 0x00000023
867 #define PRODUCT_STANDARD_SERVER_V 0x00000024
868 #define PRODUCT_DATACENTER_SERVER_V 0x00000025
869 #define PRODUCT_ENTERPRISE_SERVER_V 0x00000026
870 #define PRODUCT_DATACENTER_SERVER_CORE_V 0x00000027
871 #define PRODUCT_STANDARD_SERVER_CORE_V 0x00000028
872 #define PRODUCT_ENTERPRISE_SERVER_CORE_V 0x00000029
873 #define PRODUCT_HYPERV 0x0000002A
874 #define PRODUCT_STORAGE_EXPRESS_SERVER_CORE 0x0000002B
875 #define PRODUCT_STORAGE_STANDARD_SERVER_CORE 0x0000002C
876 #define PRODUCT_STORAGE_WORKGROUP_SERVER_CORE 0x0000002D
877 #define PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE 0x0000002E
878 #define PRODUCT_STARTER_N 0x0000002F
879 #define PRODUCT_PROFESSIONAL 0x00000030
880 #define PRODUCT_PROFESSIONAL_N 0x00000031
881 #define PRODUCT_SB_SOLUTION_SERVER 0x00000032
882 #define PRODUCT_SERVER_FOR_SB_SOLUTIONS 0x00000033
883 #define PRODUCT_STANDARD_SERVER_SOLUTIONS 0x00000034
884 #define PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE 0x00000035
885 #define PRODUCT_SB_SOLUTION_SERVER_EM 0x00000036
886 #define PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM 0x00000037
887 #define PRODUCT_SOLUTION_EMBEDDEDSERVER 0x00000038
888 #define PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE 0x00000039
889 #define PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT 0x0000003B
890 #define PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL 0x0000003C
891 #define PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC 0x0000003D
892 #define PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC 0x0000003E
893 #define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE 0x0000003F
894 #define PRODUCT_CLUSTER_SERVER_V 0x00000040
895 #define PRODUCT_EMBEDDED 0x00000041
896 #define PRODUCT_STARTER_E 0x00000042
897 #define PRODUCT_HOME_BASIC_E 0x00000043
898 #define PRODUCT_HOME_PREMIUM_E 0x00000044
899 #define PRODUCT_PROFESSIONAL_E 0x00000045
900 #define PRODUCT_ENTERPRISE_E 0x00000046
901 #define PRODUCT_ULTIMATE_E 0x00000047
902 #define PRODUCT_ENTERPRISE_EVALUATION 0x00000048
903 #define PRODUCT_MULTIPOINT_STANDARD_SERVER 0x0000004C
904 #define PRODUCT_MULTIPOINT_PREMIUM_SERVER 0x0000004D
905 #define PRODUCT_STANDARD_EVALUATION_SERVER 0x0000004F
906 #define PRODUCT_DATACENTER_EVALUATION_SERVER 0x00000050
907 #define PRODUCT_ENTERPRISE_N_EVALUATION 0x00000054
908 #define PRODUCT_EMBEDDED_AUTOMOTIVE 0x00000055
909 #define PRODUCT_EMBEDDED_INDUSTRY_A 0x00000056
910 #define PRODUCT_THINPC 0x00000057
911 #define PRODUCT_EMBEDDED_A 0x00000058
912 #define PRODUCT_EMBEDDED_INDUSTRY 0x00000059
913 #define PRODUCT_EMBEDDED_E 0x0000005A
914 #define PRODUCT_EMBEDDED_INDUSTRY_E 0x0000005B
915 #define PRODUCT_EMBEDDED_INDUSTRY_A_E 0x0000005C
916 #define PRODUCT_STORAGE_WORKGROUP_EVALUATION_SERVER 0x0000005F
917 #define PRODUCT_STORAGE_STANDARD_EVALUATION_SERVER 0x00000060
918 #define PRODUCT_CORE_ARM 0x00000061
919 #define PRODUCT_CORE_N 0x00000062
920 #define PRODUCT_CORE_COUNTRYSPECIFIC 0x00000063
921 #define PRODUCT_CORE_SINGLELANGUAGE 0x00000064
922 #define PRODUCT_CORE 0x00000065
923 #define PRODUCT_PROFESSIONAL_WMC 0x00000067
924 #define PRODUCT_UNLICENSED 0xABCDABCD
927 #define MAKELANGID(p, s) ((((USHORT)(s)) << 10) | (USHORT)(p))
928 #define PRIMARYLANGID(lgid) ((USHORT)(lgid) & 0x3ff)
929 #define SUBLANGID(lgid) ((USHORT)(lgid) >> 10)
930 #define MAKELCID(lgid, srtid) ((DWORD)((((DWORD)((USHORT)(srtid))) << 16) | \
931 ((DWORD)((USHORT)(lgid)))))
932 #define MAKESORTLCID(lgid, srtid, ver) \
933 ((DWORD)((MAKELCID(lgid, srtid)) | \
934 (((DWORD)((USHORT)(ver))) << 20)))
935 #define LANGIDFROMLCID(lcid) ((USHORT)(lcid))
936 #define SORTIDFROMLCID(lcid) ((USHORT)((((DWORD)(lcid)) >> 16) & 0xf))
937 #define SORTVERSIONFROMLCID(lcid) ((USHORT)((((DWORD)(lcid)) >> 20) & 0xf))
939 #define NLS_VALID_LOCALE_MASK 0x000fffff
940 #define LOCALE_NAME_MAX_LENGTH 85
942 /* Primary language IDs. */
943 #define LANG_NEUTRAL 0x00
944 #define LANG_INVARIANT 0x7f
945 #define LANG_AFRIKAANS 0x36
946 #define LANG_ALBANIAN 0x1c
947 #define LANG_ALSATIAN 0x84
948 #define LANG_AMHARIC 0x5e
949 #define LANG_ARABIC 0x01
950 #define LANG_ARMENIAN 0x2b
951 #define LANG_ASSAMESE 0x4d
952 #define LANG_AZERI 0x2c
953 #define LANG_AZERBAIJANI 0x2c
954 #define LANG_BANGLA 0x45
955 #define LANG_BASHKIR 0x6d
956 #define LANG_BASQUE 0x2d
957 #define LANG_BELARUSIAN 0x23
958 #define LANG_BENGALI 0x45
959 #define LANG_BOSNIAN 0x1a
960 #define LANG_BOSNIAN_NEUTRAL 0x781a
961 #define LANG_BRETON 0x7e
962 #define LANG_BULGARIAN 0x02
963 #define LANG_CATALAN 0x03
964 #define LANG_CENTRAL_KURDISH 0x92
965 #define LANG_CHEROKEE 0x5c
966 #define LANG_CHINESE 0x04
967 #define LANG_CHINESE_SIMPLIFIED 0x04
968 #define LANG_CHINESE_TRADITIONAL 0x7c04
969 #define LANG_CORSICAN 0x83
970 #define LANG_CROATIAN 0x1a
971 #define LANG_CZECH 0x05
972 #define LANG_DANISH 0x06
973 #define LANG_DARI 0x8c
974 #define LANG_DIVEHI 0x65
975 #define LANG_DUTCH 0x13
976 #define LANG_ENGLISH 0x09
977 #define LANG_ESTONIAN 0x25
978 #define LANG_FAEROESE 0x38
979 #define LANG_FARSI 0x29
980 #define LANG_FILIPINO 0x64
981 #define LANG_FINNISH 0x0b
982 #define LANG_FRENCH 0x0c
983 #define LANG_FRISIAN 0x62
984 #define LANG_FULAH 0x67
985 #define LANG_GALICIAN 0x56
986 #define LANG_GEORGIAN 0x37
987 #define LANG_GERMAN 0x07
988 #define LANG_GREEK 0x08
989 #define LANG_GREENLANDIC 0x6f
990 #define LANG_GUJARATI 0x47
991 #define LANG_HAUSA 0x68
992 #define LANG_HAWAIIAN 0x75
993 #define LANG_HEBREW 0x0d
994 #define LANG_HINDI 0x39
995 #define LANG_HUNGARIAN 0x0e
996 #define LANG_ICELANDIC 0x0f
997 #define LANG_IGBO 0x70
998 #define LANG_INDONESIAN 0x21
999 #define LANG_INUKTITUT 0x5d
1000 #define LANG_IRISH 0x3c
1001 #define LANG_ITALIAN 0x10
1002 #define LANG_JAPANESE 0x11
1003 #define LANG_KANNADA 0x4b
1004 #define LANG_KASHMIRI 0x60
1005 #define LANG_KAZAK 0x3f
1006 #define LANG_KHMER 0x53
1007 #define LANG_KICHE 0x86
1008 #define LANG_KINYARWANDA 0x87
1009 #define LANG_KONKANI 0x57
1010 #define LANG_KOREAN 0x12
1011 #define LANG_KYRGYZ 0x40
1012 #define LANG_LAO 0x54
1013 #define LANG_LATVIAN 0x26
1014 #define LANG_LITHUANIAN 0x27
1015 #define LANG_LOWER_SORBIAN 0x2e
1016 #define LANG_LUXEMBOURGISH 0x6e
1017 #define LANG_MACEDONIAN 0x2f
1018 #define LANG_MALAY 0x3e
1019 #define LANG_MALAYALAM 0x4c
1020 #define LANG_MALTESE 0x3a
1021 #define LANG_MANIPURI 0x58
1022 #define LANG_MAORI 0x81
1023 #define LANG_MAPUDUNGUN 0x7a
1024 #define LANG_MARATHI 0x4e
1025 #define LANG_MOHAWK 0x7c
1026 #define LANG_MONGOLIAN 0x50
1027 #define LANG_NEPALI 0x61
1028 #define LANG_NORWEGIAN 0x14
1029 #define LANG_OCCITAN 0x82
1030 #define LANG_ODIA 0x48
1031 #define LANG_ORIYA 0x48
1032 #define LANG_PASHTO 0x63
1033 #define LANG_PERSIAN 0x29
1034 #define LANG_POLISH 0x15
1035 #define LANG_PORTUGUESE 0x16
1036 #define LANG_PULAR 0x67
1037 #define LANG_PUNJABI 0x46
1038 #define LANG_QUECHUA 0x6b
1039 #define LANG_ROMANIAN 0x18
1040 #define LANG_ROMANSH 0x17
1041 #define LANG_RUSSIAN 0x19
1042 #define LANG_SAKHA 0x85
1043 #define LANG_SAMI 0x3b
1044 #define LANG_SANSKRIT 0x4f
1045 #define LANG_SCOTTISH_GAELIC 0x91
1046 #define LANG_SERBIAN 0x1a
1047 #define LANG_SERBIAN_NEUTRAL 0x7c1a
1048 #define LANG_SINDHI 0x59
1049 #define LANG_SINHALESE 0x5b
1050 #define LANG_SLOVAK 0x1b
1051 #define LANG_SLOVENIAN 0x24
1052 #define LANG_SOTHO 0x6c
1053 #define LANG_SPANISH 0x0a
1054 #define LANG_SWAHILI 0x41
1055 #define LANG_SWEDISH 0x1d
1056 #define LANG_SYRIAC 0x5a
1057 #define LANG_TAJIK 0x28
1058 #define LANG_TAMAZIGHT 0x5f
1059 #define LANG_TAMIL 0x49
1060 #define LANG_TATAR 0x44
1061 #define LANG_TELUGU 0x4a
1062 #define LANG_THAI 0x1e
1063 #define LANG_TIBETAN 0x51
1064 #define LANG_TIGRIGNA 0x73
1065 #define LANG_TIGRINYA 0x73
1066 #define LANG_TSWANA 0x32
1067 #define LANG_TURKISH 0x1f
1068 #define LANG_TURKMEN 0x42
1069 #define LANG_UIGHUR 0x80
1070 #define LANG_UKRAINIAN 0x22
1071 #define LANG_UPPER_SORBIAN 0x2e
1072 #define LANG_URDU 0x20
1073 #define LANG_UZBEK 0x43
1074 #define LANG_VALENCIAN 0x03
1075 #define LANG_VIETNAMESE 0x2a
1076 #define LANG_WELSH 0x52
1077 #define LANG_WOLOF 0x88
1078 #define LANG_XHOSA 0x34
1079 #define LANG_YAKUT 0x85
1080 #define LANG_YI 0x78
1081 #define LANG_YORUBA 0x6a
1082 #define LANG_ZULU 0x35
1084 #define SUBLANG_NEUTRAL 0x00
1085 #define SUBLANG_DEFAULT 0x01
1086 #define SUBLANG_SYS_DEFAULT 0x02
1087 #define SUBLANG_CUSTOM_DEFAULT 0x03
1088 #define SUBLANG_CUSTOM_UNSPECIFIED 0x04
1089 #define SUBLANG_UI_CUSTOM_DEFAULT 0x05
1090 #define SUBLANG_AFRIKAANS_SOUTH_AFRICA 0x01
1091 #define SUBLANG_ALBANIAN_ALBANIA 0x01
1092 #define SUBLANG_ALSATIAN_FRANCE 0x01
1093 #define SUBLANG_AMHARIC_ETHIOPIA 0x01
1094 #define SUBLANG_ARABIC_SAUDI_ARABIA 0x01
1095 #define SUBLANG_ARABIC_IRAQ 0x02
1096 #define SUBLANG_ARABIC_EGYPT 0x03
1097 #define SUBLANG_ARABIC_LIBYA 0x04
1098 #define SUBLANG_ARABIC_ALGERIA 0x05
1099 #define SUBLANG_ARABIC_MOROCCO 0x06
1100 #define SUBLANG_ARABIC_TUNISIA 0x07
1101 #define SUBLANG_ARABIC_OMAN 0x08
1102 #define SUBLANG_ARABIC_YEMEN 0x09
1103 #define SUBLANG_ARABIC_SYRIA 0x0a
1104 #define SUBLANG_ARABIC_JORDAN 0x0b
1105 #define SUBLANG_ARABIC_LEBANON 0x0c
1106 #define SUBLANG_ARABIC_KUWAIT 0x0d
1107 #define SUBLANG_ARABIC_UAE 0x0e
1108 #define SUBLANG_ARABIC_BAHRAIN 0x0f
1109 #define SUBLANG_ARABIC_QATAR 0x10
1110 #define SUBLANG_ARMENIAN_ARMENIA 0x01
1111 #define SUBLANG_ASSAMESE_INDIA 0x01
1112 #define SUBLANG_AZERI_LATIN 0x01
1113 #define SUBLANG_AZERI_CYRILLIC 0x02
1114 #define SUBLANG_AZERBAIJANI_AZERBAIJAN_LATIN 0x01
1115 #define SUBLANG_AZERBAIJANI_AZERBAIJAN_CYRILLIC 0x02
1116 #define SUBLANG_BANGLA_INDIA 0x01
1117 #define SUBLANG_BANGLA_BANGLADESH 0x02
1118 #define SUBLANG_BASHKIR_RUSSIA 0x01
1119 #define SUBLANG_BASQUE_BASQUE 0x01
1120 #define SUBLANG_BELARUSIAN_BELARUS 0x01
1121 #define SUBLANG_BENGALI_INDIA 0x01
1122 #define SUBLANG_BENGALI_BANGLADESH 0x02
1123 #define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN 0x05
1124 #define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x08
1125 #define SUBLANG_BRETON_FRANCE 0x01
1126 #define SUBLANG_BULGARIAN_BULGARIA 0x01
1127 #define SUBLANG_CATALAN_CATALAN 0x01
1128 #define SUBLANG_CENTRAL_KURDISH_IRAQ 0x01
1129 #define SUBLANG_CHEROKEE_CHEROKEE 0x01
1130 #define SUBLANG_CHINESE_TRADITIONAL 0x01
1131 #define SUBLANG_CHINESE_SIMPLIFIED 0x02
1132 #define SUBLANG_CHINESE_HONGKONG 0x03
1133 #define SUBLANG_CHINESE_SINGAPORE 0x04
1134 #define SUBLANG_CHINESE_MACAU 0x05
1135 #define SUBLANG_CORSICAN_FRANCE 0x01
1136 #define SUBLANG_CZECH_CZECH_REPUBLIC 0x01
1137 #define SUBLANG_CROATIAN_CROATIA 0x01
1138 #define SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN 0x04
1139 #define SUBLANG_DANISH_DENMARK 0x01
1140 #define SUBLANG_DARI_AFGHANISTAN 0x01
1141 #define SUBLANG_DIVEHI_MALDIVES 0x01
1142 #define SUBLANG_DUTCH 0x01
1143 #define SUBLANG_DUTCH_BELGIAN 0x02
1144 #define SUBLANG_ENGLISH_US 0x01
1145 #define SUBLANG_ENGLISH_UK 0x02
1146 #define SUBLANG_ENGLISH_AUS 0x03
1147 #define SUBLANG_ENGLISH_CAN 0x04
1148 #define SUBLANG_ENGLISH_NZ 0x05
1149 #define SUBLANG_ENGLISH_EIRE 0x06
1150 #define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07
1151 #define SUBLANG_ENGLISH_JAMAICA 0x08
1152 #define SUBLANG_ENGLISH_CARIBBEAN 0x09
1153 #define SUBLANG_ENGLISH_BELIZE 0x0a
1154 #define SUBLANG_ENGLISH_TRINIDAD 0x0b
1155 #define SUBLANG_ENGLISH_ZIMBABWE 0x0c
1156 #define SUBLANG_ENGLISH_PHILIPPINES 0x0d
1157 #define SUBLANG_ENGLISH_INDIA 0x10
1158 #define SUBLANG_ENGLISH_MALAYSIA 0x11
1159 #define SUBLANG_ENGLISH_SINGAPORE 0x12
1160 #define SUBLANG_ESTONIAN_ESTONIA 0x01
1161 #define SUBLANG_FAEROESE_FAROE_ISLANDS 0x01
1162 #define SUBLANG_FILIPINO_PHILIPPINES 0x01
1163 #define SUBLANG_FINNISH_FINLAND 0x01
1164 #define SUBLANG_FRENCH 0x01
1165 #define SUBLANG_FRENCH_BELGIAN 0x02
1166 #define SUBLANG_FRENCH_CANADIAN 0x03
1167 #define SUBLANG_FRENCH_SWISS 0x04
1168 #define SUBLANG_FRENCH_LUXEMBOURG 0x05
1169 #define SUBLANG_FRENCH_MONACO 0x06
1170 #define SUBLANG_FRISIAN_NETHERLANDS 0x01
1171 #define SUBLANG_FULAH_SENEGAL 0x02
1172 #define SUBLANG_GALICIAN_GALICIAN 0x01
1173 #define SUBLANG_GEORGIAN_GEORGIA 0x01
1174 #define SUBLANG_GERMAN 0x01
1175 #define SUBLANG_GERMAN_SWISS 0x02
1176 #define SUBLANG_GERMAN_AUSTRIAN 0x03
1177 #define SUBLANG_GERMAN_LUXEMBOURG 0x04
1178 #define SUBLANG_GERMAN_LIECHTENSTEIN 0x05
1179 #define SUBLANG_GREEK_GREECE 0x01
1180 #define SUBLANG_GREENLANDIC_GREENLAND 0x01
1181 #define SUBLANG_GUJARATI_INDIA 0x01
1182 #define SUBLANG_HAUSA_NIGERIA_LATIN 0x01
1183 #define SUBLANG_HAWAIIAN_US 0x01
1184 #define SUBLANG_HEBREW_ISRAEL 0x01
1185 #define SUBLANG_HINDI_INDIA 0x01
1186 #define SUBLANG_HUNGARIAN_HUNGARY 0x01
1187 #define SUBLANG_ICELANDIC_ICELAND 0x01
1188 #define SUBLANG_IGBO_NIGERIA 0x01
1189 #define SUBLANG_INDONESIAN_INDONESIA 0x01
1190 #define SUBLANG_INUKTITUT_CANADA 0x01
1191 #define SUBLANG_INUKTITUT_CANADA_LATIN 0x02
1192 #define SUBLANG_IRISH_IRELAND 0x02
1193 #define SUBLANG_ITALIAN 0x01
1194 #define SUBLANG_ITALIAN_SWISS 0x02
1195 #define SUBLANG_JAPANESE_JAPAN 0x01
1196 #define SUBLANG_KANNADA_INDIA 0x01
1197 #define SUBLANG_KASHMIRI_SASIA 0x02
1198 #define SUBLANG_KASHMIRI_INDIA 0x02
1199 #define SUBLANG_KAZAK_KAZAKHSTAN 0x01
1200 #define SUBLANG_KHMER_CAMBODIA 0x01
1201 #define SUBLANG_KICHE_GUATEMALA 0x01
1202 #define SUBLANG_KINYARWANDA_RWANDA 0x01
1203 #define SUBLANG_KONKANI_INDIA 0x01
1204 #define SUBLANG_KOREAN 0x01
1205 #define SUBLANG_KYRGYZ_KYRGYZSTAN 0x01
1206 #define SUBLANG_LAO_LAO 0x01
1207 #define SUBLANG_LATVIAN_LATVIA 0x01
1208 #define SUBLANG_LITHUANIAN 0x01
1209 #define SUBLANG_LOWER_SORBIAN_GERMANY 0x02
1210 #define SUBLANG_LUXEMBOURGISH_LUXEMBOURG 0x01
1211 #define SUBLANG_MACEDONIAN_MACEDONIA 0x01
1212 #define SUBLANG_MALAY_MALAYSIA 0x01
1213 #define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02
1214 #define SUBLANG_MALAYALAM_INDIA 0x01
1215 #define SUBLANG_MALTESE_MALTA 0x01
1216 #define SUBLANG_MAORI_NEW_ZEALAND 0x01
1217 #define SUBLANG_MAPUDUNGUN_CHILE 0x01
1218 #define SUBLANG_MARATHI_INDIA 0x01
1219 #define SUBLANG_MOHAWK_MOHAWK 0x01
1220 #define SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA 0x01
1221 #define SUBLANG_MONGOLIAN_PRC 0x02
1222 #define SUBLANG_NEPALI_INDIA 0x02
1223 #define SUBLANG_NEPALI_NEPAL 0x01
1224 #define SUBLANG_NORWEGIAN_BOKMAL 0x01
1225 #define SUBLANG_NORWEGIAN_NYNORSK 0x02
1226 #define SUBLANG_OCCITAN_FRANCE 0x01
1227 #define SUBLANG_ODIA_INDIA 0x01
1228 #define SUBLANG_ORIYA_INDIA 0x01
1229 #define SUBLANG_PASHTO_AFGHANISTAN 0x01
1230 #define SUBLANG_PERSIAN_IRAN 0x01
1231 #define SUBLANG_POLISH_POLAND 0x01
1232 #define SUBLANG_PORTUGUESE 0x02
1233 #define SUBLANG_PORTUGUESE_BRAZILIAN 0x01
1234 #define SUBLANG_PULAR_SENEGAL 0x02
1235 #define SUBLANG_PUNJABI_INDIA 0x01
1236 #define SUBLANG_PUNJABI_PAKISTAN 0x02
1237 #define SUBLANG_QUECHUA_BOLIVIA 0x01
1238 #define SUBLANG_QUECHUA_ECUADOR 0x02
1239 #define SUBLANG_QUECHUA_PERU 0x03
1240 #define SUBLANG_ROMANIAN_ROMANIA 0x01
1241 #define SUBLANG_ROMANSH_SWITZERLAND 0x01
1242 #define SUBLANG_RUSSIAN_RUSSIA 0x01
1243 #define SUBLANG_SAKHA_RUSSIA 0x01
1244 #define SUBLANG_SAMI_NORTHERN_NORWAY 0x01
1245 #define SUBLANG_SAMI_NORTHERN_SWEDEN 0x02
1246 #define SUBLANG_SAMI_NORTHERN_FINLAND 0x03
1247 #define SUBLANG_SAMI_LULE_NORWAY 0x04
1248 #define SUBLANG_SAMI_LULE_SWEDEN 0x05
1249 #define SUBLANG_SAMI_SOUTHERN_NORWAY 0x06
1250 #define SUBLANG_SAMI_SOUTHERN_SWEDEN 0x07
1251 #define SUBLANG_SAMI_SKOLT_FINLAND 0x08
1252 #define SUBLANG_SAMI_INARI_FINLAND 0x09
1253 #define SUBLANG_SANSKRIT_INDIA 0x01
1254 #define SUBLANG_SCOTTISH_GAELIC 0x01
1255 #define SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_LATIN 0x06
1256 #define SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x07
1257 #define SUBLANG_SERBIAN_MONTENEGRO_LATIN 0x0b
1258 #define SUBLANG_SERBIAN_MONTENEGRO_CYRILLIC 0x0c
1259 #define SUBLANG_SERBIAN_SERBIA_LATIN 0x09
1260 #define SUBLANG_SERBIAN_SERBIA_CYRILLIC 0x0a
1261 #define SUBLANG_SERBIAN_CROATIA 0x01
1262 #define SUBLANG_SERBIAN_LATIN 0x02
1263 #define SUBLANG_SERBIAN_CYRILLIC 0x03
1264 #define SUBLANG_SINDHI_INDIA 0x01
1265 #define SUBLANG_SINDHI_PAKISTAN 0x02
1266 #define SUBLANG_SINDHI_AFGHANISTAN 0x02
1267 #define SUBLANG_SINHALESE_SRI_LANKA 0x01
1268 #define SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA 0x01
1269 #define SUBLANG_SLOVAK_SLOVAKIA 0x01
1270 #define SUBLANG_SLOVENIAN_SLOVENIA 0x01
1271 #define SUBLANG_SPANISH 0x01
1272 #define SUBLANG_SPANISH_MEXICAN 0x02
1273 #define SUBLANG_SPANISH_MODERN 0x03
1274 #define SUBLANG_SPANISH_GUATEMALA 0x04
1275 #define SUBLANG_SPANISH_COSTA_RICA 0x05
1276 #define SUBLANG_SPANISH_PANAMA 0x06
1277 #define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07
1278 #define SUBLANG_SPANISH_VENEZUELA 0x08
1279 #define SUBLANG_SPANISH_COLOMBIA 0x09
1280 #define SUBLANG_SPANISH_PERU 0x0a
1281 #define SUBLANG_SPANISH_ARGENTINA 0x0b
1282 #define SUBLANG_SPANISH_ECUADOR 0x0c
1283 #define SUBLANG_SPANISH_CHILE 0x0d
1284 #define SUBLANG_SPANISH_URUGUAY 0x0e
1285 #define SUBLANG_SPANISH_PARAGUAY 0x0f
1286 #define SUBLANG_SPANISH_BOLIVIA 0x10
1287 #define SUBLANG_SPANISH_EL_SALVADOR 0x11
1288 #define SUBLANG_SPANISH_HONDURAS 0x12
1289 #define SUBLANG_SPANISH_NICARAGUA 0x13
1290 #define SUBLANG_SPANISH_PUERTO_RICO 0x14
1291 #define SUBLANG_SPANISH_US 0x15
1292 #define SUBLANG_SWAHILI_KENYA 0x01
1293 #define SUBLANG_SWEDISH 0x01
1294 #define SUBLANG_SWEDISH_FINLAND 0x02
1295 #define SUBLANG_SYRIAC_SYRIA 0x01
1296 #define SUBLANG_TAJIK_TAJIKISTAN 0x01
1297 #define SUBLANG_TAMAZIGHT_ALGERIA_LATIN 0x02
1298 #define SUBLANG_TAMAZIGHT_MOROCCO_TIFINAGH 0x04
1299 #define SUBLANG_TAMIL_INDIA 0x01
1300 #define SUBLANG_TAMIL_SRI_LANKA 0x02
1301 #define SUBLANG_TATAR_RUSSIA 0x01
1302 #define SUBLANG_TELUGU_INDIA 0x01
1303 #define SUBLANG_THAI_THAILAND 0x01
1304 #define SUBLANG_TIBETAN_PRC 0x01
1305 #define SUBLANG_TIGRIGNA_ERITREA 0x02
1306 #define SUBLANG_TIGRINYA_ERITREA 0x02
1307 #define SUBLANG_TIGRINYA_ETHIOPIA 0x01
1308 #define SUBLANG_TSWANA_BOTSWANA 0x02
1309 #define SUBLANG_TSWANA_SOUTH_AFRICA 0x01
1310 #define SUBLANG_TURKISH_TURKEY 0x01
1311 #define SUBLANG_TURKMEN_TURKMENISTAN 0x01
1312 #define SUBLANG_UIGHUR_PRC 0x01
1313 #define SUBLANG_UKRAINIAN_UKRAINE 0x01
1314 #define SUBLANG_UPPER_SORBIAN_GERMANY 0x01
1315 #define SUBLANG_URDU_PAKISTAN 0x01
1316 #define SUBLANG_URDU_INDIA 0x02
1317 #define SUBLANG_UZBEK_LATIN 0x01
1318 #define SUBLANG_UZBEK_CYRILLIC 0x02
1319 #define SUBLANG_VALENCIAN_VALENCIA 0x02
1320 #define SUBLANG_VIETNAMESE_VIETNAM 0x01
1321 #define SUBLANG_WELSH_UNITED_KINGDOM 0x01
1322 #define SUBLANG_WOLOF_SENEGAL 0x01
1323 #define SUBLANG_XHOSA_SOUTH_AFRICA 0x01
1324 #define SUBLANG_YAKUT_RUSSIA 0x01
1325 #define SUBLANG_YI_PRC 0x01
1326 #define SUBLANG_YORUBA_NIGERIA 0x01
1327 #define SUBLANG_ZULU_SOUTH_AFRICA 0x01
1329 #define SORT_DEFAULT 0x0
1330 #define SORT_INVARIANT_MATH 0x1
1331 #define SORT_JAPANESE_XJIS 0x0
1332 #define SORT_JAPANESE_UNICODE 0x1
1333 #define SORT_JAPANESE_RADICALSTROKE 0x4
1334 #define SORT_CHINESE_BIG5 0x0
1335 #define SORT_CHINESE_PRCP 0x0
1336 #define SORT_CHINESE_UNICODE 0x1
1337 #define SORT_CHINESE_PRC 0x2
1338 #define SORT_CHINESE_BOPOMOFO 0x3
1339 #define SORT_CHINESE_RADICALSTROKE 0x4
1340 #define SORT_KOREAN_KSC 0x0
1341 #define SORT_KOREAN_UNICODE 0x1
1342 #define SORT_GERMAN_PHONE_BOOK 0x1
1343 #define SORT_HUNGARIAN_DEFAULT 0x0
1344 #define SORT_HUNGARIAN_TECHNICAL 0x1
1345 #define SORT_GEORGIAN_TRADITIONAL 0x0
1346 #define SORT_GEORGIAN_MODERN 0x1
1348 #define LANG_SYSTEM_DEFAULT MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT)
1349 #define LANG_USER_DEFAULT MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT)
1351 #define LOCALE_SYSTEM_DEFAULT MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT)
1352 #define LOCALE_USER_DEFAULT MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT)
1353 #define LOCALE_CUSTOM_DEFAULT MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_CUSTOM_DEFAULT), SORT_DEFAULT)
1354 #define LOCALE_CUSTOM_UNSPECIFIED MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_CUSTOM_UNSPECIFIED), SORT_DEFAULT)
1355 #define LOCALE_CUSTOM_UI_DEFAULT MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_UI_CUSTOM_DEFAULT), SORT_DEFAULT)
1356 #define LOCALE_NEUTRAL MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), SORT_DEFAULT)
1357 #define LOCALE_INVARIANT MAKELCID(MAKELANGID(LANG_INVARIANT, SUBLANG_NEUTRAL), SORT_DEFAULT)
1358 /******************************************************************************
1359 * INTERLOCKED Functions *
1360 ******************************************************************************/
1362 #define BitScanForward _BitScanForward
1363 #define BitScanReverse _BitScanReverse
1364 #define BitTest _bittest
1365 #define BitTestAndComplement _bittestandcomplement
1366 #define BitTestAndSet _bittestandset
1367 #define BitTestAndReset _bittestandreset
1369 #define BitScanForward64 _BitScanForward64
1370 #define BitScanReverse64 _BitScanReverse64
1371 #define BitTest64 _bittest64
1372 #define BitTestAndComplement64 _bittestandcomplement64
1373 #define BitTestAndSet64 _bittestandset64
1374 #define BitTestAndReset64 _bittestandreset64
1377 #if defined(_M_ARM) || defined(_M_IA64)
1378 #define __ACQ_(x) x##_acq
1379 #define __REL_(x) x##_rel
1380 #define __NF_(x) x##_nf
1387 #define InterlockedBitTestAndSet _interlockedbittestandset
1388 #define InterlockedBitTestAndSetAcquire __ACQ_(_interlockedbittestandset)
1389 #define InterlockedBitTestAndSetRelease __REL_(_interlockedbittestandset)
1390 #define InterlockedBitTestAndSetNoFence __NF_(_interlockedbittestandset)
1392 #define InterlockedBitTestAndReset _interlockedbittestandreset
1393 #define InterlockedBitTestAndResetAcquire __ACQ_(_interlockedbittestandreset)
1394 #define InterlockedBitTestAndResetRelease __REL_(_interlockedbittestandreset)
1395 #define InterlockedBitTestAndResetNoFence __NF_(_interlockedbittestandreset)
1398 #define InterlockedBitTestAndSet64 _interlockedbittestandset64
1399 #define InterlockedBitTestAndSet64Acquire __ACQ_(_interlockedbittestandset64)
1400 #define InterlockedBitTestAndSet64Release __REL_(_interlockedbittestandset64)
1401 #define InterlockedBitTestAndSet64NoFence __NF_(_interlockedbittestandset64)
1403 #define InterlockedBitTestAndReset64 _interlockedbittestandreset64
1404 #define InterlockedBitTestAndReset64Acquire __ACQ_(_interlockedbittestandreset64)
1405 #define InterlockedBitTestAndReset64Release __REL_(_interlockedbittestandreset64)
1406 #define InterlockedBitTestAndReset64NoFence __NF_(_interlockedbittestandreset64)
1409 #define InterlockedAdd _InterlockedAdd
1410 #define InterlockedAddAcquire __ACQ_(_InterlockedAdd)
1411 #define InterlockedAddRelease __REL_(_InterlockedAdd)
1412 #define InterlockedAddNoFence __NF_(_InterlockedAdd)
1414 #define InterlockedAdd64 _InterlockedAdd64
1415 #define InterlockedAddAcquire64 __ACQ_(_InterlockedAdd64)
1416 #define InterlockedAddRelease64 __REL_(_InterlockedAdd64)
1417 #define InterlockedAddNoFence64 __NF_(_InterlockedAdd64)
1419 #define InterlockedAnd _InterlockedAnd
1420 #define InterlockedAndAcquire __ACQ_(_InterlockedAnd)
1421 #define InterlockedAndRelease __REL_(_InterlockedAnd)
1422 #define InterlockedAndNoFence __NF_(_InterlockedAnd)
1424 #define InterlockedAnd8 _InterlockedAnd8
1426 #define InterlockedAndAcquire8 _InterlockedAnd8_acq
1427 #define InterlockedAndRelease8 _InterlockedAnd8_rel
1428 #define InterlockedAndNoFence8 _InterlockedAnd8_nf
1429 #elif defined(_M_IA64)
1430 #define InterlockedAnd8Acquire _InterlockedAnd8_acq
1431 #define InterlockedAnd8Release _InterlockedAnd8_rel
1434 #define InterlockedAnd16 _InterlockedAnd16
1436 #define InterlockedAndAcquire16 _InterlockedAnd16_acq
1437 #define InterlockedAndRelease16 _InterlockedAnd16_rel
1438 #define InterlockedAndNoFence16 _InterlockedAnd16_nf
1439 #elif defined(_M_IA64)
1440 #define InterlockedAnd16Acquire _InterlockedAnd16_acq
1441 #define InterlockedAnd16Release _InterlockedAnd16_rel
1444 #define InterlockedAnd64 _InterlockedAnd64
1446 #define InterlockedAndAcquire64 __ACQ_(_InterlockedAnd64)
1447 #define InterlockedAndRelease64 __REL_(_InterlockedAnd64)
1448 #define InterlockedAndNoFence64 __NF_(_InterlockedAnd64)
1450 #define InterlockedAnd64Acquire __ACQ_(_InterlockedAnd64)
1451 #define InterlockedAnd64Release __REL_(_InterlockedAnd64)
1452 #define InterlockedAnd64NoFence __NF_(_InterlockedAnd64)
1456 #define InterlockedAndAffinity InterlockedAnd64
1458 #define InterlockedAndAffinity InterlockedAnd
1461 #define InterlockedCompareExchange _InterlockedCompareExchange
1462 #define InterlockedCompareExchangeAcquire __ACQ_(_InterlockedCompareExchange)
1463 #define InterlockedCompareExchangeRelease __REL_(_InterlockedCompareExchange)
1464 #define InterlockedCompareExchangeNoFence __NF_(_InterlockedCompareExchange)
1466 #define InterlockedCompareExchange16 _InterlockedCompareExchange16
1467 #define InterlockedCompareExchangeAcquire16 __ACQ_(_InterlockedCompareExchange16)
1468 #define InterlockedCompareExchangeRelease16 __REL_(_InterlockedCompareExchange16)
1469 #define InterlockedCompareExchangeNoFence16 __NF_(_InterlockedCompareExchange16)
1471 #define InterlockedCompareExchange64 _InterlockedCompareExchange64
1472 #define InterlockedCompareExchangeAcquire64 __ACQ_(_InterlockedCompareExchange64)
1473 #define InterlockedCompareExchangeRelease64 __REL_(_InterlockedCompareExchange64)
1474 #define InterlockedCompareExchangeNoFence64 __NF_(_InterlockedCompareExchange64)
1477 #define InterlockedCompareExchange128 _InterlockedCompareExchange128
1481 #define InterlockedCompare64Exchange128 _InterlockedCompare64Exchange128
1482 #define InterlockedCompare64ExchangeAcquire128 _InterlockedCompare64Exchange128_acq
1483 #define InterlockedCompare64ExchangeRelease128 _InterlockedCompare64Exchange128_rel
1486 #define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer
1487 #define InterlockedCompareExchangePointerAcquire __ACQ_(_InterlockedCompareExchangePointer)
1488 #define InterlockedCompareExchangePointerRelease __REL_(_InterlockedCompareExchangePointer)
1489 #define InterlockedCompareExchangePointerNoFence __NF_(_InterlockedCompareExchangePointer)
1491 #define InterlockedDecrement _InterlockedDecrement
1492 #define InterlockedDecrementAcquire __ACQ_(_InterlockedDecrement)
1493 #define InterlockedDecrementRelease __REL_(_InterlockedDecrement)
1494 #define InterlockedDecrementNoFence __NF_(_InterlockedDecrement)
1496 #define InterlockedDecrement16 _InterlockedDecrement16
1497 #define InterlockedDecrementAcquire16 __ACQ_(_InterlockedDecrement16)
1498 #define InterlockedDecrementRelease16 __REL_(_InterlockedDecrement16)
1499 #define InterlockedDecrementNoFence16 __NF_(_InterlockedDecrement16)
1501 #define InterlockedDecrement64 _InterlockedDecrement64
1502 #define InterlockedDecrementAcquire64 __ACQ_(_InterlockedDecrement64)
1503 #define InterlockedDecrementRelease64 __REL_(_InterlockedDecrement64)
1504 #define InterlockedDecrementNoFence64 __NF_(_InterlockedDecrement64)
1507 #define InterlockedDecrementSizeT(a) InterlockedDecrement64((LONG64 *)a)
1508 #define InterlockedDecrementSizeTNoFence(a) InterlockedDecrementNoFence64((LONG64 *)a)
1510 #define InterlockedDecrementSizeT(a) InterlockedDecrement((LONG *)a)
1511 #define InterlockedDecrementSizeTNoFence(a) InterlockedDecrementNoFence((LONG *)a)
1514 #define InterlockedExchange _InterlockedExchange
1515 #define InterlockedExchangeAcquire __ACQ_(_InterlockedExchange)
1516 /* No release here */
1517 #define InterlockedExchangeNoFence __NF_(_InterlockedExchange)
1519 #if (_MSC_VER >= 1600)
1520 #define InterlockedExchange8 _InterlockedExchange8
1521 #endif // (_MSC_VER >= 1600)
1523 #define InterlockedExchange16 _InterlockedExchange16
1524 /* No release here */
1525 #define InterlockedExchangeAcquire16 __ACQ_(_InterlockedExchange16)
1526 #define InterlockedExchangeNoFence16 __NF_(_InterlockedExchange16)
1528 #define InterlockedExchange64 _InterlockedExchange64
1529 #define InterlockedExchangeAcquire64 __ACQ_(_InterlockedExchange64)
1530 /* No release here */
1531 #define InterlockedExchangeNoFence64 __NF_(_InterlockedExchange64)
1533 #define InterlockedExchangePointer _InterlockedExchangePointer
1534 #define InterlockedExchangePointerAcquire __ACQ_(_InterlockedExchangePointer)
1535 /* No release here */
1536 #define InterlockedExchangePointerNoFence __NF_(_InterlockedExchangePointer)
1538 #define InterlockedExchangeAdd _InterlockedExchangeAdd
1539 #define InterlockedExchangeAddAcquire __ACQ_(_InterlockedExchangeAdd)
1540 #define InterlockedExchangeAddRelease __REL_(_InterlockedExchangeAdd)
1541 #define InterlockedExchangeAddNoFence __NF_(_InterlockedExchangeAdd)
1543 #define InterlockedExchangeAdd64 _InterlockedExchangeAdd64
1544 #define InterlockedExchangeAddAcquire64 __ACQ_(_InterlockedExchangeAdd64)
1545 #define InterlockedExchangeAddRelease64 __REL_(_InterlockedExchangeAdd64)
1546 #define InterlockedExchangeAddNoFence64 __NF_(_InterlockedExchangeAdd64)
1549 #define InterlockedExchangeAddSizeT(a, b) InterlockedExchangeAdd64((LONG64 *)a, b)
1550 #define InterlockedExchangeAddSizeTAcquire(a, b) InterlockedExchangeAddAcquire64((LONG64 *)a, b)
1551 #define InterlockedExchangeAddSizeTNoFence(a, b) InterlockedExchangeAddNoFence64((LONG64 *)a, b)
1553 #define InterlockedExchangeAddSizeT(a, b) InterlockedExchangeAdd((LONG *)a, b)
1554 #define InterlockedExchangeAddSizeTAcquire(a, b) InterlockedExchangeAddAcquire((LONG *)a, b)
1555 #define InterlockedExchangeAddSizeTNoFence(a, b) InterlockedExchangeAddNoFence((LONG *)a, b)
1558 #define InterlockedIncrement _InterlockedIncrement
1559 #define InterlockedIncrementAcquire __ACQ_(_InterlockedIncrement)
1560 #define InterlockedIncrementRelease __REL_(_InterlockedIncrement)
1561 #define InterlockedIncrementNoFence __NF_(_InterlockedIncrement)
1563 #define InterlockedIncrement16 _InterlockedIncrement16
1564 #define InterlockedIncrementAcquire16 __ACQ_(_InterlockedIncrement16)
1565 #define InterlockedIncrementRelease16 __REL_(_InterlockedIncrement16)
1566 #define InterlockedIncrementNoFence16 __NF_(_InterlockedIncrement16)
1568 #define InterlockedIncrement64 _InterlockedIncrement64
1569 #define InterlockedIncrementAcquire64 __ACQ_(_InterlockedIncrement64)
1570 #define InterlockedIncrementRelease64 __REL_(_InterlockedIncrement64)
1571 #define InterlockedIncrementNoFence64 __NF_(_InterlockedIncrement64)
1574 #define InterlockedIncrementSizeT(a) InterlockedIncrement64((LONG64 *)a)
1575 #define InterlockedIncrementSizeTNoFence(a) InterlockedIncrementNoFence64((LONG64 *)a)
1577 #define InterlockedIncrementSizeT(a) InterlockedIncrement((LONG *)a)
1578 #define InterlockedIncrementSizeTNoFence(a) InterlockedIncrementNoFence((LONG *)a)
1581 #define InterlockedOr _InterlockedOr
1582 #define InterlockedOrAcquire __ACQ_(_InterlockedOr)
1583 #define InterlockedOrRelease __REL_(_InterlockedOr)
1584 #define InterlockedOrNoFence __NF_(_InterlockedOr)
1586 #define InterlockedOr8 _InterlockedOr8
1588 #define InterlockedOrAcquire8 _InterlockedOr8_acq
1589 #define InterlockedOrRelease8 _InterlockedOr8_rel
1590 #define InterlockedOrNoFence8 _InterlockedOr8_nf
1591 #elif defined(_M_IA64)
1592 #define InterlockedOr8Acquire _InterlockedOr8_acq
1593 #define InterlockedOr8Release _InterlockedOr8_rel
1596 #define InterlockedOr16 _InterlockedOr16
1598 #define InterlockedOrAcquire16 _InterlockedOr16_acq
1599 #define InterlockedOrRelease16 _InterlockedOr16_rel
1600 #define InterlockedOrNoFence16 _InterlockedOr16_nf
1601 #elif defined(_M_IA64)
1602 #define InterlockedOr16Acquire _InterlockedOr16_acq
1603 #define InterlockedOr16Release _InterlockedOr16_rel
1606 #define InterlockedOr64 _InterlockedOr64
1608 #define InterlockedOrAcquire64 _InterlockedOr64_acq
1609 #define InterlockedOrRelease64 _InterlockedOr64_rel
1610 #define InterlockedOrNoFence64 _InterlockedOr64_nf
1611 #elif defined(_M_IA64) || defined(_M_AMD64)
1612 #define InterlockedOr64Acquire __ACQ_(_InterlockedOr64)
1613 #define InterlockedOr64Release __REL_(_InterlockedOr64)
1614 #define InterlockedOr64NoFence __NF_(_InterlockedOr64)
1618 #define InterlockedOrAffinity InterlockedOr64
1620 #define InterlockedOrAffinity InterlockedOr
1623 #define InterlockedXor _InterlockedXor
1624 #define InterlockedXorAcquire __ACQ_(_InterlockedXor)
1625 #define InterlockedXorRelease __REL_(_InterlockedXor)
1626 #define InterlockedXorNoFence __NF_(_InterlockedXor)
1628 #define InterlockedXor8 _InterlockedXor8
1630 #define InterlockedXorAcquire8 _InterlockedXor8_acq
1631 #define InterlockedXorRelease8 _InterlockedXor8_rel
1632 #define InterlockedXorNoFence8 _InterlockedXor8_nf
1633 #elif defined(_M_IA64)
1634 #define InterlockedXor8Acquire _InterlockedXor8_acq
1635 #define InterlockedXor8Release _InterlockedXor8_rel
1638 #define InterlockedXor16 _InterlockedXor16
1640 #define InterlockedXorAcquire16 _InterlockedXor16_acq
1641 #define InterlockedXorRelease16 _InterlockedXor16_rel
1642 #define InterlockedXorNoFence16 _InterlockedXor16_nf
1643 #elif defined(_M_IA64)
1644 #define InterlockedXor16Acquire _InterlockedXor16_acq
1645 #define InterlockedXor16Release _InterlockedXor16_rel
1648 #define InterlockedXor64 _InterlockedXor64
1650 #define InterlockedXorAcquire64 _InterlockedXor64_acq
1651 #define InterlockedXorRelease64 _InterlockedXor64_rel
1652 #define InterlockedXorNoFence64 _InterlockedXor64_nf
1653 #elif defined(_M_IA64) || defined(_M_AMD64)
1654 #define InterlockedXor64Acquire __ACQ_(_InterlockedXor64)
1655 #define InterlockedXor64Release __REL_(_InterlockedXor64)
1656 #define InterlockedXor64NoFence __NF_(_InterlockedXor64)
1663 _InterlockedExchange64(
1664 _Inout_ _Interlocked_operand_
volatile LONG64
*Target
,
1668 for (Old
= *Target
; ; Old
= Prev
)
1670 Prev
= _InterlockedCompareExchange64(Target
, Value
, Old
);
1679 _Inout_ _Interlocked_operand_
volatile LONG64
*Target
,
1682 LONG64 Old
, Prev
, New
;
1683 for (Old
= *Target
; ; Old
= Prev
)
1686 Prev
= _InterlockedCompareExchange64(Target
, New
, Old
);
1694 _InterlockedExchangeAdd64 (
1695 _Inout_ _Interlocked_operand_
volatile LONG64
*Target
,
1699 LONG64 Old
, Prev
, New
;
1700 for (Old
= *Target
; ; Old
= Prev
)
1703 Prev
= _InterlockedCompareExchange64(Target
, New
, Old
);
1712 _Inout_ _Interlocked_operand_
volatile LONG64
*Target
,
1715 LONG64 Old
, Prev
, New
;
1716 for (Old
= *Target
; ; Old
= Prev
)
1719 Prev
= _InterlockedCompareExchange64(Target
, New
, Old
);
1728 _Inout_ _Interlocked_operand_
volatile LONG64
*Target
,
1731 LONG64 Old
, Prev
, New
;
1732 for (Old
= *Target
; ; Old
= Prev
)
1735 Prev
= _InterlockedCompareExchange64(Target
, New
, Old
);
1744 _Inout_ _Interlocked_operand_
volatile LONG64
*Target
,
1747 LONG64 Old
, Prev
, New
;
1748 for (Old
= *Target
; ; Old
= Prev
)
1751 Prev
= _InterlockedCompareExchange64(Target
, New
, Old
);
1759 _InterlockedIncrement64(
1760 _Inout_ _Interlocked_operand_
volatile LONG64
*Target
)
1762 return _InterlockedAdd64(Target
, 1);
1767 _InterlockedDecrement64(
1768 _Inout_ _Interlocked_operand_
volatile LONG64
*Target
)
1770 return _InterlockedAdd64(Target
, -1);
1773 #undef _InterlockedExchangePointer
1774 #define _InterlockedExchangePointer _InlineInterlockedExchangePointer
1776 _Ret_writes_(_Inexpressible_(Unknown
))
1778 _InterlockedExchangePointer(
1779 _Inout_
_At_(*Destination
, _Pre_writable_byte_size_(_Inexpressible_(Unknown
))
1780 _Post_writable_byte_size_(_Inexpressible_(Unknown
)))
1781 _Interlocked_operand_
volatile PVOID
*Destination
,
1782 _In_opt_ PVOID Value
)
1784 return (PVOID
)InterlockedExchange((volatile long *)Destination
, (long)Value
);
1787 #undef _InterlockedCompareExchangePointer
1788 #define _InterlockedCompareExchangePointer _InlineInterlockedCompareExchangePointer
1790 _Ret_writes_(_Inexpressible_(Unknown
))
1792 _InterlockedCompareExchangePointer(
1793 _Inout_
_At_(*Destination
, _Pre_writable_byte_size_(_Inexpressible_(Unknown
))
1794 _Post_writable_byte_size_(_Inexpressible_(Unknown
)))
1795 _Interlocked_operand_
volatile PVOID
*Destination
,
1796 _In_opt_ PVOID ExChange
,
1797 _In_opt_ PVOID Comperand
)
1799 return (PVOID
)InterlockedCompareExchange((volatile long *)Destination
,
1804 #endif /* _M_IX86 */
1811 _Inout_ _Interlocked_operand_
volatile LONG64
*Target
,
1815 return _InterlockedExchangeAdd64(Target
, Value
) + Value
;
1818 #endif /* _M_AMD64 */
1822 #undef _InterlockedBitTestAndSet
1823 #define _InterlockedBitTestAndSet InterlockedBitTestAndSet_Inline
1826 _InterlockedBitTestAndSet(
1827 _Inout_ _Interlocked_operand_
volatile LONG
*Target
,
1830 ULONG Mask
= 1 << (Bit
& 31);
1831 return (BOOLEAN
)((InterlockedOr(&Target
[Bit
/ 32], Mask
) & Mask
) != 0);
1834 #undef _InterlockedBitTestAndReset
1835 #define _InterlockedBitTestAndReset InterlockedBitTestAndReset_Inline
1838 _InterlockedBitTestAndReset(
1839 _Inout_ _Interlocked_operand_
volatile LONG
*Target
,
1842 ULONG Mask
= 1 << (Bit
& 31);
1843 return (BOOLEAN
)((InterlockedAnd(&Target
[Bit
/ 32], ~Mask
) & Mask
) != 0);
1846 #undef _InterlockedBitTestAndSet64
1847 #define _InterlockedBitTestAndSet64 InterlockedBitTestAndSet64_Inline
1850 _InterlockedBitTestAndSet64(
1851 _Inout_ _Interlocked_operand_
volatile LONG64
*Target
,
1854 ULONG64 Mask
= 1LL << (Bit
& 63);
1855 return (BOOLEAN
)((InterlockedOr64(&Target
[Bit
/ 64], Mask
) & Mask
) != 0);
1858 #undef _InterlockedBitTestAndReset64
1859 #define _InterlockedBitTestAndReset64 InterlockedBitTestAndReset64_Inline
1862 _InterlockedBitTestAndReset64(
1863 _Inout_ _Interlocked_operand_
volatile LONG64
*Target
,
1866 ULONG64 Mask
= 1LL << (Bit
& 63);
1867 return (BOOLEAN
)((InterlockedAnd64(&Target
[Bit
/ 64], ~Mask
) & Mask
) != 0);
1870 #undef _InterlockedBitTestAndComplement
1871 #define _InterlockedBitTestAndComplement InterlockedBitTestAndComplement_Inline
1874 _InterlockedBitTestAndComplement(
1875 _Inout_ _Interlocked_operand_
volatile LONG
*Target
,
1878 ULONG Mask
= 1 << (Bit
& 31);
1879 return (BOOLEAN
)((InterlockedXor(&Target
[Bit
/ 32], Mask
) & Mask
) != 0);
1882 #undef _InterlockedBitTestAndComplement64
1883 #define _InterlockedBitTestAndComplement64 InterlockedBitTestAndComplement64_Inline
1886 _InterlockedBitTestAndComplement64(
1887 _Inout_ _Interlocked_operand_
volatile LONG64
*Target
,
1890 ULONG64 Mask
= 1LL << (Bit
& 63);
1891 return (BOOLEAN
)((InterlockedXor64(&Target
[Bit
/ 64], Mask
) & Mask
) != 0);
1897 #if defined(__ROS_LONG64__)
1898 #undef InterlockedExchange
1899 #define InterlockedExchange(a,b) _InterlockedExchange((long*)a,b)
1900 #undef InterlockedExchangeAdd
1901 #define InterlockedExchangeAdd(a,b) _InterlockedExchangeAdd((long*)a,b)
1902 #undef InterlockedCompareExchange
1903 #define InterlockedCompareExchange(a,b,c) _InterlockedCompareExchange((long*)a,b,c)
1904 #undef InterlockedIncrement
1905 #define InterlockedIncrement(a) _InterlockedIncrement((long*)a)
1906 #undef InterlockedDecrement
1907 #define InterlockedDecrement(a) _InterlockedDecrement((long*)a)
1910 #undef __C89_NAMELESS
1911 #undef __C89_NAMELESSSTRUCTNAME
1912 #undef __C89_NAMELESSSTRUCTNAME1
1913 #undef __C89_NAMELESSSTRUCTNAME2
1914 #undef __C89_NAMELESSSTRUCTNAME3
1915 #undef __C89_NAMELESSSTRUCTNAME4
1916 #undef __C89_NAMELESSSTRUCTNAME5
1917 #undef __C89_NAMELESSUNIONNAME
1918 #undef __C89_NAMELESSUNIONNAME1
1919 #undef __C89_NAMELESSUNIONNAME2
1920 #undef __C89_NAMELESSUNIONNAME3
1921 #undef __C89_NAMELESSUNIONNAME4
1922 #undef __C89_NAMELESSUNIONNAME5
1923 #undef __C89_NAMELESSUNIONNAME6
1924 #undef __C89_NAMELESSUNIONNAME7
1925 #undef __C89_NAMELESSUNIONNAME8
1927 #if !defined(__WINESRC__) && !defined(WINE_NO_NAMELESS_EXTENSION)
1929 /* Anonymous structs support starts with gcc 2.96/g++ 2.95 */
1930 # if (__GNUC__ > 2) || ((__GNUC__ == 2) && ((__GNUC_MINOR__ > 95) || ((__GNUC_MINOR__ == 95) && defined(__cplusplus))))
1931 # define __C89_NAMELESS __extension__
1933 # elif defined(_MSC_VER)
1934 # define __C89_NAMELESS
1938 #ifdef __C89_NAMELESS
1939 # define __C89_NAMELESSSTRUCTNAME
1940 # define __C89_NAMELESSSTRUCTNAME1
1941 # define __C89_NAMELESSSTRUCTNAME2
1942 # define __C89_NAMELESSSTRUCTNAME3
1943 # define __C89_NAMELESSSTRUCTNAME4
1944 # define __C89_NAMELESSSTRUCTNAME5
1945 # define __C89_NAMELESSUNIONNAME
1946 # define __C89_NAMELESSUNIONNAME1
1947 # define __C89_NAMELESSUNIONNAME2
1948 # define __C89_NAMELESSUNIONNAME3
1949 # define __C89_NAMELESSUNIONNAME4
1950 # define __C89_NAMELESSUNIONNAME5
1951 # define __C89_NAMELESSUNIONNAME6
1952 # define __C89_NAMELESSUNIONNAME7
1953 # define __C89_NAMELESSUNIONNAME8
1955 # define __C89_NAMELESS
1956 # define __C89_NAMELESSSTRUCTNAME DUMMYSTRUCTNAME
1957 # define __C89_NAMELESSSTRUCTNAME1 DUMMYSTRUCTNAME1
1958 # define __C89_NAMELESSSTRUCTNAME2 DUMMYSTRUCTNAME2
1959 # define __C89_NAMELESSSTRUCTNAME3 DUMMYSTRUCTNAME3
1960 # define __C89_NAMELESSSTRUCTNAME4 DUMMYSTRUCTNAME4
1961 # define __C89_NAMELESSSTRUCTNAME5 DUMMYSTRUCTNAME5
1962 # define __C89_NAMELESSUNIONNAME DUMMYUNIONNAME
1963 # define __C89_NAMELESSUNIONNAME1 DUMMYUNIONNAME1
1964 # define __C89_NAMELESSUNIONNAME2 DUMMYUNIONNAME2
1965 # define __C89_NAMELESSUNIONNAME3 DUMMYUNIONNAME3
1966 # define __C89_NAMELESSUNIONNAME4 DUMMYUNIONNAME4
1967 # define __C89_NAMELESSUNIONNAME5 DUMMYUNIONNAME5
1968 # define __C89_NAMELESSUNIONNAME6 DUMMYUNIONNAME6
1969 # define __C89_NAMELESSUNIONNAME7 DUMMYUNIONNAME7
1970 # define __C89_NAMELESSUNIONNAME8 DUMMYUNIONNAME8
1973 #define DECLSPEC_HIDDEN
1976 #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3)))
1977 # define __WINE_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
1979 # define __WINE_ALLOC_SIZE(x)
1984 # define _HAVE_INT64
1985 # ifndef _INTEGRAL_MAX_BITS
1986 # define _INTEGRAL_MAX_BITS 64
1989 # define __int64 long long
1990 #elif (defined(__WATCOMC__) || defined(_MSC_VER)) && (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 64 )
1991 # define _HAVE_INT64
1992 #endif /* __GNUC__/__WATCOMC */
1995 # pragma warning(push)
1996 # pragma warning(disable:4201)
1997 # pragma warning(disable:4214)
1998 # pragma warning(disable:4820)
2001 #define ACE_OBJECT_TYPE_PRESENT 0x00000001
2002 #define ACE_INHERITED_OBJECT_TYPE_PRESENT 0x00000002
2004 /* also in ddk/ntifs.h */
2005 #define COMPRESSION_FORMAT_NONE (0x0000)
2006 #define COMPRESSION_FORMAT_DEFAULT (0x0001)
2007 #define COMPRESSION_FORMAT_LZNT1 (0x0002)
2008 #define COMPRESSION_ENGINE_STANDARD (0x0000)
2009 #define COMPRESSION_ENGINE_MAXIMUM (0x0100)
2010 #define COMPRESSION_ENGINE_HIBER (0x0200)
2011 #define ACCESS_ALLOWED_ACE_TYPE (0x0)
2012 #define ACCESS_DENIED_ACE_TYPE (0x1)
2013 #define SYSTEM_AUDIT_ACE_TYPE (0x2)
2014 #define SYSTEM_ALARM_ACE_TYPE (0x3)
2017 #define REG_STANDARD_FORMAT 1
2018 #define REG_LATEST_FORMAT 2
2019 #define REG_NO_COMPRESSION 4
2021 #ifndef WIN32_NO_STATUS
2023 #define STATUS_WAIT_0 ((DWORD)0x00000000)
2024 #define STATUS_ABANDONED_WAIT_0 ((DWORD)0x00000080)
2025 #define STATUS_USER_APC ((DWORD)0x000000C0)
2026 #define STATUS_TIMEOUT ((DWORD)0x00000102)
2027 #define STATUS_PENDING ((DWORD)0x00000103)
2028 #define STATUS_SEGMENT_NOTIFICATION ((DWORD)0x40000005)
2029 #define STATUS_GUARD_PAGE_VIOLATION ((DWORD)0x80000001)
2030 #define STATUS_DATATYPE_MISALIGNMENT ((DWORD)0x80000002)
2031 #define STATUS_BREAKPOINT ((DWORD)0x80000003)
2032 #define STATUS_SINGLE_STEP ((DWORD)0x80000004)
2033 #define STATUS_ACCESS_VIOLATION ((DWORD)0xC0000005)
2034 #define STATUS_IN_PAGE_ERROR ((DWORD)0xC0000006)
2035 #define STATUS_INVALID_HANDLE ((DWORD)0xC0000008)
2036 #define STATUS_NO_MEMORY ((DWORD)0xC0000017)
2037 #define STATUS_ILLEGAL_INSTRUCTION ((DWORD)0xC000001D)
2038 #define STATUS_NONCONTINUABLE_EXCEPTION ((DWORD)0xC0000025)
2039 #define STATUS_INVALID_DISPOSITION ((DWORD)0xC0000026)
2040 #define STATUS_ARRAY_BOUNDS_EXCEEDED ((DWORD)0xC000008C)
2041 #define STATUS_FLOAT_DENORMAL_OPERAND ((DWORD)0xC000008D)
2042 #define STATUS_FLOAT_DIVIDE_BY_ZERO ((DWORD)0xC000008E)
2043 #define STATUS_FLOAT_INEXACT_RESULT ((DWORD)0xC000008F)
2044 #define STATUS_FLOAT_INVALID_OPERATION ((DWORD)0xC0000090)
2045 #define STATUS_FLOAT_OVERFLOW ((DWORD)0xC0000091)
2046 #define STATUS_FLOAT_STACK_CHECK ((DWORD)0xC0000092)
2047 #define STATUS_FLOAT_UNDERFLOW ((DWORD)0xC0000093)
2048 #define STATUS_INTEGER_DIVIDE_BY_ZERO ((DWORD)0xC0000094)
2049 #define STATUS_INTEGER_OVERFLOW ((DWORD)0xC0000095)
2050 #define STATUS_PRIVILEGED_INSTRUCTION ((DWORD)0xC0000096)
2051 #define STATUS_STACK_OVERFLOW ((DWORD)0xC00000FD)
2052 #define STATUS_CONTROL_C_EXIT ((DWORD)0xC000013A)
2053 #define STATUS_FLOAT_MULTIPLE_FAULTS ((DWORD)0xC00002B4)
2054 #define STATUS_FLOAT_MULTIPLE_TRAPS ((DWORD)0xC00002B5)
2055 #define STATUS_REG_NAT_CONSUMPTION ((DWORD)0xC00002C9)
2056 #define STATUS_SXS_EARLY_DEACTIVATION ((DWORD)0xC015000F)
2057 #define STATUS_SXS_INVALID_DEACTIVATION ((DWORD)0xC0150010)
2059 #define DBG_EXCEPTION_HANDLED ((DWORD)0x00010001)
2060 #define DBG_CONTINUE ((DWORD)0x00010002)
2061 #define DBG_TERMINATE_THREAD ((DWORD)0x40010003)
2062 #define DBG_TERMINATE_PROCESS ((DWORD)0x40010004)
2063 #define DBG_CONTROL_C ((DWORD)0x40010005)
2064 #define DBG_CONTROL_BREAK ((DWORD)0x40010008)
2065 #define DBG_COMMAND_EXCEPTION ((DWORD)0x40010009)
2066 #define DBG_EXCEPTION_NOT_HANDLED ((DWORD)0x80010001)
2068 #endif /* WIN32_NO_STATUS */
2070 #define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
2072 /* Also in ddk/winddk.h */
2073 #define FILE_LIST_DIRECTORY 0x00000001
2074 #define FILE_READ_DATA 0x00000001
2075 #define FILE_ADD_FILE 0x00000002
2076 #define FILE_WRITE_DATA 0x00000002
2077 #define FILE_ADD_SUBDIRECTORY 0x00000004
2078 #define FILE_APPEND_DATA 0x00000004
2079 #define FILE_CREATE_PIPE_INSTANCE 0x00000004
2080 #define FILE_READ_EA 0x00000008
2081 #define FILE_READ_PROPERTIES 0x00000008
2082 #define FILE_WRITE_EA 0x00000010
2083 #define FILE_WRITE_PROPERTIES 0x00000010
2084 #define FILE_EXECUTE 0x00000020
2085 #define FILE_TRAVERSE 0x00000020
2086 #define FILE_DELETE_CHILD 0x00000040
2087 #define FILE_READ_ATTRIBUTES 0x00000080
2088 #define FILE_WRITE_ATTRIBUTES 0x00000100
2090 #define FILE_SHARE_READ 0x00000001
2091 #define FILE_SHARE_WRITE 0x00000002
2092 #define FILE_SHARE_DELETE 0x00000004
2093 #define FILE_SHARE_VALID_FLAGS 0x00000007
2095 #define FILE_ATTRIBUTE_READONLY 0x00000001
2096 #define FILE_ATTRIBUTE_HIDDEN 0x00000002
2097 #define FILE_ATTRIBUTE_SYSTEM 0x00000004
2098 #define FILE_ATTRIBUTE_DIRECTORY 0x00000010
2099 #define FILE_ATTRIBUTE_ARCHIVE 0x00000020
2100 #define FILE_ATTRIBUTE_DEVICE 0x00000040
2101 #define FILE_ATTRIBUTE_NORMAL 0x00000080
2102 #define FILE_ATTRIBUTE_TEMPORARY 0x00000100
2103 #define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200
2104 #define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400
2105 #define FILE_ATTRIBUTE_COMPRESSED 0x00000800
2106 #define FILE_ATTRIBUTE_OFFLINE 0x00001000
2107 #define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
2108 #define FILE_ATTRIBUTE_ENCRYPTED 0x00004000
2109 #define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7
2110 #define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7
2112 #define FILE_COPY_STRUCTURED_STORAGE 0x00000041
2113 #define FILE_STRUCTURED_STORAGE 0x00000441
2115 #define FILE_VALID_OPTION_FLAGS 0x00ffffff
2116 #define FILE_VALID_PIPE_OPTION_FLAGS 0x00000032
2117 #define FILE_VALID_MAILSLOT_OPTION_FLAGS 0x00000032
2118 #define FILE_VALID_SET_FLAGS 0x00000036
2120 #define FILE_DIRECTORY_FILE 0x00000001
2121 #define FILE_WRITE_THROUGH 0x00000002
2122 #define FILE_SEQUENTIAL_ONLY 0x00000004
2123 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
2124 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
2125 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
2126 #define FILE_NON_DIRECTORY_FILE 0x00000040
2127 #define FILE_CREATE_TREE_CONNECTION 0x00000080
2128 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100
2129 #define FILE_NO_EA_KNOWLEDGE 0x00000200
2130 #define FILE_OPEN_REMOTE_INSTANCE 0x00000400
2131 #define FILE_RANDOM_ACCESS 0x00000800
2132 #define FILE_DELETE_ON_CLOSE 0x00001000
2133 #define FILE_OPEN_BY_FILE_ID 0x00002000
2134 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
2135 #define FILE_NO_COMPRESSION 0x00008000
2136 #define FILE_RESERVE_OPFILTER 0x00100000
2137 #define FILE_OPEN_REPARSE_POINT 0x00200000
2138 #define FILE_OPEN_NO_RECALL 0x00400000
2139 #define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000
2141 #define FILE_ALL_ACCESS \
2142 (STANDARD_RIGHTS_REQUIRED | \
2146 #define FILE_GENERIC_EXECUTE \
2147 (STANDARD_RIGHTS_EXECUTE | \
2148 FILE_READ_ATTRIBUTES | \
2152 #define FILE_GENERIC_READ \
2153 (STANDARD_RIGHTS_READ | \
2155 FILE_READ_ATTRIBUTES | \
2159 #define FILE_GENERIC_WRITE \
2160 (STANDARD_RIGHTS_WRITE | \
2162 FILE_WRITE_ATTRIBUTES | \
2164 FILE_APPEND_DATA | \
2167 /* also in ddk/ntifs.h */
2168 #define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001
2169 #define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002
2170 #define FILE_NOTIFY_CHANGE_NAME 0x00000003
2171 #define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004
2172 #define FILE_NOTIFY_CHANGE_SIZE 0x00000008
2173 #define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010
2174 #define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020
2175 #define FILE_NOTIFY_CHANGE_CREATION 0x00000040
2176 #define FILE_NOTIFY_CHANGE_EA 0x00000080
2177 #define FILE_NOTIFY_CHANGE_SECURITY 0x00000100
2178 #define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200
2179 #define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400
2180 #define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800
2181 #define FILE_NOTIFY_VALID_MASK 0x00000fff
2183 #define FILE_CASE_SENSITIVE_SEARCH 0x00000001
2184 #define FILE_CASE_PRESERVED_NAMES 0x00000002
2185 #define FILE_UNICODE_ON_DISK 0x00000004
2186 #define FILE_PERSISTENT_ACLS 0x00000008
2187 #define FILE_FILE_COMPRESSION 0x00000010
2188 #define FILE_VOLUME_QUOTAS 0x00000020
2189 #define FILE_SUPPORTS_SPARSE_FILES 0x00000040
2190 #define FILE_SUPPORTS_REPARSE_POINTS 0x00000080
2191 #define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100
2192 #define FS_LFN_APIS 0x00004000
2193 #define FILE_VOLUME_IS_COMPRESSED 0x00008000
2194 #define FILE_SUPPORTS_OBJECT_IDS 0x00010000
2195 #define FILE_SUPPORTS_ENCRYPTION 0x00020000
2196 #define FILE_NAMED_STREAMS 0x00040000
2198 #define IO_COMPLETION_QUERY_STATE 0x0001
2199 #define IO_COMPLETION_MODIFY_STATE 0x0002
2200 #define IO_COMPLETION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3)
2203 /* also in ddk/winddk.h */
2204 #define DUPLICATE_CLOSE_SOURCE 0x00000001
2205 #define DUPLICATE_SAME_ACCESS 0x00000002
2208 #define MAILSLOT_NO_MESSAGE ((DWORD)-1)
2209 #define MAILSLOT_WAIT_FOREVER ((DWORD)-1)
2210 #define PROCESS_TERMINATE 1
2211 #define PROCESS_CREATE_THREAD 2
2212 #define PROCESS_SET_SESSIONID 4
2213 #define PROCESS_VM_OPERATION 8
2214 #define PROCESS_VM_READ 16
2215 #define PROCESS_VM_WRITE 32
2216 #define PROCESS_CREATE_PROCESS 128
2217 #define PROCESS_SET_QUOTA 256
2218 #define PROCESS_SET_INFORMATION 512
2219 #define PROCESS_QUERY_INFORMATION 1024
2220 #define PROCESS_SUSPEND_RESUME 2048
2221 #define PROCESS_QUERY_LIMITED_INFORMATION 0x1000
2222 #define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0xFFF)
2223 #define PROCESS_DUP_HANDLE 64
2224 #define THREAD_TERMINATE 1
2225 #define THREAD_SUSPEND_RESUME 2
2226 #define THREAD_GET_CONTEXT 8
2227 #define THREAD_SET_CONTEXT 16
2228 #define THREAD_SET_INFORMATION 32
2229 #define THREAD_QUERY_INFORMATION 64
2230 #define THREAD_SET_THREAD_TOKEN 128
2231 #define THREAD_IMPERSONATE 256
2232 #define THREAD_DIRECT_IMPERSONATION 0x200
2233 #define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3FF)
2234 #define MUTANT_QUERY_STATE 0x0001
2235 #define MUTANT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|MUTANT_QUERY_STATE)
2236 #define TIMER_QUERY_STATE 0x0001
2237 #define TIMER_MODIFY_STATE 0x0002
2238 #define TIMER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|TIMER_QUERY_STATE|TIMER_MODIFY_STATE)
2239 #define THREAD_BASE_PRIORITY_LOWRT 15
2240 #define THREAD_BASE_PRIORITY_MAX 2
2241 #define THREAD_BASE_PRIORITY_MIN (-2)
2242 #define THREAD_BASE_PRIORITY_IDLE (-15)
2244 #define PROCESS_SET_LIMITED_INFORMATION 0x2000
2245 #define THREAD_RESUME 0x1000
2247 #define SE_CREATE_TOKEN_NAME TEXT("SeCreateTokenPrivilege")
2248 #define SE_ASSIGNPRIMARYTOKEN_NAME TEXT("SeAssignPrimaryTokenPrivilege")
2249 #define SE_LOCK_MEMORY_NAME TEXT("SeLockMemoryPrivilege")
2250 #define SE_INCREASE_QUOTA_NAME TEXT("SeIncreaseQuotaPrivilege")
2251 #define SE_UNSOLICITED_INPUT_NAME TEXT("SeUnsolicitedInputPrivilege")
2252 #define SE_MACHINE_ACCOUNT_NAME TEXT("SeMachineAccountPrivilege")
2253 #define SE_TCB_NAME TEXT("SeTcbPrivilege")
2254 #define SE_SECURITY_NAME TEXT("SeSecurityPrivilege")
2255 #define SE_TAKE_OWNERSHIP_NAME TEXT("SeTakeOwnershipPrivilege")
2256 #define SE_LOAD_DRIVER_NAME TEXT("SeLoadDriverPrivilege")
2257 #define SE_SYSTEM_PROFILE_NAME TEXT("SeSystemProfilePrivilege")
2258 #define SE_SYSTEMTIME_NAME TEXT("SeSystemtimePrivilege")
2259 #define SE_PROF_SINGLE_PROCESS_NAME TEXT("SeProfileSingleProcessPrivilege")
2260 #define SE_INC_BASE_PRIORITY_NAME TEXT("SeIncreaseBasePriorityPrivilege")
2261 #define SE_CREATE_PAGEFILE_NAME TEXT("SeCreatePagefilePrivilege")
2262 #define SE_CREATE_PERMANENT_NAME TEXT("SeCreatePermanentPrivilege")
2263 #define SE_BACKUP_NAME TEXT("SeBackupPrivilege")
2264 #define SE_RESTORE_NAME TEXT("SeRestorePrivilege")
2265 #define SE_SHUTDOWN_NAME TEXT("SeShutdownPrivilege")
2266 #define SE_DEBUG_NAME TEXT("SeDebugPrivilege")
2267 #define SE_AUDIT_NAME TEXT("SeAuditPrivilege")
2268 #define SE_SYSTEM_ENVIRONMENT_NAME TEXT("SeSystemEnvironmentPrivilege")
2269 #define SE_CHANGE_NOTIFY_NAME TEXT("SeChangeNotifyPrivilege")
2270 #define SE_REMOTE_SHUTDOWN_NAME TEXT("SeRemoteShutdownPrivilege")
2271 #define SE_UNDOCK_NAME TEXT("SeUndockPrivilege")
2272 #define SE_SYNC_AGENT_NAME TEXT("SeSyncAgentPrivilege")
2273 #define SE_ENABLE_DELEGATION_NAME TEXT("SeEnableDelegationPrivilege")
2274 #define SE_MANAGE_VOLUME_NAME TEXT("SeManageVolumePrivilege")
2275 #define SE_IMPERSONATE_NAME TEXT("SeImpersonatePrivilege")
2276 #define SE_CREATE_GLOBAL_NAME TEXT("SeCreateGlobalPrivilege")
2278 #define SE_GROUP_MANDATORY 0x00000001
2279 #define SE_GROUP_ENABLED_BY_DEFAULT 0x00000002
2280 #define SE_GROUP_ENABLED 0x00000004
2281 #define SE_GROUP_OWNER 0x00000008
2282 #define SE_GROUP_USE_FOR_DENY_ONLY 0x00000010
2283 #define SE_GROUP_INTEGRITY 0x00000020
2284 #define SE_GROUP_INTEGRITY_ENABLED 0x00000040
2285 #define SE_GROUP_LOGON_ID 0xC0000000
2286 #define SE_GROUP_RESOURCE 0x20000000
2287 #define SE_GROUP_VALID_ATTRIBUTES 0xE000007F
2289 /* FIXME: non-standard */
2290 #define LANG_ESPERANTO 0x8f
2291 #define LANG_WALON 0x90
2292 #define LANG_CORNISH 0x92
2294 /* FIXME: not present in the official headers */
2295 #define LANG_MALAGASY 0x8d
2296 #define LANG_GAELIC 0x94
2297 #define LANG_SAAMI 0x3b
2298 #define LANG_SUTU 0x30
2299 #define LANG_TSONGA 0x31
2300 #define LANG_VENDA 0x33
2301 #define LANG_MANX_GAELIC 0x94
2302 #define SUBLANG_PORTUGUESE_PORTUGAL 0x02
2304 #define PROCESSOR_INTEL_386 386
2305 #define PROCESSOR_INTEL_486 486
2306 #define PROCESSOR_INTEL_PENTIUM 586
2307 #define PROCESSOR_MIPS_R4000 4000
2308 #define PROCESSOR_ALPHA_21064 21064
2309 #define PROCESSOR_INTEL_IA64 2200
2310 #define PROCESSOR_PPC_601 601
2311 #define PROCESSOR_PPC_603 603
2312 #define PROCESSOR_PPC_604 604
2313 #define PROCESSOR_PPC_620 620
2314 #define PROCESSOR_INTEL_860 860
2315 #define PROCESSOR_AMD_X8664 8664
2316 #define PROCESSOR_MIPS_R2000 2000
2317 #define PROCESSOR_MIPS_R3000 3000
2318 #define PROCESSOR_HITACHI_SH3 10003
2319 #define PROCESSOR_HITACHI_SH3E 10004
2320 #define PROCESSOR_HITACHI_SH4 10005
2321 #define PROCESSOR_MOTOROLA_821 821
2322 #define PROCESSOR_SHx_SH3 103
2323 #define PROCESSOR_SHx_SH4 104
2324 #define PROCESSOR_STRONGARM 2577
2325 #define PROCESSOR_ARM720 1824
2326 #define PROCESSOR_ARM820 2080
2327 #define PROCESSOR_ARM920 2336
2328 #define PROCESSOR_ARM_7TDMI 70001
2329 #define PROCESSOR_ARCHITECTURE_INTEL 0
2330 #define PROCESSOR_ARCHITECTURE_MIPS 1
2331 #define PROCESSOR_ARCHITECTURE_ALPHA 2
2332 #define PROCESSOR_ARCHITECTURE_PPC 3
2333 #define PROCESSOR_ARCHITECTURE_SHX 4
2334 #define PROCESSOR_ARCHITECTURE_ARM 5
2335 #define PROCESSOR_ARCHITECTURE_IA64 6
2336 #define PROCESSOR_ARCHITECTURE_ALPHA64 7
2337 #define PROCESSOR_ARCHITECTURE_MSIL 8
2338 #define PROCESSOR_ARCHITECTURE_AMD64 9
2339 #define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF
2341 /* Processor features */
2342 #define PF_FLOATING_POINT_PRECISION_ERRATA 0
2343 #define PF_FLOATING_POINT_EMULATED 1
2344 #define PF_COMPARE_EXCHANGE_DOUBLE 2
2345 #define PF_MMX_INSTRUCTIONS_AVAILABLE 3
2346 #define PF_PPC_MOVEMEM_64BIT_OK 4
2347 #define PF_ALPHA_BYTE_INSTRUCTIONS 5
2348 #define PF_XMMI_INSTRUCTIONS_AVAILABLE 6
2349 #define PF_3DNOW_INSTRUCTIONS_AVAILABLE 7
2350 #define PF_RDTSC_INSTRUCTION_AVAILABLE 8
2351 #define PF_PAE_ENABLED 9
2352 #define PF_XMMI64_INSTRUCTIONS_AVAILABLE 10
2353 #define PF_SSE_DAZ_MODE_AVAILABLE 11
2354 #define PF_NX_ENABLED 12
2355 #define PF_SSE3_INSTRUCTIONS_AVAILABLE 13
2356 #define PF_COMPARE_EXCHANGE128 14
2357 #define PF_COMPARE64_EXCHANGE128 15
2358 #define PF_CHANNELS_ENABLED 16
2359 #define PF_XSAVE_ENABLED 17
2360 #define PF_ARM_VFP_32_REGISTERS_AVAILABLE 18
2361 #define PF_ARM_NEON_INSTRUCTIONS_AVAILABLE 19
2362 #define PF_SECOND_LEVEL_ADDRESS_TRANSLATION 20
2363 #define PF_VIRT_FIRMWARE_ENABLED 21
2364 #define PF_RDWRFSGSBASE_AVAILABLE 22
2365 #define PF_FASTFAIL_AVAILABLE 23
2366 #define PF_ARM_DIVIDE_INSTRUCTION_AVAILABLE 24
2367 #define PF_ARM_64BIT_LOADSTORE_ATOMIC 25
2368 #define PF_ARM_EXTERNAL_CACHE_AVAILABLE 26
2369 #define PF_ARM_FMAC_INSTRUCTIONS_AVAILABLE 27
2370 #define PF_RDRAND_INSTRUCTION_AVAILABLE 28
2371 #define PF_ARM_V8_INSTRUCTIONS_AVAILABLE 29
2372 #define PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE 30
2373 #define PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE 31
2375 /* also in ddk/ntifs.h */
2376 #define FILE_ACTION_ADDED 0x00000001
2377 #define FILE_ACTION_REMOVED 0x00000002
2378 #define FILE_ACTION_MODIFIED 0x00000003
2379 #define FILE_ACTION_RENAMED_OLD_NAME 0x00000004
2380 #define FILE_ACTION_RENAMED_NEW_NAME 0x00000005
2381 #define FILE_ACTION_ADDED_STREAM 0x00000006
2382 #define FILE_ACTION_REMOVED_STREAM 0x00000007
2383 #define FILE_ACTION_MODIFIED_STREAM 0x00000008
2384 #define FILE_ACTION_REMOVED_BY_DELETE 0x00000009
2385 #define FILE_ACTION_ID_NOT_TUNNELLED 0x0000000A
2386 #define FILE_ACTION_TUNNELLED_ID_COLLISION 0x0000000B
2388 #define HEAP_NO_SERIALIZE 1
2389 #define HEAP_GROWABLE 2
2390 #define HEAP_GENERATE_EXCEPTIONS 4
2391 #define HEAP_ZERO_MEMORY 8
2392 #define HEAP_REALLOC_IN_PLACE_ONLY 16
2393 #define HEAP_TAIL_CHECKING_ENABLED 32
2394 #define HEAP_FREE_CHECKING_ENABLED 64
2395 #define HEAP_DISABLE_COALESCE_ON_FREE 128
2396 #define HEAP_CREATE_ALIGN_16 0x10000
2397 #define HEAP_CREATE_ENABLE_TRACING 0x20000
2398 #define HEAP_CREATE_ENABLE_EXECUTE 0x00040000
2399 #define HEAP_MAXIMUM_TAG 0xFFF
2400 #define HEAP_PSEUDO_TAG_FLAG 0x8000
2401 #define HEAP_TAG_SHIFT 16
2402 #define HEAP_MAKE_TAG_FLAGS(b,o) ((DWORD)((b)+(o)<<16)))
2404 #define KEY_QUERY_VALUE 1
2405 #define KEY_SET_VALUE 2
2406 #define KEY_CREATE_SUB_KEY 4
2407 #define KEY_ENUMERATE_SUB_KEYS 8
2408 #define KEY_NOTIFY 16
2409 #define KEY_CREATE_LINK 32
2410 #define KEY_WOW64_64KEY 0x00000100
2411 #define KEY_WOW64_32KEY 0x00000200
2412 #define KEY_WOW64_RES 0x00000300
2414 #define KEY_WRITE 0x20006
2415 #define KEY_EXECUTE 0x20019
2416 #define KEY_READ 0x20019
2417 #define KEY_ALL_ACCESS 0xf003f
2418 #define REG_WHOLE_HIVE_VOLATILE 1
2419 #define REG_REFRESH_HIVE 2
2420 #define REG_NO_LAZY_FLUSH 4
2421 #define REG_FORCE_RESTORE 8
2422 #define REG_OPTION_RESERVED 0
2423 #define REG_OPTION_NON_VOLATILE 0
2424 #define REG_OPTION_VOLATILE 1
2425 #define REG_OPTION_CREATE_LINK 2
2426 #define REG_OPTION_BACKUP_RESTORE 4
2427 #define REG_OPTION_OPEN_LINK 8
2428 #define REG_LEGAL_OPTION 15
2429 #define MAXIMUM_PROCESSORS 32
2430 #define PAGE_NOACCESS 0x0001
2431 #define PAGE_READONLY 0x0002
2432 #define PAGE_READWRITE 0x0004
2433 #define PAGE_WRITECOPY 0x0008
2434 #define PAGE_EXECUTE 0x0010
2435 #define PAGE_EXECUTE_READ 0x0020
2436 #define PAGE_EXECUTE_READWRITE 0x0040
2437 #define PAGE_EXECUTE_WRITECOPY 0x0080
2438 #define PAGE_GUARD 0x0100
2439 #define PAGE_NOCACHE 0x0200
2440 #define PAGE_WRITECOMBINE 0x0400
2441 #define MEM_COMMIT 0x1000
2442 #define MEM_RESERVE 0x2000
2443 #define MEM_DECOMMIT 0x4000
2444 #define MEM_RELEASE 0x8000
2445 #define MEM_FREE 0x10000
2446 #define MEM_PRIVATE 0x20000
2447 #define MEM_MAPPED 0x40000
2448 #define MEM_RESET 0x80000
2449 #define MEM_TOP_DOWN 0x100000
2450 #define MEM_WRITE_WATCH 0x200000 /* 98/Me */
2451 #define MEM_PHYSICAL 0x400000
2452 #define MEM_4MB_PAGES 0x80000000
2453 #define MEM_IMAGE SEC_IMAGE
2454 #define SEC_NO_CHANGE 0x00400000
2455 #define SEC_FILE 0x00800000
2456 #define SEC_IMAGE 0x01000000
2457 #define SEC_VLM 0x02000000
2458 #define SEC_RESERVE 0x04000000
2459 #define SEC_COMMIT 0x08000000
2460 #define SEC_NOCACHE 0x10000000
2461 #define SEC_WRITECOMBINE 0x40000000
2462 #define SEC_LARGE_PAGES 0x80000000
2463 #define SECTION_MAP_EXECUTE_EXPLICIT 0x0020
2464 #define SECTION_EXTEND_SIZE 16
2465 #define SECTION_MAP_READ 4
2466 #define SECTION_MAP_WRITE 2
2467 #define SECTION_QUERY 1
2468 #define SECTION_MAP_EXECUTE 8
2469 #define SECTION_ALL_ACCESS 0xf001f
2470 #define WRITE_WATCH_FLAG_RESET 0x01
2471 #define MESSAGE_RESOURCE_UNICODE 1
2472 #define RTL_CRITSECT_TYPE 0
2473 #define RTL_RESOURCE_TYPE 1
2475 #define IMAGE_SIZEOF_FILE_HEADER 20
2476 #define IMAGE_FILE_RELOCS_STRIPPED 1
2477 #define IMAGE_FILE_EXECUTABLE_IMAGE 2
2478 #define IMAGE_FILE_LINE_NUMS_STRIPPED 4
2479 #define IMAGE_FILE_LOCAL_SYMS_STRIPPED 8
2480 #define IMAGE_FILE_AGGRESIVE_WS_TRIM 16
2481 #define IMAGE_FILE_LARGE_ADDRESS_AWARE 32
2482 #define IMAGE_FILE_BYTES_REVERSED_LO 128
2483 #define IMAGE_FILE_32BIT_MACHINE 256
2484 #define IMAGE_FILE_DEBUG_STRIPPED 512
2485 #define IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP 1024
2486 #define IMAGE_FILE_NET_RUN_FROM_SWAP 2048
2487 #define IMAGE_FILE_SYSTEM 4096
2488 #define IMAGE_FILE_DLL 8192
2489 #define IMAGE_FILE_UP_SYSTEM_ONLY 16384
2490 #define IMAGE_FILE_BYTES_REVERSED_HI 32768
2491 #define IMAGE_FILE_MACHINE_UNKNOWN 0
2493 #define IMAGE_FILE_MACHINE_AM33 0x1d3
2494 #define IMAGE_FILE_MACHINE_AMD64 0x8664
2495 #define IMAGE_FILE_MACHINE_ARM 0x1c0
2496 #define IMAGE_FILE_MACHINE_ARMNT 0x1c4
2497 #define IMAGE_FILE_MACHINE_EBC 0xebc
2498 #define IMAGE_FILE_MACHINE_I386 0x14c
2499 #define IMAGE_FILE_MACHINE_IA64 0x200
2500 #define IMAGE_FILE_MACHINE_M32R 0x9041
2501 #define IMAGE_FILE_MACHINE_MIPS16 0x266
2502 #define IMAGE_FILE_MACHINE_MIPSFPU 0x366
2503 #define IMAGE_FILE_MACHINE_MIPSFPU16 0x466
2504 #define IMAGE_FILE_MACHINE_POWERPC 0x1f0
2505 #define IMAGE_FILE_MACHINE_POWERPCFP 0x1f1
2506 #define IMAGE_FILE_MACHINE_R4000 0x166
2507 #define IMAGE_FILE_MACHINE_SH3 0x1a2
2508 #define IMAGE_FILE_MACHINE_SH3E 0x01a4
2509 #define IMAGE_FILE_MACHINE_SH3DSP 0x1a3
2510 #define IMAGE_FILE_MACHINE_SH4 0x1a6
2511 #define IMAGE_FILE_MACHINE_SH5 0x1a8
2512 #define IMAGE_FILE_MACHINE_THUMB 0x1c2
2513 #define IMAGE_FILE_MACHINE_WCEMIPSV2 0x169
2514 #define IMAGE_FILE_MACHINE_R3000 0x162
2515 #define IMAGE_FILE_MACHINE_R10000 0x168
2516 #define IMAGE_FILE_MACHINE_ALPHA 0x184
2517 #define IMAGE_FILE_MACHINE_ALPHA64 0x0284
2518 #define IMAGE_FILE_MACHINE_AXP64 IMAGE_FILE_MACHINE_ALPHA64
2519 #define IMAGE_FILE_MACHINE_CEE 0xC0EE
2520 #define IMAGE_FILE_MACHINE_TRICORE 0x0520
2521 #define IMAGE_FILE_MACHINE_CEF 0x0CEF
2523 /* Wine extension */
2524 #define IMAGE_FILE_MACHINE_ARM64 0x1c5
2526 #define IMAGE_FILE_EXPORT_DIRECTORY 0
2527 #define IMAGE_FILE_IMPORT_DIRECTORY 1
2528 #define IMAGE_FILE_RESOURCE_DIRECTORY 2
2529 #define IMAGE_FILE_EXCEPTION_DIRECTORY 3
2530 #define IMAGE_FILE_SECURITY_DIRECTORY 4
2531 #define IMAGE_FILE_BASE_RELOCATION_TABLE 5
2532 #define IMAGE_FILE_DEBUG_DIRECTORY 6
2533 #define IMAGE_FILE_DESCRIPTION_STRING 7
2534 #define IMAGE_FILE_MACHINE_VALUE 8 /* Mips */
2535 #define IMAGE_FILE_THREAD_LOCAL_STORAGE 9
2536 #define IMAGE_FILE_CALLBACK_DIRECTORY 10
2538 #define IMAGE_DOS_SIGNATURE 0x5A4D
2539 #define IMAGE_OS2_SIGNATURE 0x454E
2540 #define IMAGE_OS2_SIGNATURE_LE 0x454C
2541 #define IMAGE_VXD_SIGNATURE 0x454C
2542 #define IMAGE_NT_SIGNATURE 0x00004550
2543 #define IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b
2544 #define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b
2546 #define IMAGE_NT_OPTIONAL_HDR_MAGIC IMAGE_NT_OPTIONAL_HDR64_MAGIC
2548 #define IMAGE_NT_OPTIONAL_HDR_MAGIC IMAGE_NT_OPTIONAL_HDR32_MAGIC
2550 #define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
2551 #define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4944
2552 #define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
2553 #define IMAGE_SIZEOF_ROM_OPTIONAL_HEADER 56
2554 #define IMAGE_SIZEOF_STD_OPTIONAL_HEADER 28
2555 #define IMAGE_SIZEOF_NT_OPTIONAL_HEADER 224
2556 #define IMAGE_SIZEOF_SHORT_NAME 8
2557 #define IMAGE_SIZEOF_SECTION_HEADER 40
2558 #define IMAGE_SIZEOF_SYMBOL 18
2559 #define IMAGE_SIZEOF_AUX_SYMBOL 18
2560 #define IMAGE_SIZEOF_RELOCATION 10
2561 #define IMAGE_SIZEOF_BASE_RELOCATION 8
2562 #define IMAGE_SIZEOF_LINENUMBER 6
2563 #define IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60
2564 #define SIZEOF_RFPO_DATA 16
2566 #define IMAGE_SUBSYSTEM_UNKNOWN 0
2567 #define IMAGE_SUBSYSTEM_NATIVE 1
2568 #define IMAGE_SUBSYSTEM_WINDOWS_GUI 2
2569 #define IMAGE_SUBSYSTEM_WINDOWS_CUI 3
2570 #define IMAGE_SUBSYSTEM_OS2_CUI 5
2571 #define IMAGE_SUBSYSTEM_POSIX_CUI 7
2572 #define IMAGE_SUBSYSTEM_NATIVE_WINDOWS 8
2573 #define IMAGE_SUBSYSTEM_WINDOWS_CE_GUI 9
2574 #define IMAGE_SUBSYSTEM_EFI_APPLICATION 10
2575 #define IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11
2576 #define IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12
2577 #define IMAGE_SUBSYSTEM_EFI_ROM 13
2578 #define IMAGE_SUBSYSTEM_XBOX 14
2580 #define IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE 0x0040
2581 #define IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY 0x0080
2582 #define IMAGE_DLLCHARACTERISTICS_NX_COMPAT 0x0100
2583 #define IMAGE_DLLCHARACTERISTICS_NO_ISOLATION 0x0200
2584 #define IMAGE_DLLCHARACTERISTICS_NO_SEH 0x0400
2585 #define IMAGE_DLLCHARACTERISTICS_NO_BIND 0x0800
2586 #define IMAGE_DLLCHARACTERISTICS_WDM_DRIVER 0x2000
2587 #define IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE 0x8000
2588 #define IMAGE_FIRST_SECTION(h) ((PIMAGE_SECTION_HEADER) ((ULONG_PTR)h+FIELD_OFFSET(IMAGE_NT_HEADERS,OptionalHeader)+((PIMAGE_NT_HEADERS)(h))->FileHeader.SizeOfOptionalHeader))
2589 #define IMAGE_DIRECTORY_ENTRY_EXPORT 0
2590 #define IMAGE_DIRECTORY_ENTRY_IMPORT 1
2591 #define IMAGE_DIRECTORY_ENTRY_RESOURCE 2
2592 #define IMAGE_DIRECTORY_ENTRY_EXCEPTION 3
2593 #define IMAGE_DIRECTORY_ENTRY_SECURITY 4
2594 #define IMAGE_DIRECTORY_ENTRY_BASERELOC 5
2595 #define IMAGE_DIRECTORY_ENTRY_DEBUG 6
2596 #define IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7
2597 #define IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8
2598 #define IMAGE_DIRECTORY_ENTRY_TLS 9
2599 #define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10
2600 #define IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT 11
2601 #define IMAGE_DIRECTORY_ENTRY_IAT 12
2602 #define IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT 13
2603 #define IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR 14
2604 #define IMAGE_SCN_TYPE_REG 0
2605 #define IMAGE_SCN_TYPE_DSECT 1
2606 //#define IMAGE_SCN_TYPE_NOLOAD 2
2607 #define IMAGE_SCN_TYPE_GROUP 4
2608 #define IMAGE_SCN_TYPE_NO_PAD 8
2609 #define IMAGE_SCN_CNT_CODE 32
2610 #define IMAGE_SCN_CNT_INITIALIZED_DATA 64
2611 #define IMAGE_SCN_CNT_UNINITIALIZED_DATA 128
2612 #define IMAGE_SCN_LNK_OTHER 256
2613 #define IMAGE_SCN_LNK_INFO 512
2614 #define IMAGE_SCN_LNK_REMOVE 2048
2615 #define IMAGE_SCN_LNK_COMDAT 4096
2616 #define IMAGE_SCN_MEM_FARDATA 0x8000
2617 #define IMAGE_SCN_MEM_PURGEABLE 0x20000
2618 #define IMAGE_SCN_MEM_16BIT 0x20000
2619 #define IMAGE_SCN_MEM_LOCKED 0x40000
2620 #define IMAGE_SCN_MEM_PRELOAD 0x80000
2621 #define IMAGE_SCN_ALIGN_1BYTES 0x100000
2622 #define IMAGE_SCN_ALIGN_2BYTES 0x200000
2623 #define IMAGE_SCN_ALIGN_4BYTES 0x300000
2624 #define IMAGE_SCN_ALIGN_8BYTES 0x400000
2625 #define IMAGE_SCN_ALIGN_16BYTES 0x500000
2626 #define IMAGE_SCN_ALIGN_32BYTES 0x600000
2627 #define IMAGE_SCN_ALIGN_64BYTES 0x700000
2628 #define IMAGE_SCN_LNK_NRELOC_OVFL 0x1000000
2629 #define IMAGE_SCN_MEM_DISCARDABLE 0x2000000
2630 #define IMAGE_SCN_MEM_NOT_CACHED 0x4000000
2631 #define IMAGE_SCN_MEM_NOT_PAGED 0x8000000
2632 #define IMAGE_SCN_MEM_SHARED 0x10000000
2633 #define IMAGE_SCN_MEM_EXECUTE 0x20000000
2634 #define IMAGE_SCN_MEM_READ 0x40000000
2635 #define IMAGE_SCN_MEM_WRITE 0x80000000
2636 #define IMAGE_SYM_UNDEFINED 0
2637 #define IMAGE_SYM_ABSOLUTE (-1)
2638 #define IMAGE_SYM_DEBUG (-2)
2639 #define IMAGE_SYM_TYPE_NULL 0
2640 #define IMAGE_SYM_TYPE_VOID 1
2641 #define IMAGE_SYM_TYPE_CHAR 2
2642 #define IMAGE_SYM_TYPE_SHORT 3
2643 #define IMAGE_SYM_TYPE_INT 4
2644 #define IMAGE_SYM_TYPE_LONG 5
2645 #define IMAGE_SYM_TYPE_FLOAT 6
2646 #define IMAGE_SYM_TYPE_DOUBLE 7
2647 #define IMAGE_SYM_TYPE_STRUCT 8
2648 #define IMAGE_SYM_TYPE_UNION 9
2649 #define IMAGE_SYM_TYPE_ENUM 10
2650 #define IMAGE_SYM_TYPE_MOE 11
2651 #define IMAGE_SYM_TYPE_BYTE 12
2652 #define IMAGE_SYM_TYPE_WORD 13
2653 #define IMAGE_SYM_TYPE_UINT 14
2654 #define IMAGE_SYM_TYPE_DWORD 15
2655 #define IMAGE_SYM_TYPE_PCODE 32768
2656 #define IMAGE_SYM_DTYPE_NULL 0
2657 #define IMAGE_SYM_DTYPE_POINTER 1
2658 #define IMAGE_SYM_DTYPE_FUNCTION 2
2659 #define IMAGE_SYM_DTYPE_ARRAY 3
2660 #define IMAGE_SYM_CLASS_END_OF_FUNCTION (-1)
2661 #define IMAGE_SYM_CLASS_NULL 0
2662 #define IMAGE_SYM_CLASS_AUTOMATIC 1
2663 #define IMAGE_SYM_CLASS_EXTERNAL 2
2664 #define IMAGE_SYM_CLASS_STATIC 3
2665 #define IMAGE_SYM_CLASS_REGISTER 4
2666 #define IMAGE_SYM_CLASS_EXTERNAL_DEF 5
2667 #define IMAGE_SYM_CLASS_LABEL 6
2668 #define IMAGE_SYM_CLASS_UNDEFINED_LABEL 7
2669 #define IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 8
2670 #define IMAGE_SYM_CLASS_ARGUMENT 9
2671 #define IMAGE_SYM_CLASS_STRUCT_TAG 10
2672 #define IMAGE_SYM_CLASS_MEMBER_OF_UNION 11
2673 #define IMAGE_SYM_CLASS_UNION_TAG 12
2674 #define IMAGE_SYM_CLASS_TYPE_DEFINITION 13
2675 #define IMAGE_SYM_CLASS_UNDEFINED_STATIC 14
2676 #define IMAGE_SYM_CLASS_ENUM_TAG 15
2677 #define IMAGE_SYM_CLASS_MEMBER_OF_ENUM 16
2678 #define IMAGE_SYM_CLASS_REGISTER_PARAM 17
2679 #define IMAGE_SYM_CLASS_BIT_FIELD 18
2680 #define IMAGE_SYM_CLASS_FAR_EXTERNAL 68
2681 #define IMAGE_SYM_CLASS_BLOCK 100
2682 #define IMAGE_SYM_CLASS_FUNCTION 101
2683 #define IMAGE_SYM_CLASS_END_OF_STRUCT 102
2684 #define IMAGE_SYM_CLASS_FILE 103
2685 #define IMAGE_SYM_CLASS_SECTION 104
2686 #define IMAGE_SYM_CLASS_WEAK_EXTERNAL 105
2687 #define IMAGE_COMDAT_SELECT_NODUPLICATES 1
2688 #define IMAGE_COMDAT_SELECT_ANY 2
2689 #define IMAGE_COMDAT_SELECT_SAME_SIZE 3
2690 #define IMAGE_COMDAT_SELECT_EXACT_MATCH 4
2691 #define IMAGE_COMDAT_SELECT_ASSOCIATIVE 5
2692 #define IMAGE_COMDAT_SELECT_LARGEST 6
2693 #define IMAGE_COMDAT_SELECT_NEWEST 7
2694 #define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1
2695 #define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2
2696 #define IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3
2697 #define IMAGE_REL_I386_ABSOLUTE 0
2698 #define IMAGE_REL_I386_DIR16 1
2699 #define IMAGE_REL_I386_REL16 2
2700 #define IMAGE_REL_I386_DIR32 6
2701 #define IMAGE_REL_I386_DIR32NB 7
2702 #define IMAGE_REL_I386_SEG12 9
2703 #define IMAGE_REL_I386_SECTION 10
2704 #define IMAGE_REL_I386_SECREL 11
2705 #define IMAGE_REL_I386_REL32 20
2706 #define IMAGE_REL_MIPS_ABSOLUTE 0
2707 #define IMAGE_REL_MIPS_REFHALF 1
2708 #define IMAGE_REL_MIPS_REFWORD 2
2709 #define IMAGE_REL_MIPS_JMPADDR 3
2710 #define IMAGE_REL_MIPS_REFHI 4
2711 #define IMAGE_REL_MIPS_REFLO 5
2712 #define IMAGE_REL_MIPS_GPREL 6
2713 #define IMAGE_REL_MIPS_LITERAL 7
2714 #define IMAGE_REL_MIPS_SECTION 10
2715 #define IMAGE_REL_MIPS_SECREL 11
2716 #define IMAGE_REL_MIPS_SECRELLO 12
2717 #define IMAGE_REL_MIPS_SECRELHI 13
2718 #define IMAGE_REL_MIPS_REFWORDNB 34
2719 #define IMAGE_REL_MIPS_PAIR 35
2720 #define IMAGE_REL_ALPHA_ABSOLUTE 0
2721 #define IMAGE_REL_ALPHA_REFLONG 1
2722 #define IMAGE_REL_ALPHA_REFQUAD 2
2723 #define IMAGE_REL_ALPHA_GPREL32 3
2724 #define IMAGE_REL_ALPHA_LITERAL 4
2725 #define IMAGE_REL_ALPHA_LITUSE 5
2726 #define IMAGE_REL_ALPHA_GPDISP 6
2727 #define IMAGE_REL_ALPHA_BRADDR 7
2728 #define IMAGE_REL_ALPHA_HINT 8
2729 #define IMAGE_REL_ALPHA_INLINE_REFLONG 9
2730 #define IMAGE_REL_ALPHA_REFHI 10
2731 #define IMAGE_REL_ALPHA_REFLO 11
2732 #define IMAGE_REL_ALPHA_PAIR 12
2733 #define IMAGE_REL_ALPHA_MATCH 13
2734 #define IMAGE_REL_ALPHA_SECTION 14
2735 #define IMAGE_REL_ALPHA_SECREL 15
2736 #define IMAGE_REL_ALPHA_REFLONGNB 16
2737 #define IMAGE_REL_ALPHA_SECRELLO 17
2738 #define IMAGE_REL_ALPHA_SECRELHI 18
2739 #define IMAGE_REL_PPC_ABSOLUTE 0
2740 #define IMAGE_REL_PPC_ADDR64 1
2741 #define IMAGE_REL_PPC_ADDR32 2
2742 #define IMAGE_REL_PPC_ADDR24 3
2743 #define IMAGE_REL_PPC_ADDR16 4
2744 #define IMAGE_REL_PPC_ADDR14 5
2745 #define IMAGE_REL_PPC_REL24 6
2746 #define IMAGE_REL_PPC_REL14 7
2747 #define IMAGE_REL_PPC_TOCREL16 8
2748 #define IMAGE_REL_PPC_TOCREL14 9
2749 #define IMAGE_REL_PPC_ADDR32NB 10
2750 #define IMAGE_REL_PPC_SECREL 11
2751 #define IMAGE_REL_PPC_SECTION 12
2752 #define IMAGE_REL_PPC_IFGLUE 13
2753 #define IMAGE_REL_PPC_IMGLUE 14
2754 #define IMAGE_REL_PPC_SECREL16 15
2755 #define IMAGE_REL_PPC_REFHI 16
2756 #define IMAGE_REL_PPC_REFLO 17
2757 #define IMAGE_REL_PPC_PAIR 18
2758 #define IMAGE_REL_PPC_TYPEMASK 255
2759 #define IMAGE_REL_PPC_NEG 256
2760 #define IMAGE_REL_PPC_BRTAKEN 512
2761 #define IMAGE_REL_PPC_BRNTAKEN 1024
2762 #define IMAGE_REL_PPC_TOCDEFN 2048
2763 #define IMAGE_REL_BASED_ABSOLUTE 0
2764 #define IMAGE_REL_BASED_HIGH 1
2765 #define IMAGE_REL_BASED_LOW 2
2766 #define IMAGE_REL_BASED_HIGHLOW 3
2767 #define IMAGE_REL_BASED_HIGHADJ 4
2768 #define IMAGE_REL_BASED_MIPS_JMPADDR 5
2769 #define IMAGE_REL_BASED_MIPS_JMPADDR16 9
2770 #define IMAGE_REL_BASED_IA64_IMM64 9
2771 #define IMAGE_REL_BASED_DIR64 10
2772 #define IMAGE_ARCHIVE_START_SIZE 8
2773 #define IMAGE_ARCHIVE_START "!<arch>\n"
2774 #define IMAGE_ARCHIVE_END "`\n"
2775 #define IMAGE_ARCHIVE_PAD "\n"
2776 #define IMAGE_ARCHIVE_LINKER_MEMBER "/ "
2777 #define IMAGE_ARCHIVE_LONGNAMES_MEMBER "// "
2778 #define IMAGE_RESOURCE_NAME_IS_STRING 0x80000000
2779 #define IMAGE_RESOURCE_DATA_IS_DIRECTORY 0x80000000
2780 #define IMAGE_DEBUG_TYPE_UNKNOWN 0
2781 #define IMAGE_DEBUG_TYPE_COFF 1
2782 #define IMAGE_DEBUG_TYPE_CODEVIEW 2
2783 #define IMAGE_DEBUG_TYPE_FPO 3
2784 #define IMAGE_DEBUG_TYPE_MISC 4
2785 #define IMAGE_DEBUG_TYPE_EXCEPTION 5
2786 #define IMAGE_DEBUG_TYPE_FIXUP 6
2787 #define IMAGE_DEBUG_TYPE_OMAP_TO_SRC 7
2788 #define IMAGE_DEBUG_TYPE_OMAP_FROM_SRC 8
2790 #define FRAME_TRAP 1
2792 #define FRAME_NONFPO 3
2793 #define IMAGE_DEBUG_MISC_EXENAME 1
2794 #define N_BTMASK 0x000F
2795 #define N_TMASK 0x0030
2796 #define N_TMASK1 0x00C0
2797 #define N_TMASK2 0x00F0
2800 #define IS_TEXT_UNICODE_ASCII16 1
2801 #define IS_TEXT_UNICODE_REVERSE_ASCII16 16
2802 #define IS_TEXT_UNICODE_STATISTICS 2
2803 #define IS_TEXT_UNICODE_REVERSE_STATISTICS 32
2804 #define IS_TEXT_UNICODE_CONTROLS 4
2805 #define IS_TEXT_UNICODE_REVERSE_CONTROLS 64
2806 #define IS_TEXT_UNICODE_SIGNATURE 8
2807 #define IS_TEXT_UNICODE_REVERSE_SIGNATURE 128
2808 #define IS_TEXT_UNICODE_ILLEGAL_CHARS 256
2809 #define IS_TEXT_UNICODE_ODD_LENGTH 512
2810 #define IS_TEXT_UNICODE_NULL_BYTES 4096
2811 #define IS_TEXT_UNICODE_UNICODE_MASK 15
2812 #define IS_TEXT_UNICODE_REVERSE_MASK 240
2813 #define IS_TEXT_UNICODE_NOT_UNICODE_MASK 3840
2814 #define IS_TEXT_UNICODE_NOT_ASCII_MASK 61440
2815 #define SERVICE_KERNEL_DRIVER 1
2816 #define SERVICE_FILE_SYSTEM_DRIVER 2
2817 #define SERVICE_ADAPTER 4
2818 #define SERVICE_RECOGNIZER_DRIVER 8
2819 #define SERVICE_DRIVER (SERVICE_KERNEL_DRIVER|SERVICE_FILE_SYSTEM_DRIVER|SERVICE_RECOGNIZER_DRIVER)
2820 #define SERVICE_WIN32_OWN_PROCESS 16
2821 #define SERVICE_WIN32_SHARE_PROCESS 32
2822 #define SERVICE_WIN32 (SERVICE_WIN32_OWN_PROCESS|SERVICE_WIN32_SHARE_PROCESS)
2823 #define SERVICE_INTERACTIVE_PROCESS 256
2824 #define SERVICE_TYPE_ALL (SERVICE_WIN32|SERVICE_ADAPTER|SERVICE_DRIVER|SERVICE_INTERACTIVE_PROCESS)
2825 #define SERVICE_BOOT_START 0
2826 #define SERVICE_SYSTEM_START 1
2827 #define SERVICE_AUTO_START 2
2828 #define SERVICE_DEMAND_START 3
2829 #define SERVICE_DISABLED 4
2830 #define SERVICE_ERROR_IGNORE 0
2831 #define SERVICE_ERROR_NORMAL 1
2832 #define SERVICE_ERROR_SEVERE 2
2833 #define SERVICE_ERROR_CRITICAL 3
2835 /* also in ddk/ntifs.h */
2836 #define TOKEN_ASSIGN_PRIMARY (0x0001)
2837 #define TOKEN_DUPLICATE (0x0002)
2838 #define TOKEN_IMPERSONATE (0x0004)
2839 #define TOKEN_QUERY (0x0008)
2840 #define TOKEN_QUERY_SOURCE (0x0010)
2841 #define TOKEN_ADJUST_PRIVILEGES (0x0020)
2842 #define TOKEN_ADJUST_GROUPS (0x0040)
2843 #define TOKEN_ADJUST_DEFAULT (0x0080)
2844 #define TOKEN_ADJUST_SESSIONID (0x0100)
2845 #define TOKEN_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\
2846 TOKEN_ASSIGN_PRIMARY |\
2848 TOKEN_IMPERSONATE |\
2850 TOKEN_QUERY_SOURCE |\
2851 TOKEN_ADJUST_PRIVILEGES |\
2852 TOKEN_ADJUST_GROUPS |\
2853 TOKEN_ADJUST_DEFAULT |\
2854 TOKEN_ADJUST_SESSIONID)
2855 #define TOKEN_READ (STANDARD_RIGHTS_READ |\
2857 #define TOKEN_WRITE (STANDARD_RIGHTS_WRITE |\
2858 TOKEN_ADJUST_PRIVILEGES |\
2859 TOKEN_ADJUST_GROUPS |\
2860 TOKEN_ADJUST_DEFAULT)
2862 #define TOKEN_EXECUTE (STANDARD_RIGHTS_EXECUTE)
2863 #define TOKEN_SOURCE_LENGTH 8
2864 /* end ddk/ntifs.h */
2865 #define DLL_PROCESS_DETACH 0
2866 #define DLL_PROCESS_ATTACH 1
2867 #define DLL_THREAD_ATTACH 2
2868 #define DLL_THREAD_DETACH 3
2870 #define DLL_WINE_PREATTACH 8 /* Never called, but defined for compatibility with Wine source */
2872 #define TAPE_ABSOLUTE_POSITION 0
2873 #define TAPE_LOGICAL_POSITION 1
2874 #define TAPE_PSEUDO_LOGICAL_POSITION 2
2875 #define TAPE_REWIND 0
2876 #define TAPE_ABSOLUTE_BLOCK 1
2877 #define TAPE_LOGICAL_BLOCK 2
2878 #define TAPE_PSEUDO_LOGICAL_BLOCK 3
2879 #define TAPE_SPACE_END_OF_DATA 4
2880 #define TAPE_SPACE_RELATIVE_BLOCKS 5
2881 #define TAPE_SPACE_FILEMARKS 6
2882 #define TAPE_SPACE_SEQUENTIAL_FMKS 7
2883 #define TAPE_SPACE_SETMARKS 8
2884 #define TAPE_SPACE_SEQUENTIAL_SMKS 9
2885 #define TAPE_DRIVE_FIXED 1
2886 #define TAPE_DRIVE_SELECT 2
2887 #define TAPE_DRIVE_INITIATOR 4
2888 #define TAPE_DRIVE_ERASE_SHORT 16
2889 #define TAPE_DRIVE_ERASE_LONG 32
2890 #define TAPE_DRIVE_ERASE_BOP_ONLY 64
2891 #define TAPE_DRIVE_ERASE_IMMEDIATE 128
2892 #define TAPE_DRIVE_TAPE_CAPACITY 256
2893 #define TAPE_DRIVE_TAPE_REMAINING 512
2894 #define TAPE_DRIVE_FIXED_BLOCK 1024
2895 #define TAPE_DRIVE_VARIABLE_BLOCK 2048
2896 #define TAPE_DRIVE_WRITE_PROTECT 4096
2897 #define TAPE_DRIVE_EOT_WZ_SIZE 8192
2898 #define TAPE_DRIVE_ECC 0x10000
2899 #define TAPE_DRIVE_COMPRESSION 0x20000
2900 #define TAPE_DRIVE_PADDING 0x40000
2901 #define TAPE_DRIVE_REPORT_SMKS 0x80000
2902 #define TAPE_DRIVE_GET_ABSOLUTE_BLK 0x100000
2903 #define TAPE_DRIVE_GET_LOGICAL_BLK 0x200000
2904 #define TAPE_DRIVE_SET_EOT_WZ_SIZE 0x400000
2905 #define TAPE_DRIVE_EJECT_MEDIA 0x1000000
2906 #define TAPE_DRIVE_CLEAN_REQUESTS 0x2000000
2907 #define TAPE_DRIVE_SET_CMP_BOP_ONLY 0x4000000
2908 #define TAPE_DRIVE_RESERVED_BIT 0x80000000
2909 #define TAPE_DRIVE_LOAD_UNLOAD 0x80000001
2910 #define TAPE_DRIVE_TENSION 0x80000002
2911 #define TAPE_DRIVE_LOCK_UNLOCK 0x80000004
2912 #define TAPE_DRIVE_REWIND_IMMEDIATE 0x80000008
2913 #define TAPE_DRIVE_SET_BLOCK_SIZE 0x80000010
2914 #define TAPE_DRIVE_LOAD_UNLD_IMMED 0x80000020
2915 #define TAPE_DRIVE_TENSION_IMMED 0x80000040
2916 #define TAPE_DRIVE_LOCK_UNLK_IMMED 0x80000080
2917 #define TAPE_DRIVE_SET_ECC 0x80000100
2918 #define TAPE_DRIVE_SET_COMPRESSION 0x80000200
2919 #define TAPE_DRIVE_SET_PADDING 0x80000400
2920 #define TAPE_DRIVE_SET_REPORT_SMKS 0x80000800
2921 #define TAPE_DRIVE_ABSOLUTE_BLK 0x80001000
2922 #define TAPE_DRIVE_ABS_BLK_IMMED 0x80002000
2923 #define TAPE_DRIVE_LOGICAL_BLK 0x80004000
2924 #define TAPE_DRIVE_LOG_BLK_IMMED 0x80008000
2925 #define TAPE_DRIVE_END_OF_DATA 0x80010000
2926 #define TAPE_DRIVE_RELATIVE_BLKS 0x80020000
2927 #define TAPE_DRIVE_FILEMARKS 0x80040000
2928 #define TAPE_DRIVE_SEQUENTIAL_FMKS 0x80080000
2929 #define TAPE_DRIVE_SETMARKS 0x80100000
2930 #define TAPE_DRIVE_SEQUENTIAL_SMKS 0x80200000
2931 #define TAPE_DRIVE_REVERSE_POSITION 0x80400000
2932 #define TAPE_DRIVE_SPACE_IMMEDIATE 0x80800000
2933 #define TAPE_DRIVE_WRITE_SETMARKS 0x81000000
2934 #define TAPE_DRIVE_WRITE_FILEMARKS 0x82000000
2935 #define TAPE_DRIVE_WRITE_SHORT_FMKS 0x84000000
2936 #define TAPE_DRIVE_WRITE_LONG_FMKS 0x88000000
2937 #define TAPE_DRIVE_WRITE_MARK_IMMED 0x90000000
2938 #define TAPE_DRIVE_FORMAT 0xA0000000
2939 #define TAPE_DRIVE_FORMAT_IMMEDIATE 0xC0000000
2940 #define TAPE_DRIVE_HIGH_FEATURES 0x80000000
2941 #define TAPE_FIXED_PARTITIONS 0
2942 #define TAPE_INITIATOR_PARTITIONS 2
2943 #define TAPE_SELECT_PARTITIONS 1
2944 #define TAPE_FILEMARKS 1
2945 #define TAPE_LONG_FILEMARKS 3
2946 #define TAPE_SETMARKS 0
2947 #define TAPE_SHORT_FILEMARKS 2
2948 #define TAPE_ERASE_LONG 1
2949 #define TAPE_ERASE_SHORT 0
2951 #define TAPE_UNLOAD 1
2952 #define TAPE_TENSION 2
2954 #define TAPE_UNLOCK 4
2955 #define TAPE_FORMAT 5
2956 #if (_WIN32_WINNT >= 0x0500)
2957 #define VER_MINORVERSION 0x0000001
2958 #define VER_MAJORVERSION 0x0000002
2959 #define VER_BUILDNUMBER 0x0000004
2960 #define VER_PLATFORMID 0x0000008
2961 #define VER_SERVICEPACKMINOR 0x0000010
2962 #define VER_SERVICEPACKMAJOR 0x0000020
2963 #define VER_SUITENAME 0x0000040
2964 #define VER_PRODUCT_TYPE 0x0000080
2966 #define VER_GREATER 2
2967 #define VER_GREATER_EQUAL 3
2969 #define VER_LESS_EQUAL 5
2974 #define VER_PLATFORM_WIN32s 0
2975 #define VER_PLATFORM_WIN32_WINDOWS 1
2976 #define VER_PLATFORM_WIN32_NT 2
2977 #define VER_NT_WORKSTATION 1
2978 #define VER_NT_DOMAIN_CONTROLLER 2
2979 #define VER_NT_SERVER 3
2981 #define WT_EXECUTEDEFAULT 0x00000000
2982 #define WT_EXECUTEINIOTHREAD 0x00000001
2983 #define WT_EXECUTEINUITHREAD 0x00000002
2984 #define WT_EXECUTEINWAITTHREAD 0x00000004
2985 #define WT_EXECUTEONLYONCE 0x00000008
2986 #define WT_EXECUTELONGFUNCTION 0x00000010
2987 #define WT_EXECUTEINTIMERTHREAD 0x00000020
2988 #define WT_EXECUTEINPERSISTENTIOTHREAD 0x00000040
2989 #define WT_EXECUTEINPERSISTENTTHREAD 0x00000080
2990 #define WT_TRANSFER_IMPERSONATION 0x00000100
2991 #define WT_SET_MAX_THREADPOOL_THREADS(flags,limit) ((flags)|=(limit)<<16)
2992 typedef VOID (NTAPI
*WORKERCALLBACKFUNC
)(PVOID
);
2993 #if (_WIN32_WINNT >= 0x0501)
2994 #define ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION 1
2995 #define ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION 2
2996 #define ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION 3
2997 #define ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION 4
2998 #define ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION 5
2999 #define ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION 6
3000 #define ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION 7
3001 #define ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES 9
3002 #endif /* (_WIN32_WINNT >= 0x0501) */
3003 #define BTYPE(x) ((x)&N_BTMASK)
3004 #define ISPTR(x) (((x)&N_TMASK)==(IMAGE_SYM_DTYPE_POINTER<<N_BTSHFT))
3005 #define ISFCN(x) (((x)&N_TMASK)==(IMAGE_SYM_DTYPE_FUNCTION<<N_BTSHFT))
3006 #define ISARY(x) (((x)&N_TMASK)==(IMAGE_SYM_DTYPE_ARRAY<<N_BTSHFT))
3007 #define ISTAG(x) ((x)==IMAGE_SYM_CLASS_STRUCT_TAG||(x)==IMAGE_SYM_CLASS_UNION_TAG||(x)==IMAGE_SYM_CLASS_ENUM_TAG)
3008 #define INCREF(x) ((((x)&~N_BTMASK)<<N_TSHIFT)|(IMAGE_SYM_DTYPE_POINTER<<N_BTSHFT)|((x)&N_BTMASK))
3009 #define DECREF(x) ((((x)>>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK))
3010 #define TLS_MINIMUM_AVAILABLE 64
3011 #define FLS_MAXIMUM_AVAILABLE 128
3012 #define REPARSE_GUID_DATA_BUFFER_HEADER_SIZE FIELD_OFFSET(REPARSE_GUID_DATA_BUFFER, GenericReparseBuffer)
3013 #define MAXIMUM_REPARSE_DATA_BUFFER_SIZE 16384
3014 #define IO_REPARSE_TAG_RESERVED_ZERO 0
3015 #define IO_REPARSE_TAG_RESERVED_ONE 1
3016 #define IO_REPARSE_TAG_RESERVED_RANGE IO_REPARSE_TAG_RESERVED_ONE
3017 #define IsReparseTagMicrosoft(x) ((x)&0x80000000)
3018 #define IsReparseTagHighLatency(x) ((x)&0x40000000)
3019 #define IsReparseTagNameSurrogate(x) ((x)&0x20000000)
3020 #define IO_REPARSE_TAG_VALID_VALUES 0xE000FFFF
3021 #define IsReparseTagValid(x) (!((x)&~IO_REPARSE_TAG_VALID_VALUES)&&((x)>IO_REPARSE_TAG_RESERVED_RANGE))
3022 #define IO_REPARSE_TAG_SYMBOLIC_LINK IO_REPARSE_TAG_RESERVED_ZERO
3023 #define IO_REPARSE_TAG_MOUNT_POINT 0xA0000003
3024 #define IO_REPARSE_TAG_SYMLINK 0xA000000CL
3027 #ifdef _GUID_DEFINED
3028 # warning _GUID_DEFINED is deprecated, use GUID_DEFINED instead
3031 #if ! (defined _GUID_DEFINED || defined GUID_DEFINED) /* also defined in basetyps.h */
3032 #define GUID_DEFINED
3033 typedef struct _GUID
{
3034 unsigned long Data1
;
3035 unsigned short Data2
;
3036 unsigned short Data3
;
3037 unsigned char Data4
[8];
3038 } GUID
, *REFGUID
, *LPGUID
;
3039 #endif /* GUID_DEFINED */
3041 typedef enum _ACL_INFORMATION_CLASS
{
3042 AclRevisionInformation
= 1,
3044 } ACL_INFORMATION_CLASS
;
3046 typedef struct _ACL_REVISION_INFORMATION
{
3048 } ACL_REVISION_INFORMATION
, *PACL_REVISION_INFORMATION
;
3050 typedef struct _ACL_SIZE_INFORMATION
{
3052 DWORD AclBytesInUse
;
3054 } ACL_SIZE_INFORMATION
, *PACL_SIZE_INFORMATION
;
3056 #ifndef _LDT_ENTRY_DEFINED
3057 #define _LDT_ENTRY_DEFINED
3059 typedef struct _LDT_ENTRY
{
3077 DWORD Default_Big
:1;
3078 DWORD Granularity
:1;
3082 } LDT_ENTRY
, *PLDT_ENTRY
, *LPLDT_ENTRY
;
3084 #endif /* _LDT_ENTRY_DEFINED */
3086 /* FIXME: add more machines */
3088 #define SIZE_OF_80387_REGISTERS 80
3089 #define CONTEXT_i386 0x10000
3090 #define CONTEXT_i486 0x10000
3091 #define CONTEXT_CONTROL (CONTEXT_i386|0x00000001L)
3092 #define CONTEXT_INTEGER (CONTEXT_i386|0x00000002L)
3093 #define CONTEXT_SEGMENTS (CONTEXT_i386|0x00000004L)
3094 #define CONTEXT_FLOATING_POINT (CONTEXT_i386|0x00000008L)
3095 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386|0x00000010L)
3096 #define CONTEXT_EXTENDED_REGISTERS (CONTEXT_i386|0x00000020L)
3097 #define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_INTEGER|CONTEXT_SEGMENTS)
3098 #define MAXIMUM_SUPPORTED_EXTENSION 512
3100 #define EXCEPTION_READ_FAULT 0
3101 #define EXCEPTION_WRITE_FAULT 1
3102 #define EXCEPTION_EXECUTE_FAULT 8
3104 typedef struct _FLOATING_SAVE_AREA
{
3109 DWORD ErrorSelector
;
3112 BYTE RegisterArea
[SIZE_OF_80387_REGISTERS
];
3114 } FLOATING_SAVE_AREA
, *PFLOATING_SAVE_AREA
;
3116 typedef struct _CONTEXT
{
3124 FLOATING_SAVE_AREA FloatSave
;
3141 BYTE ExtendedRegisters
[MAXIMUM_SUPPORTED_EXTENSION
];
3143 #elif defined(_AMD64_)
3145 #define CONTEXT_AMD64 0x100000
3147 #if !defined(RC_INVOKED)
3148 #define CONTEXT_CONTROL (CONTEXT_AMD64 | 0x1L)
3149 #define CONTEXT_INTEGER (CONTEXT_AMD64 | 0x2L)
3150 #define CONTEXT_SEGMENTS (CONTEXT_AMD64 | 0x4L)
3151 #define CONTEXT_FLOATING_POINT (CONTEXT_AMD64 | 0x8L)
3152 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_AMD64 | 0x10L)
3154 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT)
3155 #define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS | CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS)
3157 #define CONTEXT_EXCEPTION_ACTIVE 0x8000000
3158 #define CONTEXT_SERVICE_ACTIVE 0x10000000
3159 #define CONTEXT_EXCEPTION_REQUEST 0x40000000
3160 #define CONTEXT_EXCEPTION_REPORTING 0x80000000
3163 #define INITIAL_MXCSR 0x1f80
3164 #define INITIAL_FPCSR 0x027f
3165 #define EXCEPTION_READ_FAULT 0
3166 #define EXCEPTION_WRITE_FAULT 1
3167 #define EXCEPTION_EXECUTE_FAULT 8
3169 typedef struct DECLSPEC_ALIGN(16) _M128A
{
3174 typedef struct _XMM_SAVE_AREA32
{
3188 M128A FloatRegisters
[8];
3189 M128A XmmRegisters
[16];
3191 } XMM_SAVE_AREA32
, *PXMM_SAVE_AREA32
;
3193 typedef struct DECLSPEC_ALIGN(16) _CONTEXT
{
3243 /* Floating point */
3245 XMM_SAVE_AREA32 FltSave
;
3269 M128A VectorRegister
[26];
3270 DWORD64 VectorControl
;
3273 DWORD64 DebugControl
;
3274 DWORD64 LastBranchToRip
;
3275 DWORD64 LastBranchFromRip
;
3276 DWORD64 LastExceptionToRip
;
3277 DWORD64 LastExceptionFromRip
;
3281 typedef struct _KNONVOLATILE_CONTEXT_POINTERS
{
3283 PM128A FloatingContext
[16];
3305 PULONG64 IntegerContext
[16];
3325 } KNONVOLATILE_CONTEXT_POINTERS
, *PKNONVOLATILE_CONTEXT_POINTERS
;
3327 #define RUNTIME_FUNCTION_INDIRECT 0x1
3329 typedef struct _RUNTIME_FUNCTION
{
3333 } RUNTIME_FUNCTION
,*PRUNTIME_FUNCTION
;
3335 #define UNWIND_HISTORY_TABLE_SIZE 12
3337 typedef struct _UNWIND_HISTORY_TABLE_ENTRY
3340 PRUNTIME_FUNCTION FunctionEntry
;
3341 } UNWIND_HISTORY_TABLE_ENTRY
, *PUNWIND_HISTORY_TABLE_ENTRY
;
3343 typedef struct _UNWIND_HISTORY_TABLE
3348 ULONG64 HighAddress
;
3349 UNWIND_HISTORY_TABLE_ENTRY Entry
[UNWIND_HISTORY_TABLE_SIZE
];
3350 } UNWIND_HISTORY_TABLE
, *PUNWIND_HISTORY_TABLE
;
3353 _Function_class_(GET_RUNTIME_FUNCTION_CALLBACK
)
3355 (*PGET_RUNTIME_FUNCTION_CALLBACK
)(
3356 _In_ DWORD64 ControlPc
,
3357 _In_opt_ PVOID Context
);
3360 _Function_class_(OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK
)
3361 _Must_inspect_result_
3363 (*POUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK
)(
3364 _In_ HANDLE Process
,
3365 _In_ PVOID TableAddress
,
3366 _Out_ PDWORD Entries
,
3367 _Out_ PRUNTIME_FUNCTION
*Functions
);
3369 #define OUT_OF_PROCESS_FUNCTION_TABLE_CALLBACK_EXPORT_NAME "OutOfProcessFunctionTableCallback"
3374 RtlRestoreContext(struct _CONTEXT
*ContextRecord
,
3375 struct _EXCEPTION_RECORD
*ExceptionRecord
);
3380 RtlAddFunctionTable(PRUNTIME_FUNCTION FunctionTable
,
3382 DWORD64 BaseAddress
);
3387 RtlInstallFunctionTableCallback(DWORD64 TableIdentifier
,
3388 DWORD64 BaseAddress
,
3390 PGET_RUNTIME_FUNCTION_CALLBACK Callback
,
3392 PCWSTR OutOfProcessCallbackDll
);
3397 RtlDeleteFunctionTable(PRUNTIME_FUNCTION FunctionTable
);
3402 RtlLookupFunctionEntry(
3403 _In_ DWORD64 ControlPc
,
3404 _Out_ PDWORD64 ImageBase
,
3405 _Inout_opt_ PUNWIND_HISTORY_TABLE HistoryTable
);
3411 _In_ DWORD HandlerType
,
3412 _In_ DWORD64 ImageBase
,
3413 _In_ DWORD64 ControlPc
,
3414 _In_ PRUNTIME_FUNCTION FunctionEntry
,
3415 _Inout_
struct _CONTEXT
*ContextRecord
,
3416 _Out_ PVOID
*HandlerData
,
3417 _Out_ PDWORD64 EstablisherFrame
,
3418 _Inout_opt_ PKNONVOLATILE_CONTEXT_POINTERS ContextPointers
);
3420 #elif defined(_PPC_)
3421 #define CONTEXT_CONTROL 1L
3422 #define CONTEXT_FLOATING_POINT 2L
3423 #define CONTEXT_INTEGER 4L
3424 #define CONTEXT_DEBUG_REGISTERS 8L
3425 #define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_FLOATING_POINT|CONTEXT_INTEGER)
3426 typedef struct _FLOATING_SAVE_AREA
3461 } FLOATING_SAVE_AREA
;
3463 typedef struct _CONTEXT
{
3464 FLOATING_SAVE_AREA FloatSave
;
3514 #elif defined(_ALPHA_)
3515 #define CONTEXT_ALPHA 0x20000
3516 #define CONTEXT_CONTROL (CONTEXT_ALPHA|1L)
3517 #define CONTEXT_FLOATING_POINT (CONTEXT_ALPHA|2L)
3518 #define CONTEXT_INTEGER (CONTEXT_ALPHA|4L)
3519 #define CONTEXT_FULL (CONTEXT_CONTROL|CONTEXT_FLOATING_POINT|CONTEXT_INTEGER)
3520 typedef struct _CONTEXT
{
3594 /* These are the debug or break registers on the SH3 */
3595 typedef struct _DEBUG_REGISTERS
{
3608 } DEBUG_REGISTERS
, *PDEBUG_REGISTERS
;
3610 /* The following flags control the contents of the CONTEXT structure. */
3612 #define CONTEXT_SH3 0x00000040
3613 #define CONTEXT_SH4 0x000000c0 /* CONTEXT_SH3 | 0x80 - must contain the SH3 bits */
3616 #define CONTEXT_CONTROL (CONTEXT_SH3 | 0x00000001L)
3617 #define CONTEXT_INTEGER (CONTEXT_SH3 | 0x00000002L)
3618 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_SH3 | 0x00000008L)
3619 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_DEBUG_REGISTERS)
3621 #define CONTEXT_CONTROL (CONTEXT_SH4 | 0x00000001L)
3622 #define CONTEXT_INTEGER (CONTEXT_SH4 | 0x00000002L)
3623 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_SH4 | 0x00000008L)
3624 #define CONTEXT_FLOATING_POINT (CONTEXT_SH4 | 0x00000004L)
3625 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_DEBUG_REGISTERS | CONTEXT_FLOATING_POINT)
3630 /* This frame is used to store a limited processor context into the */
3631 /* Thread structure for CPUs which have no floating point support. */
3633 typedef struct _CONTEXT
{
3634 /* The flags values within this flag control the contents of */
3635 /* a CONTEXT record. */
3637 /* If the context record is used as an input parameter, then */
3638 /* for each portion of the context record controlled by a flag */
3639 /* whose value is set, it is assumed that that portion of the */
3640 /* context record contains valid context. If the context record */
3641 /* is being used to modify a thread's context, then only that */
3642 /* portion of the threads context will be modified. */
3644 /* If the context record is used as an IN OUT parameter to capture */
3645 /* the context of a thread, then only those portions of the thread's */
3646 /* context corresponding to set flags will be returned. */
3648 /* The context record is never used as an OUT only parameter. */
3653 /* This section is specified/returned if the ContextFlags word contains */
3654 /* the flag CONTEXT_INTEGER. */
3656 /* N.B. The registers RA and R15 are defined in this section, but are */
3657 /* considered part of the control context rather than part of the integer */