mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 00:29:33 +02:00
+ Changed Exception to EProcess
git-svn-id: trunk@2923 -
This commit is contained in:
parent
c575771aee
commit
7f5b9e5c00
@ -130,6 +130,8 @@ Type
|
||||
Property WindowWidth : Cardinal Read dwXSize Write SetWindowWidth;
|
||||
Property FillAttribute : Cardinal read FFillAttribute Write FFillAttribute;
|
||||
end;
|
||||
|
||||
EProcess = Class(Exception);
|
||||
|
||||
implementation
|
||||
|
||||
|
@ -139,7 +139,7 @@ begin
|
||||
if (P.ApplicationName='') then
|
||||
begin
|
||||
If (P.CommandLine='') then
|
||||
Raise Exception.Create(SNoCommandline);
|
||||
Raise EProcess.Create(SNoCommandline);
|
||||
Cmd:=P.CommandLine;
|
||||
end
|
||||
else
|
||||
@ -204,7 +204,7 @@ Procedure CreatePipes(Var HI,HO,HE : TPipePair; CE : Boolean);
|
||||
|
||||
begin
|
||||
If not CreatePipeHandles(P[peRead],P[peWrite]) then
|
||||
Raise Exception.Create('Failed to create pipes');
|
||||
Raise EProcess.Create('Failed to create pipes');
|
||||
end;
|
||||
|
||||
Procedure ClosePair(Var P : TPipePair);
|
||||
@ -268,7 +268,7 @@ begin
|
||||
PName:=FileSearch(Pname,fpgetenv('PATH'));
|
||||
Pid:=fpfork;
|
||||
if Pid<0 then
|
||||
Raise Exception.Create('Failed to Fork process');
|
||||
Raise EProcess.Create('Failed to Fork process');
|
||||
if (PID>0) then
|
||||
begin
|
||||
// Parent process. Copy process information.
|
||||
|
@ -202,7 +202,7 @@ begin
|
||||
If Not CreateProcess (PName,PCommandLine,@FProcessAttributes,@FThreadAttributes,
|
||||
FInheritHandles,FCreationFlags,FEnv,PDir,FStartupInfo,
|
||||
fProcessInformation) then
|
||||
Raise Exception.CreateFmt('Failed to execute %s : %d',[FCommandLine,GetLastError]);
|
||||
Raise EProcess.CreateFmt('Failed to execute %s : %d',[FCommandLine,GetLastError]);
|
||||
FProcessHandle:=FProcessInformation.hProcess;
|
||||
FThreadHandle:=FProcessInformation.hThread;
|
||||
FProcessID:=FProcessINformation.dwProcessID;
|
||||
|
@ -202,7 +202,7 @@ begin
|
||||
If Not CreateProcess (PName,PCommandLine,@FProcessAttributes,@FThreadAttributes,
|
||||
FInheritHandles,FCreationFlags,FEnv,PDir,@FStartupInfo,
|
||||
fProcessInformation) then
|
||||
Raise Exception.CreateFmt('Failed to execute %s : %d',[FCommandLine,GetLastError]);
|
||||
Raise EProcess.CreateFmt('Failed to execute %s : %d',[FCommandLine,GetLastError]);
|
||||
FProcessHandle:=FProcessInformation.hProcess;
|
||||
FThreadHandle:=FProcessInformation.hThread;
|
||||
FProcessID:=FProcessINformation.dwProcessID;
|
||||
|
Loading…
Reference in New Issue
Block a user