Renamed CallTo16* functions to wine_call_to_16* and export them from

kernel32.spec.
This commit is contained in:
Alexandre Julliard 2000-11-29 19:39:30 +00:00
parent b5eefcd134
commit e296bf3717
16 changed files with 78 additions and 53 deletions

View File

@ -950,3 +950,7 @@ debug_channels (comm debugstr dll int resource stress thunk toolhelp win32)
@ varargs __wine_call_from_16_long() __wine_call_from_16_long
@ varargs __wine_call_from_16_regs() __wine_call_from_16_regs
@ varargs __wine_call_from_16_thunk() __wine_call_from_16_thunk
@ stdcall wine_call_to_16_word(ptr long) wine_call_to_16_word
@ stdcall wine_call_to_16_long(ptr long) wine_call_to_16_long
@ stdcall wine_call_to_16_regs_short(ptr long) wine_call_to_16_regs_short
@ stdcall wine_call_to_16_regs_long (ptr long) wine_call_to_16_regs_long

View File

@ -303,7 +303,7 @@ void WINAPI QT_Thunk( CONTEXT86 *context )
memcpy( (LPBYTE)CURRENT_STACK16 - argsize,
(LPBYTE)context->Esp, argsize );
CallTo16RegisterShort( &context16, argsize );
wine_call_to_16_regs_short( &context16, argsize );
context->Eax = context16.Eax;
context->Edx = context16.Edx;
context->Ecx = context16.Ecx;
@ -430,7 +430,7 @@ void WINAPI FT_Thunk( CONTEXT86 *context )
+ (*(LPBYTE *)arg - oldstack));
}
CallTo16RegisterShort( &context16, argsize );
wine_call_to_16_regs_short( &context16, argsize );
context->Eax = context16.Eax;
context->Edx = context16.Edx;
context->Ecx = context16.Ecx;
@ -637,7 +637,7 @@ void WINAPI Common32ThkLS( CONTEXT86 *context )
memcpy( (LPBYTE)CURRENT_STACK16 - argsize,
(LPBYTE)context->Esp, argsize );
CallTo16RegisterLong(&context16, argsize + 32);
wine_call_to_16_regs_long(&context16, argsize + 32);
context->Eax = context16.Eax;
/* Clean up caller's stack frame */
@ -688,7 +688,7 @@ void WINAPI OT_32ThkLSF( CONTEXT86 *context )
memcpy( (LPBYTE)CURRENT_STACK16 - argsize,
(LPBYTE)context->Esp, argsize );
CallTo16RegisterShort(&context16, argsize);
wine_call_to_16_regs_short(&context16, argsize);
context->Eax = context16.Eax;
context->Edx = context16.Edx;

View File

