From: Luchezar G. <luc...@us...> - 2004-09-13 12:09:46
|
Update of /cvsroot/freedos/kernel/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5376/kernel/kernel Modified Files: Tag: UNSTABLE inthndlr.c Log Message: Tom's patch releasing near f-nodes on Int 24 that returns to user Index: inthndlr.c =================================================================== RCS file: /cvsroot/freedos/kernel/kernel/inthndlr.c,v retrieving revision 1.87.2.5 retrieving revision 1.87.2.6 diff -u -d -r1.87.2.5 -r1.87.2.6 --- inthndlr.c 12 Sep 2004 17:47:20 -0000 1.87.2.5 +++ inthndlr.c 13 Sep 2004 12:09:37 -0000 1.87.2.6 @@ -411,7 +411,13 @@ } /* Clear carry by default for these functions */ - + /* see PATCH TE 5 jul 04 explanation at end */ + if (ErrorMode && lr.AH > 0x0c && lr.AH != 0x30 && lr.AH != 0x59) + { + ErrorMode = 0; + fnode[0].f_count = 0; /* don't panic - THEY ARE unused !! */ + fnode[1].f_count = 0; + } /* Check for Ctrl-Break */ if (break_ena || (lr.AH >= 1 && lr.AH <= 5) || (lr.AH >= 8 && lr.AH <= 0x0b)) check_handle_break(&syscon); @@ -1499,6 +1505,31 @@ r->ES = lr.ES; real_exit:; + /* PATCH !! TE 5 JUL 04 + what happened: + Application does FindFirst("I:\*.*"); + this fails, and causes Int24 + this sets ErrorMode, and calls Int24 + Application decides NOT to return to DOS, + but instead pop the stack and return to itself + (this is legal; see RBIL/INT 24 description + + a) now the alloc()'ed fnode[0] never gets free()'ed + b) errormode NEVER gets set back to 0 unyil exit() + + I have NO idea how real DOS handles this; + the appended patch cures the worst symptoms + */ + if (fnode[0].f_count != 0 || + fnode[1].f_count != 0 ) + { + if (ErrorMode == 0) + put_string("near_fnodes not 0"); /* panic ?? */ + fnode[0].f_count = 0; /* don't panic - THEY ARE unused !! */ + fnode[1].f_count = 0; + } + /* PATCH !! END TE 5 JUL 04 */ + #ifdef DEBUG if (bDumpRegs) { |