Moved data structures for 16-bit relay calls to winbase16.h and
removed builtin16.h.
This commit is contained in:
parent
0cdc0479b8
commit
95086f45a4
|
@ -37,7 +37,6 @@
|
||||||
#include "wownt32.h"
|
#include "wownt32.h"
|
||||||
#include "module.h"
|
#include "module.h"
|
||||||
#include "toolhelp.h"
|
#include "toolhelp.h"
|
||||||
#include "builtin16.h"
|
|
||||||
#include "stackframe.h"
|
#include "stackframe.h"
|
||||||
#include "excpt.h"
|
#include "excpt.h"
|
||||||
#include "wine/exception.h"
|
#include "wine/exception.h"
|
||||||
|
|
|
@ -39,7 +39,6 @@
|
||||||
#include "kernel_private.h"
|
#include "kernel_private.h"
|
||||||
#include "module.h"
|
#include "module.h"
|
||||||
#include "stackframe.h"
|
#include "stackframe.h"
|
||||||
#include "builtin16.h"
|
|
||||||
#include "toolhelp.h"
|
#include "toolhelp.h"
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
#include "wine/winbase16.h"
|
#include "wine/winbase16.h"
|
||||||
#include "module.h"
|
#include "module.h"
|
||||||
#include "stackframe.h"
|
#include "stackframe.h"
|
||||||
#include "builtin16.h"
|
|
||||||
#include "kernel_private.h"
|
#include "kernel_private.h"
|
||||||
#include "wine/unicode.h"
|
#include "wine/unicode.h"
|
||||||
#include "wine/library.h"
|
#include "wine/library.h"
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
#include "kernel_private.h"
|
#include "kernel_private.h"
|
||||||
#include "module.h"
|
#include "module.h"
|
||||||
#include "stackframe.h"
|
#include "stackframe.h"
|
||||||
#include "builtin16.h"
|
|
||||||
#include "toolhelp.h"
|
#include "toolhelp.h"
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
*/
|
*/
|
||||||
#include "dosexe.h"
|
#include "dosexe.h"
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
|
#include "wine/winbase16.h"
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
#include "builtin16.h"
|
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(int);
|
WINE_DEFAULT_DEBUG_CHANNEL(int);
|
||||||
|
|
||||||
|
|
|
@ -1,95 +0,0 @@
|
||||||
/*
|
|
||||||
* Win16 built-in DLLs definitions
|
|
||||||
*
|
|
||||||
* Copyright 1999 Ulrich Weigand
|
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 2.1 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
||||||
* Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public
|
|
||||||
* License along with this library; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __WINE_BUILTIN16_H
|
|
||||||
#define __WINE_BUILTIN16_H
|
|
||||||
|
|
||||||
#include <windef.h>
|
|
||||||
#include <wine/windef16.h>
|
|
||||||
|
|
||||||
struct _CONTEXT86;
|
|
||||||
struct _STACK16FRAME;
|
|
||||||
|
|
||||||
#include <pshpack1.h>
|
|
||||||
|
|
||||||
#ifdef __i386__
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
WORD pushw_bp; /* pushw %bp */
|
|
||||||
BYTE pushl; /* pushl $target */
|
|
||||||
void (*target)();
|
|
||||||
WORD call; /* call CALLFROM16 */
|
|
||||||
short callfrom16;
|
|
||||||
} ENTRYPOINT16;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
BYTE pushl; /* pushl $relay */
|
|
||||||
void *relay;
|
|
||||||
BYTE lcall; /* lcall __FLATCS__:glue */
|
|
||||||
void *glue;
|
|
||||||
WORD flatcs;
|
|
||||||
WORD lret; /* lret $nArgs */
|
|
||||||
WORD nArgs;
|
|
||||||
DWORD arg_types[2]; /* type of each argument */
|
|
||||||
} CALLFROM16;
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
void (*target)();
|
|
||||||
WORD call; /* call CALLFROM16 */
|
|
||||||
short callfrom16;
|
|
||||||
} ENTRYPOINT16;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
WORD lret; /* lret $nArgs */
|
|
||||||
WORD nArgs;
|
|
||||||
DWORD arg_types[2]; /* type of each argument */
|
|
||||||
} CALLFROM16;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <poppack.h>
|
|
||||||
|
|
||||||
/* argument type flags for relay debugging */
|
|
||||||
enum arg_types
|
|
||||||
{
|
|
||||||
ARG_NONE = 0, /* indicates end of arg list */
|
|
||||||
ARG_WORD, /* unsigned word */
|
|
||||||
ARG_SWORD, /* signed word */
|
|
||||||
ARG_LONG, /* long or segmented pointer */
|
|
||||||
ARG_PTR, /* linear pointer */
|
|
||||||
ARG_STR, /* linear pointer to null-terminated string */
|
|
||||||
ARG_SEGSTR /* segmented pointer to null-terminated string */
|
|
||||||
};
|
|
||||||
|
|
||||||
/* flags added to arg_types[0] */
|
|
||||||
#define ARG_RET16 0x80000000 /* function returns 16-bit value */
|
|
||||||
#define ARG_REGISTER 0x40000000 /* function is register */
|
|
||||||
|
|
||||||
extern WORD __wine_call_from_16_word();
|
|
||||||
extern LONG __wine_call_from_16_long();
|
|
||||||
extern void __wine_call_from_16_regs();
|
|
||||||
|
|
||||||
#endif /* __WINE_BUILTIN16_H */
|
|
|
@ -32,47 +32,6 @@
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <wine/winbase16.h>
|
#include <wine/winbase16.h>
|
||||||
|
|
||||||
#include <pshpack1.h>
|
|
||||||
|
|
||||||
/* 32-bit stack layout after CallTo16() */
|
|
||||||
typedef struct _STACK32FRAME
|
|
||||||
{
|
|
||||||
DWORD restore_addr; /* 00 return address for restoring code selector */
|
|
||||||
DWORD codeselector; /* 04 code selector to restore */
|
|
||||||
EXCEPTION_REGISTRATION_RECORD frame; /* 08 Exception frame */
|
|
||||||
SEGPTR frame16; /* 10 16-bit frame from last CallFrom16() */
|
|
||||||
DWORD edi; /* 14 saved registers */
|
|
||||||
DWORD esi; /* 18 */
|
|
||||||
DWORD ebx; /* 1c */
|
|
||||||
DWORD ebp; /* 20 saved 32-bit frame pointer */
|
|
||||||
DWORD retaddr; /* 24 return address */
|
|
||||||
DWORD target; /* 28 target address / CONTEXT86 pointer */
|
|
||||||
DWORD nb_args; /* 2c number of 16-bit argument bytes */
|
|
||||||
} STACK32FRAME;
|
|
||||||
|
|
||||||
/* 16-bit stack layout after CallFrom16() */
|
|
||||||
typedef struct _STACK16FRAME
|
|
||||||
{
|
|
||||||
STACK32FRAME *frame32; /* 00 32-bit frame from last CallTo16() */
|
|
||||||
DWORD edx; /* 04 saved registers */
|
|
||||||
DWORD ecx; /* 08 */
|
|
||||||
DWORD ebp; /* 0c */
|
|
||||||
WORD ds; /* 10 */
|
|
||||||
WORD es; /* 12 */
|
|
||||||
WORD fs; /* 14 */
|
|
||||||
WORD gs; /* 16 */
|
|
||||||
DWORD callfrom_ip; /* 18 callfrom tail IP */
|
|
||||||
DWORD module_cs; /* 1c module code segment */
|
|
||||||
DWORD relay; /* 20 relay function address */
|
|
||||||
WORD entry_ip; /* 22 entry point IP */
|
|
||||||
DWORD entry_point; /* 26 API entry point to call, reused as mutex count */
|
|
||||||
WORD bp; /* 2a 16-bit stack frame chain */
|
|
||||||
WORD ip; /* 2c return address */
|
|
||||||
WORD cs; /* 2e */
|
|
||||||
} STACK16FRAME;
|
|
||||||
|
|
||||||
#include <poppack.h>
|
|
||||||
|
|
||||||
#define CURRENT_STACK16 ((STACK16FRAME*)MapSL((SEGPTR)NtCurrentTeb()->WOW32Reserved))
|
#define CURRENT_STACK16 ((STACK16FRAME*)MapSL((SEGPTR)NtCurrentTeb()->WOW32Reserved))
|
||||||
#define CURRENT_DS (CURRENT_STACK16->ds)
|
#define CURRENT_DS (CURRENT_STACK16->ds)
|
||||||
|
|
||||||
|
|
|
@ -165,6 +165,106 @@ typedef struct
|
||||||
DWORD dwAllocCount;
|
DWORD dwAllocCount;
|
||||||
} WINDEBUGINFO16, *LPWINDEBUGINFO16;
|
} WINDEBUGINFO16, *LPWINDEBUGINFO16;
|
||||||
|
|
||||||
|
/* definitions specific to Wine 16-bit relaying support */
|
||||||
|
|
||||||
|
/* 32-bit stack layout after __wine_call_to_16() */
|
||||||
|
typedef struct _STACK32FRAME
|
||||||
|
{
|
||||||
|
DWORD restore_addr; /* 00 return address for restoring code selector */
|
||||||
|
DWORD codeselector; /* 04 code selector to restore */
|
||||||
|
EXCEPTION_REGISTRATION_RECORD frame; /* 08 Exception frame */
|
||||||
|
SEGPTR frame16; /* 10 16-bit frame from last CallFrom16() */
|
||||||
|
DWORD edi; /* 14 saved registers */
|
||||||
|
DWORD esi; /* 18 */
|
||||||
|
DWORD ebx; /* 1c */
|
||||||
|
DWORD ebp; /* 20 saved 32-bit frame pointer */
|
||||||
|
DWORD retaddr; /* 24 return address */
|
||||||
|
DWORD target; /* 28 target address / CONTEXT86 pointer */
|
||||||
|
DWORD nb_args; /* 2c number of 16-bit argument bytes */
|
||||||
|
} STACK32FRAME;
|
||||||
|
|
||||||
|
/* 16-bit stack layout after __wine_call_from_16() */
|
||||||
|
typedef struct _STACK16FRAME
|
||||||
|
{
|
||||||
|
STACK32FRAME *frame32; /* 00 32-bit frame from last CallTo16() */
|
||||||
|
DWORD edx; /* 04 saved registers */
|
||||||
|
DWORD ecx; /* 08 */
|
||||||
|
DWORD ebp; /* 0c */
|
||||||
|
WORD ds; /* 10 */
|
||||||
|
WORD es; /* 12 */
|
||||||
|
WORD fs; /* 14 */
|
||||||
|
WORD gs; /* 16 */
|
||||||
|
DWORD callfrom_ip; /* 18 callfrom tail IP */
|
||||||
|
DWORD module_cs; /* 1c module code segment */
|
||||||
|
DWORD relay; /* 20 relay function address */
|
||||||
|
WORD entry_ip; /* 22 entry point IP */
|
||||||
|
DWORD entry_point; /* 26 API entry point to call, reused as mutex count */
|
||||||
|
WORD bp; /* 2a 16-bit stack frame chain */
|
||||||
|
WORD ip; /* 2c return address */
|
||||||
|
WORD cs; /* 2e */
|
||||||
|
} STACK16FRAME;
|
||||||
|
|
||||||
|
#ifdef __i386__
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
WORD pushw_bp; /* pushw %bp */
|
||||||
|
BYTE pushl; /* pushl $target */
|
||||||
|
void (*target)();
|
||||||
|
WORD call; /* call CALLFROM16 */
|
||||||
|
short callfrom16;
|
||||||
|
} ENTRYPOINT16;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
BYTE pushl; /* pushl $relay */
|
||||||
|
void *relay;
|
||||||
|
BYTE lcall; /* lcall __FLATCS__:glue */
|
||||||
|
void *glue;
|
||||||
|
WORD flatcs;
|
||||||
|
WORD lret; /* lret $nArgs */
|
||||||
|
WORD nArgs;
|
||||||
|
DWORD arg_types[2]; /* type of each argument */
|
||||||
|
} CALLFROM16;
|
||||||
|
|
||||||
|
#else /* __i386__ */
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
void (*target)();
|
||||||
|
WORD call; /* call CALLFROM16 */
|
||||||
|
short callfrom16;
|
||||||
|
} ENTRYPOINT16;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
WORD lret; /* lret $nArgs */
|
||||||
|
WORD nArgs;
|
||||||
|
DWORD arg_types[2]; /* type of each argument */
|
||||||
|
} CALLFROM16;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* argument type flags for relay debugging */
|
||||||
|
enum arg_types
|
||||||
|
{
|
||||||
|
ARG_NONE = 0, /* indicates end of arg list */
|
||||||
|
ARG_WORD, /* unsigned word */
|
||||||
|
ARG_SWORD, /* signed word */
|
||||||
|
ARG_LONG, /* long or segmented pointer */
|
||||||
|
ARG_PTR, /* linear pointer */
|
||||||
|
ARG_STR, /* linear pointer to null-terminated string */
|
||||||
|
ARG_SEGSTR /* segmented pointer to null-terminated string */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* flags added to arg_types[0] */
|
||||||
|
#define ARG_RET16 0x80000000 /* function returns 16-bit value */
|
||||||
|
#define ARG_REGISTER 0x40000000 /* function is register */
|
||||||
|
|
||||||
|
extern WORD __wine_call_from_16_word();
|
||||||
|
extern LONG __wine_call_from_16_long();
|
||||||
|
extern void __wine_call_from_16_regs();
|
||||||
|
|
||||||
#include <poppack.h>
|
#include <poppack.h>
|
||||||
|
|
||||||
#define INVALID_HANDLE_VALUE16 ((HANDLE16) -1)
|
#define INVALID_HANDLE_VALUE16 ((HANDLE16) -1)
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
|
|
||||||
#include "wine/exception.h"
|
#include "wine/exception.h"
|
||||||
#include "stackframe.h"
|
#include "stackframe.h"
|
||||||
#include "builtin16.h"
|
|
||||||
#include "module.h"
|
#include "module.h"
|
||||||
|
|
||||||
#include "build.h"
|
#include "build.h"
|
||||||
|
|
Loading…
Reference in New Issue