Callout table (for KERNEL->USER calls) added.

Callbacks->CallPostAppMessageProc removed.
This commit is contained in:
Ulrich Weigand 1998-12-24 15:12:20 +00:00 committed by Alexandre Julliard
parent be672fe587
commit 61439d27fb
3 changed files with 134 additions and 3 deletions

View File

@ -34,6 +34,7 @@ extern LONG CALLBACK CallTo16_lreg_(const CONTEXT *context, INT32 offset);
extern WORD CALLBACK CallTo16_word_ (FARPROC16);
extern LONG CALLBACK CallTo16_long_ (FARPROC16);
extern WORD CALLBACK CallTo16_word_w (FARPROC16,WORD);
extern WORD CALLBACK CallTo16_word_l (FARPROC16,LONG);
extern LONG CALLBACK CallTo16_long_l (FARPROC16,LONG);
extern WORD CALLBACK CallTo16_word_ww (FARPROC16,WORD,WORD);
extern WORD CALLBACK CallTo16_word_wl (FARPROC16,WORD,LONG);
@ -47,11 +48,14 @@ extern LONG CALLBACK CallTo16_long_lll (FARPROC16,LONG,LONG,LONG);
extern WORD CALLBACK CallTo16_word_llwl (FARPROC16,LONG,LONG,WORD,LONG);
extern WORD CALLBACK CallTo16_word_lwll (FARPROC16,LONG,WORD,LONG,LONG);
extern WORD CALLBACK CallTo16_word_lwww (FARPROC16,LONG,WORD,WORD,WORD);
extern WORD CALLBACK CallTo16_word_wlww (FARPROC16,WORD,LONG,WORD,WORD);
extern WORD CALLBACK CallTo16_word_wwll (FARPROC16,WORD,WORD,LONG,LONG);
extern WORD CALLBACK CallTo16_word_wwwl (FARPROC16,WORD,WORD,WORD,LONG);
extern LONG CALLBACK CallTo16_long_wwwl (FARPROC16,WORD,WORD,WORD,LONG);
extern WORD CALLBACK CallTo16_word_llll (FARPROC16,LONG,LONG,LONG,LONG);
extern LONG CALLBACK CallTo16_long_llll (FARPROC16,LONG,LONG,LONG,LONG);
extern WORD CALLBACK CallTo16_word_wllwl(FARPROC16,WORD,LONG,LONG,WORD,LONG);
extern WORD CALLBACK CallTo16_word_lwwww(FARPROC16,LONG,WORD,WORD,WORD,WORD);
extern LONG CALLBACK CallTo16_long_lwwll(FARPROC16,LONG,WORD,WORD,LONG,LONG);
extern WORD CALLBACK CallTo16_word_wwlll(FARPROC16,WORD,WORD,LONG,LONG,LONG);
extern WORD CALLBACK CallTo16_word_wwwww(FARPROC16,WORD,WORD,WORD,WORD,WORD);
@ -158,7 +162,6 @@ static const CALLBACKS_TABLE CALLBACK_EmulatorTable =
(void *)CallTo16_word_www, /* CallLoadAppSegProc */
(void *)CallTo16_word_www, /* CallLocalNotifyFunc */
(void *)CallTo16_word_www, /* CallResourceHandlerProc */
(void *)CallTo16_word_wwwl, /* CallPostAppMessageProc */
(void *)CallTo16_long_l, /* CallWOWCallbackProc */
THUNK_WOWCallback16Ex, /* CallWOWCallback16Ex */
(void *)CallTo16_long_l, /* CallASPIPostProc */
@ -850,6 +853,57 @@ WORD WINAPI WIN16_CreateSystemTimer( WORD rate, FARPROC16 proc )
return timer;
}
/***********************************************************************
* THUNK_InitCallout
*/
void THUNK_InitCallout(void)
{
HMODULE32 hModule = GetModuleHandle32A( "USER32" );
if ( hModule )
{
#define GETADDR( var, name ) \
*(FARPROC32 *)&Callout.##var = GetProcAddress32( hModule, name )
GETADDR( PeekMessage32A, "PeekMessageA" );
GETADDR( PeekMessage32W, "PeekMessageW" );
GETADDR( GetMessage32A, "GetMessageA" );
GETADDR( GetMessage32W, "GetMessageW" );
GETADDR( SendMessage32A, "SendMessageA" );
GETADDR( SendMessage32W, "SendMessageW" );
GETADDR( PostMessage32A, "PostMessageA" );
GETADDR( PostMessage32W, "PostMessageW" );
GETADDR( PostThreadMessage32A, "PostThreadMessageA" );
GETADDR( PostThreadMessage32W, "PostThreadMessageW" );
GETADDR( TranslateMessage32, "TranslateMessage" );
GETADDR( DispatchMessage32W, "DispatchMessageW" );
GETADDR( DispatchMessage32A, "DispatchMessageA" );
GETADDR( RedrawWindow32, "RedrawWindow" );
#undef GETADDR
}
hModule = GetModuleHandle16( "USER" );
if ( hModule )
{
#define GETADDR( var, name, thk ) \
*(FARPROC32 *)&Callout.##var = (FARPROC32) \
THUNK_Alloc( WIN32_GetProcAddress16( hModule, name ), \
(RELAY)CallTo16_##thk )
GETADDR( PeekMessage16, "PeekMessage", word_lwwww );
GETADDR( GetMessage16, "GetMessage", word_lwww );
GETADDR( SendMessage16, "SendMessage", long_wwwl );
GETADDR( PostMessage16, "PostMessage", word_wwwl );
GETADDR( PostAppMessage16, "PostAppMessage", word_wwwl );
GETADDR( TranslateMessage16, "TranslateMessage", word_l );
GETADDR( DispatchMessage16, "DispatchMessage", long_l );
GETADDR( RedrawWindow16, "RedrawWindow", word_wlww );
GETADDR( InitThreadInput, "InitThreadInput", word_ww );
GETADDR( UserYield, "UserYield", word_ );
#undef GETADDR
}
}
/***********************************************************************
* 16->32 Flat Thunk routines:

View File

@ -38,7 +38,6 @@ typedef struct
WORD (CALLBACK *CallLoadAppSegProc)( FARPROC16, HANDLE16, HFILE16, WORD );
WORD (CALLBACK *CallLocalNotifyFunc)( FARPROC16, WORD, HLOCAL16, WORD );
HGLOBAL16 (CALLBACK *CallResourceHandlerProc)( FARPROC16, HGLOBAL16, HMODULE16, HRSRC16 );
BOOL16 (CALLBACK *CallPostAppMessageProc)( FARPROC16, HTASK16, UINT16, WPARAM16, LPARAM );
DWORD (CALLBACK *CallWOWCallbackProc)( FARPROC16, DWORD );
BOOL32 (CALLBACK *CallWOWCallback16Ex)( FARPROC16, DWORD, DWORD, LPVOID,
LPDWORD );
@ -71,4 +70,62 @@ typedef struct
extern const CALLBACKS_TABLE *Callbacks;
typedef struct
{
BOOL16 WINAPI (*PeekMessage16)( LPMSG16 msg, HWND16 hwnd,
UINT16 first, UINT16 last, UINT16 flags );
BOOL32 WINAPI (*PeekMessage32A)( LPMSG32 lpmsg, HWND32 hwnd,
UINT32 min, UINT32 max, UINT32 wRemoveMsg );
BOOL32 WINAPI (*PeekMessage32W)( LPMSG32 lpmsg, HWND32 hwnd,
UINT32 min, UINT32 max, UINT32 wRemoveMsg );
BOOL16 WINAPI (*GetMessage16)( SEGPTR msg, HWND16 hwnd,
UINT16 first, UINT16 last );
BOOL32 WINAPI (*GetMessage32A)( MSG32* lpmsg, HWND32 hwnd,
UINT32 min, UINT32 max );
BOOL32 WINAPI (*GetMessage32W)( MSG32* lpmsg, HWND32 hwnd,
UINT32 min, UINT32 max );
LRESULT WINAPI (*SendMessage16)( HWND16 hwnd, UINT16 msg,
WPARAM16 wParam, LPARAM lParam );
LRESULT WINAPI (*SendMessage32A)( HWND32 hwnd, UINT32 msg,
WPARAM32 wParam, LPARAM lParam );
LRESULT WINAPI (*SendMessage32W)( HWND32 hwnd, UINT32 msg,
WPARAM32 wParam, LPARAM lParam );
BOOL16 WINAPI (*PostMessage16)( HWND16 hwnd, UINT16 message,
WPARAM16 wParam, LPARAM lParam );
BOOL32 WINAPI (*PostMessage32A)( HWND32 hwnd, UINT32 message,
WPARAM32 wParam, LPARAM lParam );
BOOL32 WINAPI (*PostMessage32W)( HWND32 hwnd, UINT32 message,
WPARAM32 wParam, LPARAM lParam );
BOOL16 WINAPI (*PostAppMessage16)( HTASK16 hTask, UINT16 message,
WPARAM16 wParam, LPARAM lParam );
BOOL32 WINAPI (*PostThreadMessage32A)( DWORD idThread , UINT32 message,
WPARAM32 wParam, LPARAM lParam );
BOOL32 WINAPI (*PostThreadMessage32W)( DWORD idThread , UINT32 message,
WPARAM32 wParam, LPARAM lParam );
BOOL16 WINAPI (*TranslateMessage16)( const MSG16 *msg );
BOOL32 WINAPI (*TranslateMessage32)( const MSG32 *msg );
LONG WINAPI (*DispatchMessage16)( const MSG16* msg );
LONG WINAPI (*DispatchMessage32A)( const MSG32* msg );
LONG WINAPI (*DispatchMessage32W)( const MSG32* msg );
BOOL16 WINAPI (*RedrawWindow16)( HWND16 hwnd, const RECT16 *rectUpdate,
HRGN16 hrgnUpdate, UINT16 flags );
BOOL32 WINAPI (*RedrawWindow32)( HWND32 hwnd, const RECT32 *rectUpdate,
HRGN32 hrgnUpdate, UINT32 flags );
HQUEUE16 WINAPI (*InitThreadInput)( WORD unknown, WORD flags );
void WINAPI (*UserYield)( void );
} CALLOUT_TABLE;
extern CALLOUT_TABLE Callout;
#endif /* __WINE_CALLBACK_H */

View File

@ -10,6 +10,7 @@
#include "callback.h"
#include "task.h"
#include "syslevel.h"
#include "queue.h"
/**********************************************************************
@ -271,7 +272,6 @@ static const CALLBACKS_TABLE CALLBACK_WinelibTable =
CALLBACK_CallLoadAppSegProc, /* CallLoadAppSegProc */
CALLBACK_CallLocalNotifyFunc, /* CallLocalNotifyFunc */
CALLBACK_CallResourceHandlerProc, /* CallResourceHandlerProc */
NULL, /* CallPostAppMessageProc */
CALLBACK_CallWOWCallbackProc, /* CallWOWCallbackProc */
CALLBACK_CallWOWCallback16Ex, /* CallWOWCallback16Ex */
CALLBACK_CallASPIPostProc, /* CallASPIPostProc */
@ -291,3 +291,23 @@ static const CALLBACKS_TABLE CALLBACK_WinelibTable =
const CALLBACKS_TABLE *Callbacks = &CALLBACK_WinelibTable;
/**********************************************************************
* CALLOUT_Table
*
* The callout function table for Winelib
*/
CALLOUT_TABLE Callout =
{
PeekMessage16, PeekMessage32A, PeekMessage32W,
GetMessage16, GetMessage32A, GetMessage32W,
SendMessage16, SendMessage32A, SendMessage32W,
PostMessage16, PostMessage32A, PostMessage32W,
PostAppMessage16, PostThreadMessage32A, PostThreadMessage32W,
TranslateMessage16, TranslateMessage32,
DispatchMessage16, DispatchMessage32A, DispatchMessage32W,
RedrawWindow16, RedrawWindow32,
InitThreadInput,
UserYield
};