Temporary fix: Activate 16-bit system timer callback routines, but

skip calling them if timer signal occured while current thread was
holding the Win16Lock (to prevent 16-bit stack corruption).
This commit is contained in:
Ulrich Weigand 1999-03-10 17:49:26 +00:00 committed by Alexandre Julliard
parent 3366f18464
commit a54084a00f
1 changed files with 11 additions and 10 deletions

View File

@ -17,6 +17,7 @@
#include "process.h"
#include "stackframe.h"
#include "selectors.h"
#include "syslevel.h"
#include "task.h"
#include "except.h"
#include "win.h"
@ -821,7 +822,7 @@ void WINAPI WIN16_keybd_event( CONTEXT *context )
/***********************************************************************
* WIN16_CreateSystemTimer (SYSTEM.2)
*/
static void CALLBACK THUNK_CallSystemTimerProc( FARPROC16 proc, WORD timer )
static void THUNK_CallSystemTimerProc( FARPROC16 proc, WORD timer )
{
CONTEXT context;
memset( &context, '\0', sizeof(context) );
@ -833,23 +834,23 @@ static void CALLBACK THUNK_CallSystemTimerProc( FARPROC16 proc, WORD timer )
AX_reg( &context ) = timer;
if ( _ConfirmWin16Lock() )
{
FIXME( system, "Skipping timer %d callback because timer signal "
"arrived while we own the Win16Lock!\n", timer );
return;
}
CallTo16_sreg_( &context, 0 );
/* FIXME: This does not work if the signal occurs while some thread
/* FIXME: This does not work if the signal occurs while this thread
is currently in 16-bit code. With the current structure
of the Wine thunking code, this seems to be hard to fix ... */
}
WORD WINAPI WIN16_CreateSystemTimer( WORD rate, FARPROC16 proc )
{
THUNK *thunk = THUNK_Alloc( proc, (RELAY)THUNK_CallSystemTimerProc );
WORD timer = 0;
#if 1
FIXME(system,"are currently broken, returning 0.\n");
#else
timer = CreateSystemTimer( rate, (SYSTEMTIMERPROC)thunk );
#endif
WORD timer = CreateSystemTimer( rate, (SYSTEMTIMERPROC)thunk );
if (!timer) THUNK_Free( thunk );
return timer;
}