mirror of https://github.com/red-prig/fpPS4.git
This commit is contained in:
parent
0a67724e69
commit
70b09660c4
|
@ -78,6 +78,7 @@ type
|
|||
g_p_pid:Integer;
|
||||
g_fork :Boolean;
|
||||
function is_terminated:Boolean; virtual;
|
||||
function exit_code:DWORD; virtual;
|
||||
procedure suspend; virtual;
|
||||
procedure resume; virtual;
|
||||
procedure stop; virtual;
|
||||
|
@ -91,6 +92,11 @@ begin
|
|||
Result:=False;
|
||||
end;
|
||||
|
||||
function TGameProcess.exit_code:DWORD;
|
||||
begin
|
||||
Result:=0;
|
||||
end;
|
||||
|
||||
procedure TGameProcess.suspend;
|
||||
begin
|
||||
//
|
||||
|
|
19
gui/main.pas
19
gui/main.pas
|
@ -685,9 +685,19 @@ begin
|
|||
end;
|
||||
|
||||
procedure TfrmMain.TBStopClick(Sender: TObject);
|
||||
var
|
||||
exit_code:DWORD;
|
||||
r:RawByteString;
|
||||
begin
|
||||
if GameProcessForked then //only forked
|
||||
begin
|
||||
exit_code:=0;
|
||||
|
||||
if FGameProcess.is_terminated then
|
||||
begin
|
||||
exit_code:=FGameProcess.exit_code;
|
||||
end;
|
||||
|
||||
//terminate
|
||||
FGameProcess.stop;
|
||||
SetButtonsState(mbsStopped);
|
||||
|
@ -702,6 +712,15 @@ begin
|
|||
CloseMainWindows;
|
||||
//
|
||||
Pages.ActivePage:=TabList;
|
||||
|
||||
if (exit_code<>0) then
|
||||
begin
|
||||
r:='Game process stopped with exit code:0x'+HexStr(exit_code,8);
|
||||
FileWrite(FAddHandle,PChar(r)^,Length(r));
|
||||
|
||||
MessageDlgEx(r,mtError,[mbOK],Self);
|
||||
end;
|
||||
|
||||
end else
|
||||
begin
|
||||
TBPauseClick(Sender);
|
||||
|
|
|
@ -13,6 +13,7 @@ type
|
|||
TGameProcessPipe=class(TGameProcess)
|
||||
FChildpip:THandle;
|
||||
function is_terminated:Boolean; override;
|
||||
function exit_code:DWORD; override;
|
||||
procedure suspend; override;
|
||||
procedure resume; override;
|
||||
procedure stop; override;
|
||||
|
@ -32,6 +33,21 @@ begin
|
|||
Result:=(R=STATUS_WAIT_0);
|
||||
end;
|
||||
|
||||
function TGameProcessPipe.exit_code:DWORD;
|
||||
var
|
||||
info:PROCESS_BASIC_INFORMATION;
|
||||
begin
|
||||
info:=Default(PROCESS_BASIC_INFORMATION);
|
||||
|
||||
NtQueryInformationProcess(g_proc,
|
||||
ProcessBasicInformation,
|
||||
@info,
|
||||
SizeOf(info),
|
||||
nil);
|
||||
|
||||
Result:=info.ExitStatus;
|
||||
end;
|
||||
|
||||
procedure TGameProcessPipe.suspend;
|
||||
begin
|
||||
NtSuspendProcess(g_proc);
|
||||
|
|
Loading…
Reference in New Issue