Browse Source

+ ExecInheritedHandles boolean

pierre 26 years ago
parent
commit
aeb8ec0d54
1 changed files with 13 additions and 2 deletions
  1. 13 2
      rtl/win32/dos.pp

+ 13 - 2
rtl/win32/dos.pp

@@ -159,6 +159,11 @@ Procedure GetIntVec(intno: byte; var vector: pointer);
 Procedure SetIntVec(intno: byte; vector: pointer);
 Procedure SetIntVec(intno: byte; vector: pointer);
 Procedure Keep(exitcode: word);
 Procedure Keep(exitcode: word);
 
 
+Const
+  { allow EXEC to inherited handles from calling process,
+    needed for FPREDIR in ide/text PM }
+  ExecInheritsHandles : BOOL = false;
+
 implementation
 implementation
 uses strings;
 uses strings;
 
 
@@ -354,6 +359,7 @@ var
   l    : Longint;
   l    : Longint;
   AppPath,
   AppPath,
   AppParam : array[0..255] of char;
   AppParam : array[0..255] of char;
+  InheritedHandles : BOOL;
 begin
 begin
   FillChar(SI, SizeOf(SI), 0);
   FillChar(SI, SizeOf(SI), 0);
   SI.cb:=SizeOf(SI);
   SI.cb:=SizeOf(SI);
@@ -364,7 +370,9 @@ begin
   AppParam[1]:=' ';
   AppParam[1]:=' ';
   Move(ComLine[1],AppParam[2],length(Comline));
   Move(ComLine[1],AppParam[2],length(Comline));
   AppParam[Length(ComLine)+2]:=#0;
   AppParam[Length(ComLine)+2]:=#0;
-  if not CreateProcess(PChar(@AppPath), PChar(@AppParam), Nil, Nil, False,$20, Nil, Nil, SI, PI) then
+  InheritedHandles:=ExecInheritsHandles;
+  if not CreateProcess(PChar(@AppPath), PChar(@AppParam),
+           Nil, Nil, InheritedHandles,$20, Nil, Nil, SI, PI) then
    begin
    begin
      DosError:=Last2DosError(GetLastError);
      DosError:=Last2DosError(GetLastError);
      exit;
      exit;
@@ -886,7 +894,10 @@ End;
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.19  1999-08-25 13:57:55  michael
+  Revision 1.20  1999-09-21 11:34:40  pierre
+   + ExecInheritedHandles boolean
+
+  Revision 1.19  1999/08/25 13:57:55  michael
   + Patched FSearch from Frank McCormick
   + Patched FSearch from Frank McCormick
 
 
   Revision 1.18  1999/08/12 09:24:14  michael
   Revision 1.18  1999/08/12 09:24:14  michael