Module: wine Branch: master Commit: c306c527e708df33a67d31667be75adcbcbc7d7e URL: https://source.winehq.org/git/wine.git/?a=commit;h=c306c527e708df33a67d31667...
Author: Piotr Caban piotr@codeweavers.com Date: Fri Aug 27 13:48:09 2021 +0200
msvcrt: Fix _CxxThrowException prototype.
Signed-off-by: Piotr Caban piotr@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/msvcp60/msvcp.h | 2 +- dlls/msvcp90/exception.c | 14 +++++++------- dlls/msvcp90/msvcp90.h | 2 +- dlls/msvcrt/concurrency.c | 2 +- dlls/msvcrt/cpp.c | 11 ++--------- dlls/msvcrt/cppexcept.h | 2 +- 6 files changed, 13 insertions(+), 20 deletions(-)
diff --git a/dlls/msvcp60/msvcp.h b/dlls/msvcp60/msvcp.h index 1f53a31ad97..53b98f4c449 100644 --- a/dlls/msvcp60/msvcp.h +++ b/dlls/msvcp60/msvcp.h @@ -484,5 +484,5 @@ typedef struct { double imag; } complex_double;
-void WINAPI DECLSPEC_NORETURN _CxxThrowException(exception*,const cxx_exception_type*); +void WINAPI DECLSPEC_NORETURN _CxxThrowException(void*,const cxx_exception_type*); void __cdecl DECLSPEC_NORETURN _Xmem(void); diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c index 115e0374f7f..748e0ccce3b 100644 --- a/dlls/msvcp90/exception.c +++ b/dlls/msvcp90/exception.c @@ -1064,37 +1064,37 @@ void throw_exception(exception_type et, const char *str) case EXCEPTION_LOGIC_ERROR: { logic_error e; MSVCP_logic_error_ctor(&e, name); - _CxxThrowException((exception*)&e, &logic_error_cxx_type); + _CxxThrowException(&e, &logic_error_cxx_type); } case EXCEPTION_LENGTH_ERROR: { length_error e; MSVCP_length_error_ctor(&e, name); - _CxxThrowException((exception*)&e, &length_error_cxx_type); + _CxxThrowException(&e, &length_error_cxx_type); } case EXCEPTION_OUT_OF_RANGE: { out_of_range e; MSVCP_out_of_range_ctor(&e, name); - _CxxThrowException((exception*)&e, &out_of_range_cxx_type); + _CxxThrowException(&e, &out_of_range_cxx_type); } case EXCEPTION_INVALID_ARGUMENT: { invalid_argument e; MSVCP_invalid_argument_ctor(&e, name); - _CxxThrowException((exception*)&e, &invalid_argument_cxx_type); + _CxxThrowException(&e, &invalid_argument_cxx_type); } case EXCEPTION_RUNTIME_ERROR: { runtime_error e; MSVCP_runtime_error_ctor(&e, name); - _CxxThrowException((exception*)&e, &runtime_error_cxx_type); + _CxxThrowException(&e, &runtime_error_cxx_type); } case EXCEPTION_FAILURE: { failure e; MSVCP_failure_ctor(&e, name); - _CxxThrowException((exception*)&e, &failure_cxx_type); + _CxxThrowException(&e, &failure_cxx_type); } case EXCEPTION_RANGE_ERROR: { range_error e; MSVCP_range_error_ctor(&e, name); - _CxxThrowException((exception*)&e, &range_error_cxx_type); + _CxxThrowException(&e, &range_error_cxx_type); } } } diff --git a/dlls/msvcp90/msvcp90.h b/dlls/msvcp90/msvcp90.h index 0ef02b96ea8..9954eb9c777 100644 --- a/dlls/msvcp90/msvcp90.h +++ b/dlls/msvcp90/msvcp90.h @@ -663,5 +663,5 @@ static inline int mbstowcs_wrapper( size_t *ret, wchar_t *wcs, size_t size, cons #define hypotf( x, y ) ((float)hypot( (double)(x), (double)(y) )) #endif
-void WINAPI DECLSPEC_NORETURN _CxxThrowException(exception*,const cxx_exception_type*); +void WINAPI DECLSPEC_NORETURN _CxxThrowException(void*,const cxx_exception_type*); void __cdecl DECLSPEC_NORETURN _Xmem(void); diff --git a/dlls/msvcrt/concurrency.c b/dlls/msvcrt/concurrency.c index 5910e4d6c03..932ed52eb93 100644 --- a/dlls/msvcrt/concurrency.c +++ b/dlls/msvcrt/concurrency.c @@ -620,7 +620,7 @@ static Context* get_current_context(void) scheduler_resource_allocation_error e; scheduler_resource_allocation_error_ctor_name(&e, NULL, HRESULT_FROM_WIN32(GetLastError())); - _CxxThrowException(&e.e, &scheduler_resource_allocation_error_exception_type); + _CxxThrowException(&e, &scheduler_resource_allocation_error_exception_type); }
if(InterlockedCompareExchange(&context_tls_index, tls_index, TLS_OUT_OF_INDEXES) != TLS_OUT_OF_INDEXES) diff --git a/dlls/msvcrt/cpp.c b/dlls/msvcrt/cpp.c index 72abcfe055f..6617237b055 100644 --- a/dlls/msvcrt/cpp.c +++ b/dlls/msvcrt/cpp.c @@ -755,7 +755,6 @@ const type_info* CDECL __RTtypeid(void *cppobj) bad_typeid e; bad_typeid_ctor( &e, "Attempted a typeid of NULL pointer!" ); _CxxThrowException( &e, &bad_typeid_exception_type ); - return NULL; }
__TRY @@ -768,7 +767,6 @@ const type_info* CDECL __RTtypeid(void *cppobj) __non_rtti_object e; __non_rtti_object_ctor( &e, "Bad read pointer - no RTTI data!" ); _CxxThrowException( &e, &__non_rtti_object_exception_type ); - return NULL; } __ENDTRY return ret; @@ -785,7 +783,6 @@ const type_info* CDECL __RTtypeid(void *cppobj) bad_typeid e; bad_typeid_ctor( &e, "Attempted a typeid of NULL pointer!" ); _CxxThrowException( &e, &bad_typeid_exception_type ); - return NULL; }
__TRY @@ -805,7 +802,6 @@ const type_info* CDECL __RTtypeid(void *cppobj) __non_rtti_object e; __non_rtti_object_ctor( &e, "Bad read pointer - no RTTI data!" ); _CxxThrowException( &e, &__non_rtti_object_exception_type ); - return NULL; } __ENDTRY return ret; @@ -892,7 +888,6 @@ void* CDECL __RTDynamicCast(void *cppobj, int unknown, __non_rtti_object e; __non_rtti_object_ctor( &e, "Access violation - no RTTI data!" ); _CxxThrowException( &e, &__non_rtti_object_exception_type ); - return NULL; } __ENDTRY return ret; @@ -955,7 +950,6 @@ void* CDECL __RTDynamicCast(void *cppobj, int unknown, __non_rtti_object e; __non_rtti_object_ctor( &e, "Access violation - no RTTI data!" ); _CxxThrowException( &e, &__non_rtti_object_exception_type ); - return NULL; } __ENDTRY return ret; @@ -995,7 +989,6 @@ void* CDECL __RTCastToVoid(void *cppobj) __non_rtti_object e; __non_rtti_object_ctor( &e, "Access violation - no RTTI data!" ); _CxxThrowException( &e, &__non_rtti_object_exception_type ); - return NULL; } __ENDTRY return ret; @@ -1006,7 +999,7 @@ void* CDECL __RTCastToVoid(void *cppobj) * _CxxThrowException (MSVCRT.@) */ #ifndef __x86_64__ -void WINAPI _CxxThrowException( exception *object, const cxx_exception_type *type ) +void WINAPI _CxxThrowException( void *object, const cxx_exception_type *type ) { ULONG_PTR args[3];
@@ -1016,7 +1009,7 @@ void WINAPI _CxxThrowException( exception *object, const cxx_exception_type *typ RaiseException( CXX_EXCEPTION, EH_NONCONTINUABLE, 3, args ); } #else -void WINAPI _CxxThrowException( exception *object, const cxx_exception_type *type ) +void WINAPI _CxxThrowException( void *object, const cxx_exception_type *type ) { ULONG_PTR args[4];
diff --git a/dlls/msvcrt/cppexcept.h b/dlls/msvcrt/cppexcept.h index f6593d87607..e192eafaafd 100644 --- a/dlls/msvcrt/cppexcept.h +++ b/dlls/msvcrt/cppexcept.h @@ -125,7 +125,7 @@ typedef struct } cxx_exception_type; #endif
-void WINAPI _CxxThrowException(exception*,const cxx_exception_type*); +void WINAPI _CxxThrowException(void*,const cxx_exception_type*); int CDECL _XcptFilter(NTSTATUS, PEXCEPTION_POINTERS);
static inline const char *dbgstr_type_info( const type_info *info )