Report errors to applications when illegal dates are passed to set

system date call (required by many installation checks).
This commit is contained in:
Jukka Heinonen 2003-05-06 00:12:52 +00:00 committed by Alexandre Julliard
parent 97b7bc1984
commit 643e8740d5
1 changed files with 19 additions and 3 deletions

View File

@ -1543,9 +1543,25 @@ void WINAPI DOSVM_Int21Handler( CONTEXT86 *context )
break;
case 0x2b: /* SET SYSTEM DATE */
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",
DL_reg(context), DH_reg(context), CX_reg(context) );
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 */