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