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:
parent
3366f18464
commit
a54084a00f
|
@ -17,6 +17,7 @@
|
||||||
#include "process.h"
|
#include "process.h"
|
||||||
#include "stackframe.h"
|
#include "stackframe.h"
|
||||||
#include "selectors.h"
|
#include "selectors.h"
|
||||||
|
#include "syslevel.h"
|
||||||
#include "task.h"
|
#include "task.h"
|
||||||
#include "except.h"
|
#include "except.h"
|
||||||
#include "win.h"
|
#include "win.h"
|
||||||
|
@ -821,7 +822,7 @@ void WINAPI WIN16_keybd_event( CONTEXT *context )
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* WIN16_CreateSystemTimer (SYSTEM.2)
|
* WIN16_CreateSystemTimer (SYSTEM.2)
|
||||||
*/
|
*/
|
||||||
static void CALLBACK THUNK_CallSystemTimerProc( FARPROC16 proc, WORD timer )
|
static void THUNK_CallSystemTimerProc( FARPROC16 proc, WORD timer )
|
||||||
{
|
{
|
||||||
CONTEXT context;
|
CONTEXT context;
|
||||||
memset( &context, '\0', sizeof(context) );
|
memset( &context, '\0', sizeof(context) );
|
||||||
|
@ -833,23 +834,23 @@ static void CALLBACK THUNK_CallSystemTimerProc( FARPROC16 proc, WORD timer )
|
||||||
|
|
||||||
AX_reg( &context ) = 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 );
|
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
|
is currently in 16-bit code. With the current structure
|
||||||
of the Wine thunking code, this seems to be hard to fix ... */
|
of the Wine thunking code, this seems to be hard to fix ... */
|
||||||
}
|
}
|
||||||
WORD WINAPI WIN16_CreateSystemTimer( WORD rate, FARPROC16 proc )
|
WORD WINAPI WIN16_CreateSystemTimer( WORD rate, FARPROC16 proc )
|
||||||
{
|
{
|
||||||
THUNK *thunk = THUNK_Alloc( proc, (RELAY)THUNK_CallSystemTimerProc );
|
THUNK *thunk = THUNK_Alloc( proc, (RELAY)THUNK_CallSystemTimerProc );
|
||||||
WORD timer = 0;
|
WORD timer = CreateSystemTimer( rate, (SYSTEMTIMERPROC)thunk );
|
||||||
|
|
||||||
#if 1
|
|
||||||
FIXME(system,"are currently broken, returning 0.\n");
|
|
||||||
#else
|
|
||||||
timer = CreateSystemTimer( rate, (SYSTEMTIMERPROC)thunk );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!timer) THUNK_Free( thunk );
|
if (!timer) THUNK_Free( thunk );
|
||||||
return timer;
|
return timer;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue