1999-07-11 15:58:31 +02:00
|
|
|
/*
|
|
|
|
* Win16 built-in DLLs definitions
|
|
|
|
*
|
|
|
|
* Copyright 1999 Ulrich Weigand
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_BUILTIN16_H
|
|
|
|
#define __WINE_BUILTIN16_H
|
|
|
|
|
|
|
|
#include "windef.h"
|
1999-08-15 14:43:17 +02:00
|
|
|
#include "ldt.h"
|
|
|
|
|
|
|
|
struct _CONTEXT86;
|
|
|
|
struct _STACK16FRAME;
|
|
|
|
|
|
|
|
extern BOOL BUILTIN_Init(void);
|
|
|
|
extern HMODULE16 BUILTIN_LoadModule( LPCSTR name, BOOL force );
|
|
|
|
extern LPCSTR BUILTIN_GetEntryPoint16( struct _STACK16FRAME *frame, LPSTR name, WORD *pOrd );
|
|
|
|
|
|
|
|
extern void RELAY_Unimplemented16(void);
|
|
|
|
|
|
|
|
extern WORD CallFrom16Word();
|
|
|
|
extern LONG CallFrom16Long();
|
|
|
|
extern void CallFrom16Register();
|
|
|
|
extern void CallFrom16Thunk();
|
|
|
|
|
|
|
|
extern WORD CALLBACK CallTo16Word( FARPROC16 target, INT nArgs );
|
|
|
|
extern LONG CALLBACK CallTo16Long( FARPROC16 target, INT nArgs );
|
|
|
|
extern LONG CALLBACK CallTo16RegisterShort( const struct _CONTEXT86 *context, INT nArgs );
|
|
|
|
extern LONG CALLBACK CallTo16RegisterLong ( const struct _CONTEXT86 *context, INT nArgs );
|
1999-07-11 15:58:31 +02:00
|
|
|
|
|
|
|
#include "pshpack1.h"
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
WORD pushw_bp; /* pushw %bp */
|
1999-08-15 14:43:17 +02:00
|
|
|
BYTE pushl; /* pushl $target */
|
1999-07-11 19:20:01 +02:00
|
|
|
void (*target)();
|
1999-08-15 14:43:17 +02:00
|
|
|
WORD call; /* call CALLFROM16 */
|
|
|
|
WORD callfrom16;
|
1999-07-11 15:58:31 +02:00
|
|
|
} ENTRYPOINT16;
|
|
|
|
|
1999-08-15 14:43:17 +02:00
|
|
|
#define EP(target, offset) { 0x5566, 0x68, (target), 0xe866, (offset) }
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
BYTE pushl; /* pushl $relay */
|
|
|
|
DWORD relay;
|
|
|
|
BYTE lcall; /* lcall __FLATCS__:glue */
|
|
|
|
DWORD glue;
|
|
|
|
WORD flatcs;
|
|
|
|
BYTE prefix; /* lret $nArgs */
|
|
|
|
BYTE lret;
|
|
|
|
WORD nArgs;
|
|
|
|
LPCSTR profile; /* profile string */
|
|
|
|
} CALLFROM16;
|
|
|
|
|
|
|
|
#define CF16_WORD( relay, nArgs, profile ) \
|
|
|
|
{ 0x68, (DWORD)(relay), \
|
|
|
|
0x9a, (DWORD)CallFrom16Word, __FLATCS__, \
|
|
|
|
0x66, (nArgs)? 0xca : 0xcb, (nArgs)? (nArgs) : 0x9090, \
|
|
|
|
(profile) }
|
|
|
|
|
|
|
|
#define CF16_LONG( relay, nArgs, profile ) \
|
|
|
|
{ 0x68, (DWORD)(relay), \
|
|
|
|
0x9a, (DWORD)CallFrom16Long, __FLATCS__, \
|
|
|
|
0x66, (nArgs)? 0xca : 0xcb, (nArgs)? (nArgs) : 0x9090, \
|
|
|
|
(profile) }
|
|
|
|
|
|
|
|
#define CF16_REGS( relay, nArgs, profile ) \
|
|
|
|
{ 0x68, (DWORD)(relay), \
|
|
|
|
0x9a, (DWORD)CallFrom16Register, __FLATCS__, \
|
|
|
|
0x66, (nArgs)? 0xca : 0xcb, (nArgs)? (nArgs) : 0x9090, \
|
|
|
|
(profile) }
|
1999-07-11 15:58:31 +02:00
|
|
|
|
|
|
|
#include "poppack.h"
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
const char *name; /* DLL name */
|
|
|
|
void *module_start; /* 32-bit address of the module data */
|
|
|
|
int module_size; /* Size of the module data */
|
|
|
|
const BYTE *code_start; /* 32-bit address of DLL code */
|
|
|
|
const BYTE *data_start; /* 32-bit address of DLL data */
|
|
|
|
} WIN16_DESCRIPTOR;
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* __WINE_BUILTIN16_H */
|