Browse Source

* Allow new PrepareCreatedHandleForProcess to do the work

Michaël Van Canneyt 1 year ago
parent
commit
a55e2c682b
1 changed files with 3 additions and 11 deletions
  1. 3 11
      packages/fcl-process/src/win/process.inc

+ 3 - 11
packages/fcl-process/src/win/process.inc

@@ -280,18 +280,10 @@ Var
     InitThreadAttributes(Self,FThreadAttributes);
     InitStartupInfo(Self,FStartUpInfo);
     FStartupInfo.hStdInput:=FDescriptors[phtInput].ResolveProcessHandle;
-    if FDescriptors[phtInput].IOType=iotPipe then
-      DuplicateHandleFP(FStartupInfo.hStdInput);
     FStartupInfo.hStdOutput:=FDescriptors[phtOutput].ResolveProcessHandle;
-    if FDescriptors[phtOutput].IOType=iotPipe then
-      DuplicateHandleFP(FStartupInfo.hStdOutput);
-    if Not(poStdErrToOutPut in Options) then  
-      begin
-      FStartupInfo.hStdError:=FDescriptors[phtError].ResolveProcessHandle;
-      if FDescriptors[phtError].IOType=iotPipe then
-        DuplicateHandleFP(FStartupInfo.hStdError);
-      end
-    else  
+    if Not(poStdErrToOutPut in Options) then
+      FStartupInfo.hStdError:=FDescriptors[phtError].ResolveProcessHandle
+    else
       FStartupInfo.hStdError:=FStartupInfo.hStdOutput;
     Try
       // Beware: CreateProcess can alter the strings