From 643e8740d58cd5dae7c12800847967ea63585c3a Mon Sep 17 00:00:00 2001 From: Jukka Heinonen Date: Tue, 6 May 2003 00:12:52 +0000 Subject: [PATCH] Report errors to applications when illegal dates are passed to set system date call (required by many installation checks). --- dlls/winedos/int21.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/dlls/winedos/int21.c b/dlls/winedos/int21.c index 2bb7db83106..c15b1e4b5a4 100644 --- a/dlls/winedos/int21.c +++ b/dlls/winedos/int21.c @@ -1543,9 +1543,25 @@ void WINAPI DOSVM_Int21Handler( CONTEXT86 *context ) break; case 0x2b: /* SET SYSTEM DATE */ - FIXME("SetSystemDate(%02d/%02d/%04d): not allowed\n", - DL_reg(context), DH_reg(context), CX_reg(context) ); - SET_AL( context, 0 ); /* Let's pretend we succeeded */ + TRACE( "SET SYSTEM DATE\n" ); + { + WORD year = CX_reg(context); + BYTE month = DH_reg(context); + BYTE day = DL_reg(context); + + if (year >= 1980 && year <= 2099 && + month >= 1 && month <= 12 && + day >= 1 && day <= 31) + { + FIXME( "SetSystemDate(%02d/%02d/%04d): not allowed\n", + day, month, year ); + SET_AL( context, 0 ); /* Let's pretend we succeeded */ + } + else + { + SET_AL( context, 0xff ); /* invalid date */ + } + } break; case 0x2c: /* GET SYSTEM TIME */