1*c2c66affSColin Finck /*
2*c2c66affSColin Finck  * COPYRIGHT:       GPL - See COPYING in the top level directory
3*c2c66affSColin Finck  * PROJECT:         ReactOS Virtual DOS Machine
4*c2c66affSColin Finck  * FILE:            subsystems/mvdm/ntvdm/dos/dos32krnl/country.h
5*c2c66affSColin Finck  * PURPOSE:         DOS32 Country support
6*c2c66affSColin Finck  * PROGRAMMERS:     Hermes Belusca-Maito (hermes.belusca@sfr.fr)
7*c2c66affSColin Finck  *
8*c2c66affSColin Finck  * NOTE:            Support for default (english) language only.
9*c2c66affSColin Finck  *                  For other languages, please use COUNTRY.SYS
10*c2c66affSColin Finck  */
11*c2c66affSColin Finck 
12*c2c66affSColin Finck #ifndef _COUNTRY_H_
13*c2c66affSColin Finck #define _COUNTRY_H_
14*c2c66affSColin Finck 
15*c2c66affSColin Finck /* DEFINITIONS ****************************************************************/
16*c2c66affSColin Finck 
17*c2c66affSColin Finck #pragma pack(push, 1)
18*c2c66affSColin Finck 
19*c2c66affSColin Finck #if 0 // Keep here for information purposes only
20*c2c66affSColin Finck // DOS 2.00-2.10 country info structure
21*c2c66affSColin Finck typedef struct _DOS_COUNTRY_INFO_OLD
22*c2c66affSColin Finck {
23*c2c66affSColin Finck     WORD DateTimeFormat;
24*c2c66affSColin Finck     CHAR CurrencySymbol[2];
25*c2c66affSColin Finck     CHAR ThousandSep[2];
26*c2c66affSColin Finck     CHAR DecimalSep[2];
27*c2c66affSColin Finck     BYTE Reserved[24];
28*c2c66affSColin Finck } DOS_COUNTRY_INFO_OLD, *PDOS_COUNTRY_INFO_OLD;
29*c2c66affSColin Finck C_ASSERT(sizeof(DOS_COUNTRY_INFO_OLD) == 0x20);
30*c2c66affSColin Finck #endif
31*c2c66affSColin Finck 
32*c2c66affSColin Finck // DOS 2.11+ compatible country info structure
33*c2c66affSColin Finck typedef struct _DOS_COUNTRY_INFO
34*c2c66affSColin Finck {
35*c2c66affSColin Finck     WORD DateTimeFormat;
36*c2c66affSColin Finck     CHAR CurrencySymbol[5];
37*c2c66affSColin Finck     CHAR ThousandSep[2];
38*c2c66affSColin Finck     CHAR DecimalSep[2];
39*c2c66affSColin Finck     CHAR DateSep[2];
40*c2c66affSColin Finck     CHAR TimeSep[2];
41*c2c66affSColin Finck     BYTE CurrencyFormat;
42*c2c66affSColin Finck     BYTE CurrencyDigitsNum;
43*c2c66affSColin Finck     BYTE TimeFormat;
44*c2c66affSColin Finck     DWORD CaseMapPtr;
45*c2c66affSColin Finck     CHAR DataListSep[2];
46*c2c66affSColin Finck     BYTE Reserved[10];
47*c2c66affSColin Finck } DOS_COUNTRY_INFO, *PDOS_COUNTRY_INFO;
48*c2c66affSColin Finck C_ASSERT(sizeof(DOS_COUNTRY_INFO) == 0x22);
49*c2c66affSColin Finck 
50*c2c66affSColin Finck typedef struct _DOS_COUNTRY_INFO_EX
51*c2c66affSColin Finck {
52*c2c66affSColin Finck     WORD Size;
53*c2c66affSColin Finck     WORD CountryId;
54*c2c66affSColin Finck     WORD CodePage;
55*c2c66affSColin Finck     DOS_COUNTRY_INFO CountryInfo;
56*c2c66affSColin Finck } DOS_COUNTRY_INFO_EX, *PDOS_COUNTRY_INFO_EX;
57*c2c66affSColin Finck C_ASSERT(sizeof(DOS_COUNTRY_INFO_EX) == 0x28);
58*c2c66affSColin Finck 
59*c2c66affSColin Finck typedef struct _DOS_COUNTRY_INFO_2
60*c2c66affSColin Finck {
61*c2c66affSColin Finck     BYTE InfoId;
62*c2c66affSColin Finck     union
63*c2c66affSColin Finck     {
64*c2c66affSColin Finck         DOS_COUNTRY_INFO_EX CountryInfoEx;
65*c2c66affSColin Finck 
66*c2c66affSColin Finck         DWORD UpCaseTblPtr;
67*c2c66affSColin Finck         DWORD LoCaseTblPtr;
68*c2c66affSColin Finck 
69*c2c66affSColin Finck         DWORD FNameUpCaseTblPtr;
70*c2c66affSColin Finck         DWORD FNameTermTblPtr;
71*c2c66affSColin Finck 
72*c2c66affSColin Finck         DWORD CollateTblPtr;
73*c2c66affSColin Finck         DWORD DBCSLeadTblPtr;
74*c2c66affSColin Finck     };
75*c2c66affSColin Finck } DOS_COUNTRY_INFO_2, *PDOS_COUNTRY_INFO_2;
76*c2c66affSColin Finck 
77*c2c66affSColin Finck #pragma pack(pop)
78*c2c66affSColin Finck 
79*c2c66affSColin Finck /* FUNCTIONS ******************************************************************/
80*c2c66affSColin Finck 
81*c2c66affSColin Finck WORD
82*c2c66affSColin Finck DosGetCountryInfo(IN OUT PWORD CountryId,
83*c2c66affSColin Finck                   OUT PDOS_COUNTRY_INFO CountryInfo);
84*c2c66affSColin Finck 
85*c2c66affSColin Finck WORD
86*c2c66affSColin Finck DosGetCountryInfoEx(IN BYTE InfoId,
87*c2c66affSColin Finck                     IN WORD CodePage,
88*c2c66affSColin Finck                     IN WORD CountryId,
89*c2c66affSColin Finck                     OUT PDOS_COUNTRY_INFO_2 CountryInfo,
90*c2c66affSColin Finck                     IN OUT PWORD BufferSize);
91*c2c66affSColin Finck 
92*c2c66affSColin Finck WORD DosIfCharYesNo(WORD Char);
93*c2c66affSColin Finck CHAR DosToUpper(CHAR Char);
94*c2c66affSColin Finck VOID DosToUpperStrN(PCHAR DestStr, PCHAR SrcStr, WORD Length);
95*c2c66affSColin Finck VOID DosToUpperStrZ(PSTR DestStr, PSTR SrcStr);
96*c2c66affSColin Finck 
97*c2c66affSColin Finck BOOLEAN DosCountryInitialize(VOID);
98*c2c66affSColin Finck 
99*c2c66affSColin Finck #endif /* _COUNTRY_H_ */
100