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
CTRL_C_EVENT,
CTRL_BREAK_EVENT: begin
if GState <> dsRun then Exit;
if GMainProcess = nil then Exit;
TDbgWinProcess(GMainProcess).Interrupt;
if GController.MainProcess = nil then Exit;
TDbgWinProcess(GController.MainProcess).Interrupt;
Result := True;
end;
CTRL_CLOSE_EVENT: begin
if (GState in [dsRun, dsPause]) and (GMainProcess <> nil)
then TerminateProcess(GMainProcess.Handle, 0);
if (GController.MainProcess <> nil)
then TerminateProcess(GController.MainProcess.Handle, 0);
end;
end;
end;

View File

@ -511,10 +511,10 @@ begin
Exit;
end;
{$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
then begin
WriteLN('File "', GFileName, '" does not exist');
WriteLN('File "', GController.ExecutableFilename, '" does not exist');
Exit;
end;