Modularized CallFrom/To16 routines. Adapted dependent routines,

16-bit snoop/relay debugging, and make rules.
This commit is contained in:
Ulrich Weigand 1999-07-11 13:58:31 +00:00 committed by Alexandre Julliard
parent 03c13bbdd7
commit 3dff7bb842
17 changed files with 1558 additions and 1332 deletions

View File

@ -9,6 +9,8 @@
# ASM_SRCS : assembly sources (optional)
# GEN_ASM_SRCS : generated assembly sources (optional)
# RC_SRCS : resource source files (optional)
# SPEC_SRCS : interface definition files (optional)
# GLUE : C sources for which glue code needs to be generated (optional)
# EXTRA_SRCS : extra source files for make depend (optional)
# EXTRA_OBJS : extra object files (optional)
# WRCEXTRA : extra wrc flags (e.g. '-p _SysRes') (optional)
@ -69,12 +71,12 @@ mandir = @mandir@/man1
manext = .1
includedir = @includedir@/wine
OBJS = $(C_SRCS:.c=.o) $(GEN_ASM_SRCS:.s=.o) $(ASM_SRCS:.S=.o) \
$(RC_SRCS:.rc=.o) $(EXTRA_OBJS)
OBJS = $(C_SRCS:.c=.o) $(GEN_ASM_SRCS:.s=.o) $(ASM_SRCS:.S=.o) $(RC_SRCS:.rc=.o) \
$(SPEC_SRCS:.spec=.spec.o) $(GLUE:.c=.glue.o) $(EXTRA_OBJS)
# Implicit rules
.SUFFIXES: .rc .res
.SUFFIXES: .rc .res .spec .spec.c .glue.s
.c.o:
$(CC) -c $(ALLCFLAGS) -o $*.o $<
@ -100,6 +102,11 @@ OBJS = $(C_SRCS:.c=.o) $(GEN_ASM_SRCS:.s=.o) $(ASM_SRCS:.S=.o) \
.res.h:
$(WRC) $(WRCFLAGS) $(WRCEXTRA) -bnh $<
.spec.spec.c:
$(BUILD) -o $@ -spec $<
.c.glue.s:
$(BUILD) -o $@ -glue $<
# Rule to rebuild the resource compiler
@ -147,11 +154,15 @@ lint:
# Misc. rules
$(SPEC_SRCS:.spec=.spec.c): $(BUILD) $(TOPSRCDIR)/include/builtin16.h $(TOPSRCDIR)/include/builtin32.h
$(GLUE:.c=.glue.s): $(BUILD)
depend:: $(MAKEDEP) $(C_SRCS) $(RC_SRCS) $(EXTRA_SRCS)
$(MAKEDEP) $(DIVINCL) -C$(SRCDIR) $(C_SRCS) $(RC_SRCS) $(EXTRA_SRCS)
clean::
$(RM) *.o \#*\# *~ *% .#* *.bak *.orig *.rej *.flc y.tab.c y.tab.h lex.yy.c core $(GEN_ASM_SRCS) $(RC_SRCS:.rc=.s) $(RC_SRCS:.rc=.h) $(PROGRAMS)
$(RM) *.o \#*\# *~ *% .#* *.bak *.orig *.rej *.flc y.tab.c y.tab.h lex.yy.c core $(GEN_ASM_SRCS) $(RC_SRCS:.rc=.s) $(RC_SRCS:.rc=.h) $(SPEC_SRCS:.spec=.spec.c) $(GLUE:.c=.glue.s) $(PROGRAMS)
dummy:

View File

@ -1,45 +1,91 @@
Makefile
avifile.s
callfrom16.s
callto16.s
comm.s
commdlg.s
compobj.s
ddeml.s
dispdib.s
display.s
gdi.s
kernel.s
keyboard.s
lzexpand.s
mmsystem.s
mouse.s
msacm.s
msvideo.s
ole2.s
ole2conv.s
ole2disp.s
ole2nls.s
ole2prox.s
ole2thk.s
olecli.s
olesvr.s
rasapi16.s
shell.s
sound.s
storage.s
stress.s
system.s
toolhelp.s
typelib.s
user.s
ver.s
w32sys.s
win32s16.s
win87em.s
winaspi.s
windebug.s
wineps.s
wing.s
winsock.s
wprocs.s
avifile.spec.c
avifile.spec.glue.s
call16.s
callfrom16.spec.c
callfrom16.spec.glue.s
callto16.spec.c
callto16.spec.glue.s
comm.spec.c
comm.spec.glue.s
commdlg.spec.c
commdlg.spec.glue.s
compobj.spec.c
compobj.spec.glue.s
ddeml.spec.c
ddeml.spec.glue.s
dispdib.spec.c
dispdib.spec.glue.s
display.spec.c
display.spec.glue.s
gdi.spec.c
gdi.spec.glue.s
kernel.spec.c
kernel.spec.glue.s
keyboard.spec.c
keyboard.spec.glue.s
lzexpand.spec.c
lzexpand.spec.glue.s
mmsystem.spec.c
mmsystem.spec.glue.s
mouse.spec.c
mouse.spec.glue.s
msacm.spec.c
msacm.spec.glue.s
msvideo.spec.c
msvideo.spec.glue.s
ole2.spec.c
ole2.spec.glue.s
ole2conv.spec.c
ole2conv.spec.glue.s
ole2disp.spec.c
ole2disp.spec.glue.s
ole2nls.spec.c
ole2nls.spec.glue.s
ole2prox.spec.c
ole2prox.spec.glue.s
ole2thk.spec.c
ole2thk.spec.glue.s
olecli.spec.c
olecli.spec.glue.s
olesvr.spec.c
olesvr.spec.glue.s
rasapi16.spec.c
rasapi16.spec.glue.s
shell.spec.c
shell.spec.glue.s
sound.spec.c
sound.spec.glue.s
storage.spec.c
storage.spec.glue.s
stress.spec.c
stress.spec.glue.s
system.spec.c
system.spec.glue.s
thunk.glue.s
toolhelp.spec.c
toolhelp.spec.glue.s
typelib.spec.c
typelib.spec.glue.s
user.spec.c
user.spec.glue.s
ver.spec.c
ver.spec.glue.s
w32sys.spec.c
w32sys.spec.glue.s
win32s16.spec.c
win32s16.spec.glue.s
win87em.spec.c
win87em.spec.glue.s
winaspi.spec.c
winaspi.spec.glue.s
windebug.spec.c
windebug.spec.glue.s
wineps.spec.c
wineps.spec.glue.s
wing.spec.c
wing.spec.glue.s
winsock.spec.c
winsock.spec.glue.s
wprocs.spec.c
wprocs.spec.glue.s

View File

@ -5,7 +5,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = if1632
DLLS = \
SPEC_SRCS = \
avifile.spec \
comm.spec \
commdlg.spec \
@ -49,8 +49,6 @@ DLLS = \
winsock.spec \
wprocs.spec
SPEC_FILES = $(DLLS:.spec=.s)
C_SRCS = \
builtin.c \
dummy.c \
@ -59,25 +57,16 @@ C_SRCS = \
thunk.c
GEN_ASM_SRCS = \
$(SPEC_FILES) \
callfrom16.s \
callto16.s
call16.s
.SUFFIXES: .spec
GLUE = $(SPEC_SRCS:.spec=.spec.c) \
thunk.c
.spec.s:
$(BUILD) -o $@ -spec $<
all: checkbuild $(MODULE).o
all: $(MODULE).o
@MAKE_RULES@
$(SPEC_FILES): $(BUILD)
callfrom16.s: $(SPEC_FILES)
$(BUILD) -o $@ -callfrom16 `cat $(SPEC_FILES) | grep CallFrom16_ | sed 's/.*CallFrom16_\(.*\)/\1/' | sort | uniq`
callto16.s: $(SRCDIR)/thunk.c $(BUILD)
$(BUILD) -o $@ -callto16 $(SRCDIR)/thunk.c
call16.s: $(BUILD)
$(BUILD) -o $@ -call16
### Dependencies:

View File