@ -266,12 +266,12 @@ BOOL WINAPI K32WOWCallback16Ex( DWORD vpfn16, DWORD dwFlags,
/*
* Actually, we should take care whether the called routine cleans up
* its stack or not. Fortunately, our CallTo16 core doesn't rely on
* its stack or not. Fortunately, our wine_call_to_16 core doesn't rely on
* the callee to do so; after the routine has returned, the 16-bit
* stack pointer is always reset to the position it had before.
*/
ret = CallTo16Long( (FARPROC16)vpfn16, cbArgs );
ret = wine_call_to_16_long( (FARPROC16)vpfn16, cbArgs );
if ( pdwRetCode )
*pdwRetCode = ret;

View File

@ -82,7 +82,7 @@ static VOID WINAPI MOUSE_CallMouseEventProc( FARPROC16 proc,
context.Esi = LOWORD( dwExtraInfo );
context.Edi = HIWORD( dwExtraInfo );
CallTo16RegisterShort( &context, 0 );
wine_call_to_16_regs_short( &context, 0 );
}
VOID WINAPI WIN16_MOUSE_Enable( FARPROC16 proc )

View File

@ -63,17 +63,37 @@ BOOL RELAY_Init(void)
* (these will never be called but need to be present to satisfy the linker ...)
*/
#ifndef __i386__
WORD CALLBACK CallTo16Word( FARPROC16 target, INT nArgs )
{ assert( FALSE ); }
/***********************************************************************
* wine_call_to_16_word
*/
WORD WINAPI wine_call_to_16_word( FARPROC16 target, INT nArgs )
{
assert( FALSE );
}
LONG CALLBACK CallTo16Long( FARPROC16 target, INT nArgs )
{ assert( FALSE ); }
/***********************************************************************
* wine_call_to_16_long
*/
LONG WINAPI wine_call_to_16_long( FARPROC16 target, INT nArgs )
{
assert( FALSE );
}
void CALLBACK CallTo16RegisterShort( CONTEXT86 *context, INT nArgs )
{ assert( FALSE ); }
/***********************************************************************
* wine_call_to_16_regs_short
*/
void WINAPI wine_call_to_16_regs_short( CONTEXT86 *context, INT nArgs )
{
assert( FALSE );
}
void CALLBACK CallTo16RegisterLong ( CONTEXT86 *context, INT nArgs )
{ assert( FALSE ); }
/***********************************************************************
* wine_call_to_16_regs_long
*/
void WINAPI wine_call_to_16_regs_long ( CONTEXT86 *context, INT nArgs )
{
assert( FALSE );
}
/***********************************************************************
* __wine_call_from_16_word

View File

@ -13,11 +13,6 @@
struct _CONTEXT86;
struct _STACK16FRAME;
extern WORD CALLBACK CallTo16Word( FARPROC16 target, INT nArgs );
extern LONG CALLBACK CallTo16Long( FARPROC16 target, INT nArgs );
extern void CALLBACK CallTo16RegisterShort( struct _CONTEXT86 *context, INT nArgs );
extern void CALLBACK CallTo16RegisterLong ( struct _CONTEXT86 *context, INT nArgs );
#include "pshpack1.h"
typedef struct

View File

@ -255,4 +255,10 @@ SEGPTR WINAPI WIN16_LockResource16(HGLOBAL16);
LONG WINAPI WIN16_hread(HFILE16,SEGPTR,LONG);
UINT16 WINAPI WIN16_lread(HFILE16,SEGPTR,UINT16);
/* Wine-specific functions */
WORD WINAPI wine_call_to_16_word( FARPROC16 target, INT nArgs );
LONG WINAPI wine_call_to_16_long( FARPROC16 target, INT nArgs );
void WINAPI wine_call_to_16_regs_short( CONTEXT86 *context, INT nArgs );
void WINAPI wine_call_to_16_regs_long ( CONTEXT86 *context, INT nArgs );
#endif /* __WINE_WINE_WINBASE16_H */

View File

@ -1192,7 +1192,7 @@ static void NE_InitProcess(void)
SELECTOROF(pTask->teb->cur_stack),
OFFSETOF(pTask->teb->cur_stack) );
CallTo16RegisterShort( &context, 0 );
wine_call_to_16_regs_short( &context, 0 );
ExitThread( LOWORD(context.Eax) );
}

View File

@ -627,7 +627,7 @@ static BOOL NE_InitDLL( TDB* pTask, NE_MODULE *pModule )
TRACE_(dll)("Calling LibMain, cs:ip=%04lx:%04lx ds=%04lx di=%04x cx=%04x\n",
context.SegCs, context.Eip, context.SegDs,
LOWORD(context.Edi), LOWORD(context.Ecx) );
CallTo16RegisterShort( &context, 0 );
wine_call_to_16_regs_short( &context, 0 );
return TRUE;
}
@ -712,7 +712,7 @@ static void NE_CallDllEntryPoint( NE_MODULE *pModule, DWORD dwReason )
*(DWORD *)(stack - 14) = 0; /* dwReserved1 */
*(WORD *) (stack - 16) = 0; /* wReserved2 */
CallTo16RegisterShort( &context, 16 );
wine_call_to_16_regs_short( &context, 16 );
}
}

View File

@ -136,7 +136,7 @@ static void SYSTEM_CallSystemTimerProc( FARPROC16 proc, WORD timer )
AX_reg( &context ) = timer;
CallTo16RegisterShort( &context, 0 );
wine_call_to_16_regs_short( &context, 0 );
}
WORD WINAPI WIN16_CreateSystemTimer( WORD rate, FARPROC16 proc )

View File

