mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 12:49:33 +02:00
* DLL crash fixed : ExitProcess can not be called in DLL system_exit
Problem : Halt or RunError code inside DLL will return to caller !! * Changed the "if h<4 then" into "if do_isdevice(h) then " in do_close to avoid closing of standard files
This commit is contained in:
parent
206ae47ad5
commit
5cf8dc7d80
@ -330,10 +330,15 @@ begin
|
||||
if p[i]='/' then p[i]:='\';
|
||||
end;
|
||||
|
||||
function do_isdevice(handle:longint):boolean;
|
||||
begin
|
||||
do_isdevice:=(getfiletype(handle)=2);
|
||||
end;
|
||||
|
||||
|
||||
procedure do_close(h : longint);
|
||||
begin
|
||||
if H<=4 then
|
||||
if do_isdevice(h) then
|
||||
exit;
|
||||
CloseHandle(h);
|
||||
end;
|
||||
@ -549,11 +554,6 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
function do_isdevice(handle:longint):boolean;
|
||||
begin
|
||||
do_isdevice:=(getfiletype(handle)=2);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
{*****************************************************************************
|
||||
@ -751,6 +751,11 @@ end;
|
||||
*****************************************************************************}
|
||||
Procedure system_exit;
|
||||
begin
|
||||
{ don't call ExitProcess inside
|
||||
the DLL exit code !!
|
||||
This crashes Win95 at least PM }
|
||||
if IsLibrary then
|
||||
Exit;
|
||||
if not IsConsole then
|
||||
begin
|
||||
Close(stderr);
|
||||
@ -1161,7 +1166,13 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.56 2000-01-16 23:05:03 peter
|
||||
Revision 1.57 2000-01-18 09:03:04 pierre
|
||||
* DLL crash fixed : ExitProcess can not be called in DLL system_exit
|
||||
Problem : Halt or RunError code inside DLL will return to caller !!
|
||||
* Changed the "if h<4 then" into "if do_isdevice(h) then " in do_close
|
||||
to avoid closing of standard files
|
||||
|
||||
Revision 1.56 2000/01/16 23:05:03 peter
|
||||
* fixed typo
|
||||
|
||||
Revision 1.55 2000/01/16 22:25:38 peter
|
||||
@ -1333,4 +1344,4 @@ end.
|
||||
|
||||
Revision 1.3 1998/04/26 21:49:57 florian
|
||||
+ more stuff added (??dir procedures etc.)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user