Implement INT 21h, AX = 38h (Get/Set Country-dependent Information).
Patch by Pierre Schweitzer. Thanks!


svn path=/trunk/; revision=66039
This commit is contained in:
Aleksandar Andrejevic
2015-01-14 22:22:05 +00:00
parent 9186a358da
commit 3e4d9f61d6
2 changed files with 69 additions and 0 deletions
@@ -1469,6 +1469,8 @@ VOID WINAPI DosInt21h(LPWORD Stack)
SYSTEMTIME SystemTime;
PCHAR String;
PDOS_INPUT_BUFFER InputBuffer;
PDOS_COUNTRY_CODE_BUFFER CountryCodeBuffer;
INT Return;
/* Check the value in the AH register */
switch (getAH())
@@ -1992,6 +1994,65 @@ VOID WINAPI DosInt21h(LPWORD Stack)
break;
}
/* Get/Set Country-dependent Information */
case 0x38:
{
CountryCodeBuffer = (PDOS_COUNTRY_CODE_BUFFER)SEG_OFF_TO_PTR(getDS(), getDX());
if (getAL() == 0x00)
{
/* Get */
Return = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IDATE,
&CountryCodeBuffer->TimeFormat,
sizeof(CountryCodeBuffer->TimeFormat) / sizeof(TCHAR));
if (Return == 0)
{
Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF;
setAX(LOWORD(GetLastError()));
break;
}
Return = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SCURRENCY,
&CountryCodeBuffer->CurrencySymbol,
sizeof(CountryCodeBuffer->CurrencySymbol) / sizeof(TCHAR));
if (Return == 0)
{
Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF;
setAX(LOWORD(GetLastError()));
break;
}
Return = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND,
&CountryCodeBuffer->ThousandSep,
sizeof(CountryCodeBuffer->ThousandSep) / sizeof(TCHAR));
if (Return == 0)
{
Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF;
setAX(LOWORD(GetLastError()));
break;
}
Return = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL,
&CountryCodeBuffer->DecimalSep,
sizeof(CountryCodeBuffer->DecimalSep) / sizeof(TCHAR));
if (Return == 0)
{
Stack[STACK_FLAGS] |= EMULATOR_FLAG_CF;
setAX(LOWORD(GetLastError()));
break;
}
Stack[STACK_FLAGS] &= ~EMULATOR_FLAG_CF;
}
else
{
// TODO: NOT IMPLEMENTED
UNIMPLEMENTED;
}
break;
}
/* Create Directory */
case 0x39:
{
@@ -159,6 +159,14 @@ typedef struct _DOS_EXEC_PARAM_BLOCK
DWORD EntryPoint;
} DOS_EXEC_PARAM_BLOCK, *PDOS_EXEC_PARAM_BLOCK;
typedef struct _DOS_COUNTRY_CODE_BUFFER
{
WORD TimeFormat;
WORD CurrencySymbol;
WORD ThousandSep;
WORD DecimalSep;
} DOS_COUNTRY_CODE_BUFFER, *PDOS_COUNTRY_CODE_BUFFER;
#pragma pack(pop)
extern BOOLEAN DoEcho;