Browse Source

* revert accidentally committed part of executeprocess patch

git-svn-id: trunk@32334 -
marco 9 years ago
parent
commit
700a22f420
1 changed files with 7 additions and 30 deletions
  1. 7 30
      rtl/win/sysutils.pp

+ 7 - 30
rtl/win/sysutils.pp

@@ -1076,20 +1076,14 @@ end;
 
 
 {$pop}
 {$pop}
 
 
-function ExecuteProcess(Const Path: RawByteString; Const ComLine: RawByteString;Flags:TExecuteFlags=[]):integer;
-begin
-  result:=ExecuteProcess(Unicodestring(Path),UnicodeString(ComLine),Flags);
-end;
-
-
-function ExecuteProcess(Const Path: UnicodeString; Const ComLine: UnicodeString;Flags:TExecuteFlags=[]):integer;
+function ExecuteProcess(Const Path: AnsiString; Const ComLine: AnsiString;Flags:TExecuteFlags=[]):integer;
 // win specific  function
 // win specific  function
 var
 var
-  SI: TStartupInfoW;
+  SI: TStartupInfo;
   PI: TProcessInformation;
   PI: TProcessInformation;
   Proc : THandle;
   Proc : THandle;
   l    : DWord;
   l    : DWord;
-  CommandLine : unicodestring;
+  CommandLine : ansistring;
   e : EOSError;
   e : EOSError;
   ExecInherits : longbool;
   ExecInherits : longbool;
 begin
 begin
@@ -1112,7 +1106,7 @@ begin
 
 
   ExecInherits:=ExecInheritsHandles in Flags;
   ExecInherits:=ExecInheritsHandles in Flags;
 
 
-  if not CreateProcessW(nil, pwidechar(CommandLine),
+  if not CreateProcessA(nil, pchar(CommandLine),
     Nil, Nil, ExecInherits,$20, Nil, Nil, SI, PI) then
     Nil, Nil, ExecInherits,$20, Nil, Nil, SI, PI) then
     begin
     begin
       e:=EOSError.CreateFmt(SExecuteProcessFailed,[CommandLine,GetLastError]);
       e:=EOSError.CreateFmt(SExecuteProcessFailed,[CommandLine,GetLastError]);
@@ -1137,27 +1131,10 @@ begin
     end;
     end;
 end;
 end;
 
 
-
-function ExecuteProcess(Const Path: RawByteString; Const ComLine: Array of RawByteString;Flags:TExecuteFlags=[]):integer;
-
-var
-  CommandLine: UnicodeString;
-  I: integer;
-
-begin
-  Commandline := '';
-  for I := 0 to High (ComLine) do
-   if Pos (' ', ComLine [I]) <> 0 then
-    CommandLine := CommandLine + ' ' + '"' + ComLine [I] + '"'
-   else
-    CommandLine := CommandLine + ' ' + Comline [I];
-  ExecuteProcess := ExecuteProcess (UnicodeString(Path), CommandLine,Flags);
-end;
-
-function ExecuteProcess(Const Path: UnicodeString; Const ComLine: Array of UnicodeString;Flags:TExecuteFlags=[]):integer;
+function ExecuteProcess(Const Path: AnsiString; Const ComLine: Array of AnsiString;Flags:TExecuteFlags=[]):integer;
 
 
 var
 var
-  CommandLine: UnicodeString;
+  CommandLine: AnsiString;
   I: integer;
   I: integer;
 
 
 begin
 begin
@@ -1167,7 +1144,7 @@ begin
     CommandLine := CommandLine + ' ' + '"' + ComLine [I] + '"'
     CommandLine := CommandLine + ' ' + '"' + ComLine [I] + '"'
    else
    else
     CommandLine := CommandLine + ' ' + Comline [I];
     CommandLine := CommandLine + ' ' + Comline [I];
-  ExecuteProcess := ExecuteProcess (Path,CommandLine,Flags);
+  ExecuteProcess := ExecuteProcess (Path, CommandLine,Flags);
 end;
 end;
 
 
 Procedure Sleep(Milliseconds : Cardinal);
 Procedure Sleep(Milliseconds : Cardinal);