@ -287,7 +287,7 @@ static void DPMI_CallRMCBProc( CONTEXT86 *context, RMCB *rmcb, WORD flag )
ctx.SegEs = rmcb->regs_sel;
ctx.Edi = rmcb->regs_ofs;
/* FIXME: I'm pretty sure this isn't right - should push flags first */
CallTo16RegisterShort(&ctx, 0);
wine_call_to_16_regs_short(&ctx, 0);
es = ctx.SegEs;
edi = ctx.Edi;
}
@ -615,7 +615,7 @@ static void StartPM( CONTEXT86 *context, LPDOSTASK lpDosTask )
pm_ctx.SegGs = 0;
TRACE("DOS program is now entering protected mode\n");
CallTo16RegisterShort(&pm_ctx, 0);
wine_call_to_16_regs_short(&pm_ctx, 0);
/* in the current state of affairs, we won't ever actually return here... */
/* we should have int21/ah=4c do it someday, though... */

View File

@ -329,7 +329,7 @@ static DWORD CALLBACK THREAD_StartThread16( LPVOID threadArgs )
HeapFree( GetProcessHeap(), 0, threadArgs );
((LPDWORD)CURRENT_STACK16)[-1] = param;
return CallTo16Long( start, sizeof(DWORD) );
return wine_call_to_16_long( start, sizeof(DWORD) );
}
HANDLE WINAPI CreateThread16( SECURITY_ATTRIBUTES *sa, DWORD stack,
FARPROC16 start, SEGPTR param,

View File

@ -417,10 +417,10 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk, int sho
*
* This routine builds the core routines used in 32->16 thunks:
*
* extern void CALLBACK CallTo16Word( SEGPTR target, int nb_args );
* extern void CALLBACK CallTo16Long( SEGPTR target, int nb_args );
* extern void CALLBACK CallTo16RegisterShort( const CONTEXT86 *context, int nb_args );
* extern void CALLBACK CallTo16RegisterLong ( const CONTEXT86 *context, int nb_args );
* extern void WINAPI wine_call_to_16_word( SEGPTR target, int nb_args );
* extern void WINAPI wine_call_to_16_long( SEGPTR target, int nb_args );
* extern void WINAPI wine_call_to_16_regs_short( const CONTEXT86 *context, int nb_args );
* extern void WINAPI wine_call_to_16_regs_long ( const CONTEXT86 *context, int nb_args );
*
* These routines can be called directly from 32-bit code.
*
@ -442,19 +442,19 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk, int sho
static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func )
{
char *name = reg_func == 2 ? "RegisterLong" :
reg_func == 1 ? "RegisterShort" :
short_ret? "Word" : "Long";
char *name = reg_func == 2 ? "regs_long" :
reg_func == 1 ? "regs_short" :
short_ret? "word" : "long";
/* Function header */
fprintf( outfile, "\n\t.align 4\n" );
#ifdef USE_STABS
fprintf( outfile, ".stabs \"CallTo16%s:F1\",36,0,0," PREFIX "CallTo16%s\n",
fprintf( outfile, ".stabs \"wine_call_to_16_%s:F1\",36,0,0," PREFIX "wine_call_to_16_%s\n",
name, name);
#endif
fprintf( outfile, "\t.type " PREFIX "CallTo16%s,@function\n", name );
fprintf( outfile, "\t.globl " PREFIX "CallTo16%s\n", name );
fprintf( outfile, PREFIX "CallTo16%s:\n", name );
fprintf( outfile, "\t.type " PREFIX "wine_call_to_16_%s,@function\n", name );
fprintf( outfile, "\t.globl " PREFIX "wine_call_to_16_%s\n", name );
fprintf( outfile, PREFIX "wine_call_to_16_%s:\n", name );
/* Function entry sequence */
fprintf( outfile, "\tpushl %%ebp\n" );
@ -470,10 +470,10 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func )
if ( UsePIC )
{
/* Get Global Offset Table into %ebx */
fprintf( outfile, "\tcall .LCallTo16%s.getgot1\n", name );
fprintf( outfile, ".LCallTo16%s.getgot1:\n", name );
fprintf( outfile, "\tcall .Lwine_call_to_16_%s.getgot1\n", name );
fprintf( outfile, ".Lwine_call_to_16_%s.getgot1:\n", name );
fprintf( outfile, "\tpopl %%ebx\n" );
fprintf( outfile, "\taddl $_GLOBAL_OFFSET_TABLE_+[.-.LCallTo16%s.getgot1], %%ebx\n", name );
fprintf( outfile, "\taddl $_GLOBAL_OFFSET_TABLE_+[.-.Lwine_call_to_16_%s.getgot1], %%ebx\n", name );
}
/* Enter Win16 Mutex */
@ -509,7 +509,7 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func )
/* Call the actual CallTo16 routine (simulate a lcall) */
fprintf( outfile, "\tpushl %%cs\n" );
fprintf( outfile, "\tcall .LCallTo16%s\n", name );
fprintf( outfile, "\tcall .Lwine_call_to_16_%s\n", name );
if ( !reg_func )
{
@ -553,10 +553,10 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func )
if ( UsePIC )
{
/* Get Global Offset Table into %ebx (might have been overwritten) */
fprintf( outfile, "\tcall .LCallTo16%s.getgot2\n", name );
fprintf( outfile, ".LCallTo16%s.getgot2:\n", name );
fprintf( outfile, "\tcall .Lwine_call_to_16_%s.getgot2\n", name );
fprintf( outfile, ".Lwine_call_to_16_%s.getgot2:\n", name );
fprintf( outfile, "\tpopl %%ebx\n" );
fprintf( outfile, "\taddl $_GLOBAL_OFFSET_TABLE_+[.-.LCallTo16%s.getgot2], %%ebx\n", name );
fprintf( outfile, "\taddl $_GLOBAL_OFFSET_TABLE_+[.-.Lwine_call_to_16_%s.getgot2], %%ebx\n", name );
}
/* Print debugging info */
@ -595,7 +595,7 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func )
/* Start of the actual CallTo16 routine */
fprintf( outfile, ".LCallTo16%s:\n", name );
fprintf( outfile, ".Lwine_call_to_16_%s:\n", name );
/* Complete STACK32FRAME */
fprintf( outfile, "\t.byte 0x64\n\tpushl (%d)\n", STACKOFFSET );

