|
@@ -45,6 +45,12 @@ unit sysinitgprof;
|
|
|
procedure CMainEXE;cdecl;forward;
|
|
|
procedure CMainDLL;cdecl;forward;
|
|
|
|
|
|
+ const
|
|
|
+ STD_INPUT_HANDLE = dword(-10);
|
|
|
+
|
|
|
+ function GetStdHandle(nStdHandle:DWORD) : THandle; stdcall; external 'kernel32' name 'GetStdHandle';
|
|
|
+ function GetConsoleMode(hConsoleHandle: THandle; var lpMode: DWORD): Boolean; stdcall; external 'kernel32' name 'GetConsoleMode';
|
|
|
+
|
|
|
procedure EXEgmon_start;
|
|
|
begin
|
|
|
if monstarted=0 then
|
|
@@ -96,6 +102,10 @@ unit sysinitgprof;
|
|
|
subl $0x8,%esp
|
|
|
andl $0xfffffff0,%esp
|
|
|
end;
|
|
|
+ { it seems cygwin messed around with the console mode so we've to
|
|
|
+ store the startup console mode before cygwin can do anything (FK)
|
|
|
+ }
|
|
|
+ GetConsoleMode(GetStdHandle((Std_Input_Handle)),StartupConsoleMode);
|
|
|
Cygwin_crt0(@CMainEXE);
|
|
|
end;
|
|
|
|