mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-29 04:13:32 +00:00
[NTVDM]
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user