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