View File

@ -413,7 +413,7 @@ static void BuildCallFrom16Func( FILE *outfile, char *profile, char *prefix, int
*
* These routines are provided solely for convenience; they simply
* write the arguments onto the 16-bit stack, and call the appropriate
* CallTo16... core routine.
* wine_call_to_16... core routine.
*
* If you have more sophisticated argument conversion requirements than
* are provided by these routines, you might as well call the core
@ -463,8 +463,8 @@ static void BuildCallTo16Func( FILE *outfile, char *profile, char *prefix )
fprintf( outfile, " *)args = arg%d;\n", i+1 );
}
fprintf( outfile, " return CallTo16%s( proc, %d );\n}\n\n",
short_ret? "Word" : "Long", argsize );
fprintf( outfile, " return wine_call_to_16_%s( proc, %d );\n}\n\n",
short_ret? "word" : "long", argsize );
}
@ -802,8 +802,8 @@ void BuildGlue( FILE *outfile, FILE *infile )
fprintf( outfile, "#include \"builtin16.h\"\n" );
fprintf( outfile, "#include \"stackframe.h\"\n\n" );
fprintf( outfile, "extern WORD CALLBACK CallTo16Word( FARPROC16 target, INT nArgs );\n" );
fprintf( outfile, "extern LONG CALLBACK CallTo16Long( FARPROC16 target, INT nArgs );\n" );
fprintf( outfile, "extern WORD WINAPI wine_call_to_16_word( FARPROC16 target, INT nArgs );\n" );
fprintf( outfile, "extern LONG WINAPI wine_call_to_16_long( FARPROC16 target, INT nArgs );\n" );
/* Build the callback glue functions */

View File

@ -83,7 +83,7 @@ static VOID WINAPI KEYBOARD_CallKeybdEventProc( FARPROC16 proc,
context.Esi = LOWORD( dwExtraInfo );
context.Edi = HIWORD( dwExtraInfo );
CallTo16RegisterShort( &context, 0 );
wine_call_to_16_regs_short( &context, 0 );
}
VOID WINAPI WIN16_KEYBOARD_Enable( FARPROC16 proc, LPBYTE lpKeyState )

View File

@ -238,7 +238,7 @@ static LRESULT WINAPI WINPROC_CallWndProc16( WNDPROC16 proc, HWND16 hwnd,
args[3] = msg;
args[4] = hwnd;
CallTo16RegisterShort( &context, 5 * sizeof(WORD) );
wine_call_to_16_regs_short( &context, 5 * sizeof(WORD) );
ret = MAKELONG( LOWORD(context.Eax), LOWORD(context.Edx) );
if (offset) stack16_pop( offset );