I think it's time to rethink the HFILE16_TO_HFILE32 strategy,

can't keep working around flaws in it like this (now stdio
was getting closed when programs close handles >=5)
This commit is contained in:
Ove Kaaven 1998-10-11 12:22:54 +00:00 committed by Alexandre Julliard
parent 32486cded4
commit c6e16c3a4a
1 changed files with 7 additions and 2 deletions

View File

@ -1078,7 +1078,7 @@ void WINAPI DOS3Call( CONTEXT *context )
DX_reg(context) ));
int res;
TRACE(int21,"BUFFERED INPUT\n");
TRACE(int21,"BUFFERED INPUT (size=%d)\n",buffer[0]);
if (buffer[1])
TRACE(int21,"Handle old chars in buffer!\n");
res=_lread16( 0, buffer+2,buffer[0]);
@ -1347,8 +1347,13 @@ void WINAPI DOS3Call( CONTEXT *context )
case 0x3e: /* "CLOSE" - CLOSE FILE */
TRACE(int21,"CLOSE handle %d\n",BX_reg(context));
if (BX_reg(context)<5) {
if ((BX_reg(context)<5)||
/* FIXME: need to improve on those handle conversion macros */
(BX_reg(context)==HFILE32_TO_HFILE16(GetStdHandle(STD_INPUT_HANDLE)))||
(BX_reg(context)==HFILE32_TO_HFILE16(GetStdHandle(STD_OUTPUT_HANDLE)))||
(BX_reg(context)==HFILE32_TO_HFILE16(GetStdHandle(STD_ERROR_HANDLE)))) {
/* hack to make sure stdio isn't closed */
FIXME(int21, "stdio handle closed, need proper conversion\n");
DOS_ExtendedError = 0x06;
bSetDOSExtendedError = TRUE;
} else