4 * This file is part of the ReactOS PSDK package.
7 * Created by Casper S. Hornstrup <chorns@users.sourceforge.net>
9 * THIS SOFTWARE IS NOT COPYRIGHTED
11 * This source code is offered for use in the public domain. You may
12 * use, modify or distribute it freely.
14 * This code is distributed in the hope that it will be useful but
15 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
16 * DISCLAIMED. This includes but is not limited to warranties of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
30 #include <sdkddkver.h>
31 #include <specstrings.h>
32 #include <kernelspecs.h>
38 /* Default to strict */
45 /* Pseudo Modifiers for Input Parameters */
67 /* Constant modifier */
82 #define NULL ((void *)0)
83 #define NULL64 ((void * POINTER_64)0)
87 /* Defines the "size" of an any-size array */
89 #define ANYSIZE_ARRAY 1
92 /* Helper macro to enable gcc's extension. */
93 #ifndef __GNU_EXTENSION
95 #define __GNU_EXTENSION __extension__
97 #define __GNU_EXTENSION
101 #ifndef DUMMYUNIONNAME
102 #if defined(NONAMELESSUNION)// || !defined(_MSC_EXTENSIONS)
103 #define _ANONYMOUS_UNION
104 #define _UNION_NAME(x) x
105 #define DUMMYUNIONNAME u
106 #define DUMMYUNIONNAME1 u1
107 #define DUMMYUNIONNAME2 u2
108 #define DUMMYUNIONNAME3 u3
109 #define DUMMYUNIONNAME4 u4
110 #define DUMMYUNIONNAME5 u5
111 #define DUMMYUNIONNAME6 u6
112 #define DUMMYUNIONNAME7 u7
113 #define DUMMYUNIONNAME8 u8
114 #define DUMMYUNIONNAME9 u9
116 #define _ANONYMOUS_UNION __GNU_EXTENSION
117 #define _UNION_NAME(x)
118 #define DUMMYUNIONNAME
119 #define DUMMYUNIONNAME1
120 #define DUMMYUNIONNAME2
121 #define DUMMYUNIONNAME3
122 #define DUMMYUNIONNAME4
123 #define DUMMYUNIONNAME5
124 #define DUMMYUNIONNAME6
125 #define DUMMYUNIONNAME7
126 #define DUMMYUNIONNAME8
127 #define DUMMYUNIONNAME9
128 #endif /* NONAMELESSUNION */
129 #endif /* !DUMMYUNIONNAME */
131 #ifndef DUMMYSTRUCTNAME
132 #if defined(NONAMELESSUNION)// || !defined(_MSC_EXTENSIONS)
133 #define _ANONYMOUS_STRUCT
134 #define _STRUCT_NAME(x) x
135 #define DUMMYSTRUCTNAME s
136 #define DUMMYSTRUCTNAME1 s1
137 #define DUMMYSTRUCTNAME2 s2
138 #define DUMMYSTRUCTNAME3 s3
139 #define DUMMYSTRUCTNAME4 s4
140 #define DUMMYSTRUCTNAME5 s5
142 #define _ANONYMOUS_STRUCT __GNU_EXTENSION
143 #define _STRUCT_NAME(x)
144 #define DUMMYSTRUCTNAME
145 #define DUMMYSTRUCTNAME1
146 #define DUMMYSTRUCTNAME2
147 #define DUMMYSTRUCTNAME3
148 #define DUMMYSTRUCTNAME4
149 #define DUMMYSTRUCTNAME5
150 #endif /* NONAMELESSUNION */
151 #endif /* DUMMYSTRUCTNAME */
153 #if defined(STRICT_GS_ENABLED)
154 #pragma strict_gs_check(push, on)
157 #if defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) || defined(_M_AMD64) || defined(_M_ARM)
158 #define ALIGNMENT_MACHINE
159 #define UNALIGNED __unaligned
161 #define UNALIGNED64 __unaligned
166 #undef ALIGNMENT_MACHINE
171 #if defined(_WIN64) || defined(_M_ALPHA)
172 #define MAX_NATURAL_ALIGNMENT sizeof(ULONGLONG)
173 #define MEMORY_ALLOCATION_ALIGNMENT 16
175 #define MAX_NATURAL_ALIGNMENT sizeof(ULONG)
176 #define MEMORY_ALLOCATION_ALIGNMENT 8
179 #if defined(_M_MRX000) && !(defined(MIDL_PASS) || defined(RC_INVOKED)) && defined(ENABLE_RESTRICTED)
180 #define RESTRICTED_POINTER __restrict
182 #define RESTRICTED_POINTER
185 #define ARGUMENT_PRESENT(ArgumentPointer) \
186 ((CHAR*)((ULONG_PTR)(ArgumentPointer)) != (CHAR*)NULL)
188 /* Returns the base address of a structure from a structure member */
189 #ifndef CONTAINING_RECORD
190 #define CONTAINING_RECORD(address, type, field) \
191 ((type *)(((ULONG_PTR)address) - (ULONG_PTR)(&(((type *)0)->field))))
194 /* Returns the byte offset of the specified structure's member */
196 #define FIELD_OFFSET(Type, Field) ((LONG)(LONG_PTR)&(((Type*) 0)->Field))
198 #define FIELD_OFFSET(Type, Field) ((LONG)__builtin_offsetof(Type, Field))
201 /* Returns the type's alignment */
202 #if defined(_MSC_VER)
203 #define TYPE_ALIGNMENT(t) __alignof(t)
205 #define TYPE_ALIGNMENT(t) FIELD_OFFSET(struct { char x; t test; }, test)
208 #if defined(_AMD64_) || defined(_X86_)
209 #define PROBE_ALIGNMENT(_s) TYPE_ALIGNMENT(ULONG)
210 #elif defined(_IA64_) || defined(_ARM_)
211 #define PROBE_ALIGNMENT(_s) max((TYPE_ALIGNMENT(_s), TYPE_ALIGNMENT(ULONG))
213 #error "unknown architecture"
217 #define PROBE_ALIGNMENT32(_s) TYPE_ALIGNMENT(ULONG)
221 #define EXTERN_C extern "C"
223 #define EXTERN_C extern
226 /* Calling Conventions */
227 #if defined(_MANAGED)
228 #define FASTCALL __stdcall
229 #elif defined(_M_IX86)
230 #define FASTCALL __fastcall
235 #define NTAPI __stdcall
237 #ifndef STDMETHODCALLTYPE
238 #define STDMETHODCALLTYPE __stdcall
239 #define STDMETHODVCALLTYPE __cdecl
240 #define STDAPICALLTYPE __stdcall
241 #define STDAPIVCALLTYPE __cdecl
242 #define STDAPI EXTERN_C HRESULT STDAPICALLTYPE
243 #define STDAPI_(t) EXTERN_C t STDAPICALLTYPE
244 #define STDMETHODIMP HRESULT STDMETHODCALLTYPE
245 #define STDMETHODIMP_(t) t STDMETHODCALLTYPE
246 #define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE
247 #define STDAPIV_(t) EXTERN_C t STDAPIVCALLTYPE
248 #define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE
249 #define STDMETHODIMPV_(t) t STDMETHODVCALLTYPE
250 #endif /* !STDMETHODCALLTYPE */
252 #define STDOVERRIDEMETHODIMP __override STDMETHODIMP
253 #define STDOVERRIDEMETHODIMP_(t) __override STDMETHODIMP_(t)
254 #define IFACEMETHODIMP __override STDMETHODIMP
255 #define IFACEMETHODIMP_(t) __override STDMETHODIMP_(t)
256 #define STDOVERRIDEMETHODIMPV __override STDMETHODIMPV
257 #define STDOVERRIDEMETHODIMPV_(t) __override STDMETHODIMPV_(t)
258 #define IFACEMETHODIMPV __override STDMETHODIMPV
259 #define IFACEMETHODIMPV_(t) __override STDMETHODIMPV_(t)
262 /* Import and Export Specifiers */
264 /* Done the same way as in windef.h for now */
265 #define DECLSPEC_IMPORT __declspec(dllimport)
266 #define DECLSPEC_NORETURN __declspec(noreturn)
268 #ifndef DECLSPEC_ADDRSAFE
269 #if defined(_MSC_VER) && (defined(_M_ALPHA) || defined(_M_AXP64))
270 #define DECLSPEC_ADDRSAFE __declspec(address_safe)
272 #define DECLSPEC_ADDRSAFE
274 #endif /* DECLSPEC_ADDRSAFE */
276 #ifndef DECLSPEC_NOTHROW
277 #if !defined(MIDL_PASS)
278 #define DECLSPEC_NOTHROW __declspec(nothrow)
280 #define DECLSPEC_NOTHROW
285 #if defined(_MSC_VER)
286 #define NOP_FUNCTION __noop
288 #define NOP_FUNCTION (void)0
292 #if !defined(_NTSYSTEM_)
293 #define NTSYSAPI DECLSPEC_IMPORT
294 #define NTSYSCALLAPI DECLSPEC_IMPORT
297 #if defined(_NTDLLBUILD_)
300 #define NTSYSCALLAPI DECLSPEC_ADDRSAFE
306 #if defined(_MSC_VER)
307 #define FORCEINLINE __forceinline
308 #elif ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L)
309 # define FORCEINLINE extern inline __attribute__((__always_inline__,__gnu_inline__))
311 # define FORCEINLINE extern __inline__ __attribute__((__always_inline__))
313 #endif /* FORCEINLINE */
315 #ifndef DECLSPEC_NOINLINE
316 #if (_MSC_VER >= 1300)
317 #define DECLSPEC_NOINLINE __declspec(noinline)
318 #elif defined(__GNUC__)
319 #define DECLSPEC_NOINLINE __attribute__((noinline))
321 #define DECLSPEC_NOINLINE
323 #endif /* DECLSPEC_NOINLINE */
325 #if !defined(_M_CEE_PURE)
326 #define NTAPI_INLINE NTAPI
331 /* Use to specify structure alignment */
332 #ifndef DECLSPEC_ALIGN
333 #if defined(_MSC_VER) && !defined(MIDL_PASS)
334 #define DECLSPEC_ALIGN(x) __declspec(align(x))
335 #elif defined(__GNUC__)
336 #define DECLSPEC_ALIGN(x) __attribute__ ((__aligned__(x)))
338 #define DECLSPEC_ALIGN(x)
340 #endif /* DECLSPEC_ALIGN */
342 #ifndef SYSTEM_CACHE_ALIGNMENT_SIZE
343 #if defined(_AMD64_) || defined(_X86_)
344 #define SYSTEM_CACHE_ALIGNMENT_SIZE 64
346 #define SYSTEM_CACHE_ALIGNMENT_SIZE 128
350 #ifndef DECLSPEC_CACHEALIGN
351 #define DECLSPEC_CACHEALIGN DECLSPEC_ALIGN(SYSTEM_CACHE_ALIGNMENT_SIZE)
354 #ifndef DECLSPEC_UUID
355 #if defined(_MSC_VER) && defined(__cplusplus)
356 #define DECLSPEC_UUID(x) __declspec(uuid(x))
358 #define DECLSPEC_UUID(x)
362 #ifndef DECLSPEC_NOVTABLE
363 #if defined(_MSC_VER) && defined(__cplusplus)
364 #define DECLSPEC_NOVTABLE __declspec(novtable)
366 #define DECLSPEC_NOVTABLE
370 #ifndef DECLSPEC_SELECTANY
371 #if defined(_MSC_VER) || defined(__GNUC__)
372 #define DECLSPEC_SELECTANY __declspec(selectany)
374 #define DECLSPEC_SELECTANY
378 #ifndef DECLSPEC_DEPRECATED
379 #if (defined(_MSC_VER) || defined(__GNUC__)) && !defined(MIDL_PASS)
380 #define DECLSPEC_DEPRECATED __declspec(deprecated)
381 #define DEPRECATE_SUPPORTED
383 #define DECLSPEC_DEPRECATED
384 #undef DEPRECATE_SUPPORTED
388 #ifdef DEPRECATE_DDK_FUNCTIONS
390 #define DECLSPEC_DEPRECATED_DDK DECLSPEC_DEPRECATED
391 #ifdef DEPRECATE_SUPPORTED
392 #define PRAGMA_DEPRECATED_DDK 1
395 #define DECLSPEC_DEPRECATED_DDK
396 #define PRAGMA_DEPRECATED_DDK 1
399 #define DECLSPEC_DEPRECATED_DDK
400 #define PRAGMA_DEPRECATED_DDK 0
403 /* Use to silence unused variable warnings when it is intentional */
404 #define UNREFERENCED_PARAMETER(P) {(P)=(P);}
405 #define UNREFERENCED_LOCAL_VARIABLE(L) ((void)(L))
406 #define DBG_UNREFERENCED_PARAMETER(P) {(P)=(P);}
407 #define DBG_UNREFERENCED_LOCAL_VARIABLE(L) ((void)(L))
409 /* min/max helper macros */
413 #define min(a,b) (((a) < (b)) ? (a) : (b))
417 #define max(a,b) (((a) > (b)) ? (a) : (b))
420 #endif /* NOMINMAX */
422 /* Tell windef.h that we have defined some basic types */
427 typedef void * POINTER_64 PVOID64
;
430 typedef void *HANDLE
, **PHANDLE
;;
432 #define DECLARE_HANDLE(n) typedef struct n##__{int unused;} *n
434 #define DECLARE_HANDLE(n) typedef HANDLE n
437 /* Upper-Case Versions of Some Standard C Types */
443 #if !defined(MIDL_PASS)
448 /* Avoid redefinition in windef.h */
452 typedef unsigned char UCHAR
, *PUCHAR
;
453 typedef unsigned short USHORT
, *PUSHORT
;
454 typedef unsigned long ULONG
, *PULONG
;
456 typedef CONST UCHAR
*PCUCHAR
;
457 typedef CONST USHORT
*PCUSHORT
;
458 typedef CONST ULONG
*PCULONG
;
460 typedef double DOUBLE
;
463 typedef SHORT
*PSHORT
;
467 typedef unsigned char FCHAR
;
468 typedef unsigned short FSHORT
;
469 typedef unsigned long FLONG
;
471 typedef unsigned char BOOLEAN
, *PBOOLEAN
;
472 typedef ULONG LOGICAL
, *PLOGICAL
;
473 typedef _Return_type_success_(return >= 0) LONG NTSTATUS
, *PNTSTATUS
;;
474 typedef signed char SCHAR
, *PSCHAR
;
476 #ifndef _HRESULT_DEFINED
477 #define _HRESULT_DEFINED
478 typedef _Return_type_success_(return >= 0) LONG HRESULT
;
483 __GNU_EXTENSION
typedef __int64 LONGLONG
, *PLONGLONG
;
484 __GNU_EXTENSION
typedef unsigned __int64 ULONGLONG
, *PULONGLONG
;
486 typedef ULONGLONG DWORDLONG
, *PDWORDLONG
;
488 /* Update Sequence Number */
489 typedef LONGLONG USN
;
491 /* ANSI (Multi-byte Character) types */
492 typedef CHAR
*PCHAR
, *LPCH
, *PCH
, *PNZCH
;
493 typedef CONST CHAR
*LPCCH
, *PCCH
, *PCNZCH
;
494 typedef _Null_terminated_ CHAR
*NPSTR
, *LPSTR
, *PSTR
;
495 typedef _Null_terminated_ PSTR
*PZPSTR
;
496 typedef _Null_terminated_ CONST PSTR
*PCZPSTR
;
497 typedef _Null_terminated_ CONST CHAR
*LPCSTR
, *PCSTR
;
498 typedef _Null_terminated_ PCSTR
*PZPCSTR
;
500 typedef _NullNull_terminated_ CHAR
*PZZSTR
;
501 typedef _NullNull_terminated_ CONST CHAR
*PCZZSTR
;
503 /* Pointer to an Asciiz string */
504 typedef _Null_terminated_ CHAR
*PSZ
;
505 typedef _Null_terminated_ CONST
char *PCSZ
;
507 /* UNICODE (Wide Character) types */
508 typedef wchar_t WCHAR
;
509 typedef WCHAR
*PWCHAR
, *LPWCH
, *PWCH
;
510 typedef CONST WCHAR
*LPCWCH
, *PCWCH
;
511 typedef _Null_terminated_ WCHAR
*NWPSTR
, *LPWSTR
, *PWSTR
;
512 typedef _Null_terminated_ PWSTR
*PZPWSTR
;
513 typedef _Null_terminated_ CONST PWSTR
*PCZPWSTR
;
514 typedef _Null_terminated_ WCHAR UNALIGNED
*LPUWSTR
, *PUWSTR
;
515 typedef _Null_terminated_ CONST WCHAR
*LPCWSTR
, *PCWSTR
;
516 typedef _Null_terminated_ PCWSTR
*PZPCWSTR
;
517 typedef _Null_terminated_ CONST WCHAR UNALIGNED
*LPCUWSTR
, *PCUWSTR
;
519 typedef _NullNull_terminated_ WCHAR
*PZZWSTR
;
520 typedef _NullNull_terminated_ CONST WCHAR
*PCZZWSTR
;
521 typedef _NullNull_terminated_ WCHAR UNALIGNED
*PUZZWSTR
;
522 typedef _NullNull_terminated_ CONST WCHAR UNALIGNED
*PCUZZWSTR
;
524 typedef WCHAR
*PNZWCH
;
525 typedef CONST WCHAR
*PCNZWCH
;
526 typedef WCHAR UNALIGNED
*PUNZWCH
;
527 typedef CONST WCHAR UNALIGNED
*PCUNZWCH
;
529 #if (_WIN32_WINNT >= 0x0600) || (defined(__cplusplus) && defined(WINDOWS_ENABLE_CPLUSPLUS))
530 typedef CONST WCHAR
*LPCWCHAR
, *PCWCHAR
;
531 typedef CONST WCHAR UNALIGNED
*LPCUWCHAR
, *PCUWCHAR
;
532 typedef unsigned long UCSCHAR
, *PUCSCHAR
, *PUCSSTR
;
533 typedef const UCSCHAR
*PCUCSCHAR
, *PCUCSSTR
;
534 typedef UCSCHAR UNALIGNED
*PUUCSCHAR
, *PUUCSSTR
;
535 typedef const UCSCHAR UNALIGNED
*PCUUCSCHAR
, *PCUUCSSTR
;
536 #define UCSCHAR_INVALID_CHARACTER (0xffffffff)
537 #define MIN_UCSCHAR (0)
538 #define MAX_UCSCHAR (0x0010FFFF)
539 #endif /* _WIN32_WINNT >= 0x0600 */
543 #ifndef _TCHAR_DEFINED
544 typedef WCHAR TCHAR
, *PTCHAR
;
545 typedef WCHAR TUCHAR
, *PTUCHAR
;
546 #define _TCHAR_DEFINED
547 #endif /* !_TCHAR_DEFINED */
548 typedef LPWCH LPTCH
, PTCH
;
549 typedef LPCWCH LPCTCH
, PCTCH
;
550 typedef LPWSTR PTSTR
, LPTSTR
;
551 typedef LPCWSTR PCTSTR
, LPCTSTR
;
552 typedef LPUWSTR PUTSTR
, LPUTSTR
;
553 typedef LPCUWSTR PCUTSTR
, LPCUTSTR
;
555 typedef PZZWSTR PZZTSTR
;
556 typedef PCZZWSTR PCZZTSTR
;
557 typedef PUZZWSTR PUZZTSTR
;
558 typedef PCUZZWSTR PCUZZTSTR
;
559 typedef PZPWSTR PZPTSTR
;
560 typedef PNZWCH PNZTCH
;
561 typedef PCNZWCH PCNZTCH
;
562 typedef PUNZWCH PUNZTCH
;
563 typedef PCUNZWCH PCUNZTCH
;
564 #define __TEXT(quote) L##quote
568 #ifndef _TCHAR_DEFINED
569 typedef char TCHAR
, *PTCHAR
;
570 typedef unsigned char TUCHAR
, *PTUCHAR
;
571 #define _TCHAR_DEFINED
572 #endif /* !_TCHAR_DEFINED */
573 typedef LPCH LPTCH
, PTCH
;
574 typedef LPCCH LPCTCH
, PCTCH
;
575 typedef LPSTR PTSTR
, LPTSTR
, PUTSTR
, LPUTSTR
;
576 typedef LPCSTR PCTSTR
, LPCTSTR
, PCUTSTR
, LPCUTSTR
;
577 typedef PZZSTR PZZTSTR
, PUZZTSTR
;
578 typedef PCZZSTR PCZZTSTR
, PCUZZTSTR
;
579 typedef PZPSTR PZPTSTR
;
580 typedef PNZCH PNZTCH
, PUNZTCH
;
581 typedef PCNZCH PCNZTCH
, PCUNZTCH
;
582 #define __TEXT(quote) quote // r_winnt
584 #endif /* UNICODE */ // r_winnt
585 #define TEXT(quote) __TEXT(quote) // r_winnt
587 /* Cardinal Data Types */
589 typedef CCHAR
*PCCHAR
;
590 typedef short CSHORT
, *PCSHORT
;
591 typedef ULONG CLONG
, *PCLONG
;
593 /* NLS basics (Locale and Language Ids) */
594 typedef unsigned long LCID
, *PLCID
;
595 typedef unsigned short LANGID
;
597 #ifndef __COMPARTMENT_ID_DEFINED__
598 #define __COMPARTMENT_ID_DEFINED__
601 UNSPECIFIED_COMPARTMENT_ID
= 0,
602 DEFAULT_COMPARTMENT_ID
603 } COMPARTMENT_ID
, *PCOMPARTMENT_ID
;
604 #endif /* __COMPARTMENT_ID_DEFINED__ */
607 #pragma warning(push)
608 #pragma warning(disable:4201)
611 /* Used to store a non-float 8 byte aligned structure */
614 _ANONYMOUS_UNION
union
616 __GNU_EXTENSION __int64 UseThisFieldToCopy
;
617 double DoNotUseThisField
;
619 } QUAD
, *PQUAD
, UQUAD
, *PUQUAD
;
621 /* Large Integer Unions */
622 #if defined(MIDL_PASS)
623 typedef struct _LARGE_INTEGER
{
625 typedef union _LARGE_INTEGER
{
626 _ANONYMOUS_STRUCT
struct
636 #endif /* MIDL_PASS */
638 } LARGE_INTEGER
, *PLARGE_INTEGER
;
640 #if defined(MIDL_PASS)
641 typedef struct _ULARGE_INTEGER
{
643 typedef union _ULARGE_INTEGER
{
644 _ANONYMOUS_STRUCT
struct
654 #endif /* MIDL_PASS */
656 } ULARGE_INTEGER
, *PULARGE_INTEGER
;
659 #pragma warning(pop) /* disable:4201 */
662 /* Physical Addresses are always treated as 64-bit wide */
663 typedef LARGE_INTEGER PHYSICAL_ADDRESS
, *PPHYSICAL_ADDRESS
;
665 /* Locally Unique Identifier */
666 typedef struct _LUID
{
671 /* Native API Return Value Macros */
672 #define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)
673 #define NT_INFORMATION(Status) ((((ULONG)(Status)) >> 30) == 1)
674 #define NT_WARNING(Status) ((((ULONG)(Status)) >> 30) == 2)
675 #define NT_ERROR(Status) ((((ULONG)(Status)) >> 30) == 3)
678 typedef struct _UNICODE_STRING
{
680 USHORT MaximumLength
;
682 [size_is(MaximumLength
/ 2), length_is((Length
) / 2)] PUSHORT Buffer
;
684 _Field_size_bytes_part_(MaximumLength
, Length
) PWCH Buffer
;
686 } UNICODE_STRING
, *PUNICODE_STRING
;
687 typedef const UNICODE_STRING
* PCUNICODE_STRING
;
689 #define UNICODE_NULL ((WCHAR)0)
690 #define UNICODE_STRING_MAX_BYTES ((USHORT) 65534)
691 #define UNICODE_STRING_MAX_CHARS (32767)
693 typedef struct _CSTRING
{
695 USHORT MaximumLength
;
697 } CSTRING
, *PCSTRING
;
698 #define ANSI_NULL ((CHAR)0)
700 typedef struct _STRING
{
702 USHORT MaximumLength
;
704 [size_is(MaximumLength
), length_is(Length
) ]
706 _Field_size_bytes_part_opt_(MaximumLength
, Length
) PCHAR Buffer
;
709 typedef STRING ANSI_STRING
;
710 typedef PSTRING PANSI_STRING
;
711 typedef STRING OEM_STRING
;
712 typedef PSTRING POEM_STRING
;
713 typedef CONST STRING
* PCOEM_STRING
;
714 typedef STRING CANSI_STRING
;
715 typedef PSTRING PCANSI_STRING
;
717 typedef struct _STRING32
{
719 USHORT MaximumLength
;
721 } STRING32
, *PSTRING32
,
722 UNICODE_STRING32
, *PUNICODE_STRING32
,
723 ANSI_STRING32
, *PANSI_STRING32
;
725 typedef struct _STRING64
{
727 USHORT MaximumLength
;
729 } STRING64
, *PSTRING64
,
730 UNICODE_STRING64
, *PUNICODE_STRING64
,
731 ANSI_STRING64
, *PANSI_STRING64
;
733 /* Object Attributes */
734 typedef struct _OBJECT_ATTRIBUTES
{
736 HANDLE RootDirectory
;
737 PUNICODE_STRING ObjectName
;
739 PVOID SecurityDescriptor
;
740 PVOID SecurityQualityOfService
;
741 } OBJECT_ATTRIBUTES
, *POBJECT_ATTRIBUTES
;
742 typedef CONST OBJECT_ATTRIBUTES
*PCOBJECT_ATTRIBUTES
;
744 typedef struct _OBJECT_ATTRIBUTES32
{
749 ULONG SecurityDescriptor
;
750 ULONG SecurityQualityOfService
;
751 } OBJECT_ATTRIBUTES32
, *POBJECT_ATTRIBUTES32
;
752 typedef CONST OBJECT_ATTRIBUTES32
*PCOBJECT_ATTRIBUTES32
;
754 typedef struct _OBJECT_ATTRIBUTES64
{
756 ULONG64 RootDirectory
;
759 ULONG64 SecurityDescriptor
;
760 ULONG64 SecurityQualityOfService
;
761 } OBJECT_ATTRIBUTES64
, *POBJECT_ATTRIBUTES64
;
762 typedef CONST OBJECT_ATTRIBUTES64
*PCOBJECT_ATTRIBUTES64
;
764 /* Values for the Attributes member */
765 #define OBJ_INHERIT 0x00000002L
766 #define OBJ_PERMANENT 0x00000010L
767 #define OBJ_EXCLUSIVE 0x00000020L
768 #define OBJ_CASE_INSENSITIVE 0x00000040L
769 #define OBJ_OPENIF 0x00000080L
770 #define OBJ_OPENLINK 0x00000100L
771 #define OBJ_KERNEL_HANDLE 0x00000200L
772 #define OBJ_FORCE_ACCESS_CHECK 0x00000400L
773 #define OBJ_VALID_ATTRIBUTES 0x000007F2L
776 #define InitializeObjectAttributes(p,n,a,r,s) { \
777 (p)->Length = sizeof(OBJECT_ATTRIBUTES); \
778 (p)->RootDirectory = (r); \
779 (p)->ObjectName = (n); \
780 (p)->Attributes = (a); \
781 (p)->SecurityDescriptor = (s); \
782 (p)->SecurityQualityOfService = NULL; \
785 #define RTL_CONSTANT_OBJECT_ATTRIBUTES(n,a) { \
786 sizeof(OBJECT_ATTRIBUTES), \
788 RTL_CONST_CAST(PUNICODE_STRING)(n), \
794 #define RTL_INIT_OBJECT_ATTRIBUTES(n, a) \
795 RTL_CONSTANT_OBJECT_ATTRIBUTES(n, a)
798 typedef enum _NT_PRODUCT_TYPE
{
802 } NT_PRODUCT_TYPE
, *PNT_PRODUCT_TYPE
;
804 typedef enum _EVENT_TYPE
{
809 typedef enum _TIMER_TYPE
{
814 typedef enum _WAIT_TYPE
{
819 /* Doubly Linked Lists */
820 typedef struct _LIST_ENTRY
{
821 struct _LIST_ENTRY
*Flink
;
822 struct _LIST_ENTRY
*Blink
;
823 } LIST_ENTRY
, *PLIST_ENTRY
, *RESTRICTED_POINTER PRLIST_ENTRY
;
825 typedef struct LIST_ENTRY32
{
828 } LIST_ENTRY32
, *PLIST_ENTRY32
;
830 typedef struct LIST_ENTRY64
{
833 } LIST_ENTRY64
, *PLIST_ENTRY64
;
835 /* Singly Linked Lists */
836 typedef struct _SINGLE_LIST_ENTRY
{
837 struct _SINGLE_LIST_ENTRY
*Next
;
838 } SINGLE_LIST_ENTRY
, *PSINGLE_LIST_ENTRY
;
840 typedef struct _SINGLE_LIST_ENTRY32
{
842 } SINGLE_LIST_ENTRY32
, *PSINGLE_LIST_ENTRY32
;
844 typedef struct _PROCESSOR_NUMBER
{
848 } PROCESSOR_NUMBER
, *PPROCESSOR_NUMBER
;
850 #define ALL_PROCESSOR_GROUPS 0xffff
853 _Function_class_(EXCEPTION_ROUTINE
)
855 EXCEPTION_DISPOSITION
858 _Inout_
struct _EXCEPTION_RECORD
*ExceptionRecord
,
859 _In_ PVOID EstablisherFrame
,
860 _Inout_
struct _CONTEXT
*ContextRecord
,
861 _In_ PVOID DispatcherContext
);
863 typedef EXCEPTION_ROUTINE
*PEXCEPTION_ROUTINE
;
865 typedef struct _GROUP_AFFINITY
{
869 } GROUP_AFFINITY
, *PGROUP_AFFINITY
;
873 #define RTL_FIELD_TYPE(type, field) (((type*)0)->field)
874 #define RTL_BITS_OF(sizeOfArg) (sizeof(sizeOfArg) * 8)
875 #define RTL_BITS_OF_FIELD(type, field) (RTL_BITS_OF(RTL_FIELD_TYPE(type, field)))
878 extern "C++" template<typename _Type
> struct _RTL_remove_const_template
;
879 extern "C++" template<typename _Type
> struct _RTL_remove_const_template
<const _Type
&> { typedef _Type type
; };
880 #define _RTL_CONSTANT_STRING_remove_const_macro(s) \
881 (const_cast<_RTL_remove_const_template<decltype((s)[0])>::type*>(s))
882 extern "C++" template<class _Ty
> struct _RTL_CONSTANT_STRING_type_check_template
;
883 extern "C++" template<class _Ty
, int _Count
> struct _RTL_CONSTANT_STRING_type_check_template
<const _Ty (&)[_Count
]> { typedef char type
; };
884 #define _RTL_CONSTANT_STRING_type_check(s) _RTL_CONSTANT_STRING_type_check_template<decltype(s)>::type
886 #define _RTL_CONSTANT_STRING_remove_const_macro(s) (s)
887 char _RTL_CONSTANT_STRING_type_check(const void *s
);
889 #define RTL_CONSTANT_STRING(s) { \
890 sizeof(s)-sizeof((s)[0]), \
891 sizeof(s) / sizeof(_RTL_CONSTANT_STRING_type_check(s)), \
892 _RTL_CONSTANT_STRING_remove_const_macro(s) }
894 #define RTL_FIELD_SIZE(type, field) (sizeof(((type *)0)->field))
896 #define RTL_SIZEOF_THROUGH_FIELD(type, field) \
897 (FIELD_OFFSET(type, field) + RTL_FIELD_SIZE(type, field))
899 #define RTL_CONTAINS_FIELD(Struct, Size, Field) \
900 ( (((PCHAR)(&(Struct)->Field)) + sizeof((Struct)->Field)) <= (((PCHAR)(Struct))+(Size)) )
902 #define RTL_NUMBER_OF_V1(A) (sizeof(A)/sizeof((A)[0]))
905 #define RTL_NUMBER_OF_V2(A) \
906 (({ int _check_array_type[__builtin_types_compatible_p(typeof(A), typeof(&A[0])) ? -1 : 1]; (void)_check_array_type; }), \
909 /// \todo implement security checks for cplusplus / MSVC
910 #define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A)
913 #ifdef ENABLE_RTL_NUMBER_OF_V2
914 #define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V2(A)
916 #define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V1(A)
918 #define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A)
919 #define _ARRAYSIZE(A) RTL_NUMBER_OF_V1(A)
921 #define RTL_NUMBER_OF_FIELD(type, field) \
922 (RTL_NUMBER_OF(RTL_FIELD_TYPE(type, field)))
924 #define RTL_PADDING_BETWEEN_FIELDS(type, field1, field2) \
925 ((FIELD_OFFSET(type, field2) > FIELD_OFFSET(type, field1)) \
926 ? (FIELD_OFFSET(type, field2) - FIELD_OFFSET(type, field1) - RTL_FIELD_SIZE(type, field1)) \
927 : (FIELD_OFFSET(type, field1) - FIELD_OFFSET(type, field2) - RTL_FIELD_SIZE(type, field2)))
929 #if defined(__cplusplus)
930 #define RTL_CONST_CAST(type) const_cast<type>
932 #define RTL_CONST_CAST(type) (type)
938 #define MINSHORT 0x8000
939 #define MAXSHORT 0x7fff
940 #define MINLONG 0x80000000
941 #define MAXLONG 0x7fffffff
942 #define MAXUCHAR 0xff
943 #define MAXUSHORT 0xffff
944 #define MAXULONG 0xffffffff
945 #define MAXLONGLONG (0x7fffffffffffffffLL)
947 /* Multiplication and Shift Operations. Note: we don't use inline
948 asm functions, the compiler can optimize this better. */
949 #define Int32x32To64(a,b) (((__int64)(long)(a))*((__int64)(long)(b)))
950 #define UInt32x32To64(a,b) ((unsigned __int64)(unsigned int)(a)*(unsigned __int64)(unsigned int)(b))
952 #if defined(MIDL_PASS)|| defined(RC_INVOKED) || defined(_M_CEE_PURE)
953 /* Use native math */
954 #define Int64ShllMod32(a,b) ((unsigned __int64)(a)<<(b))
955 #define Int64ShraMod32(a,b) (((__int64)(a))>>(b))
956 #define Int64ShrlMod32(a,b) (((unsigned __int64)(a))>>(b))
959 #define Int64ShllMod32(a,b) __ll_lshift(a,b)
960 #define Int64ShraMod32(a,b) __ll_rshift(a,b)
961 #define Int64ShrlMod32(a,b) __ull_rshift(a,b)
964 #define RotateLeft32 _rotl
965 #define RotateLeft64 _rotl64
966 #define RotateRight32 _rotr
967 #define RotateRight64 _rotr64
969 #if defined(_M_AMD64)
970 #define RotateLeft8 _rotl8
971 #define RotateLeft16 _rotl16
972 #define RotateRight8 _rotr8
973 #define RotateRight16 _rotr16
974 #endif /* _M_AMD64 */
976 /* C_ASSERT Definition */
977 #define C_ASSERT(expr) extern char (*c_assert(void)) [(expr) ? 1 : -1]
979 /* Eliminate Microsoft C/C++ compiler warning 4715 */
980 #if defined(_MSC_VER)
981 # define DEFAULT_UNREACHABLE default: __assume(0)
982 #elif defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5))))
983 # define DEFAULT_UNREACHABLE default: __builtin_unreachable()
985 # define DEFAULT_UNREACHABLE default: break
988 #define VER_WORKSTATION_NT 0x40000000
989 #define VER_SERVER_NT 0x80000000
990 #define VER_SUITE_SMALLBUSINESS 0x00000001
991 #define VER_SUITE_ENTERPRISE 0x00000002
992 #define VER_SUITE_BACKOFFICE 0x00000004
993 #define VER_SUITE_COMMUNICATIONS 0x00000008
994 #define VER_SUITE_TERMINAL 0x00000010
995 #define VER_SUITE_SMALLBUSINESS_RESTRICTED 0x00000020
996 #define VER_SUITE_EMBEDDEDNT 0x00000040
997 #define VER_SUITE_DATACENTER 0x00000080
998 #define VER_SUITE_SINGLEUSERTS 0x00000100
999 #define VER_SUITE_PERSONAL 0x00000200
1000 #define VER_SUITE_BLADE 0x00000400
1001 #define VER_SUITE_EMBEDDED_RESTRICTED 0x00000800
1002 #define VER_SUITE_SECURITY_APPLIANCE 0x00001000
1003 #define VER_SUITE_STORAGE_SERVER 0x00002000
1004 #define VER_SUITE_COMPUTE_SERVER 0x00004000
1005 #define VER_SUITE_WH_SERVER 0x00008000
1007 #define PRODUCT_UNDEFINED 0x00000000
1008 #define PRODUCT_ULTIMATE 0x00000001
1009 #define PRODUCT_HOME_BASIC 0x00000002
1010 #define PRODUCT_HOME_PREMIUM 0x00000003
1011 #define PRODUCT_ENTERPRISE 0x00000004
1012 #define PRODUCT_HOME_BASIC_N 0x00000005
1013 #define PRODUCT_BUSINESS 0x00000006
1014 #define PRODUCT_STANDARD_SERVER 0x00000007
1015 #define PRODUCT_DATACENTER_SERVER 0x00000008
1016 #define PRODUCT_SMALLBUSINESS_SERVER 0x00000009
1017 #define PRODUCT_ENTERPRISE_SERVER 0x0000000A
1018 #define PRODUCT_STARTER 0x0000000B
1019 #define PRODUCT_DATACENTER_SERVER_CORE 0x0000000C
1020 #define PRODUCT_STANDARD_SERVER_CORE 0x0000000D
1021 #define PRODUCT_ENTERPRISE_SERVER_CORE 0x0000000E
1022 #define PRODUCT_ENTERPRISE_SERVER_IA64 0x0000000F
1023 #define PRODUCT_BUSINESS_N 0x00000010
1024 #define PRODUCT_WEB_SERVER 0x00000011
1025 #define PRODUCT_CLUSTER_SERVER 0x00000012
1026 #define PRODUCT_HOME_SERVER 0x00000013
1027 #define PRODUCT_STORAGE_EXPRESS_SERVER 0x00000014
1028 #define PRODUCT_STORAGE_STANDARD_SERVER 0x00000015
1029 #define PRODUCT_STORAGE_WORKGROUP_SERVER 0x00000016
1030 #define PRODUCT_STORAGE_ENTERPRISE_SERVER 0x00000017
1031 #define PRODUCT_SERVER_FOR_SMALLBUSINESS 0x00000018
1032 #define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM 0x00000019
1033 #define PRODUCT_HOME_PREMIUM_N 0x0000001A
1034 #define PRODUCT_ENTERPRISE_N 0x0000001B
1035 #define PRODUCT_ULTIMATE_N 0x0000001C
1036 #define PRODUCT_WEB_SERVER_CORE 0x0000001D
1037 #define PRODUCT_MEDIUMBUSINESS_SERVER_MANAGEMENT 0x0000001E
1038 #define PRODUCT_MEDIUMBUSINESS_SERVER_SECURITY 0x0000001F
1039 #define PRODUCT_MEDIUMBUSINESS_SERVER_MESSAGING 0x00000020
1040 #define PRODUCT_SERVER_FOUNDATION 0x00000021
1041 #define PRODUCT_HOME_PREMIUM_SERVER 0x00000022
1042 #define PRODUCT_SERVER_FOR_SMALLBUSINESS_V 0x00000023
1043 #define PRODUCT_STANDARD_SERVER_V 0x00000024
1044 #define PRODUCT_DATACENTER_SERVER_V 0x00000025
1045 #define PRODUCT_ENTERPRISE_SERVER_V 0x00000026
1046 #define PRODUCT_DATACENTER_SERVER_CORE_V 0x00000027
1047 #define PRODUCT_STANDARD_SERVER_CORE_V 0x00000028
1048 #define PRODUCT_ENTERPRISE_SERVER_CORE_V 0x00000029
1049 #define PRODUCT_HYPERV 0x0000002A
1050 #define PRODUCT_STORAGE_EXPRESS_SERVER_CORE 0x0000002B
1051 #define PRODUCT_STORAGE_STANDARD_SERVER_CORE 0x0000002C
1052 #define PRODUCT_STORAGE_WORKGROUP_SERVER_CORE 0x0000002D
1053 #define PRODUCT_STORAGE_ENTERPRISE_SERVER_CORE 0x0000002E
1054 #define PRODUCT_STARTER_N 0x0000002F
1055 #define PRODUCT_PROFESSIONAL 0x00000030
1056 #define PRODUCT_PROFESSIONAL_N 0x00000031
1057 #define PRODUCT_SB_SOLUTION_SERVER 0x00000032
1058 #define PRODUCT_SERVER_FOR_SB_SOLUTIONS 0x00000033
1059 #define PRODUCT_STANDARD_SERVER_SOLUTIONS 0x00000034
1060 #define PRODUCT_STANDARD_SERVER_SOLUTIONS_CORE 0x00000035
1061 #define PRODUCT_SB_SOLUTION_SERVER_EM 0x00000036
1062 #define PRODUCT_SERVER_FOR_SB_SOLUTIONS_EM 0x00000037
1063 #define PRODUCT_SOLUTION_EMBEDDEDSERVER 0x00000038
1064 #define PRODUCT_SOLUTION_EMBEDDEDSERVER_CORE 0x00000039
1065 #define PRODUCT_ESSENTIALBUSINESS_SERVER_MGMT 0x0000003B
1066 #define PRODUCT_ESSENTIALBUSINESS_SERVER_ADDL 0x0000003C
1067 #define PRODUCT_ESSENTIALBUSINESS_SERVER_MGMTSVC 0x0000003D
1068 #define PRODUCT_ESSENTIALBUSINESS_SERVER_ADDLSVC 0x0000003E
1069 #define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM_CORE 0x0000003F
1070 #define PRODUCT_CLUSTER_SERVER_V 0x00000040
1071 #define PRODUCT_EMBEDDED 0x00000041
1072 #define PRODUCT_STARTER_E 0x00000042
1073 #define PRODUCT_HOME_BASIC_E 0x00000043
1074 #define PRODUCT_HOME_PREMIUM_E 0x00000044
1075 #define PRODUCT_PROFESSIONAL_E 0x00000045
1076 #define PRODUCT_ENTERPRISE_E 0x00000046
1077 #define PRODUCT_ULTIMATE_E 0x00000047
1078 #define PRODUCT_ENTERPRISE_EVALUATION 0x00000048
1079 #define PRODUCT_MULTIPOINT_STANDARD_SERVER 0x0000004C
1080 #define PRODUCT_MULTIPOINT_PREMIUM_SERVER 0x0000004D
1081 #define PRODUCT_STANDARD_EVALUATION_SERVER 0x0000004F
1082 #define PRODUCT_DATACENTER_EVALUATION_SERVER 0x00000050
1083 #define PRODUCT_ENTERPRISE_N_EVALUATION 0x00000054
1084 #define PRODUCT_EMBEDDED_AUTOMOTIVE 0x00000055
1085 #define PRODUCT_EMBEDDED_INDUSTRY_A 0x00000056
1086 #define PRODUCT_THINPC 0x00000057
1087 #define PRODUCT_EMBEDDED_A 0x00000058
1088 #define PRODUCT_EMBEDDED_INDUSTRY 0x00000059
1089 #define PRODUCT_EMBEDDED_E 0x0000005A
1090 #define PRODUCT_EMBEDDED_INDUSTRY_E 0x0000005B
1091 #define PRODUCT_EMBEDDED_INDUSTRY_A_E 0x0000005C
1092 #define PRODUCT_STORAGE_WORKGROUP_EVALUATION_SERVER 0x0000005F
1093 #define PRODUCT_STORAGE_STANDARD_EVALUATION_SERVER 0x00000060
1094 #define PRODUCT_CORE_ARM 0x00000061
1095 #define PRODUCT_CORE_N 0x00000062
1096 #define PRODUCT_CORE_COUNTRYSPECIFIC 0x00000063
1097 #define PRODUCT_CORE_SINGLELANGUAGE 0x00000064
1098 #define PRODUCT_CORE 0x00000065
1099 #define PRODUCT_PROFESSIONAL_WMC 0x00000067
1100 #define PRODUCT_UNLICENSED 0xABCDABCD
1102 /* LangID and NLS */
1103 #define MAKELANGID(p, s) ((((USHORT)(s)) << 10) | (USHORT)(p))
1104 #define PRIMARYLANGID(lgid) ((USHORT)(lgid) & 0x3ff)
1105 #define SUBLANGID(lgid) ((USHORT)(lgid) >> 10)
1106 #define MAKELCID(lgid, srtid) ((ULONG)((((ULONG)((USHORT)(srtid))) << 16) | \
1107 ((ULONG)((USHORT)(lgid)))))
1108 #define MAKESORTLCID(lgid, srtid, ver) \
1109 ((ULONG)((MAKELCID(lgid, srtid)) | \
1110 (((ULONG)((USHORT)(ver))) << 20)))
1111 #define LANGIDFROMLCID(lcid) ((USHORT)(lcid))
1112 #define SORTIDFROMLCID(lcid) ((USHORT)((((ULONG)(lcid)) >> 16) & 0xf))
1113 #define SORTVERSIONFROMLCID(lcid) ((USHORT)((((ULONG)(lcid)) >> 20) & 0xf))
1115 #define NLS_VALID_LOCALE_MASK 0x000fffff
1116 #define LOCALE_NAME_MAX_LENGTH 85
1118 /* Primary language IDs. */
1119 #define LANG_NEUTRAL 0x00
1120 #define LANG_INVARIANT 0x7f
1121 #define LANG_AFRIKAANS 0x36
1122 #define LANG_ALBANIAN 0x1c
1123 #define LANG_ALSATIAN 0x84
1124 #define LANG_AMHARIC 0x5e
1125 #define LANG_ARABIC 0x01
1126 #define LANG_ARMENIAN 0x2b
1127 #define LANG_ASSAMESE 0x4d
1128 #define LANG_AZERI 0x2c
1129 #define LANG_AZERBAIJANI 0x2c
1130 #define LANG_BANGLA 0x45
1131 #define LANG_BASHKIR 0x6d
1132 #define LANG_BASQUE 0x2d
1133 #define LANG_BELARUSIAN 0x23
1134 #define LANG_BENGALI 0x45
1135 #define LANG_BRETON 0x7e
1136 #define LANG_BOSNIAN 0x1a
1137 #define LANG_BOSNIAN_NEUTRAL 0x781a
1138 #define LANG_BULGARIAN 0x02
1139 #define LANG_CATALAN 0x03
1140 #define LANG_CENTRAL_KURDISH 0x92
1141 #define LANG_CHEROKEE 0x5c
1142 #define LANG_CHINESE 0x04
1143 #define LANG_CHINESE_SIMPLIFIED 0x04
1144 #define LANG_CHINESE_TRADITIONAL 0x7c04
1145 #define LANG_CORSICAN 0x83
1146 #define LANG_CROATIAN 0x1a
1147 #define LANG_CZECH 0x05
1148 #define LANG_DANISH 0x06
1149 #define LANG_DARI 0x8c
1150 #define LANG_DIVEHI 0x65
1151 #define LANG_DUTCH 0x13
1152 #define LANG_ENGLISH 0x09
1153 #define LANG_ESTONIAN 0x25
1154 #define LANG_FAEROESE 0x38
1155 #define LANG_FARSI 0x29
1156 #define LANG_FILIPINO 0x64
1157 #define LANG_FINNISH 0x0b
1158 #define LANG_FRENCH 0x0c
1159 #define LANG_FRISIAN 0x62
1160 #define LANG_FULAH 0x67
1161 #define LANG_GALICIAN 0x56
1162 #define LANG_GEORGIAN 0x37
1163 #define LANG_GERMAN 0x07
1164 #define LANG_GREEK 0x08
1165 #define LANG_GREENLANDIC 0x6f
1166 #define LANG_GUJARATI 0x47
1167 #define LANG_HAUSA 0x68
1168 #define LANG_HAWAIIAN 0x75
1169 #define LANG_HEBREW 0x0d
1170 #define LANG_HINDI 0x39
1171 #define LANG_HUNGARIAN 0x0e
1172 #define LANG_ICELANDIC 0x0f
1173 #define LANG_IGBO 0x70
1174 #define LANG_INDONESIAN 0x21
1175 #define LANG_INUKTITUT 0x5d
1176 #define LANG_IRISH 0x3c
1177 #define LANG_ITALIAN 0x10
1178 #define LANG_JAPANESE 0x11
1179 #define LANG_KANNADA 0x4b
1180 #define LANG_KASHMIRI 0x60
1181 #define LANG_KAZAK 0x3f
1182 #define LANG_KHMER 0x53
1183 #define LANG_KICHE 0x86
1184 #define LANG_KINYARWANDA 0x87
1185 #define LANG_KONKANI 0x57
1186 #define LANG_KOREAN 0x12
1187 #define LANG_KYRGYZ 0x40
1188 #define LANG_LAO 0x54
1189 #define LANG_LATVIAN 0x26
1190 #define LANG_LITHUANIAN 0x27
1191 #define LANG_LOWER_SORBIAN 0x2e
1192 #define LANG_LUXEMBOURGISH 0x6e
1193 #define LANG_MACEDONIAN 0x2f
1194 #define LANG_MALAY 0x3e
1195 #define LANG_MALAYALAM 0x4c
1196 #define LANG_MALTESE 0x3a
1197 #define LANG_MANIPURI 0x58
1198 #define LANG_MAORI 0x81
1199 #define LANG_MAPUDUNGUN 0x7a
1200 #define LANG_MARATHI 0x4e
1201 #define LANG_MOHAWK 0x7c
1202 #define LANG_MONGOLIAN 0x50
1203 #define LANG_NEPALI 0x61
1204 #define LANG_NORWEGIAN 0x14
1205 #define LANG_OCCITAN 0x82
1206 #define LANG_ODIA 0x48
1207 #define LANG_ORIYA 0x48
1208 #define LANG_PASHTO 0x63
1209 #define LANG_PERSIAN 0x29
1210 #define LANG_POLISH 0x15
1211 #define LANG_PORTUGUESE 0x16
1212 #define LANG_PULAR 0x67
1213 #define LANG_PUNJABI 0x46
1214 #define LANG_QUECHUA 0x6b
1215 #define LANG_ROMANIAN 0x18
1216 #define LANG_ROMANSH 0x17
1217 #define LANG_RUSSIAN 0x19
1218 #define LANG_SAKHA 0x85
1219 #define LANG_SAMI 0x3b
1220 #define LANG_SANSKRIT 0x4f
1221 #define LANG_SCOTTISH_GAELIC 0x91
1222 #define LANG_SERBIAN 0x1a
1223 #define LANG_SERBIAN_NEUTRAL 0x7c1a
1224 #define LANG_SINDHI 0x59
1225 #define LANG_SINHALESE 0x5b
1226 #define LANG_SLOVAK 0x1b
1227 #define LANG_SLOVENIAN 0x24
1228 #define LANG_SOTHO 0x6c
1229 #define LANG_SPANISH 0x0a
1230 #define LANG_SWAHILI 0x41
1231 #define LANG_SWEDISH 0x1d
1232 #define LANG_SYRIAC 0x5a
1233 #define LANG_TAJIK 0x28
1234 #define LANG_TAMAZIGHT 0x5f
1235 #define LANG_TAMIL 0x49
1236 #define LANG_TATAR 0x44
1237 #define LANG_TELUGU 0x4a
1238 #define LANG_THAI 0x1e
1239 #define LANG_TIBETAN 0x51
1240 #define LANG_TIGRIGNA 0x73
1241 #define LANG_TIGRINYA 0x73
1242 #define LANG_TSWANA 0x32
1243 #define LANG_TURKISH 0x1f
1244 #define LANG_TURKMEN 0x42
1245 #define LANG_UIGHUR 0x80
1246 #define LANG_UKRAINIAN 0x22
1247 #define LANG_UPPER_SORBIAN 0x2e
1248 #define LANG_URDU 0x20
1249 #define LANG_UZBEK 0x43
1250 #define LANG_VALENCIAN 0x03
1251 #define LANG_VIETNAMESE 0x2a
1252 #define LANG_WELSH 0x52
1253 #define LANG_WOLOF 0x88
1254 #define LANG_XHOSA 0x34
1255 #define LANG_YAKUT 0x85
1256 #define LANG_YI 0x78
1257 #define LANG_YORUBA 0x6a
1258 #define LANG_ZULU 0x35
1260 #define SUBLANG_NEUTRAL 0x00
1261 #define SUBLANG_DEFAULT 0x01
1262 #define SUBLANG_SYS_DEFAULT 0x02
1263 #define SUBLANG_CUSTOM_DEFAULT 0x03
1264 #define SUBLANG_CUSTOM_UNSPECIFIED 0x04
1265 #define SUBLANG_UI_CUSTOM_DEFAULT 0x05
1266 #define SUBLANG_AFRIKAANS_SOUTH_AFRICA 0x01
1267 #define SUBLANG_ALBANIAN_ALBANIA 0x01
1268 #define SUBLANG_ALSATIAN_FRANCE 0x01
1269 #define SUBLANG_AMHARIC_ETHIOPIA 0x01
1270 #define SUBLANG_ARABIC_SAUDI_ARABIA 0x01
1271 #define SUBLANG_ARABIC_IRAQ 0x02
1272 #define SUBLANG_ARABIC_EGYPT 0x03
1273 #define SUBLANG_ARABIC_LIBYA 0x04
1274 #define SUBLANG_ARABIC_ALGERIA 0x05
1275 #define SUBLANG_ARABIC_MOROCCO 0x06
1276 #define SUBLANG_ARABIC_TUNISIA 0x07
1277 #define SUBLANG_ARABIC_OMAN 0x08
1278 #define SUBLANG_ARABIC_YEMEN 0x09
1279 #define SUBLANG_ARABIC_SYRIA 0x0a
1280 #define SUBLANG_ARABIC_JORDAN 0x0b
1281 #define SUBLANG_ARABIC_LEBANON 0x0c
1282 #define SUBLANG_ARABIC_KUWAIT 0x0d
1283 #define SUBLANG_ARABIC_UAE 0x0e
1284 #define SUBLANG_ARABIC_BAHRAIN 0x0f
1285 #define SUBLANG_ARABIC_QATAR 0x10
1286 #define SUBLANG_ARMENIAN_ARMENIA 0x01
1287 #define SUBLANG_ASSAMESE_INDIA 0x01
1288 #define SUBLANG_AZERI_LATIN 0x01
1289 #define SUBLANG_AZERI_CYRILLIC 0x02
1290 #define SUBLANG_AZERBAIJANI_AZERBAIJAN_LATIN 0x01
1291 #define SUBLANG_AZERBAIJANI_AZERBAIJAN_CYRILLIC 0x02
1292 #define SUBLANG_BANGLA_INDIA 0x01
1293 #define SUBLANG_BANGLA_BANGLADESH 0x02
1294 #define SUBLANG_BASHKIR_RUSSIA 0x01
1295 #define SUBLANG_BASQUE_BASQUE 0x01
1296 #define SUBLANG_BELARUSIAN_BELARUS 0x01
1297 #define SUBLANG_BENGALI_INDIA 0x01
1298 #define SUBLANG_BENGALI_BANGLADESH 0x02
1299 #define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN 0x05
1300 #define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x08
1301 #define SUBLANG_BRETON_FRANCE 0x01
1302 #define SUBLANG_BULGARIAN_BULGARIA 0x01
1303 #define SUBLANG_CATALAN_CATALAN 0x01
1304 #define SUBLANG_CENTRAL_KURDISH_IRAQ 0x01
1305 #define SUBLANG_CHEROKEE_CHEROKEE 0x01
1306 #define SUBLANG_CHINESE_TRADITIONAL 0x01
1307 #define SUBLANG_CHINESE_SIMPLIFIED 0x02
1308 #define SUBLANG_CHINESE_HONGKONG 0x03
1309 #define SUBLANG_CHINESE_SINGAPORE 0x04
1310 #define SUBLANG_CHINESE_MACAU 0x05
1311 #define SUBLANG_CORSICAN_FRANCE 0x01
1312 #define SUBLANG_CZECH_CZECH_REPUBLIC 0x01
1313 #define SUBLANG_CROATIAN_CROATIA 0x01
1314 #define SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN 0x04
1315 #define SUBLANG_DANISH_DENMARK 0x01
1316 #define SUBLANG_DARI_AFGHANISTAN 0x01
1317 #define SUBLANG_DIVEHI_MALDIVES 0x01
1318 #define SUBLANG_DUTCH 0x01
1319 #define SUBLANG_DUTCH_BELGIAN 0x02
1320 #define SUBLANG_ENGLISH_US 0x01
1321 #define SUBLANG_ENGLISH_UK 0x02
1322 #define SUBLANG_ENGLISH_AUS 0x03
1323 #define SUBLANG_ENGLISH_CAN 0x04
1324 #define SUBLANG_ENGLISH_NZ 0x05
1325 #define SUBLANG_ENGLISH_EIRE 0x06
1326 #define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07
1327 #define SUBLANG_ENGLISH_JAMAICA 0x08
1328 #define SUBLANG_ENGLISH_CARIBBEAN 0x09
1329 #define SUBLANG_ENGLISH_BELIZE 0x0a
1330 #define SUBLANG_ENGLISH_TRINIDAD 0x0b
1331 #define SUBLANG_ENGLISH_ZIMBABWE 0x0c
1332 #define SUBLANG_ENGLISH_PHILIPPINES 0x0d
1333 #define SUBLANG_ENGLISH_INDIA 0x10
1334 #define SUBLANG_ENGLISH_MALAYSIA 0x11
1335 #define SUBLANG_ENGLISH_SINGAPORE 0x12
1336 #define SUBLANG_ESTONIAN_ESTONIA 0x01
1337 #define SUBLANG_FAEROESE_FAROE_ISLANDS 0x01
1338 #define SUBLANG_FILIPINO_PHILIPPINES 0x01
1339 #define SUBLANG_FINNISH_FINLAND 0x01
1340 #define SUBLANG_FRENCH 0x01
1341 #define SUBLANG_FRENCH_BELGIAN 0x02
1342 #define SUBLANG_FRENCH_CANADIAN 0x03
1343 #define SUBLANG_FRENCH_SWISS 0x04
1344 #define SUBLANG_FRENCH_LUXEMBOURG 0x05
1345 #define SUBLANG_FRENCH_MONACO 0x06
1346 #define SUBLANG_FRISIAN_NETHERLANDS 0x01
1347 #define SUBLANG_FULAH_SENEGAL 0x02
1348 #define SUBLANG_GALICIAN_GALICIAN 0x01
1349 #define SUBLANG_GEORGIAN_GEORGIA 0x01
1350 #define SUBLANG_GERMAN 0x01
1351 #define SUBLANG_GERMAN_SWISS 0x02
1352 #define SUBLANG_GERMAN_AUSTRIAN 0x03
1353 #define SUBLANG_GERMAN_LUXEMBOURG 0x04
1354 #define SUBLANG_GERMAN_LIECHTENSTEIN 0x05
1355 #define SUBLANG_GREEK_GREECE 0x01
1356 #define SUBLANG_GREENLANDIC_GREENLAND 0x01
1357 #define SUBLANG_GUJARATI_INDIA 0x01
1358 #define SUBLANG_HAUSA_NIGERIA_LATIN 0x01
1359 #define SUBLANG_HAWAIIAN_US 0x01
1360 #define SUBLANG_HEBREW_ISRAEL 0x01
1361 #define SUBLANG_HINDI_INDIA 0x01
1362 #define SUBLANG_HUNGARIAN_HUNGARY 0x01
1363 #define SUBLANG_ICELANDIC_ICELAND 0x01
1364 #define SUBLANG_IGBO_NIGERIA 0x01
1365 #define SUBLANG_INDONESIAN_INDONESIA 0x01
1366 #define SUBLANG_INUKTITUT_CANADA 0x01
1367 #define SUBLANG_INUKTITUT_CANADA_LATIN 0x02
1368 #define SUBLANG_IRISH_IRELAND 0x02
1369 #define SUBLANG_ITALIAN 0x01
1370 #define SUBLANG_ITALIAN_SWISS 0x02
1371 #define SUBLANG_JAPANESE_JAPAN 0x01
1372 #define SUBLANG_KANNADA_INDIA 0x01
1373 #define SUBLANG_KASHMIRI_SASIA 0x02
1374 #define SUBLANG_KASHMIRI_INDIA 0x02
1375 #define SUBLANG_KAZAK_KAZAKHSTAN 0x01
1376 #define SUBLANG_KHMER_CAMBODIA 0x01
1377 #define SUBLANG_KICHE_GUATEMALA 0x01
1378 #define SUBLANG_KINYARWANDA_RWANDA 0x01
1379 #define SUBLANG_KONKANI_INDIA 0x01
1380 #define SUBLANG_KOREAN 0x01
1381 #define SUBLANG_KYRGYZ_KYRGYZSTAN 0x01
1382 #define SUBLANG_LAO_LAO 0x01
1383 #define SUBLANG_LATVIAN_LATVIA 0x01
1384 #define SUBLANG_LITHUANIAN 0x01
1385 #define SUBLANG_LOWER_SORBIAN_GERMANY 0x02
1386 #define SUBLANG_LUXEMBOURGISH_LUXEMBOURG 0x01
1387 #define SUBLANG_MACEDONIAN_MACEDONIA 0x01
1388 #define SUBLANG_MALAY_MALAYSIA 0x01
1389 #define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02
1390 #define SUBLANG_MALAYALAM_INDIA 0x01
1391 #define SUBLANG_MALTESE_MALTA 0x01
1392 #define SUBLANG_MAORI_NEW_ZEALAND 0x01
1393 #define SUBLANG_MAPUDUNGUN_CHILE 0x01
1394 #define SUBLANG_MARATHI_INDIA 0x01
1395 #define SUBLANG_MOHAWK_MOHAWK 0x01
1396 #define SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA 0x01
1397 #define SUBLANG_MONGOLIAN_PRC 0x02
1398 #define SUBLANG_NEPALI_INDIA 0x02
1399 #define SUBLANG_NEPALI_NEPAL 0x01
1400 #define SUBLANG_NORWEGIAN_BOKMAL 0x01
1401 #define SUBLANG_NORWEGIAN_NYNORSK 0x02
1402 #define SUBLANG_OCCITAN_FRANCE 0x01
1403 #define SUBLANG_ODIA_INDIA 0x01
1404 #define SUBLANG_ORIYA_INDIA 0x01
1405 #define SUBLANG_PASHTO_AFGHANISTAN 0x01
1406 #define SUBLANG_PERSIAN_IRAN 0x01
1407 #define SUBLANG_POLISH_POLAND 0x01
1408 #define SUBLANG_PORTUGUESE 0x02
1409 #define SUBLANG_PORTUGUESE_BRAZILIAN 0x01
1410 #define SUBLANG_PULAR_SENEGAL 0x02
1411 #define SUBLANG_PUNJABI_INDIA 0x01
1412 #define SUBLANG_PUNJABI_PAKISTAN 0x02
1413 #define SUBLANG_QUECHUA_BOLIVIA 0x01
1414 #define SUBLANG_QUECHUA_ECUADOR 0x02
1415 #define SUBLANG_QUECHUA_PERU 0x03
1416 #define SUBLANG_ROMANIAN_ROMANIA 0x01
1417 #define SUBLANG_ROMANSH_SWITZERLAND 0x01
1418 #define SUBLANG_RUSSIAN_RUSSIA 0x01
1419 #define SUBLANG_SAKHA_RUSSIA 0x01
1420 #define SUBLANG_SAMI_NORTHERN_NORWAY 0x01
1421 #define SUBLANG_SAMI_NORTHERN_SWEDEN 0x02
1422 #define SUBLANG_SAMI_NORTHERN_FINLAND 0x03
1423 #define SUBLANG_SAMI_LULE_NORWAY 0x04
1424 #define SUBLANG_SAMI_LULE_SWEDEN 0x05
1425 #define SUBLANG_SAMI_SOUTHERN_NORWAY 0x06
1426 #define SUBLANG_SAMI_SOUTHERN_SWEDEN 0x07
1427 #define SUBLANG_SAMI_SKOLT_FINLAND 0x08
1428 #define SUBLANG_SAMI_INARI_FINLAND 0x09
1429 #define SUBLANG_SANSKRIT_INDIA 0x01
1430 #define SUBLANG_SCOTTISH_GAELIC 0x01
1431 #define SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_LATIN 0x06
1432 #define SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x07
1433 #define SUBLANG_SERBIAN_MONTENEGRO_LATIN 0x0b
1434 #define SUBLANG_SERBIAN_MONTENEGRO_CYRILLIC 0x0c
1435 #define SUBLANG_SERBIAN_SERBIA_LATIN 0x09
1436 #define SUBLANG_SERBIAN_SERBIA_CYRILLIC 0x0a
1437 #define SUBLANG_SERBIAN_CROATIA 0x01
1438 #define SUBLANG_SERBIAN_LATIN 0x02
1439 #define SUBLANG_SERBIAN_CYRILLIC 0x03
1440 #define SUBLANG_SINDHI_INDIA 0x01
1441 #define SUBLANG_SINDHI_PAKISTAN 0x02
1442 #define SUBLANG_SINDHI_AFGHANISTAN 0x02
1443 #define SUBLANG_SINHALESE_SRI_LANKA 0x01
1444 #define SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA 0x01
1445 #define SUBLANG_SLOVAK_SLOVAKIA 0x01
1446 #define SUBLANG_SLOVENIAN_SLOVENIA 0x01
1447 #define SUBLANG_SPANISH 0x01
1448 #define SUBLANG_SPANISH_MEXICAN 0x02
1449 #define SUBLANG_SPANISH_MODERN 0x03
1450 #define SUBLANG_SPANISH_GUATEMALA 0x04
1451 #define SUBLANG_SPANISH_COSTA_RICA 0x05
1452 #define SUBLANG_SPANISH_PANAMA 0x06
1453 #define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07
1454 #define SUBLANG_SPANISH_VENEZUELA 0x08
1455 #define SUBLANG_SPANISH_COLOMBIA 0x09
1456 #define SUBLANG_SPANISH_PERU 0x0a
1457 #define SUBLANG_SPANISH_ARGENTINA 0x0b
1458 #define SUBLANG_SPANISH_ECUADOR 0x0c
1459 #define SUBLANG_SPANISH_CHILE 0x0d
1460 #define SUBLANG_SPANISH_URUGUAY 0x0e
1461 #define SUBLANG_SPANISH_PARAGUAY 0x0f
1462 #define SUBLANG_SPANISH_BOLIVIA 0x10
1463 #define SUBLANG_SPANISH_EL_SALVADOR 0x11
1464 #define SUBLANG_SPANISH_HONDURAS 0x12
1465 #define SUBLANG_SPANISH_NICARAGUA 0x13
1466 #define SUBLANG_SPANISH_PUERTO_RICO 0x14
1467 #define SUBLANG_SPANISH_US 0x15
1468 #define SUBLANG_SWAHILI_KENYA 0x01
1469 #define SUBLANG_SWEDISH 0x01
1470 #define SUBLANG_SWEDISH_FINLAND 0x02
1471 #define SUBLANG_SYRIAC_SYRIA 0x01
1472 #define SUBLANG_TAJIK_TAJIKISTAN 0x01
1473 #define SUBLANG_TAMAZIGHT_ALGERIA_LATIN 0x02
1474 #define SUBLANG_TAMAZIGHT_MOROCCO_TIFINAGH 0x04
1475 #define SUBLANG_TAMIL_INDIA 0x01
1476 #define SUBLANG_TAMIL_SRI_LANKA 0x02
1477 #define SUBLANG_TATAR_RUSSIA 0x01
1478 #define SUBLANG_TELUGU_INDIA 0x01
1479 #define SUBLANG_THAI_THAILAND 0x01
1480 #define SUBLANG_TIBETAN_PRC 0x01
1481 #define SUBLANG_TIGRIGNA_ERITREA 0x02
1482 #define SUBLANG_TIGRINYA_ERITREA 0x02
1483 #define SUBLANG_TIGRINYA_ETHIOPIA 0x01
1484 #define SUBLANG_TSWANA_BOTSWANA 0x02
1485 #define SUBLANG_TSWANA_SOUTH_AFRICA 0x01
1486 #define SUBLANG_TURKISH_TURKEY 0x01
1487 #define SUBLANG_TURKMEN_TURKMENISTAN 0x01
1488 #define SUBLANG_UIGHUR_PRC 0x01
1489 #define SUBLANG_UKRAINIAN_UKRAINE 0x01
1490 #define SUBLANG_UPPER_SORBIAN_GERMANY 0x01
1491 #define SUBLANG_URDU_PAKISTAN 0x01
1492 #define SUBLANG_URDU_INDIA 0x02
1493 #define SUBLANG_UZBEK_LATIN 0x01
1494 #define SUBLANG_UZBEK_CYRILLIC 0x02
1495 #define SUBLANG_VALENCIAN_VALENCIA 0x02
1496 #define SUBLANG_VIETNAMESE_VIETNAM 0x01
1497 #define SUBLANG_WELSH_UNITED_KINGDOM 0x01
1498 #define SUBLANG_WOLOF_SENEGAL 0x01
1499 #define SUBLANG_XHOSA_SOUTH_AFRICA 0x01
1500 #define SUBLANG_YAKUT_RUSSIA 0x01
1501 #define SUBLANG_YI_PRC 0x01
1502 #define SUBLANG_YORUBA_NIGERIA 0x01
1503 #define SUBLANG_ZULU_SOUTH_AFRICA 0x01
1505 #define SORT_DEFAULT 0x0
1506 #define SORT_INVARIANT_MATH 0x1
1507 #define SORT_JAPANESE_XJIS 0x0
1508 #define SORT_JAPANESE_UNICODE 0x1
1509 #define SORT_JAPANESE_RADICALSTROKE 0x4
1510 #define SORT_CHINESE_BIG5 0x0
1511 #define SORT_CHINESE_PRCP 0x0
1512 #define SORT_CHINESE_UNICODE 0x1
1513 #define SORT_CHINESE_PRC 0x2
1514 #define SORT_CHINESE_BOPOMOFO 0x3
1515 #define SORT_CHINESE_RADICALSTROKE 0x4
1516 #define SORT_KOREAN_KSC 0x0
1517 #define SORT_KOREAN_UNICODE 0x1
1518 #define SORT_GERMAN_PHONE_BOOK 0x1
1519 #define SORT_HUNGARIAN_DEFAULT 0x0
1520 #define SORT_HUNGARIAN_TECHNICAL 0x1
1521 #define SORT_GEORGIAN_TRADITIONAL 0x0
1522 #define SORT_GEORGIAN_MODERN 0x1
1524 #define LANG_SYSTEM_DEFAULT MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT))
1525 #define LANG_USER_DEFAULT MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT))
1527 #define LOCALE_SYSTEM_DEFAULT MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT)
1528 #define LOCALE_USER_DEFAULT MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT)
1529 #define LOCALE_CUSTOM_DEFAULT MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_CUSTOM_DEFAULT), SORT_DEFAULT)
1530 #define LOCALE_CUSTOM_UNSPECIFIED MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_CUSTOM_UNSPECIFIED), SORT_DEFAULT)
1531 #define LOCALE_CUSTOM_UI_DEFAULT MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_UI_CUSTOM_DEFAULT), SORT_DEFAULT)
1532 #define LOCALE_NEUTRAL MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), SORT_DEFAULT)
1533 #define LOCALE_INVARIANT MAKELCID(MAKELANGID(LANG_INVARIANT, SUBLANG_NEUTRAL), SORT_DEFAULT)
1539 #endif /* _NTDEF_ */