1 /***********************************************************************\
2 *                                winnls.d                               *
3 *                                                                       *
4 *                       Windows API header module                       *
5 *                                                                       *
6 *                 Translated from MinGW Windows headers                 *
7 *                           by Stewart Gordon                           *
8 *                                                                       *
9 *                       Placed into public domain                       *
10 \***********************************************************************/
11 module windows.winnls;
12 pragma(lib, "kernel32");
13 nothrow:
14 private import windows.basetsd, windows.w32api, windows.winbase, windows.windef;
15 
16 alias DWORD LCTYPE, CALTYPE, CALID, LGRPID, GEOID, GEOTYPE, GEOCLASS;
17 
18 const size_t
19 	MAX_DEFAULTCHAR =  2,
20 	MAX_LEADBYTES   = 12;
21 
22 const LCTYPE
23 	LOCALE_USE_CP_ACP    = 0x40000000,
24 	LOCALE_RETURN_NUMBER = 0x20000000;
25 
26 enum : LCTYPE {
27 	LOCALE_ILANGUAGE = 1,
28 	LOCALE_SLANGUAGE,
29 	LOCALE_SABBREVLANGNAME,
30 	LOCALE_SNATIVELANGNAME,
31 	LOCALE_ICOUNTRY,
32 	LOCALE_SCOUNTRY,
33 	LOCALE_SABBREVCTRYNAME,
34 	LOCALE_SNATIVECTRYNAME,
35 	LOCALE_IDEFAULTLANGUAGE,
36 	LOCALE_IDEFAULTCOUNTRY,
37 	LOCALE_IDEFAULTCODEPAGE,
38 	LOCALE_SLIST,
39 	LOCALE_IMEASURE,
40 	LOCALE_SDECIMAL,
41 	LOCALE_STHOUSAND,
42 	LOCALE_SGROUPING,
43 	LOCALE_IDIGITS,
44 	LOCALE_ILZERO,
45 	LOCALE_SNATIVEDIGITS,
46 	LOCALE_SCURRENCY,
47 	LOCALE_SINTLSYMBOL,
48 	LOCALE_SMONDECIMALSEP,
49 	LOCALE_SMONTHOUSANDSEP,
50 	LOCALE_SMONGROUPING,
51 	LOCALE_ICURRDIGITS,
52 	LOCALE_IINTLCURRDIGITS,
53 	LOCALE_ICURRENCY,
54 	LOCALE_INEGCURR,
55 	LOCALE_SDATE,
56 	LOCALE_STIME,
57 	LOCALE_SSHORTDATE,
58 	LOCALE_SLONGDATE,
59 	LOCALE_IDATE,
60 	LOCALE_ILDATE,
61 	LOCALE_ITIME,
62 	LOCALE_ICENTURY,
63 	LOCALE_ITLZERO,
64 	LOCALE_IDAYLZERO,
65 	LOCALE_IMONLZERO,
66 	LOCALE_S1159,
67 	LOCALE_S2359,
68 	LOCALE_SDAYNAME1,
69 	LOCALE_SDAYNAME2,
70 	LOCALE_SDAYNAME3,
71 	LOCALE_SDAYNAME4,
72 	LOCALE_SDAYNAME5,
73 	LOCALE_SDAYNAME6,
74 	LOCALE_SDAYNAME7,
75 	LOCALE_SABBREVDAYNAME1,
76 	LOCALE_SABBREVDAYNAME2,
77 	LOCALE_SABBREVDAYNAME3,
78 	LOCALE_SABBREVDAYNAME4,
79 	LOCALE_SABBREVDAYNAME5,
80 	LOCALE_SABBREVDAYNAME6,
81 	LOCALE_SABBREVDAYNAME7,
82 	LOCALE_SMONTHNAME1,
83 	LOCALE_SMONTHNAME2,
84 	LOCALE_SMONTHNAME3,
85 	LOCALE_SMONTHNAME4,
86 	LOCALE_SMONTHNAME5,
87 	LOCALE_SMONTHNAME6,
88 	LOCALE_SMONTHNAME7,
89 	LOCALE_SMONTHNAME8,
90 	LOCALE_SMONTHNAME9,
91 	LOCALE_SMONTHNAME10,
92 	LOCALE_SMONTHNAME11,
93 	LOCALE_SMONTHNAME12,
94 	LOCALE_SABBREVMONTHNAME1,
95 	LOCALE_SABBREVMONTHNAME2,
96 	LOCALE_SABBREVMONTHNAME3,
97 	LOCALE_SABBREVMONTHNAME4,
98 	LOCALE_SABBREVMONTHNAME5,
99 	LOCALE_SABBREVMONTHNAME6,
100 	LOCALE_SABBREVMONTHNAME7,
101 	LOCALE_SABBREVMONTHNAME8,
102 	LOCALE_SABBREVMONTHNAME9,
103 	LOCALE_SABBREVMONTHNAME10,
104 	LOCALE_SABBREVMONTHNAME11,
105 	LOCALE_SABBREVMONTHNAME12,
106 	LOCALE_SPOSITIVESIGN,
107 	LOCALE_SNEGATIVESIGN,
108 	LOCALE_IPOSSIGNPOSN,
109 	LOCALE_INEGSIGNPOSN,
110 	LOCALE_IPOSSYMPRECEDES,
111 	LOCALE_IPOSSEPBYSPACE,
112 	LOCALE_INEGSYMPRECEDES,
113 	LOCALE_INEGSEPBYSPACE,
114 	LOCALE_FONTSIGNATURE,
115 	LOCALE_SISO639LANGNAME,
116 	LOCALE_SISO3166CTRYNAME, // = 90
117 	LOCALE_SENGLANGUAGE         = 0x1001,
118 	LOCALE_SENGCOUNTRY          = 0x1002,
119 	LOCALE_IDEFAULTANSICODEPAGE = 0x1004,
120 	LOCALE_INEGNUMBER           = 0x1010,
121 	LOCALE_STIMEFORMAT          = 0x1003,
122 	LOCALE_ITIMEMARKPOSN        = 0x1005,
123 	LOCALE_ICALENDARTYPE        = 0x1009,
124 	LOCALE_IOPTIONALCALENDAR    = 0x100B,
125 	LOCALE_IFIRSTDAYOFWEEK      = 0x100C,
126 	LOCALE_IFIRSTWEEKOFYEAR     = 0x100D,
127 	LOCALE_SMONTHNAME13         = 0x100E,
128 	LOCALE_SABBREVMONTHNAME13   = 0x100F
129 }
130 
131 enum : LCID {
132 	LOCALE_USER_DEFAULT   = 0x400,
133 	LOCALE_SYSTEM_DEFAULT = 0x800
134 }
135 
136 const DWORD
137 	NORM_IGNORECASE     =       1,
138 	NORM_IGNORENONSPACE =       2,
139 	NORM_IGNORESYMBOLS  =       4,
140 	SORT_STRINGSORT     = 0x01000,
141 	NORM_IGNOREKANATYPE = 0x10000,
142 	NORM_IGNOREWIDTH    = 0x20000;
143 
144 const DWORD
145 	LCMAP_LOWERCASE           = 0x00000100,
146 	LCMAP_UPPERCASE           = 0x00000200,
147 	LCMAP_SORTKEY             = 0x00000400,
148 	LCMAP_BYTEREV             = 0x00000800,
149 	LCMAP_HIRAGANA            = 0x00100000,
150 	LCMAP_KATAKANA            = 0x00200000,
151 	LCMAP_HALFWIDTH           = 0x00400000,
152 	LCMAP_FULLWIDTH           = 0x00800000,
153 	LCMAP_LINGUISTIC_CASING   = 0x01000000,
154 	LCMAP_SIMPLIFIED_CHINESE  = 0x02000000,
155 	LCMAP_TRADITIONAL_CHINESE = 0x04000000;
156 
157 const CALID ENUM_ALL_CALENDARS = -1;
158 
159 const DWORD
160 	DATE_SHORTDATE        =          1,
161 	DATE_LONGDATE         =          2,
162 	DATE_USE_ALT_CALENDAR =          4,
163 	LOCALE_NOUSEROVERRIDE = 0x80000000;
164 
165 enum : DWORD {
166 	CP_INSTALLED = 1,
167 	CP_SUPPORTED
168 }
169 
170 enum : DWORD {
171 	LCID_INSTALLED       = 1,
172 	LCID_SUPPORTED       = 2,
173 	LCID_ALTERNATE_SORTS = 4
174 }
175 
176 const DWORD
177 	MAP_FOLDCZONE   =  16,
178 	MAP_PRECOMPOSED =  32,
179 	MAP_COMPOSITE   =  64,
180 	MAP_FOLDDIGITS  = 128;
181 
182 enum : UINT {
183 	CP_ACP,
184 	CP_OEMCP,
185 	CP_MACCP,
186 	CP_THREAD_ACP, // =     3
187 	CP_SYMBOL         =    42,
188 	CP_UTF7           = 65000,
189 	CP_UTF8           = 65001
190 }
191 
192 enum : DWORD {
193 	CT_CTYPE1 = 1,
194 	CT_CTYPE2 = 2,
195 	CT_CTYPE3 = 4
196 }
197 
198 const WORD
199 	C1_UPPER  =   1,
200 	C1_LOWER  =   2,
201 	C1_DIGIT  =   4,
202 	C1_SPACE  =   8,
203 	C1_PUNCT  =  16,
204 	C1_CNTRL  =  32,
205 	C1_BLANK  =  64,
206 	C1_XDIGIT = 128,
207 	C1_ALPHA  = 256;
208 
209 enum : WORD {
210 	C2_NOTAPPLICABLE,
211 	C2_LEFTTORIGHT,
212 	C2_RIGHTTOLEFT,
213 	C2_EUROPENUMBER,
214 	C2_EUROPESEPARATOR,
215 	C2_EUROPETERMINATOR,
216 	C2_ARABICNUMBER,
217 	C2_COMMONSEPARATOR,
218 	C2_BLOCKSEPARATOR,
219 	C2_SEGMENTSEPARATOR,
220 	C2_WHITESPACE,
221 	C2_OTHERNEUTRAL  // = 11
222 }
223 
224 const WORD
225 	C3_NOTAPPLICABLE =      0,
226 	C3_NONSPACING    =      1,
227 	C3_DIACRITIC     =      2,
228 	C3_VOWELMARK     =      4,
229 	C3_SYMBOL        =      8,
230 	C3_KATAKANA      = 0x0010,
231 	C3_HIRAGANA      = 0x0020,
232 	C3_HALFWIDTH     = 0x0040,
233 	C3_FULLWIDTH     = 0x0080,
234 	C3_IDEOGRAPH     = 0x0100,
235 	C3_KASHIDA       = 0x0200,
236 	C3_LEXICAL       = 0x0400,
237 	C3_ALPHA         = 0x8000;
238 
239 const DWORD
240 	TIME_NOMINUTESORSECONDS = 1,
241 	TIME_NOSECONDS          = 2,
242 	TIME_NOTIMEMARKER       = 4,
243 	TIME_FORCE24HOURFORMAT  = 8;
244 
245 const DWORD
246 	MB_PRECOMPOSED       = 1,
247 	MB_COMPOSITE         = 2,
248 	MB_USEGLYPHCHARS     = 4,
249 	MB_ERR_INVALID_CHARS = 8;
250 
251 const DWORD
252 	WC_DISCARDNS      =  16,
253 	WC_SEPCHARS       =  32,
254 	WC_DEFAULTCHAR    =  64,
255 	WC_COMPOSITECHECK = 512;
256 
257 enum : LONG {
258 	CTRY_DEFAULT            =   0,
259 	CTRY_DOMINICAN_REPUBLIC =   1,
260 	CTRY_PUERTO_RICO        =   1,
261 	CTRY_CARIBBEAN          =   1,
262 	CTRY_JAMAICA            =   1,
263 	CTRY_UNITED_STATES      =   1,
264 	CTRY_TRINIDAD_Y_TOBAGO  =   1,
265 	CTRY_CANADA             =   2,
266 	CTRY_RUSSIA             =   7,
267 	CTRY_UZBEKISTAN         =   7,
268 	CTRY_KAZAKSTAN          =   7,
269 	CTRY_TATARSTAN          =   7,
270 	CTRY_EGYPT              =  20,
271 	CTRY_SOUTH_AFRICA       =  27,
272 	CTRY_GREECE             =  30,
273 	CTRY_NETHERLANDS        =  31,
274 	CTRY_BELGIUM            =  32,
275 	CTRY_FRANCE             =  33,
276 	CTRY_MONACO             =  33,
277 	CTRY_SPAIN              =  34,
278 	CTRY_HUNGARY            =  36,
279 	CTRY_ITALY              =  39,
280 	CTRY_ROMANIA            =  40,
281 	CTRY_SWITZERLAND        =  41,
282 	CTRY_LIECHTENSTEIN      =  41,
283 	CTRY_AUSTRIA            =  43,
284 	CTRY_UNITED_KINGDOM     =  44,
285 	CTRY_DENMARK            =  45,
286 	CTRY_SWEDEN             =  46,
287 	CTRY_NORWAY             =  47,
288 	CTRY_POLAND             =  48,
289 	CTRY_GERMANY            =  49,
290 	CTRY_PERU               =  51,
291 	CTRY_MEXICO             =  52,
292 	CTRY_ARGENTINA          =  54,
293 	CTRY_BRAZIL             =  55,
294 	CTRY_CHILE              =  56,
295 	CTRY_COLOMBIA           =  57,
296 	CTRY_VENEZUELA          =  58,
297 	CTRY_MALAYSIA           =  60,
298 	CTRY_AUSTRALIA          =  61,
299 	CTRY_INDONESIA          =  62,
300 	CTRY_PHILIPPINES        =  63,
301 	CTRY_NEW_ZEALAND        =  64,
302 	CTRY_SINGAPORE          =  65,
303 	CTRY_THAILAND           =  66,
304 	CTRY_JAPAN              =  81,
305 	CTRY_SOUTH_KOREA        =  82,
306 	CTRY_VIET_NAM           =  84,
307 	CTRY_PRCHINA            =  86,
308 	CTRY_TURKEY             =  90,
309 	CTRY_INDIA              =  91,
310 	CTRY_PAKISTAN           =  92,
311 	CTRY_MOROCCO            = 212,
312 	CTRY_ALGERIA            = 213,
313 	CTRY_TUNISIA            = 216,
314 	CTRY_LIBYA              = 218,
315 	CTRY_KENYA              = 254,
316 	CTRY_ZIMBABWE           = 263,
317 	CTRY_FAEROE_ISLANDS     = 298,
318 	CTRY_PORTUGAL           = 351,
319 	CTRY_LUXEMBOURG         = 352,
320 	CTRY_IRELAND            = 353,
321 	CTRY_ICELAND            = 354,
322 	CTRY_ALBANIA            = 355,
323 	CTRY_FINLAND            = 358,
324 	CTRY_BULGARIA           = 359,
325 	CTRY_LITHUANIA          = 370,
326 	CTRY_LATVIA             = 371,
327 	CTRY_ESTONIA            = 372,
328 	CTRY_ARMENIA            = 374,
329 	CTRY_BELARUS            = 375,
330 	CTRY_UKRAINE            = 380,
331 	CTRY_SERBIA             = 381,
332 	CTRY_CROATIA            = 385,
333 	CTRY_SLOVENIA           = 386,
334 	CTRY_MACEDONIA          = 389,
335 	CTRY_CZECH              = 420,
336 	CTRY_SLOVAK             = 421,
337 	CTRY_BELIZE             = 501,
338 	CTRY_GUATEMALA          = 502,
339 	CTRY_EL_SALVADOR        = 503,
340 	CTRY_HONDURAS           = 504,
341 	CTRY_NICARAGUA          = 505,
342 	CTRY_COSTA_RICA         = 506,
343 	CTRY_PANAMA             = 507,
344 	CTRY_BOLIVIA            = 591,
345 	CTRY_ECUADOR            = 593,
346 	CTRY_PARAGUAY           = 595,
347 	CTRY_URUGUAY            = 598,
348 	CTRY_BRUNEI_DARUSSALAM  = 673,
349 	CTRY_HONG_KONG          = 852,
350 	CTRY_MACAU              = 853,
351 	CTRY_TAIWAN             = 886,
352 	CTRY_MALDIVES           = 960,
353 	CTRY_LEBANON            = 961,
354 	CTRY_JORDAN             = 962,
355 	CTRY_SYRIA              = 963,
356 	CTRY_IRAQ               = 964,
357 	CTRY_KUWAIT             = 965,
358 	CTRY_SAUDI_ARABIA       = 966,
359 	CTRY_YEMEN              = 967,
360 	CTRY_OMAN               = 968,
361 	CTRY_UAE                = 971,
362 	CTRY_ISRAEL             = 972,
363 	CTRY_BAHRAIN            = 973,
364 	CTRY_QATAR              = 974,
365 	CTRY_MONGOLIA           = 976,
366 	CTRY_IRAN               = 981,
367 	CTRY_AZERBAIJAN         = 994,
368 	CTRY_GEORGIA            = 995,
369 	CTRY_KYRGYZSTAN         = 996
370 }
371 
372 enum : CALTYPE {
373 	CAL_ICALINTVALUE          = 1,
374 	CAL_SCALNAME,
375 	CAL_IYEAROFFSETRANGE,
376 	CAL_SERASTRING,
377 	CAL_SSHORTDATE,
378 	CAL_SLONGDATE,
379 	CAL_SDAYNAME1,
380 	CAL_SDAYNAME2,
381 	CAL_SDAYNAME3,
382 	CAL_SDAYNAME4,
383 	CAL_SDAYNAME5,
384 	CAL_SDAYNAME6,
385 	CAL_SDAYNAME7,
386 	CAL_SABBREVDAYNAME1,
387 	CAL_SABBREVDAYNAME2,
388 	CAL_SABBREVDAYNAME3,
389 	CAL_SABBREVDAYNAME4,
390 	CAL_SABBREVDAYNAME5,
391 	CAL_SABBREVDAYNAME6,
392 	CAL_SABBREVDAYNAME7,
393 	CAL_SMONTHNAME1,
394 	CAL_SMONTHNAME2,
395 	CAL_SMONTHNAME3,
396 	CAL_SMONTHNAME4,
397 	CAL_SMONTHNAME5,
398 	CAL_SMONTHNAME6,
399 	CAL_SMONTHNAME7,
400 	CAL_SMONTHNAME8,
401 	CAL_SMONTHNAME9,
402 	CAL_SMONTHNAME10,
403 	CAL_SMONTHNAME11,
404 	CAL_SMONTHNAME12,
405 	CAL_SMONTHNAME13,
406 	CAL_SABBREVMONTHNAME1,
407 	CAL_SABBREVMONTHNAME2,
408 	CAL_SABBREVMONTHNAME3,
409 	CAL_SABBREVMONTHNAME4,
410 	CAL_SABBREVMONTHNAME5,
411 	CAL_SABBREVMONTHNAME6,
412 	CAL_SABBREVMONTHNAME7,
413 	CAL_SABBREVMONTHNAME8,
414 	CAL_SABBREVMONTHNAME9,
415 	CAL_SABBREVMONTHNAME10,
416 	CAL_SABBREVMONTHNAME11,
417 	CAL_SABBREVMONTHNAME12,
418 	CAL_SABBREVMONTHNAME13 // = 46
419 }
420 
421 
422 enum : CALTYPE {
423 	CAL_GREGORIAN                =  1,
424 	CAL_GREGORIAN_US,
425 	CAL_JAPAN,
426 	CAL_TAIWAN,
427 	CAL_KOREA,
428 	CAL_HIJRI,
429 	CAL_THAI,
430 	CAL_HEBREW,
431 	CAL_GREGORIAN_ME_FRENCH,
432 	CAL_GREGORIAN_ARABIC,
433 	CAL_GREGORIAN_XLIT_ENGLISH,
434 	CAL_GREGORIAN_XLIT_FRENCH // = 12
435 }
436 
437 enum : int {
438 	CSTR_LESS_THAN    = 1,
439 	CSTR_EQUAL,
440 	CSTR_GREATER_THAN
441 }
442 
443 enum : DWORD {
444 	LGRPID_INSTALLED = 1,
445 	LGRPID_SUPPORTED
446 }
447 
448 enum : LGRPID {
449 	LGRPID_WESTERN_EUROPE = 1,
450 	LGRPID_CENTRAL_EUROPE,
451 	LGRPID_BALTIC,
452 	LGRPID_GREEK,
453 	LGRPID_CYRILLIC,
454 	LGRPID_TURKISH,
455 	LGRPID_JAPANESE,
456 	LGRPID_KOREAN,
457 	LGRPID_TRADITIONAL_CHINESE,
458 	LGRPID_SIMPLIFIED_CHINESE,
459 	LGRPID_THAI,
460 	LGRPID_HEBREW,
461 	LGRPID_ARABIC,
462 	LGRPID_VIETNAMESE,
463 	LGRPID_INDIC,
464 	LGRPID_GEORGIAN,
465 	LGRPID_ARMENIAN // = 17
466 }
467 
468 static if (_WIN32_WINNT >= 0x500) {
469 	enum : LCTYPE {
470 		LOCALE_SYEARMONTH             = 0x1006,
471 		LOCALE_SENGCURRNAME           = 0x1007,
472 		LOCALE_SNATIVECURRNAME        = 0x1008,
473 		LOCALE_IDEFAULTEBCDICCODEPAGE = 0x1012,
474 		LOCALE_SSORTNAME              = 0x1013,
475 		LOCALE_IDIGITSUBSTITUTION     = 0x1014,
476 		LOCALE_IPAPERSIZE             = 0x100A
477 	}
478 
479 	const DWORD
480 		DATE_YEARMONTH  =  8,
481 		DATE_LTRREADING = 16,
482 		DATE_RTLREADING = 32;
483 
484 	const DWORD MAP_EXPAND_LIGATURES = 0x2000;
485 	const DWORD WC_NO_BEST_FIT_CHARS = 1024;
486 
487 	enum : CALTYPE {
488 		CAL_SYEARMONTH       = 47,
489 		CAL_ITWODIGITYEARMAX = 48,
490 		CAL_NOUSEROVERRIDE   = LOCALE_NOUSEROVERRIDE,
491 		CAL_RETURN_NUMBER    = LOCALE_RETURN_NUMBER,
492 		CAL_USE_CP_ACP       = LOCALE_USE_CP_ACP
493 	}
494 } // (_WIN32_WINNT >= 0x500)
495 
496 extern (Windows) {
497 	alias BOOL function(LPSTR) CALINFO_ENUMPROCA;
498 	alias BOOL function(LPWSTR) CALINFO_ENUMPROCW;
499 	alias BOOL function(LPSTR, CALID) CALINFO_ENUMPROCEXA;
500 	alias BOOL function(LPWSTR, CALID) CALINFO_ENUMPROCEXW;
501 	alias BOOL function(LGRPID, LPSTR, LPSTR, DWORD, LONG_PTR)
502 	  LANGUAGEGROUP_ENUMPROCA;
503 	alias BOOL function(LGRPID, LPWSTR, LPWSTR, DWORD, LONG_PTR)
504 	  LANGUAGEGROUP_ENUMPROCW;
505 	alias BOOL function(LGRPID, LCID, LPSTR, LONG_PTR)
506 	  LANGGROUPLOCALE_ENUMPROCA;
507 	alias BOOL function(LGRPID, LCID, LPWSTR, LONG_PTR)
508 	  LANGGROUPLOCALE_ENUMPROCW;
509 	alias BOOL function(LPWSTR, LONG_PTR) UILANGUAGE_ENUMPROCW;
510 	alias BOOL function(LPSTR, LONG_PTR) UILANGUAGE_ENUMPROCA;
511 	alias BOOL function(LPSTR) LOCALE_ENUMPROCA;
512 	alias BOOL function(LPWSTR) LOCALE_ENUMPROCW;
513 	alias BOOL function(LPSTR) CODEPAGE_ENUMPROCA;
514 	alias BOOL function(LPWSTR) CODEPAGE_ENUMPROCW;
515 	alias BOOL function(LPSTR) DATEFMT_ENUMPROCA;
516 	alias BOOL function(LPWSTR) DATEFMT_ENUMPROCW;
517 	alias BOOL function(LPSTR, CALID) DATEFMT_ENUMPROCEXA;
518 	alias BOOL function(LPWSTR, CALID) DATEFMT_ENUMPROCEXW;
519 	alias BOOL function(LPSTR) TIMEFMT_ENUMPROCA;
520 	alias BOOL function(LPWSTR) TIMEFMT_ENUMPROCW;
521 	alias BOOL function(GEOID) GEO_ENUMPROC;
522 }
523 
524 enum NLS_FUNCTION {
525 	COMPARE_STRING = 0x0001
526 }
527 
528 enum SYSGEOCLASS {
529 	GEOCLASS_NATION = 16,
530 	GEOCLASS_REGION = 14
531 }
532 
533 enum SYSGEOTYPE {
534 	GEO_NATION            = 0x0001,
535 	GEO_LATITUDE          = 0x0002,
536 	GEO_LONGITUDE         = 0x0003,
537 	GEO_ISO2              = 0x0004,
538 	GEO_ISO3              = 0x0005,
539 	GEO_RFC1766           = 0x0006,
540 	GEO_LCID              = 0x0007,
541 	GEO_FRIENDLYNAME      = 0x0008,
542 	GEO_OFFICIALNAME      = 0x0009,
543 	GEO_TIMEZONES         = 0x000a,
544 	GEO_OFFICIALLANGUAGES = 0x000a
545 }
546 
547 struct CPINFO {
548 	UINT                  MaxCharSize;
549 	BYTE[MAX_DEFAULTCHAR] DefaultChar;
550 	BYTE[MAX_LEADBYTES]   LeadByte;
551 }
552 alias CPINFO* LPCPINFO;
553 
554 struct CPINFOEXA {
555 	UINT                  MaxCharSize;
556 	BYTE[MAX_DEFAULTCHAR] DefaultChar;
557 	BYTE[MAX_LEADBYTES]   LeadByte;
558 	WCHAR                 UnicodeDefaultChar;
559 	UINT                  CodePage;
560 	CHAR[MAX_PATH]        CodePageName;
561 }
562 alias CPINFOEXA* LPCPINFOEXA;
563 
564 struct CPINFOEXW {
565 	UINT                  MaxCharSize;
566 	BYTE[MAX_DEFAULTCHAR] DefaultChar;
567 	BYTE[MAX_LEADBYTES]   LeadByte;
568 	WCHAR                 UnicodeDefaultChar;
569 	UINT                  CodePage;
570 	WCHAR[MAX_PATH]       CodePageName;
571 }
572 alias CPINFOEXW* LPCPINFOEXW;
573 
574 struct CURRENCYFMTA {
575 	UINT  NumDigits;
576 	UINT  LeadingZero;
577 	UINT  Grouping;
578 	LPSTR lpDecimalSep;
579 	LPSTR lpThousandSep;
580 	UINT  NegativeOrder;
581 	UINT  PositiveOrder;
582 	LPSTR lpCurrencySymbol;
583 }
584 alias CURRENCYFMTA* LPCURRENCYFMTA;
585 
586 struct CURRENCYFMTW {
587 	UINT   NumDigits;
588 	UINT   LeadingZero;
589 	UINT   Grouping;
590 	LPWSTR lpDecimalSep;
591 	LPWSTR lpThousandSep;
592 	UINT   NegativeOrder;
593 	UINT   PositiveOrder;
594 	LPWSTR lpCurrencySymbol;
595 }
596 alias CURRENCYFMTW* LPCURRENCYFMTW;
597 
598 struct NLSVERSIONINFO {
599 	DWORD dwNLSVersionInfoSize;
600 	DWORD dwNLSVersion;
601 	DWORD dwDefinedVersion;
602 }
603 alias NLSVERSIONINFO* LPNLSVERSIONINFO;
604 
605 struct NUMBERFMTA {
606 	UINT  NumDigits;
607 	UINT  LeadingZero;
608 	UINT  Grouping;
609 	LPSTR lpDecimalSep;
610 	LPSTR lpThousandSep;
611 	UINT  NegativeOrder;
612 }
613 alias NUMBERFMTA* LPNUMBERFMTA;
614 
615 struct NUMBERFMTW {
616 	UINT   NumDigits;
617 	UINT   LeadingZero;
618 	UINT   Grouping;
619 	LPWSTR lpDecimalSep;
620 	LPWSTR lpThousandSep;
621 	UINT   NegativeOrder;
622 }
623 alias NUMBERFMTW* LPNUMBERFMTW;
624 
625 extern (Windows) {
626 	int CompareStringA(LCID, DWORD, LPCSTR, int, LPCSTR, int);
627 	int CompareStringW(LCID, DWORD, LPCWSTR, int, LPCWSTR, int);
628 	LCID ConvertDefaultLocale(LCID);
629 	BOOL EnumCalendarInfoA(CALINFO_ENUMPROCA, LCID, CALID, CALTYPE);
630 	BOOL EnumCalendarInfoW(CALINFO_ENUMPROCW, LCID, CALID, CALTYPE);
631 	BOOL EnumDateFormatsA(DATEFMT_ENUMPROCA, LCID, DWORD);
632 	BOOL EnumDateFormatsW(DATEFMT_ENUMPROCW, LCID, DWORD);
633 	BOOL EnumSystemCodePagesA(CODEPAGE_ENUMPROCA, DWORD);
634 	BOOL EnumSystemCodePagesW(CODEPAGE_ENUMPROCW, DWORD);
635 	BOOL EnumSystemGeoID(GEOCLASS, GEOID, GEO_ENUMPROC);
636 	BOOL EnumSystemLocalesA(LOCALE_ENUMPROCA, DWORD);
637 	BOOL EnumSystemLocalesW(LOCALE_ENUMPROCW, DWORD);
638 	BOOL EnumTimeFormatsA(TIMEFMT_ENUMPROCA, LCID, DWORD);
639 	BOOL EnumTimeFormatsW(TIMEFMT_ENUMPROCW, LCID, DWORD);
640 	int FoldStringA(DWORD, LPCSTR, int, LPSTR, int);
641 	int FoldStringW(DWORD, LPCWSTR, int, LPWSTR, int);
642 	UINT GetACP();
643 	int GetCalendarInfoA(LCID, CALID, CALTYPE, LPSTR, int, LPDWORD);
644 	int GetCalendarInfoW(LCID, CALID, CALTYPE, LPWSTR, int, LPDWORD);
645 	BOOL GetCPInfo(UINT, LPCPINFO);
646 	BOOL GetCPInfoExA(UINT, DWORD, LPCPINFOEXA);
647 	BOOL GetCPInfoExW(UINT, DWORD, LPCPINFOEXW);
648 	int GetCurrencyFormatA(LCID, DWORD, LPCSTR,  const(CURRENCYFMTA)*, LPSTR, int);
649 	int GetCurrencyFormatW(LCID, DWORD, LPCWSTR,  const(CURRENCYFMTW)*, LPWSTR,
650 	  int);
651 	int GetDateFormatA(LCID, DWORD,  const(SYSTEMTIME)*, LPCSTR, LPSTR, int);
652 	int GetDateFormatW(LCID, DWORD,  const(SYSTEMTIME)*, LPCWSTR, LPWSTR, int);
653 	int GetGeoInfoA(GEOID, GEOTYPE, LPSTR, int, LANGID);
654 	int GetGeoInfoW(GEOID, GEOTYPE, LPWSTR, int, LANGID);
655 	int GetLocaleInfoA(LCID, LCTYPE, LPSTR, int);
656 	int GetLocaleInfoW(LCID, LCTYPE, LPWSTR, int);
657 	BOOL GetNLSVersion(NLS_FUNCTION, LCID, LPNLSVERSIONINFO);
658 	int GetNumberFormatA(LCID, DWORD, LPCSTR,  const(NUMBERFMTA)*, LPSTR, int);
659 	int GetNumberFormatW(LCID, DWORD, LPCWSTR,  const(NUMBERFMTW)*, LPWSTR, int);
660 	UINT GetOEMCP();
661 	BOOL GetStringTypeA(LCID, DWORD, LPCSTR, int, LPWORD);
662 	BOOL GetStringTypeW(DWORD, LPCWSTR, int, LPWORD);
663 	BOOL GetStringTypeExA(LCID, DWORD, LPCSTR, int, LPWORD);
664 	BOOL GetStringTypeExW(LCID, DWORD, LPCWSTR, int, LPWORD);
665 	LANGID GetSystemDefaultLangID();
666 	LCID GetSystemDefaultLCID();
667 	LCID GetThreadLocale();
668 	int GetTimeFormatA(LCID, DWORD,  const(SYSTEMTIME)*, LPCSTR, LPSTR, int);
669 	int GetTimeFormatW(LCID, DWORD,  const(SYSTEMTIME)*, LPCWSTR, LPWSTR, int);
670 	LANGID GetUserDefaultLangID();
671 	LCID GetUserDefaultLCID();
672 	GEOID GetUserGeoID(GEOCLASS);
673 	BOOL IsDBCSLeadByte(BYTE);
674 	BOOL IsDBCSLeadByteEx(UINT, BYTE);
675 	BOOL IsNLSDefinedString(NLS_FUNCTION, DWORD, LPNLSVERSIONINFO, LPCWSTR,
676 	  int);
677 	BOOL IsValidCodePage(UINT);
678 	BOOL IsValidLocale(LCID, DWORD);
679 	int LCMapStringA(LCID, DWORD, LPCSTR, int, LPSTR, int);
680 	int LCMapStringW(LCID, DWORD, LPCWSTR, int, LPWSTR, int);
681 	int MultiByteToWideChar(UINT, DWORD, LPCSTR, int, LPWSTR, int);
682 	int SetCalendarInfoA(LCID, CALID, CALTYPE, LPCSTR);
683 	int SetCalendarInfoW(LCID, CALID, CALTYPE, LPCWSTR);
684 	BOOL SetLocaleInfoA(LCID, LCTYPE, LPCSTR);
685 	BOOL SetLocaleInfoW(LCID, LCTYPE, LPCWSTR);
686 	BOOL SetThreadLocale(LCID);
687 	BOOL SetUserGeoID(GEOID);
688 	int WideCharToMultiByte(UINT, DWORD, LPCWSTR, int, LPSTR, int, LPCSTR,
689 	  LPBOOL);
690 
691 	static if (_WIN32_WINNT >= 0x410) {
692 		BOOL EnumCalendarInfoExA(CALINFO_ENUMPROCEXA, LCID, CALID, CALTYPE);
693 		BOOL EnumCalendarInfoExW(CALINFO_ENUMPROCEXW, LCID, CALID, CALTYPE);
694 		BOOL EnumDateFormatsExA(DATEFMT_ENUMPROCEXA, LCID, DWORD);
695 		BOOL EnumDateFormatsExW(DATEFMT_ENUMPROCEXW, LCID, DWORD);
696 		BOOL IsValidLanguageGroup(LGRPID, DWORD);
697 	}
698 
699 	static if (_WIN32_WINNT >= 0x500) {
700 		LANGID GetSystemDefaultUILanguage();
701 		LANGID GetUserDefaultUILanguage();
702 
703 		BOOL EnumSystemLanguageGroupsA(LANGUAGEGROUP_ENUMPROCA, DWORD,
704 		  LONG_PTR);
705 		BOOL EnumSystemLanguageGroupsW(LANGUAGEGROUP_ENUMPROCW, DWORD,
706 		  LONG_PTR);
707 		BOOL EnumLanguageGroupLocalesA(LANGGROUPLOCALE_ENUMPROCA, LGRPID,
708 		  DWORD, LONG_PTR);
709 		BOOL EnumLanguageGroupLocalesW(LANGGROUPLOCALE_ENUMPROCW, LGRPID,
710 		  DWORD, LONG_PTR);
711 		BOOL EnumUILanguagesA(UILANGUAGE_ENUMPROCA, DWORD, LONG_PTR);
712 		BOOL EnumUILanguagesW(UILANGUAGE_ENUMPROCW, DWORD, LONG_PTR);
713 	}
714 }
715 
716 version (Unicode) {
717 	alias CALINFO_ENUMPROCW CALINFO_ENUMPROC;
718 	alias CALINFO_ENUMPROCEXW CALINFO_ENUMPROCEX;
719 	alias LOCALE_ENUMPROCW LOCALE_ENUMPROC;
720 	alias CODEPAGE_ENUMPROCW CODEPAGE_ENUMPROC;
721 	alias DATEFMT_ENUMPROCW DATEFMT_ENUMPROC;
722 	alias DATEFMT_ENUMPROCEXW DATEFMT_ENUMPROCEX;
723 	alias TIMEFMT_ENUMPROCW TIMEFMT_ENUMPROC;
724 	alias LANGUAGEGROUP_ENUMPROCW LANGUAGEGROUP_ENUMPROC;
725 	alias LANGGROUPLOCALE_ENUMPROCW LANGGROUPLOCALE_ENUMPROC;
726 	alias UILANGUAGE_ENUMPROCW UILANGUAGE_ENUMPROC;
727 	alias CPINFOEXW CPINFOEX;
728 	alias LPCPINFOEXW LPCPINFOEX;
729 	alias CURRENCYFMTW CURRENCYFMT;
730 	alias LPCURRENCYFMTW LPCURRENCYFMT;
731 	alias NUMBERFMTW NUMBERFMT;
732 	alias LPNUMBERFMTW LPNUMBERFMT;
733 	alias CompareStringW CompareString;
734 	alias EnumCalendarInfoW EnumCalendarInfo;
735 	alias EnumSystemCodePagesW EnumSystemCodePages;
736 	alias EnumSystemLocalesW EnumSystemLocales;
737 	alias EnumTimeFormatsW EnumTimeFormats;
738 	alias FoldStringW FoldString;
739 	alias GetCalendarInfoW GetCalendarInfo;
740 	alias GetCPInfoExW GetCPInfoEx;
741 	alias GetCurrencyFormatW GetCurrencyFormat;
742 	alias GetDateFormatW GetDateFormat;
743 	alias GetGeoInfoW GetGeoInfo;
744 	alias GetLocaleInfoW GetLocaleInfo;
745 	alias GetNumberFormatW GetNumberFormat;
746 	alias GetStringTypeExW GetStringTypeEx;
747 	alias GetTimeFormatW GetTimeFormat;
748 	alias LCMapStringW LCMapString;
749 	alias SetCalendarInfoW SetCalendarInfo;
750 	alias SetLocaleInfoW SetLocaleInfo;
751 
752 	static if (_WIN32_WINNT >= 0x410) {
753 		alias EnumCalendarInfoExW EnumCalendarInfoEx;
754 		alias EnumDateFormatsExW EnumDateFormatsEx;
755 	}
756 
757 	static if (_WIN32_WINNT >= 0x500) {
758 		alias EnumSystemLanguageGroupsW EnumSystemLanguageGroups;
759 		alias EnumLanguageGroupLocalesW EnumLanguageGroupLocales;
760 		alias EnumUILanguagesW EnumUILanguages;
761 	}
762 
763 } else {
764 	alias CALINFO_ENUMPROCA CALINFO_ENUMPROC;
765 	alias CALINFO_ENUMPROCEXA CALINFO_ENUMPROCEX;
766 	alias LOCALE_ENUMPROCA LOCALE_ENUMPROC;
767 	alias CODEPAGE_ENUMPROCA CODEPAGE_ENUMPROC;
768 	alias DATEFMT_ENUMPROCA DATEFMT_ENUMPROC;
769 	alias DATEFMT_ENUMPROCEXA DATEFMT_ENUMPROCEX;
770 	alias TIMEFMT_ENUMPROCA TIMEFMT_ENUMPROC;
771 	alias LANGUAGEGROUP_ENUMPROCA LANGUAGEGROUP_ENUMPROC;
772 	alias LANGGROUPLOCALE_ENUMPROCA LANGGROUPLOCALE_ENUMPROC;
773 	alias UILANGUAGE_ENUMPROCA UILANGUAGE_ENUMPROC;
774 	alias CPINFOEXA CPINFOEX;
775 	alias LPCPINFOEXA LPCPINFOEX;
776 	alias CURRENCYFMTA CURRENCYFMT;
777 	alias LPCURRENCYFMTA LPCURRENCYFMT;
778 	alias NUMBERFMTA NUMBERFMT;
779 	alias LPNUMBERFMTA LPNUMBERFMT;
780 	alias CompareStringA CompareString;
781 	alias EnumCalendarInfoA EnumCalendarInfo;
782 	alias EnumSystemCodePagesA EnumSystemCodePages;
783 	alias EnumSystemLocalesA EnumSystemLocales;
784 	alias EnumTimeFormatsA EnumTimeFormats;
785 	alias FoldStringA FoldString;
786 	alias GetCalendarInfoA GetCalendarInfo;
787 	alias GetCPInfoExA GetCPInfoEx;
788 	alias GetCurrencyFormatA GetCurrencyFormat;
789 	alias GetDateFormatA GetDateFormat;
790 	alias GetGeoInfoA GetGeoInfo;
791 	alias GetLocaleInfoA GetLocaleInfo;
792 	alias GetNumberFormatA GetNumberFormat;
793 	alias GetStringTypeExA GetStringTypeEx;
794 	alias GetTimeFormatA GetTimeFormat;
795 	alias LCMapStringA LCMapString;
796 	alias SetCalendarInfoA SetCalendarInfo;
797 	alias SetLocaleInfoA SetLocaleInfo;
798 
799 	static if (_WIN32_WINNT >= 0x410) {
800 		alias EnumCalendarInfoExA EnumCalendarInfoEx;
801 		alias EnumDateFormatsExA EnumDateFormatsEx;
802 	}
803 
804 	static if (_WIN32_WINNT >= 0x500) {
805 		alias EnumSystemLanguageGroupsA EnumSystemLanguageGroups;
806 		alias EnumLanguageGroupLocalesA EnumLanguageGroupLocales;
807 		alias EnumUILanguagesA EnumUILanguages;
808 	}
809 }