diff --git a/kernel/inthndlr.c b/kernel/inthndlr.c index 7af35f5..3e1905a 100644 --- a/kernel/inthndlr.c +++ b/kernel/inthndlr.c @@ -434,10 +434,26 @@ dispatch: } /* 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) + /* We force clear the near fnodes, + On a normal int21h entry these are unused, so should already + be clear, thus this code is effectively redundant. + However when re-entering int21h, such as a device driver + (e.g. shsufdrv), the fnodes may contain the values of the + in progress call; as long as the driver/tsr causing the + reentrancey saves and restores the SDA across the call then + any changes we do (ie clearing these) should go unnoticed + and if the cause of the reentrancy does not save/restore the + SDA then the caller should expected the unexpected. + Failure to do this will at a minimal result in the extra + output indicating fnodes not 0 (and possibly clearing at end + of call) when the re-entered int21h call completes, but could + result in the re-entered call to fail with no free near fnodes + if both are already in use by the original int21h call (?bug 1879?). + See also PATCH TE 5 jul 04 explanation at end + */ + if (/*ErrorMode && */lr.AH > 0x0c && lr.AH != 0x30 && lr.AH != 0x59) { - ErrorMode = 0; + /*if (ErrorMode)*/ ErrorMode = 0; fnode[0].f_count = 0; /* don't panic - THEY ARE unused !! */ fnode[1].f_count = 0; }