Author: aandrejevic
Date: Thu Jun 20 02:10:42 2013
New Revision: 59264
URL:
http://svn.reactos.org/svn/reactos?rev=59264&view=rev
Log:
[NTVDM]
Implement the "get system time" and "get system date" functions in the
virtual DOS kernel.
Modified:
branches/ntvdm/subsystems/ntvdm/dos.c
Modified: branches/ntvdm/subsystems/ntvdm/dos.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/dos.c?re…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/dos.c [iso-8859-1] Thu Jun 20 02:10:42 2013
@@ -488,9 +488,11 @@
{
INT i;
CHAR Character;
+ SYSTEMTIME SystemTime;
PCHAR String;
PDOS_INPUT_BUFFER InputBuffer;
DWORD Eax = EmulatorGetRegister(EMULATOR_REG_AX);
+ DWORD Ecx = EmulatorGetRegister(EMULATOR_REG_CX);
DWORD Edx = EmulatorGetRegister(EMULATOR_REG_DX);
DWORD Ebx = EmulatorGetRegister(EMULATOR_REG_BX);
WORD DataSegment = EmulatorGetRegister(EMULATOR_REG_DS);
@@ -565,6 +567,36 @@
break;
}
+ /* Get system date */
+ case 0x2A:
+ {
+ GetSystemTime(&SystemTime);
+ EmulatorSetRegister(EMULATOR_REG_CX,
+ (Ecx & 0xFFFF0000) | SystemTime.wYear);
+ EmulatorSetRegister(EMULATOR_REG_DX,
+ (Edx & 0xFFFF0000)
+ | (SystemTime.wMonth << 8)
+ | SystemTime.wDay);
+ EmulatorSetRegister(EMULATOR_REG_AX,
+ (Eax & 0xFFFFFF00) | SystemTime.wDayOfWeek);
+ break;
+ }
+
+ /* Get system time */
+ case 0x2C:
+ {
+ GetSystemTime(&SystemTime);
+ EmulatorSetRegister(EMULATOR_REG_CX,
+ (Ecx & 0xFFFF0000)
+ | (SystemTime.wHour << 8)
+ | SystemTime.wMinute);
+ EmulatorSetRegister(EMULATOR_REG_DX,
+ (Edx & 0xFFFF0000)
+ | (SystemTime.wSecond << 8)
+ | (SystemTime.wMilliseconds / 10));
+ break;
+ }
+
/* Allocate Memory */
case 0x48:
{