From f752be843eb945d6be1b76ec51fe04d8b2c28b6f Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 4 Dec 2003 05:51:01 +0000 Subject: [PATCH] Implement some more register functions using DEFINE_REGS_ENTRYPOINT to make them available for imports. --- dlls/msvcrt/cppexcept.c | 7 ++++--- dlls/msvcrt/except.c | 3 +++ dlls/msvcrt/msvcrt.spec | 8 ++++---- dlls/msvcrtd/msvcrtd.spec | 8 ++++---- dlls/ntdll/ntdll.spec | 4 ++-- dlls/ntdll/rtl.c | 7 +++++++ 6 files changed, 24 insertions(+), 13 deletions(-) diff --git a/dlls/msvcrt/cppexcept.c b/dlls/msvcrt/cppexcept.c index cfbb7cdba7c..ed41ede06a1 100644 --- a/dlls/msvcrt/cppexcept.c +++ b/dlls/msvcrt/cppexcept.c @@ -384,14 +384,15 @@ static DWORD cxx_frame_handler( PEXCEPTION_RECORD rec, cxx_exception_frame* fram /********************************************************************* * __CxxFrameHandler (MSVCRT.@) */ -void __CxxFrameHandler( PEXCEPTION_RECORD rec, EXCEPTION_REGISTRATION_RECORD* frame, - PCONTEXT exc_context, EXCEPTION_REGISTRATION_RECORD** dispatch, - CONTEXT86 *context ) +void MSVCRT__CxxFrameHandler( PEXCEPTION_RECORD rec, EXCEPTION_REGISTRATION_RECORD* frame, + PCONTEXT exc_context, EXCEPTION_REGISTRATION_RECORD** dispatch, + CONTEXT86 *context ) { cxx_function_descr *descr = (cxx_function_descr *)context->Eax; context->Eax = cxx_frame_handler( rec, (cxx_exception_frame *)frame, exc_context, dispatch, descr, NULL, 0, context ); } +DEFINE_REGS_ENTRYPOINT( __CxxFrameHandler, MSVCRT__CxxFrameHandler, 16, 0 ); #endif /* __i386__ */ diff --git a/dlls/msvcrt/except.c b/dlls/msvcrt/except.c index 045af5e5c34..7ada266cba2 100644 --- a/dlls/msvcrt/except.c +++ b/dlls/msvcrt/except.c @@ -280,6 +280,7 @@ typedef void (*MSVCRT_unwind_function)(const void*); /******************************************************************* * _setjmp (MSVCRT.@) */ +DEFINE_REGS_ENTRYPOINT( MSVCRT__setjmp, _MSVCRT__setjmp, 4, 0 ); void _MSVCRT__setjmp(_JUMP_BUFFER *jmp, CONTEXT86* context) { TRACE("(%p)\n",jmp); @@ -301,6 +302,7 @@ void _MSVCRT__setjmp(_JUMP_BUFFER *jmp, CONTEXT86* context) /******************************************************************* * _setjmp3 (MSVCRT.@) */ +DEFINE_REGS_ENTRYPOINT( MSVCRT__setjmp3, _MSVCRT__setjmp3, 8, 0 ); void _MSVCRT__setjmp3(_JUMP_BUFFER *jmp, int nb_args, CONTEXT86* context) { TRACE("(%p,%d)\n",jmp,nb_args); @@ -337,6 +339,7 @@ void _MSVCRT__setjmp3(_JUMP_BUFFER *jmp, int nb_args, CONTEXT86* context) /********************************************************************* * longjmp (MSVCRT.@) */ +DEFINE_REGS_ENTRYPOINT( MSVCRT_longjmp, _MSVCRT_longjmp, 8, 0 ); void _MSVCRT_longjmp(_JUMP_BUFFER *jmp, int retval, CONTEXT86* context) { unsigned long cur_frame = 0; diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index c1b7644d13a..03fd344c6e7 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -75,7 +75,7 @@ @ extern _HUGE MSVCRT__HUGE @ cdecl _Strftime(str long str ptr ptr) @ cdecl _XcptFilter(long ptr) -@ cdecl -register -i386 __CxxFrameHandler(ptr ptr ptr ptr) +@ cdecl -i386 __CxxFrameHandler(ptr ptr ptr ptr) @ stub __CxxLongjmpUnwind #(ptr) stdcall @ cdecl __RTCastToVoid(ptr) MSVCRT___RTCastToVoid @ cdecl __RTDynamicCast(ptr long ptr ptr long) MSVCRT___RTDynamicCast @@ -426,8 +426,8 @@ @ stdcall _set_error_mode(long) @ stub _set_sbh_threshold #(long) @ stub _seterrormode #(long) -@ cdecl -register -i386 _setjmp(ptr) _MSVCRT__setjmp -@ cdecl -register -i386 _setjmp3(ptr long) _MSVCRT__setjmp3 +@ cdecl -i386 _setjmp(ptr) MSVCRT__setjmp +@ cdecl -i386 _setjmp3(ptr long) MSVCRT__setjmp3 @ stub _setmaxstdio #(long) @ cdecl _setmbcp(long) @ cdecl _setmode(long long) @@ -659,7 +659,7 @@ @ cdecl localtime(ptr) @ cdecl log(double) @ cdecl log10(double) -@ cdecl -register -i386 longjmp(ptr long) _MSVCRT_longjmp +@ cdecl -i386 longjmp(ptr long) MSVCRT_longjmp @ cdecl malloc(long) MSVCRT_malloc @ cdecl mblen(ptr long) MSVCRT_mblen @ cdecl mbstowcs(ptr str long) ntdll.mbstowcs diff --git a/dlls/msvcrtd/msvcrtd.spec b/dlls/msvcrtd/msvcrtd.spec index 124ad1b9d74..f62dcd8916d 100644 --- a/dlls/msvcrtd/msvcrtd.spec +++ b/dlls/msvcrtd/msvcrtd.spec @@ -94,7 +94,7 @@ @ extern _HUGE msvcrt._HUGE @ cdecl _Strftime(str long str ptr ptr) msvcrt._Strftime @ cdecl _XcptFilter(long ptr) msvcrt._XcptFilter -@ cdecl -register -i386 __CxxFrameHandler(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler +@ cdecl -i386 __CxxFrameHandler(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler @ stub __CxxLongjmpUnwind #(ptr) stdcall @ cdecl __RTCastToVoid(ptr) msvcrt.__RTCastToVoid @ cdecl __RTDynamicCast(ptr long ptr ptr long) msvcrt.__RTDynamicCast @@ -456,8 +456,8 @@ @ stub _set_error_mode #(long) @ stub _set_sbh_threshold #(long) @ stub _seterrormode #(long) -@ cdecl -register -i386 _setjmp(ptr) msvcrt._setjmp -@ cdecl -register -i386 _setjmp3(ptr long) msvcrt._setjmp3 +@ cdecl -i386 _setjmp(ptr) msvcrt._setjmp +@ cdecl -i386 _setjmp3(ptr long) msvcrt._setjmp3 @ stub _setmaxstdio #(long) @ cdecl _setmbcp(long) msvcrt._setmbcp @ cdecl _setmode(long long) msvcrt._setmode @@ -689,7 +689,7 @@ @ cdecl localtime(ptr) @ cdecl log(double) @ cdecl log10(double) -@ cdecl -register -i386 longjmp(ptr long) msvcrt.longjmp +@ cdecl -i386 longjmp(ptr long) msvcrt.longjmp @ cdecl malloc(long) msvcrt.malloc @ cdecl mblen(ptr long) msvcrt.mblen @ cdecl mbstowcs(ptr str long) ntdll.mbstowcs diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index 538ecd1088a..c09f3079636 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -904,12 +904,12 @@ @ stub __eGetStatusWord @ stdcall -ret64 _alldiv(long long long long) @ stdcall -ret64 _allmul(long long long long) -@ stdcall -register -i386 _alloca_probe() NTDLL_alloca_probe +@ stdcall -i386 _alloca_probe() @ stdcall -ret64 _allrem(long long long long) @ cdecl -ret64 _atoi64(str) @ stdcall -ret64 _aulldiv(long long long long) @ stdcall -ret64 _aullrem(long long long long) -@ stdcall -register -i386 _chkstk() NTDLL_chkstk +@ stdcall -i386 _chkstk() @ stub _fltused @ cdecl -ret64 _ftol() NTDLL__ftol @ cdecl _i64toa(long long ptr long) diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c index 1023187109a..4e99d712132 100644 --- a/dlls/ntdll/rtl.c +++ b/dlls/ntdll/rtl.c @@ -354,20 +354,27 @@ BOOLEAN WINAPI RtlGetNtProductType(LPDWORD type) * * Glorified "enter xxxx". */ +#ifdef __i386__ void WINAPI NTDLL_chkstk( CONTEXT86 *context ) { context->Esp -= context->Eax; } +DEFINE_REGS_ENTRYPOINT( _chkstk, NTDLL_chkstk, 0, 0 ); +#endif /************************************************************************** * _alloca_probe [NTDLL.@] * * Glorified "enter xxxx". */ +#ifdef __i386__ void WINAPI NTDLL_alloca_probe( CONTEXT86 *context ) { context->Esp -= context->Eax; } +DEFINE_REGS_ENTRYPOINT( _alloca_probe, NTDLL_alloca_probe, 0, 0 ); +#endif + /****************************************************************************** * RtlInitializeGenericTable [NTDLL.@]