@ -263,12 +263,11 @@ HMODULE16 BUILTIN_LoadModule( LPCSTR name, BOOL force )
/***********************************************************************
* BUILTIN_GetEntryPoint16
*
* Return the ordinal and name corresponding to a CS:IP address.
* Return the ordinal, name, and type info corresponding to a CS:IP address.
* This is used only by relay debugging.
*/
LPCSTR BUILTIN_GetEntryPoint16( WORD cs, WORD ip, WORD *pOrd )
LPCSTR BUILTIN_GetEntryPoint16( WORD cs, WORD ip, LPSTR name, WORD *pOrd )
{
static char buffer[80];
WORD i, max_offset;
register BYTE *p;
NE_MODULE *pModule;
@ -286,7 +285,7 @@ LPCSTR BUILTIN_GetEntryPoint16( WORD cs, WORD ip, WORD *pOrd )
entry = (ET_ENTRY *)((BYTE *)bundle+6);
for (i = bundle->first + 1; i <= bundle->last; i++)
{
if ((entry->offs <= ip)
if ((entry->offs < ip)
&& (entry->segnum == 1) /* code segment ? */
&& (entry->offs >= max_offset))
{
@ -308,11 +307,13 @@ LPCSTR BUILTIN_GetEntryPoint16( WORD cs, WORD ip, WORD *pOrd )
if (*(WORD *)(p + *p + 1) == *pOrd) break;
}
sprintf( buffer, "%.*s.%d: %.*s",
sprintf( name, "%.*s.%d: %.*s",
*((BYTE *)pModule + pModule->name_table),
(char *)pModule + pModule->name_table + 1,
*pOrd, *p, (char *)(p + 1) );
return buffer;
/* Retrieve type info string */
return *(LPCSTR *)((LPBYTE)PTR_SEG_OFF_TO_LIN( cs, ip ) - 6) + 10;
}
@ -324,8 +325,9 @@ LPCSTR BUILTIN_GetEntryPoint16( WORD cs, WORD ip, WORD *pOrd )
void BUILTIN_DefaultIntHandler( CONTEXT86 *context )
{
WORD ordinal;
char name[80];
STACK16FRAME *frame = CURRENT_STACK16;
BUILTIN_GetEntryPoint16( frame->entry_cs, frame->entry_ip, &ordinal );
BUILTIN_GetEntryPoint16( frame->entry_cs, frame->entry_ip, name, &ordinal );
INT_BARF( context, ordinal - FIRST_INTERRUPT_ORDINAL );
}

View File

@ -30,34 +30,27 @@ BOOL RELAY_Init(void)
/* Allocate the code selector for CallTo16 routines */
extern void CALLTO16_Start(), CALLTO16_End();
extern void CALLTO16_Ret_word(), CALLTO16_Ret_long();
extern void CALLTO16_Ret_eax();
extern void Call16_Ret_Start(), Call16_Ret_End();
extern void CallTo16_Ret();
extern void CALL32_CBClient_Ret();
extern void CALL32_CBClientEx_Ret();
extern DWORD CALLTO16_RetAddr_word;
extern DWORD CALLTO16_RetAddr_long;
extern DWORD CALLTO16_RetAddr_eax;
extern DWORD CallTo16_RetAddr;
extern DWORD CALL32_CBClient_RetAddr;
extern DWORD CALL32_CBClientEx_RetAddr;
codesel = GLOBAL_CreateBlock( GMEM_FIXED, (void *)CALLTO16_Start,
(int)CALLTO16_End - (int)CALLTO16_Start,
codesel = GLOBAL_CreateBlock( GMEM_FIXED, (void *)Call16_Ret_Start,
(int)Call16_Ret_End - (int)Call16_Ret_Start,
0, TRUE, TRUE, FALSE, NULL );
if (!codesel) return FALSE;
/* Patch the return addresses for CallTo16 routines */
CALLTO16_RetAddr_word=MAKELONG( (int)CALLTO16_Ret_word-(int)CALLTO16_Start,
codesel );
CALLTO16_RetAddr_long=MAKELONG( (int)CALLTO16_Ret_long-(int)CALLTO16_Start,
codesel );
CALLTO16_RetAddr_eax =MAKELONG( (int)CALLTO16_Ret_eax -(int)CALLTO16_Start,
codesel );
CallTo16_RetAddr =
MAKELONG( (int)CallTo16_Ret -(int)Call16_Ret_Start, codesel );
CALL32_CBClient_RetAddr =
MAKELONG( (int)CALL32_CBClient_Ret -(int)CALLTO16_Start, codesel );
MAKELONG( (int)CALL32_CBClient_Ret -(int)Call16_Ret_Start, codesel );
CALL32_CBClientEx_RetAddr =
MAKELONG( (int)CALL32_CBClientEx_Ret -(int)CALLTO16_Start, codesel );
MAKELONG( (int)CALL32_CBClientEx_Ret -(int)Call16_Ret_Start, codesel );
/* Create built-in modules */
if (!BUILTIN_Init()) return FALSE;
@ -73,25 +66,29 @@ extern char **debug_relay_excludelist,**debug_relay_includelist;
/***********************************************************************
* RELAY_DebugCallFrom16
*/
void RELAY_DebugCallFrom16( int func_type, char *args,
void *entry_point, CONTEXT86 *context )
void RELAY_DebugCallFrom16( CONTEXT86 *context )
{
STACK16FRAME *frame;
WORD ordinal;
char *args16;
const char *funstr;
int i;
char *args16, funstr[80];
const char *args;
int i, usecdecl, reg_func;
if (!TRACE_ON(relay)) return;
frame = CURRENT_STACK16;
funstr = BUILTIN_GetEntryPoint16(frame->entry_cs,frame->entry_ip,&ordinal);
if (!funstr) return; /* happens for the two snoop register relays */
args = BUILTIN_GetEntryPoint16(frame->entry_cs,frame->entry_ip,funstr,&ordinal);
if (!args) return; /* happens for the two snoop register relays */
if (!RELAY_ShowDebugmsgRelay(funstr)) return;
DPRINTF( "Call %s(",funstr);
VA_START16( args16 );
if (func_type & 4) /* cdecl */
usecdecl = ( *args == 'c' );
args += 2;
reg_func = ( memcmp( args, "regs_", 5 ) == 0 );
args += 5;
if (usecdecl)
{
while (*args)
{
@ -185,11 +182,11 @@ void RELAY_DebugCallFrom16( int func_type, char *args,
DPRINTF( ") ret=%04x:%04x ds=%04x\n", frame->cs, frame->ip, frame->ds );
VA_END16( args16 );
if (func_type & 2) /* register function */
DPRINTF( " AX=%04x BX=%04x CX=%04x DX=%04x SI=%04x DI=%04x ES=%04x EFL=%08lx\n",
AX_reg(context), BX_reg(context), CX_reg(context),
DX_reg(context), SI_reg(context), DI_reg(context),
(WORD)ES_reg(context), EFL_reg(context) );
if (reg_func)
DPRINTF(" AX=%04x BX=%04x CX=%04x DX=%04x SI=%04x DI=%04x ES=%04x EFL=%08lx\n",
AX_reg(context), BX_reg(context), CX_reg(context),
DX_reg(context), SI_reg(context), DI_reg(context),
(WORD)ES_reg(context), EFL_reg(context) );
SYSLEVEL_CheckNotLevel( 2 );
}
@ -198,36 +195,38 @@ void RELAY_DebugCallFrom16( int func_type, char *args,
/***********************************************************************
* RELAY_DebugCallFrom16Ret
*/
void RELAY_DebugCallFrom16Ret( int func_type, int ret_val, CONTEXT86 *context)
void RELAY_DebugCallFrom16Ret( CONTEXT86 *context, int ret_val )
{
STACK16FRAME *frame;
WORD ordinal;
const char *funstr;
char funstr[80];
const char *args;
if (!TRACE_ON(relay)) return;
frame = CURRENT_STACK16;
funstr = BUILTIN_GetEntryPoint16(frame->entry_cs,frame->entry_ip,&ordinal);
if (!funstr) return;
args = BUILTIN_GetEntryPoint16(frame->entry_cs,frame->entry_ip,funstr,&ordinal);
if (!args) return;
if (!RELAY_ShowDebugmsgRelay(funstr)) return;
DPRINTF( "Ret %s() ",funstr);
switch(func_type)
if ( memcmp( args+2, "long_", 5 ) == 0 )
{
case 0: /* long */
DPRINTF( "retval=0x%08x ret=%04x:%04x ds=%04x\n",
ret_val, frame->cs, frame->ip, frame->ds );
break;
case 1: /* word */
}
else if ( memcmp( args+2, "word_", 5 ) == 0 )
{
DPRINTF( "retval=0x%04x ret=%04x:%04x ds=%04x\n",
ret_val & 0xffff, frame->cs, frame->ip, frame->ds );
break;
case 2: /* regs */
}
else if ( memcmp( args+2, "regs_", 5 ) == 0 )
{
DPRINTF("retval=none ret=%04x:%04x ds=%04x\n",
(WORD)CS_reg(context), IP_reg(context), (WORD)DS_reg(context));
DPRINTF(" AX=%04x BX=%04x CX=%04x DX=%04x SI=%04x DI=%04x ES=%04x EFL=%08lx\n",
AX_reg(context), BX_reg(context), CX_reg(context),
DX_reg(context), SI_reg(context), DI_reg(context),
(WORD)ES_reg(context), EFL_reg(context) );
break;
}
SYSLEVEL_CheckNotLevel( 2 );
@ -243,10 +242,11 @@ void RELAY_DebugCallFrom16Ret( int func_type, int ret_val, CONTEXT86 *context)
void RELAY_Unimplemented16(void)
{
WORD ordinal;
char name[80];
STACK16FRAME *frame = CURRENT_STACK16;
BUILTIN_GetEntryPoint16(frame->entry_cs,frame->entry_ip,name,&ordinal);
MESSAGE("No handler for Win16 routine %s (called from %04x:%04x)\n",
BUILTIN_GetEntryPoint16(frame->entry_cs,frame->entry_ip,&ordinal),
frame->cs, frame->ip );
name, frame->cs, frame->ip );
ExitProcess(1);
}

View File

@ -24,7 +24,7 @@ DEFAULT_DEBUG_CHANNEL(snoop)
void WINAPI SNOOP16_Entry(CONTEXT86 *context);
void WINAPI SNOOP16_Return(CONTEXT86 *context);
extern void CallFrom16_p_regs_();
extern void KERNEL_CallFrom16_p_regs_();
/* Generic callfrom16_p_regs function entry.
* pushw %bp 0x55
@ -103,14 +103,14 @@ SNOOP16_RegisterDLL(NE_MODULE *pModule,LPCSTR name) {
snr[0].pushl = 0x68;
snr[0].realfun = (DWORD)SNOOP16_Entry;
snr[0].lcall = 0x9a;
snr[0].callfromregs = (DWORD)CallFrom16_p_regs_;
snr[0].callfromregs = (DWORD)KERNEL_CallFrom16_p_regs_;
GET_CS(snr[0].seg);
snr[1].prefix = 0x66;
snr[1].pushbp = 0x55;
snr[1].pushl = 0x68;
snr[1].realfun = (DWORD)SNOOP16_Return;
snr[1].lcall = 0x9a;
snr[1].callfromregs = (DWORD)CallFrom16_p_regs_;
snr[1].callfromregs = (DWORD)KERNEL_CallFrom16_p_regs_;
GET_CS(snr[1].seg);
}
while (*dll) {

View File

@ -26,85 +26,84 @@ DECLARE_DEBUG_CHANNEL(system)
DECLARE_DEBUG_CHANNEL(thunk)
extern LONG CallTo16RegisterShort(const CONTEXT86 *context, INT offset);
extern LONG CallTo16RegisterLong(const CONTEXT86 *context, INT offset);
/* List of the 16-bit callback functions. This list is used */
/* by the build program to generate the file if1632/callto16.S */
/* ### start build ### */
extern LONG CALLBACK CallTo16_sreg_(const CONTEXT86 *context, INT offset);
extern LONG CALLBACK CallTo16_lreg_(const CONTEXT86 *context, INT 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);
extern WORD CALLBACK CallTo16_word_ll (FARPROC16,LONG,LONG);
extern LONG CALLBACK CallTo16_long_ll (FARPROC16,LONG,LONG);
extern WORD CALLBACK CallTo16_word_www (FARPROC16,WORD,WORD,WORD);
extern WORD CALLBACK CallTo16_word_wwl (FARPROC16,WORD,WORD,LONG);
extern WORD CALLBACK CallTo16_word_wlw (FARPROC16,WORD,LONG,WORD);
extern LONG CALLBACK CallTo16_long_wwl (FARPROC16,WORD,WORD,LONG);
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);
extern WORD CALLBACK CallTo16_word_lwlll(FARPROC16,LONG,WORD,LONG,LONG,LONG);
extern LONG CALLBACK CallTo16_long_lwlll(FARPROC16,LONG,WORD,LONG,LONG,LONG);
extern LONG CALLBACK CallTo16_long_lllll(FARPROC16,LONG,LONG,LONG,LONG,LONG);
extern LONG CALLBACK CallTo16_long_llllll(FARPROC16,LONG,LONG,LONG,LONG,LONG,
LONG);
extern LONG CALLBACK CallTo16_long_lllllll(FARPROC16,LONG,LONG,LONG,LONG,LONG,
LONG,LONG);
extern WORD CALLBACK CallTo16_word_llwwlll(FARPROC16,LONG,LONG,WORD,WORD,LONG,
LONG,LONG);
extern LONG CALLBACK CallTo16_word_lwwlllll(FARPROC16,LONG,WORD,WORD,LONG,LONG,
extern WORD THUNK_CallTo16_word_ (FARPROC16);
extern LONG THUNK_CallTo16_long_ (FARPROC16);
extern WORD THUNK_CallTo16_word_w (FARPROC16,WORD);
extern WORD THUNK_CallTo16_word_l (FARPROC16,LONG);
extern LONG THUNK_CallTo16_long_l (FARPROC16,LONG);
extern WORD THUNK_CallTo16_word_ww (FARPROC16,WORD,WORD);
extern WORD THUNK_CallTo16_word_wl (FARPROC16,WORD,LONG);
extern WORD THUNK_CallTo16_word_ll (FARPROC16,LONG,LONG);
extern LONG THUNK_CallTo16_long_ll (FARPROC16,LONG,LONG);
extern WORD THUNK_CallTo16_word_www (FARPROC16,WORD,WORD,WORD);
extern WORD THUNK_CallTo16_word_wwl (FARPROC16,WORD,WORD,LONG);
extern WORD THUNK_CallTo16_word_wlw (FARPROC16,WORD,LONG,WORD);
extern LONG THUNK_CallTo16_long_wwl (FARPROC16,WORD,WORD,LONG);
extern LONG THUNK_CallTo16_long_lll (FARPROC16,LONG,LONG,LONG);
extern WORD THUNK_CallTo16_word_llwl (FARPROC16,LONG,LONG,WORD,LONG);
extern WORD THUNK_CallTo16_word_lwll (FARPROC16,LONG,WORD,LONG,LONG);
extern WORD THUNK_CallTo16_word_lwww (FARPROC16,LONG,WORD,WORD,WORD);
extern WORD THUNK_CallTo16_word_wlww (FARPROC16,WORD,LONG,WORD,WORD);
extern WORD THUNK_CallTo16_word_wwll (FARPROC16,WORD,WORD,LONG,LONG);
extern WORD THUNK_CallTo16_word_wwwl (FARPROC16,WORD,WORD,WORD,LONG);
extern LONG THUNK_CallTo16_long_wwwl (FARPROC16,WORD,WORD,WORD,LONG);
extern WORD THUNK_CallTo16_word_llll (FARPROC16,LONG,LONG,LONG,LONG);
extern LONG THUNK_CallTo16_long_llll (FARPROC16,LONG,LONG,LONG,LONG);
extern WORD THUNK_CallTo16_word_wllwl(FARPROC16,WORD,LONG,LONG,WORD,LONG);
extern WORD THUNK_CallTo16_word_lwwww(FARPROC16,LONG,WORD,WORD,WORD,WORD);
extern LONG THUNK_CallTo16_long_lwwll(FARPROC16,LONG,WORD,WORD,LONG,LONG);
extern WORD THUNK_CallTo16_word_wwlll(FARPROC16,WORD,WORD,LONG,LONG,LONG);
extern WORD THUNK_CallTo16_word_wwwww(FARPROC16,WORD,WORD,WORD,WORD,WORD);
extern WORD THUNK_CallTo16_word_lwlll(FARPROC16,LONG,WORD,LONG,LONG,LONG);
extern LONG THUNK_CallTo16_long_lwlll(FARPROC16,LONG,WORD,LONG,LONG,LONG);
extern LONG THUNK_CallTo16_long_lllll(FARPROC16,LONG,LONG,LONG,LONG,LONG);
extern LONG THUNK_CallTo16_long_llllll(FARPROC16,LONG,LONG,LONG,LONG,LONG,LONG);
extern LONG THUNK_CallTo16_long_lllllll(FARPROC16,LONG,LONG,LONG,LONG,LONG,LONG,LONG);
extern WORD THUNK_CallTo16_word_llwwlll(FARPROC16,LONG,LONG,WORD,WORD,LONG,LONG,LONG);
extern LONG THUNK_CallTo16_word_lwwlllll(FARPROC16,LONG,WORD,WORD,LONG,LONG,
LONG,LONG,LONG);
extern LONG CALLBACK CallTo16_long_llllllll(FARPROC16,LONG,LONG,LONG,LONG,LONG,
extern LONG THUNK_CallTo16_long_llllllll(FARPROC16,LONG,LONG,LONG,LONG,LONG,
LONG,LONG,LONG);
extern LONG CALLBACK CallTo16_long_lllllllll(FARPROC16,LONG,LONG,LONG,LONG,
extern LONG THUNK_CallTo16_long_lllllllll(FARPROC16,LONG,LONG,LONG,LONG,
LONG,LONG,LONG,LONG,LONG);
extern LONG CALLBACK CallTo16_long_llllllllll(FARPROC16,LONG,LONG,LONG,LONG,
extern LONG THUNK_CallTo16_long_llllllllll(FARPROC16,LONG,LONG,LONG,LONG,
LONG,LONG,LONG,LONG,LONG,LONG);
extern LONG CALLBACK CallTo16_long_lllllllllll(FARPROC16,LONG,LONG,LONG,LONG,
extern LONG THUNK_CallTo16_long_lllllllllll(FARPROC16,LONG,LONG,LONG,LONG,
LONG,LONG,LONG,LONG,LONG,LONG,
LONG);
extern LONG CALLBACK CallTo16_long_llllllllllll(FARPROC16,LONG,LONG,LONG,LONG,
extern LONG THUNK_CallTo16_long_llllllllllll(FARPROC16,LONG,LONG,LONG,LONG,
LONG,LONG,LONG,LONG,LONG,LONG,
LONG,LONG);
extern LONG CALLBACK CallTo16_long_lwwllwlllllw(FARPROC16,LONG,WORD,WORD,LONG,
extern LONG THUNK_CallTo16_long_lwwllwlllllw(FARPROC16,LONG,WORD,WORD,LONG,
LONG,WORD,LONG,LONG,LONG,LONG,
LONG,WORD);
extern LONG CALLBACK CallTo16_long_lllllllllllll(FARPROC16,LONG,LONG,LONG,LONG,
extern LONG THUNK_CallTo16_long_lllllllllllll(FARPROC16,LONG,LONG,LONG,LONG,
LONG,LONG,LONG,LONG,LONG,LONG,
LONG,LONG,LONG);
extern LONG CALLBACK CallTo16_long_llllllllllllll(FARPROC16,LONG,LONG,LONG,
extern LONG THUNK_CallTo16_long_llllllllllllll(FARPROC16,LONG,LONG,LONG,
LONG,LONG,LONG,LONG,LONG,
LONG,LONG,LONG,LONG,LONG,
LONG);
extern LONG CALLBACK CallTo16_word_lwwwwlwwwwllll(FARPROC16,LONG,WORD,WORD,
extern LONG THUNK_CallTo16_word_lwwwwlwwwwllll(FARPROC16,LONG,WORD,WORD,
WORD,WORD,LONG,WORD,WORD,
WORD,WORD,LONG,LONG,LONG,
LONG);
extern LONG CALLBACK CallTo16_long_lllllllllllllll(FARPROC16,LONG,LONG,LONG,
extern LONG THUNK_CallTo16_long_lllllllllllllll(FARPROC16,LONG,LONG,LONG,
LONG,LONG,LONG,LONG,LONG,
LONG,LONG,LONG,LONG,LONG,
LONG,LONG);
extern LONG CALLBACK CallTo16_long_llllllllllllllll(FARPROC16,LONG,LONG,LONG,
extern LONG THUNK_CallTo16_long_llllllllllllllll(FARPROC16,LONG,LONG,LONG,
LONG,LONG,LONG,LONG,LONG,
LONG,LONG,LONG,LONG,LONG,
LONG,LONG,LONG);
extern void THUNK_CallFrom16_p_long_wwwll();
/* ### stop build ### */
@ -144,38 +143,36 @@ static BOOL WINAPI THUNK_WOWCallback16Ex( FARPROC16,DWORD,DWORD,
LPVOID,LPDWORD );
static BOOL THUNK_ThunkletInit( void );
extern void CallFrom16_p_long_wwwll(void);
/* Callbacks function table for the emulator */
static const CALLBACKS_TABLE CALLBACK_EmulatorTable =
{
(void *)CallTo16_sreg_, /* CallRegisterShortProc */
(void *)CallTo16_lreg_, /* CallRegisterLongProc */
(void*)CallFrom16_p_long_wwwll, /* CallFrom16WndProc */
THUNK_CallWndProc16, /* CallWndProc */
(void *)CallTo16_long_lwwll, /* CallDriverProc */
(void *)CallTo16_word_wwlll, /* CallDriverCallback */
(void *)CallTo16_word_wwlll, /* CallTimeFuncProc */
(void *)CallTo16_word_w, /* CallWindowsExitProc */
(void *)CallTo16_word_lwww, /* CallWordBreakProc */
(void *)CallTo16_word_ww, /* CallBootAppProc */
(void *)CallTo16_word_www, /* CallLoadAppSegProc */
(void *)CallTo16_word_www, /* CallLocalNotifyFunc */
(void *)CallTo16_word_www, /* CallResourceHandlerProc */
(void *)CallTo16_long_l, /* CallWOWCallbackProc */
THUNK_WOWCallback16Ex, /* CallWOWCallback16Ex */
(void *)CallTo16_long_ll, /* CallUTProc */
(void *)CallTo16_long_l, /* CallASPIPostProc */
(void *)CallTo16_word_lwll, /* CallDrvControlProc */
(void *)CallTo16_word_lwlll, /* CallDrvEnableProc */
(void *)CallTo16_word_llll, /* CallDrvEnumDFontsProc */
(void *)CallTo16_word_lwll, /* CallDrvEnumObjProc */
(void *)CallTo16_word_lwwlllll, /* CallDrvOutputProc */
(void *)CallTo16_long_lwlll, /* CallDrvRealizeProc */
(void *)CallTo16_word_lwwwwlwwwwllll, /* CallDrvStretchBltProc */
(void *)CallTo16_long_lwwllwlllllw, /* CallDrvExtTextOutProc */
(void *)CallTo16_word_llwwlll, /* CallDrvGetCharWidth */
(void *)CallTo16_word_ww /* CallDrvAbortProc */
(void *)CallTo16RegisterShort, /* CallRegisterShortProc */
(void *)CallTo16RegisterLong, /* CallRegisterLongProc */
(void*)THUNK_CallFrom16_p_long_wwwll, /* CallFrom16WndProc */
THUNK_CallWndProc16, /* CallWndProc */
(void *)THUNK_CallTo16_long_lwwll, /* CallDriverProc */
(void *)THUNK_CallTo16_word_wwlll, /* CallDriverCallback */
(void *)THUNK_CallTo16_word_wwlll, /* CallTimeFuncProc */
(void *)THUNK_CallTo16_word_w, /* CallWindowsExitProc */
(void *)THUNK_CallTo16_word_lwww, /* CallWordBreakProc */
(void *)THUNK_CallTo16_word_ww, /* CallBootAppProc */
(void *)THUNK_CallTo16_word_www, /* CallLoadAppSegProc */
(void *)THUNK_CallTo16_word_www, /* CallLocalNotifyFunc */
(void *)THUNK_CallTo16_word_www, /* CallResourceHandlerProc */
(void *)THUNK_CallTo16_long_l, /* CallWOWCallbackProc */
THUNK_WOWCallback16Ex, /* CallWOWCallback16Ex */
(void *)THUNK_CallTo16_long_ll, /* CallUTProc */
(void *)THUNK_CallTo16_long_l, /* CallASPIPostProc */
(void *)THUNK_CallTo16_word_lwll, /* CallDrvControlProc */
(void *)THUNK_CallTo16_word_lwlll, /* CallDrvEnableProc */
(void *)THUNK_CallTo16_word_llll, /* CallDrvEnumDFontsProc */
(void *)THUNK_CallTo16_word_lwll, /* CallDrvEnumObjProc */
(void *)THUNK_CallTo16_word_lwwlllll, /* CallDrvOutputProc */
(void *)THUNK_CallTo16_long_lwlll, /* CallDrvRealizeProc */
(void *)THUNK_CallTo16_word_lwwwwlwwwwllll, /* CallDrvStretchBltProc */
(void *)THUNK_CallTo16_long_lwwllwlllllw, /* CallDrvExtTextOutProc */
(void *)THUNK_CallTo16_word_llwwlll, /* CallDrvGetCharWidth */
(void *)THUNK_CallTo16_word_ww /* CallDrvAbortProc */
};
@ -307,7 +304,7 @@ static LRESULT WINAPI THUNK_CallWndProc16( WNDPROC16 proc, HWND16 hwnd,
args[3] = msg;
args[4] = hwnd;
ret = CallTo16_sreg_( &context, 5 * sizeof(WORD) );
ret = CallTo16RegisterShort( &context, 5 * sizeof(WORD) );
if (offset) STACK16_POP( teb, offset );
WIN_RestoreWndsLock(iWndsLocks);
@ -322,7 +319,7 @@ static LRESULT WINAPI THUNK_CallWndProc16( WNDPROC16 proc, HWND16 hwnd,
INT16 WINAPI THUNK_EnumObjects16( HDC16 hdc, INT16 nObjType,
GOBJENUMPROC16 func, LPARAM lParam )
{
DECL_THUNK( thunk, func, CallTo16_word_ll );
DECL_THUNK( thunk, func, THUNK_CallTo16_word_ll );
return EnumObjects16( hdc, nObjType, (GOBJENUMPROC16)&thunk, lParam );
}
@ -333,7 +330,7 @@ INT16 WINAPI THUNK_EnumObjects16( HDC16 hdc, INT16 nObjType,
INT16 WINAPI THUNK_EnumFonts16( HDC16 hdc, LPCSTR lpFaceName,
FONTENUMPROC16 func, LPARAM lParam )
{
DECL_THUNK( thunk, func, CallTo16_word_llwl );
DECL_THUNK( thunk, func, THUNK_CallTo16_word_llwl );
return EnumFonts16( hdc, lpFaceName, (FONTENUMPROC16)&thunk, lParam );
}
@ -343,7 +340,7 @@ INT16 WINAPI THUNK_EnumFonts16( HDC16 hdc, LPCSTR lpFaceName,
BOOL16 WINAPI THUNK_EnumMetaFile16( HDC16 hdc, HMETAFILE16 hmf,
MFENUMPROC16 func, LPARAM lParam )
{
DECL_THUNK( thunk, func, CallTo16_word_wllwl );
DECL_THUNK( thunk, func, THUNK_CallTo16_word_wllwl );
return EnumMetaFile16( hdc, hmf, (MFENUMPROC16)&thunk, lParam );
}
@ -354,7 +351,7 @@ BOOL16 WINAPI THUNK_EnumMetaFile16( HDC16 hdc, HMETAFILE16 hmf,
INT16 WINAPI THUNK_EnumFontFamilies16( HDC16 hdc, LPCSTR lpszFamily,
FONTENUMPROC16 func, LPARAM lParam )
{
DECL_THUNK( thunk, func, CallTo16_word_llwl );
DECL_THUNK( thunk, func, THUNK_CallTo16_word_llwl );
return EnumFontFamilies16(hdc, lpszFamily, (FONTENUMPROC16)&thunk, lParam);
}
@ -366,7 +363,7 @@ INT16 WINAPI THUNK_EnumFontFamiliesEx16( HDC16 hdc, LPLOGFONT16 lpLF,
FONTENUMPROCEX16 func, LPARAM lParam,
DWORD reserved )
{
DECL_THUNK( thunk, func, CallTo16_word_llwl );
DECL_THUNK( thunk, func, THUNK_CallTo16_word_llwl );
return EnumFontFamiliesEx16( hdc, lpLF, (FONTENUMPROCEX16)&thunk,
lParam, reserved );
}
@ -378,7 +375,7 @@ INT16 WINAPI THUNK_EnumFontFamiliesEx16( HDC16 hdc, LPLOGFONT16 lpLF,
void WINAPI THUNK_LineDDA16( INT16 nXStart, INT16 nYStart, INT16 nXEnd,
INT16 nYEnd, LINEDDAPROC16 func, LPARAM lParam )
{
DECL_THUNK( thunk, func, CallTo16_word_wwl );
DECL_THUNK( thunk, func, THUNK_CallTo16_word_wwl );
LineDDA16( nXStart, nYStart, nXEnd, nYEnd, (LINEDDAPROC16)&thunk, lParam );
}
@ -388,7 +385,7 @@ void WINAPI THUNK_LineDDA16( INT16 nXStart, INT16 nYStart, INT16 nXEnd,
*/
BOOL16 WINAPI THUNK_EnumWindows16( WNDENUMPROC16 func, LPARAM lParam )
{
DECL_THUNK( thunk, func, CallTo16_word_wl );
DECL_THUNK( thunk, func, THUNK_CallTo16_word_wl );
return EnumWindows16( (WNDENUMPROC16)&thunk, lParam );
}
@ -399,7 +396,7 @@ BOOL16 WINAPI THUNK_EnumWindows16( WNDENUMPROC16 func, LPARAM lParam )
BOOL16 WINAPI THUNK_EnumChildWindows16( HWND16 parent, WNDENUMPROC16 func,
LPARAM lParam )
{
DECL_THUNK( thunk, func, CallTo16_word_wl );
DECL_THUNK( thunk, func, THUNK_CallTo16_word_wl );
return EnumChildWindows16( parent, (WNDENUMPROC16)&thunk, lParam );
}
@ -410,7 +407,7 @@ BOOL16 WINAPI THUNK_EnumChildWindows16( HWND16 parent, WNDENUMPROC16 func,
BOOL16 WINAPI THUNK_EnumTaskWindows16( HTASK16 hTask, WNDENUMPROC16 func,
LPARAM lParam )
{
DECL_THUNK( thunk, func, CallTo16_word_wl );
DECL_THUNK( thunk, func, THUNK_CallTo16_word_wl );
return EnumTaskWindows16( hTask, (WNDENUMPROC16)&thunk, lParam );
}
@ -420,7 +417,7 @@ BOOL16 WINAPI THUNK_EnumTaskWindows16( HTASK16 hTask, WNDENUMPROC16 func,
*/
INT16 WINAPI THUNK_EnumProps16( HWND16 hwnd, PROPENUMPROC16 func )
{
DECL_THUNK( thunk, func, CallTo16_word_wlw );
DECL_THUNK( thunk, func, THUNK_CallTo16_word_wlw );
return EnumProps16( hwnd, (PROPENUMPROC16)&thunk );
}
@ -433,7 +430,7 @@ BOOL16 WINAPI THUNK_GrayString16( HDC16 hdc, HBRUSH16 hbr,
INT16 cch, INT16 x, INT16 y,
INT16 cx, INT16 cy )
{
DECL_THUNK( thunk, func, CallTo16_word_wlw );
DECL_THUNK( thunk, func, THUNK_CallTo16_word_wlw );
if (!func)
return GrayString16( hdc, hbr, NULL, lParam, cch, x, y, cx, cy );
else
@ -449,7 +446,7 @@ FARPROC16 WINAPI THUNK_SetWindowsHook16( INT16 id, HOOKPROC16 proc )
{
HINSTANCE16 hInst = FarGetOwner16( HIWORD(proc) );
HTASK16 hTask = (id == WH_MSGFILTER) ? GetCurrentTask() : 0;
THUNK *thunk = THUNK_Alloc( (FARPROC16)proc, (RELAY)CallTo16_long_wwl );
THUNK *thunk = THUNK_Alloc( (FARPROC16)proc, (RELAY)THUNK_CallTo16_long_wwl );
if (!thunk) return 0;
return (FARPROC16)SetWindowsHookEx16( id, (HOOKPROC16)thunk, hInst, hTask);
}
@ -475,7 +472,7 @@ BOOL16 WINAPI THUNK_UnhookWindowsHook16( INT16 id, HOOKPROC16 proc )
HHOOK WINAPI THUNK_SetWindowsHookEx16( INT16 id, HOOKPROC16 proc,
HINSTANCE16 hInst, HTASK16 hTask )
{
THUNK *thunk = THUNK_Alloc( (FARPROC16)proc, (RELAY)CallTo16_long_wwl );
THUNK *thunk = THUNK_Alloc( (FARPROC16)proc, (RELAY)THUNK_CallTo16_long_wwl );
if (!thunk) return 0;
return SetWindowsHookEx16( id, (HOOKPROC16)thunk, hInst, hTask );
}
@ -518,7 +515,7 @@ BOOL16 WINAPI THUNK_SetDCHook( HDC16 hdc, FARPROC16 proc, DWORD dwHookData )
thunk = NULL;
else if (proc != defDCHookProc)
{
thunk = THUNK_Alloc( proc, (RELAY)CallTo16_word_wwll );
thunk = THUNK_Alloc( proc, (RELAY)THUNK_CallTo16_word_wwll );
if (!thunk) return FALSE;
}
else thunk = (THUNK *)DCHook16;
@ -560,7 +557,7 @@ DWORD WINAPI THUNK_GetDCHook( HDC16 hdc, FARPROC16 *phookProc )
*/
FARPROC16 WINAPI THUNK_SetTaskSignalProc( HTASK16 hTask, FARPROC16 proc )
{
THUNK *thunk = THUNK_Alloc( proc, (RELAY)CallTo16_word_wwwww );
THUNK *thunk = THUNK_Alloc( proc, (RELAY)THUNK_CallTo16_word_wwwww );
if ( !thunk ) return NULL;
thunk = (THUNK*)SetTaskSignalProc( hTask, (FARPROC16)thunk );
@ -580,7 +577,7 @@ static DWORD CALLBACK THUNK_StartThread16( LPVOID threadArgs )
DWORD param = ((DWORD *)threadArgs)[1];
HeapFree( GetProcessHeap(), 0, threadArgs );
return CallTo16_long_l( start, param );
return THUNK_CallTo16_long_l( start, param );
}
HANDLE WINAPI THUNK_CreateThread16( SECURITY_ATTRIBUTES *sa, DWORD stack,
FARPROC16 start, SEGPTR param,
@ -621,61 +618,61 @@ static BOOL WINAPI THUNK_WOWCallback16Ex(
args[i] = ((DWORD*)xargs)[cbArgs-i-1];
}
switch (cbArgs) {
case 0: ret = CallTo16_long_(proc);break;
case 1: ret = CallTo16_long_l(proc,args[0]);break;
case 2: ret = CallTo16_long_ll(proc,args[0],args[1]);break;
case 3: ret = CallTo16_long_lll(proc,args[0],args[1],args[2]);break;
case 4: ret = CallTo16_long_llll(proc,args[0],args[1],args[2],args[3]);
case 0: ret = THUNK_CallTo16_long_(proc);break;
case 1: ret = THUNK_CallTo16_long_l(proc,args[0]);break;
case 2: ret = THUNK_CallTo16_long_ll(proc,args[0],args[1]);break;
case 3: ret = THUNK_CallTo16_long_lll(proc,args[0],args[1],args[2]);break;
case 4: ret = THUNK_CallTo16_long_llll(proc,args[0],args[1],args[2],args[3]);
break;
case 5: ret = CallTo16_long_lllll(proc,args[0],args[1],args[2],args[3],
case 5: ret = THUNK_CallTo16_long_lllll(proc,args[0],args[1],args[2],args[3],
args[4]
);
break;
case 6: ret = CallTo16_long_llllll(proc,args[0],args[1],args[2],args[3],
case 6: ret = THUNK_CallTo16_long_llllll(proc,args[0],args[1],args[2],args[3],
args[4],args[5]
);
break;
case 7: ret = CallTo16_long_lllllll(proc,args[0],args[1],args[2],args[3],
case 7: ret = THUNK_CallTo16_long_lllllll(proc,args[0],args[1],args[2],args[3],
args[4],args[5],args[6]
);
break;
case 8: ret = CallTo16_long_llllllll(proc,args[0],args[1],args[2],args[3],
case 8: ret = THUNK_CallTo16_long_llllllll(proc,args[0],args[1],args[2],args[3],
args[4],args[5],args[6],args[7]
);
break;
case 9: ret = CallTo16_long_lllllllll(proc,args[0],args[1],args[2],args[3],
case 9: ret = THUNK_CallTo16_long_lllllllll(proc,args[0],args[1],args[2],args[3],
args[4],args[5],args[6],args[7],args[8]
);
break;
case 10:ret = CallTo16_long_llllllllll(proc,args[0],args[1],args[2],args[3],
case 10:ret = THUNK_CallTo16_long_llllllllll(proc,args[0],args[1],args[2],args[3],
args[4],args[5],args[6],args[7],args[8],args[9]
);
break;
case 11:ret = CallTo16_long_lllllllllll(proc,args[0],args[1],args[2],
case 11:ret = THUNK_CallTo16_long_lllllllllll(proc,args[0],args[1],args[2],
args[3],args[4],args[5],args[6],args[7],args[8],args[9],args[10]
);
break;
case 12:ret = CallTo16_long_llllllllllll(proc,args[0],args[1],args[2],
case 12:ret = THUNK_CallTo16_long_llllllllllll(proc,args[0],args[1],args[2],
args[3],args[4],args[5],args[6],args[7],args[8],args[9],
args[10],args[11]
);
break;
case 13:ret = CallTo16_long_lllllllllllll(proc,args[0],args[1],args[2],
case 13:ret = THUNK_CallTo16_long_lllllllllllll(proc,args[0],args[1],args[2],
args[3],args[4],args[5],args[6],args[7],args[8],args[9],
args[10],args[11],args[12]
);
break;
case 14:ret = CallTo16_long_llllllllllllll(proc,args[0],args[1],args[2],
case 14:ret = THUNK_CallTo16_long_llllllllllllll(proc,args[0],args[1],args[2],
args[3],args[4],args[5],args[6],args[7],args[8],args[9],
args[10],args[11],args[12],args[13]
);
break;
case 15:ret = CallTo16_long_lllllllllllllll(proc,args[0],args[1],args[2],
case 15:ret = THUNK_CallTo16_long_lllllllllllllll(proc,args[0],args[1],args[2],
args[3],args[4],args[5],args[6],args[7],args[8],args[9],
args[10],args[11],args[12],args[13],args[14]
);
break;
case 16:ret = CallTo16_long_llllllllllllllll(proc,args[0],args[1],args[2],
case 16:ret = THUNK_CallTo16_long_llllllllllllllll(proc,args[0],args[1],args[2],
args[3],args[4],args[5],args[6],args[7],args[8],args[9],
args[10],args[11],args[12],args[13],args[14],args[15]
);
@ -712,7 +709,7 @@ static VOID WINAPI THUNK_CallMouseEventProc( FARPROC16 proc,
SI_reg(&context) = LOWORD( dwExtraInfo );
DI_reg(&context) = HIWORD( dwExtraInfo );
CallTo16_sreg_( &context, 0 );
CallTo16RegisterShort( &context, 0 );
}
VOID WINAPI THUNK_MOUSE_Enable( FARPROC16 proc )
{
@ -774,7 +771,7 @@ static VOID WINAPI THUNK_CallKeybdEventProc( FARPROC16 proc,
SI_reg(&context) = LOWORD( dwExtraInfo );
DI_reg(&context) = HIWORD( dwExtraInfo );
CallTo16_sreg_( &context, 0 );
CallTo16RegisterShort( &context, 0 );
}
VOID WINAPI THUNK_KEYBOARD_Enable( FARPROC16 proc, LPBYTE lpKeyState )
{
@ -834,7 +831,7 @@ static void THUNK_CallSystemTimerProc( FARPROC16 proc, WORD timer )
return;
}
CallTo16_sreg_( &context, 0 );
CallTo16RegisterShort( &context, 0 );
/* FIXME: This does not work if the signal occurs while this thread
is currently in 16-bit code. With the current structure
@ -890,7 +887,7 @@ void THUNK_InitCallout(void)
#define GETADDR( var, name, thk ) \
*(FARPROC *)&Callout.##var = (FARPROC) \
THUNK_Alloc( WIN32_GetProcAddress16( hModule, name ), \
(RELAY)CallTo16_##thk )
(RELAY)THUNK_CallTo16_##thk )
GETADDR( PeekMessage16, "PeekMessage", word_lwwww );
GETADDR( GetMessage16, "GetMessage", word_lwww );
@ -1006,7 +1003,7 @@ UINT WINAPI ThunkConnect16(
void WINAPI C16ThkSL(CONTEXT86 *context)
{
extern void CallFrom16_t_long_(void);
extern void CallFrom16Thunk(void);
LPBYTE stub = PTR_SEG_TO_LIN(EAX_reg(context)), x = stub;
WORD cs, ds;
GET_CS(cs);
@ -1031,7 +1028,7 @@ void WINAPI C16ThkSL(CONTEXT86 *context)
*x++ = 0x55;
*x++ = 0x66; *x++ = 0x52;
*x++ = 0x66; *x++ = 0x9A; *((DWORD *)x)++ = (DWORD)CallFrom16_t_long_;
*x++ = 0x66; *x++ = 0x9A; *((DWORD *)x)++ = (DWORD)CallFrom16Thunk;
*((WORD *)x)++ = cs;
/* Jump to the stub code just created */
@ -1056,7 +1053,7 @@ void WINAPI C16ThkSL01(CONTEXT86 *context)
struct ThunkDataSL16 *SL16 = PTR_SEG_TO_LIN(EDX_reg(context));
struct ThunkDataSL *td = SL16->fpData;
extern void CallFrom16_t_long_(void);
extern void CallFrom16Thunk(void);
DWORD procAddress = (DWORD)GetProcAddress16(GetModuleHandle16("KERNEL"), 631);
WORD cs;
GET_CS(cs);
@ -1086,7 +1083,7 @@ void WINAPI C16ThkSL01(CONTEXT86 *context)
*x++ = 0x55;
*x++ = 0x66; *x++ = 0x52;
*x++ = 0x66; *x++ = 0x9A; *((DWORD *)x)++ = (DWORD)CallFrom16_t_long_;
*x++ = 0x66; *x++ = 0x9A; *((DWORD *)x)++ = (DWORD)CallFrom16Thunk;
*((WORD *)x)++ = cs;
/* Jump to the stub code just created */

63
include/builtin16.h Normal file
View File

@ -0,0 +1,63 @@
/*
* Win16 built-in DLLs definitions
*
* Copyright 1999 Ulrich Weigand
*/
#ifndef __WINE_BUILTIN16_H
#define __WINE_BUILTIN16_H
#include "windef.h"
#include "pshpack1.h"
typedef struct
{
WORD pushw_bp; /* pushw %bp */
BYTE pushl; /* pushl $target */
DWORD target;
BYTE lcall; /* lcall __FLATCS__:relay */
DWORD relay;
WORD flatcs;
} STD_ENTRYPOINT16;
typedef struct
{
WORD movw_ax; /* movw $<ax>, %ax */
WORD ax;
WORD movw_dx; /* movw $<dx>, %dx */
WORD dx;
WORD lret; /* lret $<args> */
WORD args;
WORD nopnop; /* nop; nop */
} RET_ENTRYPOINT16;
typedef union
{
STD_ENTRYPOINT16 std;
RET_ENTRYPOINT16 ret;
} ENTRYPOINT16;
#define EP_STD( target, relay ) \
{ std: { 0x5566, 0x68, (DWORD)(target), 0x9a, (DWORD)(relay), __FLATCS__ } }
#define EP_RET( retval, nargs ) \
{ ret: { 0xb866, LOWORD(retval), 0xba66, HIWORD(retval), \
(nargs)? 0xca66 : 0xcb66, (nargs)? (nargs) : 0x9090, 0x9090 } }
#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;
extern void RELAY_Unimplemented16(void);
#endif /* __WINE_BUILTIN16_H */

View File

@ -20,53 +20,53 @@ extern int (*IF1632_CallLargeStack)( int (*func)(void), void *arg );
typedef struct
{
LONG (CALLBACK *CallRegisterShortProc)( CONTEXT86 *, INT );
LONG (CALLBACK *CallRegisterLongProc)( CONTEXT86 *, INT );
VOID (CALLBACK *CallFrom16WndProc)(void);
LRESULT (CALLBACK *CallWndProc)( WNDPROC16, HWND16, UINT16,
LONG (*CallRegisterShortProc)( CONTEXT86 *, INT );
LONG (*CallRegisterLongProc)( CONTEXT86 *, INT );
VOID (*CallFrom16WndProc)(void);
LRESULT (*CallWndProc)( WNDPROC16, HWND16, UINT16,
WPARAM16, LPARAM );
LRESULT (CALLBACK *CallDriverProc)( DRIVERPROC16, DWORD, HDRVR16,
LRESULT (*CallDriverProc)( DRIVERPROC16, DWORD, HDRVR16,
UINT16, LPARAM, LPARAM );
LRESULT (CALLBACK *CallDriverCallback)( FARPROC16, HANDLE16, UINT16,
LRESULT (*CallDriverCallback)( FARPROC16, HANDLE16, UINT16,
DWORD, LPARAM, LPARAM );
LRESULT (CALLBACK *CallTimeFuncProc)( FARPROC16, WORD, UINT16,
LRESULT (*CallTimeFuncProc)( FARPROC16, WORD, UINT16,
DWORD, LPARAM, LPARAM );
INT16 (CALLBACK *CallWindowsExitProc)( FARPROC16, INT16 );
INT16 (CALLBACK *CallWordBreakProc)( EDITWORDBREAKPROC16, SEGPTR, INT16,
INT16 (*CallWindowsExitProc)( FARPROC16, INT16 );
INT16 (*CallWordBreakProc)( EDITWORDBREAKPROC16, SEGPTR, INT16,
INT16, INT16 );
VOID (CALLBACK *CallBootAppProc)( FARPROC16, HANDLE16, HFILE16 );
WORD (CALLBACK *CallLoadAppSegProc)( FARPROC16, HANDLE16, HFILE16, WORD );
WORD (CALLBACK *CallLocalNotifyFunc)( FARPROC16, WORD, HLOCAL16, WORD );
HGLOBAL16 (CALLBACK *CallResourceHandlerProc)( FARPROC16, HGLOBAL16, HMODULE16, HRSRC16 );
DWORD (CALLBACK *CallWOWCallbackProc)( FARPROC16, DWORD );
BOOL (CALLBACK *CallWOWCallback16Ex)( FARPROC16, DWORD, DWORD, LPVOID,
VOID (*CallBootAppProc)( FARPROC16, HANDLE16, HFILE16 );
WORD (*CallLoadAppSegProc)( FARPROC16, HANDLE16, HFILE16, WORD );
WORD (*CallLocalNotifyFunc)( FARPROC16, WORD, HLOCAL16, WORD );
HGLOBAL16 (*CallResourceHandlerProc)( FARPROC16, HGLOBAL16, HMODULE16, HRSRC16 );
DWORD (*CallWOWCallbackProc)( FARPROC16, DWORD );
BOOL (*CallWOWCallback16Ex)( FARPROC16, DWORD, DWORD, LPVOID,
LPDWORD );
DWORD (CALLBACK *CallUTProc)( FARPROC16, DWORD, DWORD );
LRESULT (CALLBACK *CallASPIPostProc)( FARPROC16, SEGPTR );
DWORD (*CallUTProc)( FARPROC16, DWORD, DWORD );
LRESULT (*CallASPIPostProc)( FARPROC16, SEGPTR );
/* Following are the graphics driver callbacks */
WORD (CALLBACK *CallDrvControlProc)( FARPROC16, SEGPTR, WORD,
WORD (*CallDrvControlProc)( FARPROC16, SEGPTR, WORD,
SEGPTR, SEGPTR );
WORD (CALLBACK *CallDrvEnableProc)( FARPROC16, SEGPTR, WORD, SEGPTR,
WORD (*CallDrvEnableProc)( FARPROC16, SEGPTR, WORD, SEGPTR,
SEGPTR, SEGPTR );
WORD (CALLBACK *CallDrvEnumDFontsProc)( FARPROC16, SEGPTR, SEGPTR,
WORD (*CallDrvEnumDFontsProc)( FARPROC16, SEGPTR, SEGPTR,
FARPROC16, SEGPTR );
WORD (CALLBACK *CallDrvEnumObjProc)( FARPROC16, SEGPTR, WORD, FARPROC16,
WORD (*CallDrvEnumObjProc)( FARPROC16, SEGPTR, WORD, FARPROC16,
SEGPTR );
WORD (CALLBACK *CallDrvOutputProc)( FARPROC16, SEGPTR, WORD, WORD, SEGPTR,
WORD (*CallDrvOutputProc)( FARPROC16, SEGPTR, WORD, WORD, SEGPTR,
SEGPTR, SEGPTR, SEGPTR, SEGPTR );
DWORD (CALLBACK *CallDrvRealizeProc)( FARPROC16, SEGPTR, WORD, SEGPTR,
DWORD (*CallDrvRealizeProc)( FARPROC16, SEGPTR, WORD, SEGPTR,
SEGPTR, SEGPTR );
WORD (CALLBACK *CallDrvStretchBltProc)( FARPROC16, SEGPTR, WORD, WORD,
WORD (*CallDrvStretchBltProc)( FARPROC16, SEGPTR, WORD, WORD,
WORD, WORD, SEGPTR, WORD, WORD,
WORD, WORD, DWORD, SEGPTR, SEGPTR,
SEGPTR );
DWORD (CALLBACK *CallDrvExtTextOutProc)( FARPROC16, SEGPTR, WORD, WORD,
DWORD (*CallDrvExtTextOutProc)( FARPROC16, SEGPTR, WORD, WORD,
SEGPTR, SEGPTR, INT16, SEGPTR,
SEGPTR, SEGPTR, SEGPTR, SEGPTR,
WORD );
WORD (CALLBACK *CallDrvGetCharWidthProc)( FARPROC16, SEGPTR, SEGPTR, WORD,
WORD (*CallDrvGetCharWidthProc)( FARPROC16, SEGPTR, SEGPTR, WORD,
WORD, SEGPTR, SEGPTR, SEGPTR );
BOOL16 (CALLBACK *CallDrvAbortProc)( FARPROC16, HDC16, INT16 );
BOOL16 (*CallDrvAbortProc)( FARPROC16, HDC16, INT16 );
} CALLBACKS_TABLE;
extern const CALLBACKS_TABLE *Callbacks;

View File

@ -235,7 +235,7 @@ HGLOBAL16 NE_LoadPEResource( NE_MODULE *pModule, WORD type, LPVOID bits, DWORD s
/* if1632/builtin.c */
extern BOOL BUILTIN_Init(void);
extern HMODULE16 BUILTIN_LoadModule( LPCSTR name, BOOL force );
extern LPCSTR BUILTIN_GetEntryPoint16( WORD cs, WORD ip, WORD *pOrd );
extern LPCSTR BUILTIN_GetEntryPoint16( WORD cs, WORD ip, LPSTR name, WORD *pOrd );
/* relay32/builtin.c */
extern HMODULE BUILTIN32_LoadImage(LPCSTR name, OFSTRUCT *ofs);

View File

@ -32,17 +32,20 @@ typedef struct _STACK32FRAME
typedef struct
{
STACK32FRAME *frame32; /* 00 32-bit frame from last CallTo16() */
DWORD ebp; /* 04 full 32-bit content of ebp */
WORD mutex_count; /* 08 Win16Mutex recursion count */
WORD fs; /* 0a fs */
WORD entry_ip; /* 0c ip of entry point */
WORD ds; /* 0e ds */
WORD entry_cs; /* 10 cs of entry point */
WORD es; /* 12 es */
DWORD entry_point; /* 14 32-bit entry point to call */
WORD bp; /* 18 16-bit bp */
WORD ip; /* 1a return address */
WORD cs; /* 1c */
DWORD edx; /* 04 saved registers */
DWORD ecx; /* 08 */
DWORD ebp; /* 0c */
WORD ds; /* 10 */
WORD es; /* 12 */
WORD fs; /* 14 */
WORD gs; /* 16 */
DWORD relay; /* 18 address of argument relay stub */
DWORD entry_ip; /* 1c ip of entry point */
DWORD entry_cs; /* 20 cs of entry point */
DWORD entry_point; /* 24 API entry point to call, reused as mutex count */
WORD bp; /* 28 16-bit stack frame chain */
WORD ip; /* 2a return address */
WORD cs; /* 2c */
} STACK16FRAME;
#include "poppack.h"

View File

@ -21,7 +21,7 @@ DEFAULT_DEBUG_CHANNEL(relay)
/**********************************************************************
* CALLBACK_CallWndProc
*/
static LRESULT WINAPI CALLBACK_CallWndProc( WNDPROC16 proc, HWND16 hwnd,
static LRESULT CALLBACK_CallWndProc( WNDPROC16 proc, HWND16 hwnd,
UINT16 msg, WPARAM16 wParam,
LPARAM lParam )
{
@ -36,225 +36,149 @@ static LRESULT WINAPI CALLBACK_CallWndProc( WNDPROC16 proc, HWND16 hwnd,
return retvalue;
}
/**********************************************************************
* CALLBACK_CallRegisterProc
*/
static LONG WINAPI CALLBACK_CallRegisterProc( CONTEXT86 *context, INT offset)
static LONG CALLBACK_CallRegisterProc( CONTEXT86 *context, INT offset)
{
ERR("Cannot call a register proc in Winelib\n" );
assert( FALSE );
return 0;
}
/**********************************************************************
* CALLBACK_CallDriverProc
*/
static LRESULT WINAPI CALLBACK_CallDriverProc( DRIVERPROC16 proc, DWORD dwId,
HDRVR16 hdrvr, UINT16 msg,
LPARAM lp1, LPARAM lp2 )
static LRESULT CALLBACK_CallDriverProc( DRIVERPROC16 proc, DWORD dwId,
HDRVR16 hdrvr, UINT16 msg,
LPARAM lp1, LPARAM lp2 )
{
return proc( dwId, hdrvr, msg, lp1, lp2 );
ERR("Cannot call a 16-bit driver proc in Winelib\n" );
assert( FALSE );
return 0;
}
/**********************************************************************
* CALLBACK_CallDriverCallback
*/
static LRESULT WINAPI CALLBACK_CallDriverCallback( FARPROC16 proc,
HANDLE16 hDev, UINT16 msg,
DWORD dwUser, LPARAM lp1,
LPARAM lp2 )
static LRESULT CALLBACK_CallDriverCallback( FARPROC16 proc,
HANDLE16 hDev, UINT16 msg,
DWORD dwUser, LPARAM lp1,
LPARAM lp2 )
{
return proc( hDev, msg, dwUser, lp1, lp2 );
ERR("Cannot call a 16-bit driver proc in Winelib\n" );
assert( FALSE );
return 0;
}
/**********************************************************************
* CALLBACK_CallTimeFuncProc
*/
static LRESULT WINAPI CALLBACK_CallTimeFuncProc( FARPROC16 proc, WORD id,
static LRESULT CALLBACK_CallTimeFuncProc( FARPROC16 proc, WORD id,
UINT16 msg, DWORD dwUser,
LPARAM lp1, LPARAM lp2 )
{
return proc( id, msg, dwUser, lp1, lp2 );
}
/**********************************************************************
* CALLBACK_CallWindowsExitProc
*/
static INT16 WINAPI CALLBACK_CallWindowsExitProc( FARPROC16 proc, INT16 type)
static INT16 CALLBACK_CallWindowsExitProc( FARPROC16 proc, INT16 type)
{
return proc( type );
}
/**********************************************************************
* CALLBACK_CallWordBreakProc
*/
static INT16 WINAPI CALLBACK_CallWordBreakProc( EDITWORDBREAKPROC16 proc,
static INT16 CALLBACK_CallWordBreakProc( EDITWORDBREAKPROC16 proc,
SEGPTR text, INT16 word,
INT16 len, INT16 action )
{
return proc( (LPSTR)text, word, len, action );
}
/**********************************************************************
* CALLBACK_CallBootAppProc
*/
static void WINAPI CALLBACK_CallBootAppProc( FARPROC16 proc, HANDLE16 module,
static void CALLBACK_CallBootAppProc( FARPROC16 proc, HANDLE16 module,
HFILE16 file )
{
proc( module, file );
ERR("Cannot call a 16-bit self-load handler in Winelib\n" );
assert( FALSE );
return;
}
/**********************************************************************
* CALLBACK_CallLoadAppSegProc
*/
static WORD WINAPI CALLBACK_CallLoadAppSegProc( FARPROC16 proc,
static WORD CALLBACK_CallLoadAppSegProc( FARPROC16 proc,
HANDLE16 module, HFILE16 file,
WORD seg )
{
return proc( module, file, seg );
ERR("Cannot call a 16-bit self-load handler in Winelib\n" );
assert( FALSE );
return 0;
}
/**********************************************************************
* CALLBACK_CallLocalNotifyFunc
*/
static WORD WINAPI CALLBACK_CallLocalNotifyFunc( FARPROC16 proc,
WORD wMsg, HLOCAL16 hMem,
WORD wArg )
static WORD CALLBACK_CallLocalNotifyFunc( FARPROC16 proc,
WORD wMsg, HLOCAL16 hMem, WORD wArg )
{
return proc( wMsg, hMem, wArg );
ERR("Cannot call a 16-bit notification handler in Winelib\n" );
assert( FALSE );
return 0;
}
/**********************************************************************
* CALLBACK_CallResourceHandlerProc
*/
static HGLOBAL16 WINAPI CALLBACK_CallResourceHandlerProc( FARPROC16 proc,
HGLOBAL16 hMemObj,
HMODULE16 hModule,
HRSRC16 hRsrc )
static HGLOBAL16 CALLBACK_CallResourceHandlerProc( FARPROC16 proc,
HGLOBAL16 hMemObj,
HMODULE16 hModule,
HRSRC16 hRsrc )
{
ERR("Cannot call a 16-bit resource handler in Winelib\n" );
assert( FALSE );
return 0;
}
/**********************************************************************
* CALLBACK_CallASPIPostProc
*/
static LRESULT WINAPI CALLBACK_CallASPIPostProc( FARPROC16 proc, SEGPTR ptr )
static LRESULT CALLBACK_CallASPIPostProc( FARPROC16 proc, SEGPTR ptr )
{
return proc( ptr );
}
/**********************************************************************
* CALLBACK_CallWOWCallbackProc
*/
static DWORD WINAPI CALLBACK_CallWOWCallbackProc( FARPROC16 proc, DWORD dw )
static DWORD CALLBACK_CallWOWCallbackProc( FARPROC16 proc, DWORD dw )
{
return proc( dw );
ERR("Cannot call a WOW thunk proc in Winelib\n" );
assert( FALSE );
return 0;
}
/**********************************************************************
* CALLBACK_CallWOWCallback16Ex
*
* WCB16_MAX_CBARGS (16) is the maximum number of args.
*
* Can call functions using CDECL or PASCAL calling conventions. The CDECL
* ones are reversed (not 100% sure about that).
*/
static BOOL WINAPI CALLBACK_CallWOWCallback16Ex(
FARPROC16 proc, DWORD dwFlags, DWORD cbArgs, LPVOID xargs,LPDWORD pdwret
) {
LPDWORD args = (LPDWORD)xargs;
DWORD ret,i;
if (dwFlags == WCB16_CDECL) {
/* swap the arguments */
args = HeapAlloc(GetProcessHeap(),0,cbArgs*sizeof(DWORD));
for (i=0;i<cbArgs;i++)
args[i] = ((DWORD*)xargs)[cbArgs-i-1];
}
switch (cbArgs) {
case 0: ret = proc();break;
case 1: ret = proc(args[0]);break;
case 2: ret = proc(args[0],args[1]);break;
case 3: ret = proc(args[0],args[1],args[2]);break;
case 4: ret = proc(args[0],args[1],args[2],args[3]);break;
case 5: ret = proc(args[0],args[1],args[2],args[3],args[4]);break;
case 6: ret = proc(args[0],args[1],args[2],args[3],args[4],args[5]);
break;
case 7: ret = proc(args[0],args[1],args[2],args[3],args[4],args[5],
args[6]
);
break;
case 8: ret = proc(args[0],args[1],args[2],args[3],args[4],args[5],
args[6],args[7]
);
break;
case 9: ret = proc(args[0],args[1],args[2],args[3],args[4],args[5],
args[6],args[7],args[8]
);
break;
case 10:ret = proc(args[0],args[1],args[2],args[3],args[4],args[5],
args[6],args[7],args[8],args[9]
);
break;
case 11:ret = proc(args[0],args[1],args[2],args[3],args[4],args[5],
args[6],args[7],args[8],args[9],args[10]
);
break;
case 12:ret = proc(args[0],args[1],args[2],args[3],args[4],args[5],
args[6],args[7],args[8],args[9],args[10],args[11]
);
break;
case 13:ret = proc(args[0],args[1],args[2],args[3],args[4],args[5],
args[6],args[7],args[8],args[9],args[10],args[11],
args[12]
);
break;
case 14:ret = proc(args[0],args[1],args[2],args[3],args[4],args[5],
args[6],args[7],args[8],args[9],args[10],args[11],
args[12],args[13]
);
break;
case 15:ret = proc(args[0],args[1],args[2],args[3],args[4],args[5],
args[6],args[7],args[8],args[9],args[10],args[11],
args[12],args[13],args[14]
);
break;
case 16:ret = proc(args[0],args[1],args[2],args[3],args[4],args[5],
args[6],args[7],args[8],args[9],args[10],args[11],
args[12],args[13],args[14],args[15]
);
break;
default:
WARN("(%ld) arguments not supported.\n",cbArgs);
if (dwFlags == WCB16_CDECL)
HeapFree(GetProcessHeap(),0,args);
return FALSE;
}
if (dwFlags == WCB16_CDECL)
HeapFree(GetProcessHeap(),0,args);
if (pdwret)
*pdwret = ret;
return TRUE;
static BOOL CALLBACK_CallWOWCallback16Ex( FARPROC16 proc, DWORD dwFlags,
DWORD cbArgs, LPVOID xargs, LPDWORD pdwret )
{
ERR("Cannot call a WOW thunk proc in Winelib\n" );
assert( FALSE );
return 0;
}
/**********************************************************************
* CALLBACK_CallUTProc
*/
static DWORD WINAPI CALLBACK_CallUTProc( FARPROC16 proc, DWORD w1, DWORD w2 )
static DWORD CALLBACK_CallUTProc( FARPROC16 proc, DWORD w1, DWORD w2 )
{
ERR("Cannot call a UT thunk proc in Winelib\n" );
assert( FALSE );

View File

@ -27,12 +27,8 @@ extern int (*INSTR_IsRelay)( const void *addr );
static int is_relay_addr( const void *addr )
{
extern char CallFrom16_Start, CallFrom16_End, CALLTO16_Start, CALLTO16_End;
return ((((char *)addr >= &CallFrom16_Start) &&
((char *)addr < &CallFrom16_End)) ||
(((char *)addr >= &CALLTO16_Start) &&
((char *)addr < &CALLTO16_End)));
extern char Call16_Start, Call16_End;
return ((char *)addr >= &Call16_Start) && ((char *)addr < &Call16_End);
}
/***********************************************************************

View File

@ -1,45 +1,45 @@
Makefile
advapi32.c
avifil32.c
advapi32.spec.c
avifil32.spec.c
call32.s
comctl32.c
comdlg32.c
crtdll.c
dciman32.c
ddraw.c
dinput.c
dplay.c
dplayx.c
dsound.c
gdi32.c
imagehlp.c
imm32.c
kernel32.c
lz32.c
mcianim.c
mciavi.c
mcicda.c
mciseq.c
mciwave.c
mpr.c
msacm32.c
msnet32.c
msvfw32.c
ntdll.c
ole32.c
oleaut32.c
olecli32.c
oledlg.c
olesvr32.c
psapi.c
rasapi32.c
shell32.c
tapi32.c
user32.c
version.c
w32skrnl.c
winmm.c
winspool.c
wnaspi32.c
wow32.c
wsock32.c
comctl32.spec.c
comdlg32.spec.c
crtdll.spec.c
dciman32.spec.c
ddraw.spec.c
dinput.spec.c
dplay.spec.c
dplayx.spec.c
dsound.spec.c
gdi32.spec.c
imagehlp.spec.c
imm32.spec.c
kernel32.spec.c
lz32.spec.c
mcianim.spec.c
mciavi.spec.c
mcicda.spec.c
mciseq.spec.c
mciwave.spec.c
mpr.spec.c
msacm32.spec.c
msnet32.spec.c
msvfw32.spec.c
ntdll.spec.c
ole32.spec.c
oleaut32.spec.c
olecli32.spec.c
oledlg.spec.c
olesvr32.spec.c
psapi.spec.c
rasapi32.spec.c
shell32.spec.c
tapi32.spec.c
user32.spec.c
version.spec.c
w32skrnl.spec.c
winmm.spec.c
winspool.spec.c
wnaspi32.spec.c
wow32.spec.c
wsock32.spec.c

View File

@ -5,7 +5,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = relay32
DLLS = \
SPEC_SRCS = \
advapi32.spec \
avifil32.spec \
comctl32.spec \
@ -56,30 +56,14 @@ C_SRCS = \
snoop.c \
utthunk.c
SPEC_FILES = $(DLLS:.spec=.c)
EXTRA_OBJS = $(DLLS:.spec=.o)
GEN_ASM_SRCS = \
call32.s
.SUFFIXES: .spec
.spec.c:
$(BUILD) -o $@ -spec $<
all: checkbuild $(MODULE).o
all: $(MODULE).o
@MAKE_RULES@
$(SPEC_FILES): $(BUILD)
$(EXTRA_OBJS): $(TOPSRCDIR)/include/builtin32.h
call32.s: $(BUILD)
$(BUILD) -o $@ -call32
clean::
$(RM) $(SPEC_FILES)
### Dependencies:

View File

@ -204,14 +204,10 @@ VOID WINAPI RestoreThunkLock(DWORD mutex_count)
*/
VOID SYSLEVEL_ReleaseWin16Lock(VOID)
{
DWORD count;
/* entry_point is never used again once the entry point has
been called. Thus we re-use it to hold the Win16Lock count */
ReleaseThunkLock(&count);
if (count > 0xffff)
ERR("Win16Mutex recursion count too large!\n");
CURRENT_STACK16->mutex_count = (WORD)count;
ReleaseThunkLock(&CURRENT_STACK16->entry_point);
}
/************************************************************************
@ -219,12 +215,7 @@ VOID SYSLEVEL_ReleaseWin16Lock(VOID)
*/
VOID SYSLEVEL_RestoreWin16Lock(VOID)
{
DWORD count = CURRENT_STACK16->mutex_count;
if (!count)
ERR("Win16Mutex recursion count is zero!\n");
RestoreThunkLock(count);
RestoreThunkLock(CURRENT_STACK16->entry_point);
}
/************************************************************************

File diff suppressed because it is too large Load Diff