* additional fixes for ExecuteProcess - running of DOS programs in current directory and proper closing of the created queue

git-svn-id: trunk@19323 -
This commit is contained in:
Tomas Hajny 2011-10-02 01:41:56 +00:00
parent ceecda9d2e
commit f13c5fae05

View File

@ -669,7 +669,13 @@ begin
FillChar (SD, SizeOf (SD), 0); FillChar (SD, SizeOf (SD), 0);
SD.Length := SizeOf (SD); SD.Length := SizeOf (SD);
SD.Related := ssf_Related_Child; SD.Related := ssf_Related_Child;
SD.PgmName := PChar (Path); if FileExists (Path) then
(* Full path necessary for starting different executable files from current *)
(* directory. *)
CommandLine := ExpandFileName (Path)
else
CommandLine := Path;
SD.PgmName := PChar (CommandLine);
if ComLine <> '' then if ComLine <> '' then
SD.PgmInputs := PChar (ComLine); SD.PgmInputs := PChar (ComLine);
SD.InheritOpt := ssf_InhertOpt_Parent; SD.InheritOpt := ssf_InhertOpt_Parent;
@ -694,7 +700,9 @@ begin
DosCloseQueue (HQ); DosCloseQueue (HQ);
DosFreeMem (PCI); DosFreeMem (PCI);
FreeMem (ObjNameBuf, ObjBufSize); FreeMem (ObjNameBuf, ObjBufSize);
end; end
else
DosCloseQueue (HQ);
end end
else else
DosCloseQueue (HQ); DosCloseQueue (HQ);