Author: aandrejevic Date: Wed Jan 14 22:22:05 2015 New Revision: 66039
URL: http://svn.reactos.org/svn/reactos?rev=66039&view=rev Log: [NTVDM] Implement INT 21h, AX = 38h (Get/Set Country-dependent Information). Patch by Pierre Schweitzer. Thanks!
Modified: trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.h
Modified: trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/dos/dos32k... ============================================================================== --- trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.c [iso-8859-1] Wed Jan 14 22:22:05 2015 @@ -1469,6 +1469,8 @@ 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 @@ 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: {
Modified: trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/ntvdm/dos/dos32k... ============================================================================== --- trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/ntvdm/dos/dos32krnl/dos.h [iso-8859-1] Wed Jan 14 22:22:05 2015 @@ -158,6 +158,14 @@ DWORD StackLocation; 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)