Allocate bitmap objects in the large heap area.
[wine.git] / include / callback.h
blobec3a17d9a41843fdfce1c0a1d4282fda0450e7e5
1 /*
2 * Callback functions
4 * Copyright 1995 Alexandre Julliard
5 */
7 #ifndef __WINE_CALLBACK_H
8 #define __WINE_CALLBACK_H
10 #include "windef.h"
11 #include "winnt.h"
12 #include "wingdi.h"
13 #include "wine/winuser16.h"
15 extern void SYSDEPS_SwitchToThreadStack( void (*func)(void) ) WINE_NORETURN;
17 typedef void (*RELAY)();
18 extern FARPROC THUNK_Alloc( FARPROC16 func, RELAY relay );
19 extern void THUNK_Free( FARPROC thunk );
20 extern BOOL THUNK_Init(void);
21 extern void THUNK_InitCallout(void);
24 typedef struct
26 BOOL WINAPI (*PostMessageA)( HWND, UINT, WPARAM, LPARAM );
27 WORD WINAPI (*UserSignalProc)( UINT, DWORD, DWORD, HMODULE16 );
28 void WINAPI (*FinalUserInit16)( void );
29 HQUEUE16 WINAPI (*InitThreadInput16)( WORD, WORD );
30 void WINAPI (*UserYield16)( void );
31 WORD WINAPI (*DestroyIcon32)( HGLOBAL16, UINT16 );
32 DWORD WINAPI (*WaitForInputIdle)( HANDLE, DWORD );
33 } CALLOUT_TABLE;
35 extern CALLOUT_TABLE Callout;
38 typedef struct {
39 struct _DOSTASK* WINAPI (*Current)( void );
40 struct _DOSTASK* WINAPI (*LoadDPMI)( void );
41 void WINAPI (*LoadDosExe)( LPCSTR filename, HANDLE hFile );
42 BOOL WINAPI (*Exec)( CONTEXT86 *context, LPCSTR filename, BYTE func, LPVOID paramblk );
43 void WINAPI (*Exit)( CONTEXT86 *context, BOOL cs_psp, WORD retval );
44 int WINAPI (*Enter)( CONTEXT86 *context );
45 void WINAPI (*Wait)( int read_pipe, HANDLE hObject );
46 void WINAPI (*QueueEvent)( int irq, int priority, void (*relay)(CONTEXT86*,void*), void *data );
47 void WINAPI (*OutPIC)( WORD port, BYTE val );
48 void WINAPI (*SetTimer)( unsigned ticks );
49 unsigned WINAPI (*GetTimer)( void );
50 } DOSVM_TABLE;
52 extern DOSVM_TABLE Dosvm;
55 #include "pshpack1.h"
57 typedef struct tagTHUNK
59 BYTE popl_eax; /* 0x58 popl %eax (return address)*/
60 BYTE pushl_func; /* 0x68 pushl $proc */
61 FARPROC16 proc WINE_PACKED;
62 BYTE pushl_eax; /* 0x50 pushl %eax */
63 BYTE jmp; /* 0xe9 jmp relay (relative jump)*/
64 RELAY relay WINE_PACKED;
65 struct tagTHUNK *next WINE_PACKED;
66 DWORD magic;
67 } THUNK;
69 #include "poppack.h"
71 #define CALLTO16_THUNK_MAGIC 0x54484e4b /* "THNK" */
73 #define DECL_THUNK(aname,aproc,arelay) \
74 THUNK aname; \
75 aname.popl_eax = 0x58; \
76 aname.pushl_func = 0x68; \
77 aname.proc = (FARPROC16) (aproc); \
78 aname.pushl_eax = 0x50; \
79 aname.jmp = 0xe9; \
80 aname.relay = (RELAY)((char *)(arelay) - (char *)(&(aname).next)); \
81 aname.next = NULL; \
82 aname.magic = CALLTO16_THUNK_MAGIC;
84 #endif /* __WINE_CALLBACK_H */