FpDebug: Fixed compilation of the example console-debugger on Windows

git-svn-id: trunk@44794 -
This commit is contained in:
joost 2014-04-23 18:37:34 +00:00
parent 194ab88119
commit 48c19eb556
2 changed files with 6 additions and 7 deletions

View File

@ -57,15 +57,14 @@ begin
case CtrlType of case CtrlType of
CTRL_C_EVENT, CTRL_C_EVENT,
CTRL_BREAK_EVENT: begin CTRL_BREAK_EVENT: begin
if GState <> dsRun then Exit; if GController.MainProcess = nil then Exit;
if GMainProcess = nil then Exit; TDbgWinProcess(GController.MainProcess).Interrupt;
TDbgWinProcess(GMainProcess).Interrupt;
Result := True; Result := True;
end; end;
CTRL_CLOSE_EVENT: begin CTRL_CLOSE_EVENT: begin
if (GState in [dsRun, dsPause]) and (GMainProcess <> nil) if (GController.MainProcess <> nil)
then TerminateProcess(GMainProcess.Handle, 0); then TerminateProcess(GController.MainProcess.Handle, 0);
end; end;
end; end;
end; end;

View File

@ -511,10 +511,10 @@ begin
Exit; Exit;
end; end;
{$ifdef windows} {$ifdef windows}
hFile := CreateFile(PChar(GFileName), GENERIC_READ, FILE_SHARE_READ, nil, OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, 0); hFile := CreateFile(PChar(GController.ExecutableFilename), GENERIC_READ, FILE_SHARE_READ, nil, OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, 0);
if hFile = INVALID_HANDLE_VALUE if hFile = INVALID_HANDLE_VALUE
then begin then begin
WriteLN('File "', GFileName, '" does not exist'); WriteLN('File "', GController.ExecutableFilename, '" does not exist');
Exit; Exit;
end; end;