- May
- 13,211
- 180
Rex, in several places I use TCCGlobals[44] as a test for whether there's a Ctrl-C or Ctrl-Break.
It continues to work in all but one case, my WAIT plugin command. Here's the relevant code. Do you have any idea why it's not working here (that is, why I can't interrupt the while-loop below)? Is there something more I should be doing inside the loop so that TCC sees a Ctrl-C ot Ctrl-Break immediately? Thanks.
This code is called from the plugin command INT WINAPI WAIT ( WCHAR *psz ) which uses no signal handlers.
Code:
global.TCCGlobals = (LPBYTE) GetProcAddress(hTCDLL, "?aGlobals@@3UGLOBAL_VARIABLES@@A");
It continues to work in all but one case, my WAIT plugin command. Here's the relevant code. Do you have any idea why it's not working here (that is, why I can't interrupt the while-loop below)? Is there something more I should be doing inside the loop so that TCC sees a Ctrl-C ot Ctrl-Break immediately? Thanks.
This code is called from the plugin command INT WINAPI WAIT ( WCHAR *psz ) which uses no signal handlers.
Code:
VOID WaitUntilPerfCountOrFileTime ( ULONGLONG ullDue, BOOL bWaitFileTime )
{
typedef ULONGLONG ( *GETNOWTYPE ) (VOID);
GETNOWTYPE GETNOW = bWaitFileTime ? CurrentFileTime : PerfCount;
while ( GETNOW() < ullDue && global.TCCGlobals[44] == 0 )
{
Sleep(1);
tty_yield(0);
}
}