* fixes to the win16 stderr output

git-svn-id: trunk@31849 -
This commit is contained in:
nickysn 2015-09-27 15:17:59 +00:00
parent 84b47dc92c
commit f5c2ce9058
2 changed files with 15 additions and 1 deletions

View File

@ -403,6 +403,11 @@ function do_isdevice(handle:THandle):boolean;
var
regs: Registers;
begin
if (handle=StdInputHandle) or (handle=StdOutputHandle) or (handle=StdErrorHandle) then
begin
do_isdevice:=true;
exit;
end;
FillChar(regs,SizeOf(regs),0);
regs.AX := $4400;
regs.BX := handle;

View File

@ -298,7 +298,7 @@ Begin
End;
procedure ErrorClose(Var F: TextRec);
procedure ShowErrMsg;
begin
if ErrorLen>0 then
begin
@ -312,8 +312,16 @@ begin
end;
procedure ErrorClose(Var F: TextRec);
begin
ShowErrMsg;
end;
procedure ErrorOpen(Var F: TextRec);
Begin
TextRec(F).Handle:=StdErrorHandle;
TextRec(F).Mode:=fmOutput;
TextRec(F).InOutFunc:=@ErrorWrite;
TextRec(F).FlushFunc:=@ErrorWrite;
TextRec(F).CloseFunc:=@ErrorClose;
@ -355,6 +363,7 @@ begin
Close(erroutput);
Close(Input);
Close(Output);
ShowErrMsg;
asm
mov al, byte [exitcode]
mov ah, 4Ch