diff --git a/dlls/kernel/kernel32.spec b/dlls/kernel/kernel32.spec index 787a8640c78..63041604687 100644 --- a/dlls/kernel/kernel32.spec +++ b/dlls/kernel/kernel32.spec @@ -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 diff --git a/dlls/kernel/thunk.c b/dlls/kernel/thunk.c index 2a57685e51b..cf6c3211b45 100644 --- a/dlls/kernel/thunk.c +++ b/dlls/kernel/thunk.c @@ -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; diff --git a/dlls/kernel/wowthunk.c b/dlls/kernel/wowthunk.c index 4ed24f029d3..70a0320338c 100644 --- a/dlls/kernel/wowthunk.c +++ b/dlls/kernel/wowthunk.c @@ -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; diff --git a/dlls/user/mouse.c b/dlls/user/mouse.c index a3e3b0342e2..c7b2b241ff6 100644 --- a/dlls/user/mouse.c +++ b/dlls/user/mouse.c @@ -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 ) diff --git a/if1632/relay.c b/if1632/relay.c index fe82f3acfa7..c2d770a2699 100644 --- a/if1632/relay.c +++ b/if1632/relay.c @@ -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 diff --git a/include/builtin16.h b/include/builtin16.h index f939fe821b8..aebc0cffba0 100644 --- a/include/builtin16.h +++ b/include/builtin16.h @@ -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 diff --git a/include/wine/winbase16.h b/include/wine/winbase16.h index ff0f39e5edf..6bc2aa159f9 100644 --- a/include/wine/winbase16.h +++ b/include/wine/winbase16.h @@ -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 */ diff --git a/loader/ne/module.c b/loader/ne/module.c index 4111aa832e5..bae492cece7 100644 --- a/loader/ne/module.c +++ b/loader/ne/module.c @@ -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) ); } diff --git a/loader/ne/segment.c b/loader/ne/segment.c index 9953ee055ef..a50664cb74e 100644 --- a/loader/ne/segment.c +++ b/loader/ne/segment.c @@ -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 ); } } diff --git a/misc/system.c b/misc/system.c index 82473e325d0..d0a1675f20d 100644 --- a/misc/system.c +++ b/misc/system.c @@ -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 ) diff --git a/msdos/dpmi.c b/msdos/dpmi.c index a8a75a690de..abaefe62a13 100644 --- a/msdos/dpmi.c +++ b/msdos/dpmi.c @@ -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... */ diff --git a/scheduler/thread.c b/scheduler/thread.c index bdd94432579..603101fee27 100644 --- a/scheduler/thread.c +++ b/scheduler/thread.c @@ -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, diff --git a/tools/winebuild/relay.c b/tools/winebuild/relay.c index 70eba96a50a..37f5f0a8fd9 100644 --- a/tools/winebuild/relay.c +++ b/tools/winebuild/relay.c @@ -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 ); diff --git a/tools/winebuild/spec16.c b/tools/winebuild/spec16.c index 8586473d401..25637019668 100644 --- a/tools/winebuild/spec16.c +++ b/tools/winebuild/spec16.c @@ -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 */ diff --git a/windows/keyboard.c b/windows/keyboard.c index 09b38b5cf8c..0de75822866 100644 --- a/windows/keyboard.c +++ b/windows/keyboard.c @@ -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 ) diff --git a/windows/winproc.c b/windows/winproc.c index 07b3069d324..5967fc06b18 100644 --- a/windows/winproc.c +++ b/windows/winproc.c @@ -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 );