Module: wine Branch: master Commit: a794b0224e27f91bf0855cd7376d6af3de44523d URL: https://gitlab.winehq.org/wine/wine/-/commit/a794b0224e27f91bf0855cd7376d6af...
Author: Alexandre Julliard julliard@winehq.org Date: Wed May 22 13:50:39 2024 +0200
msvcrt: Use RVAs in rtti and exception data on all platforms except i386.
---
dlls/concrt140/concrt140.c | 2 +- dlls/concrt140/details.c | 2 +- dlls/msvcr90/tests/msvcr90.c | 10 +++++----- dlls/msvcrt/concurrency.c | 2 +- dlls/msvcrt/cpp.c | 2 +- dlls/msvcrt/cxx.h | 2 +- dlls/msvcrt/msvcrt.h | 3 +-- dlls/msvcrt/tests/cpp.c | 4 ++-- 8 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/dlls/concrt140/concrt140.c b/dlls/concrt140/concrt140.c index 72d8da0dd62..75b4ae24581 100644 --- a/dlls/concrt140/concrt140.c +++ b/dlls/concrt140/concrt140.c @@ -140,7 +140,7 @@ BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) { case DLL_PROCESS_ATTACH: if (!init_cxx_funcs()) return FALSE; -#ifdef __x86_64__ +#ifdef RTTI_USE_RVA init_exception_rtti((char*)inst); init_range_error_rtti((char*)inst); init_runtime_error_rtti((char*)inst); diff --git a/dlls/concrt140/details.c b/dlls/concrt140/details.c index 978a7a8f96e..a8e7478b9a6 100644 --- a/dlls/concrt140/details.c +++ b/dlls/concrt140/details.c @@ -1100,7 +1100,7 @@ __ASM_BLOCK_END
void init_concurrency_details(void *base) { -#ifdef __x86_64__ +#ifdef RTTI_USE_RVA init__Concurrent_queue_base_v4_rtti(base); init__Runtime_object_rtti(base); #endif diff --git a/dlls/msvcr90/tests/msvcr90.c b/dlls/msvcr90/tests/msvcr90.c index 0b274fd694f..6a584d81b04 100644 --- a/dlls/msvcr90/tests/msvcr90.c +++ b/dlls/msvcr90/tests/msvcr90.c @@ -234,7 +234,7 @@ typedef struct typedef void (*cxx_copy_ctor)(void);
/* complete information about a C++ type */ -#ifndef __x86_64__ +#ifdef __i386__ typedef struct __cxx_type_info { UINT flags; /* flags (see CLASS_* flags below) */ @@ -255,7 +255,7 @@ typedef struct __cxx_type_info #endif
/* table of C++ types that apply for a given object */ -#ifndef __x86_64__ +#ifdef __i386__ typedef struct __cxx_type_info_table { UINT count; /* number of types */ @@ -270,7 +270,7 @@ typedef struct __cxx_type_info_table #endif
/* type information for an exception object */ -#ifndef __x86_64__ +#ifdef __i386__ typedef struct __cxx_exception_type { UINT flags; /* TYPE_FLAG flags */ @@ -1489,7 +1489,7 @@ static void test_access_s(void) ok(errno == ENOENT, "got %x\n", res); }
-#ifndef __x86_64__ +#ifdef __i386__ #define EXCEPTION_REF(instance, name) &instance.name #else #define EXCEPTION_REF(instance, name) FIELD_OFFSET(struct _exception_data, name) @@ -1521,7 +1521,7 @@ static void test_is_exception_typeof(void)
int ret;
-#ifdef __x86_64__ +#ifndef __i386__ rec.NumberParameters = 4; rec.ExceptionInformation[3] = (ULONG_PTR)&exception_data; #endif diff --git a/dlls/msvcrt/concurrency.c b/dlls/msvcrt/concurrency.c index f075c685326..39059d66b38 100644 --- a/dlls/msvcrt/concurrency.c +++ b/dlls/msvcrt/concurrency.c @@ -3775,7 +3775,7 @@ __ASM_BLOCK_END
void msvcrt_init_concurrency(void *base) { -#ifdef __x86_64__ +#ifdef RTTI_USE_RVA init_cexception_rtti(base); init_improper_lock_rtti(base); init_improper_scheduler_attach_rtti(base); diff --git a/dlls/msvcrt/cpp.c b/dlls/msvcrt/cpp.c index 7e0d3f69396..2db4ef32e99 100644 --- a/dlls/msvcrt/cpp.c +++ b/dlls/msvcrt/cpp.c @@ -573,7 +573,7 @@ DEFINE_CXX_DATA1( bad_alloc, &exception_cxx_type_info, bad_alloc_dtor )
void msvcrt_init_exception(void *base) { -#ifdef __x86_64__ +#ifdef RTTI_USE_RVA init_type_info_rtti(base); init_exception_rtti(base); #if _MSVCR_VER >= 80 diff --git a/dlls/msvcrt/cxx.h b/dlls/msvcrt/cxx.h index c0b43f78256..8037d7def56 100644 --- a/dlls/msvcrt/cxx.h +++ b/dlls/msvcrt/cxx.h @@ -21,7 +21,7 @@ #include "rtlsupportapi.h" #include "wine/asm.h"
-#ifndef __x86_64__ +#ifdef __i386__ #undef RTTI_USE_RVA #else #define RTTI_USE_RVA 1 diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index fe626e2e79f..dd7fb5895a0 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -117,11 +117,10 @@ BOOL __cdecl __CxxRegisterExceptionObject(EXCEPTION_POINTERS*, cxx_frame_info*); void __cdecl __CxxUnregisterExceptionObject(cxx_frame_info*, BOOL); void CDECL __DestructExceptionObject(EXCEPTION_RECORD*);
-#if defined(__x86_64__) && _MSVCR_VER>=140 void** __cdecl __current_exception(void); int* __cdecl __processing_throw(void); -void __cdecl terminate(void);
+#if defined(__x86_64__) && _MSVCR_VER>=140 BOOL msvcrt_init_handler4(void); void msvcrt_attach_handler4(void); void msvcrt_free_handler4(void); diff --git a/dlls/msvcrt/tests/cpp.c b/dlls/msvcrt/tests/cpp.c index 29bb126bcda..bfc092e0591 100644 --- a/dlls/msvcrt/tests/cpp.c +++ b/dlls/msvcrt/tests/cpp.c @@ -869,7 +869,7 @@ static inline void/*rtti_object_locator*/ *get_obj_locator( void *cppobj ) return (void *)vtable[-1]; }
-#ifndef __x86_64__ +#ifdef __i386__ #define DEFINE_RTTI_REF(type, name) type *name #define RTTI_REF(instance, name) &instance.name #define RTTI_REF_SIG0(instance, name, base) RTTI_REF(instance, name) @@ -970,7 +970,7 @@ static void test_rtti(void) exception e,b; void *casted; BOOL old_signature; -#ifdef __x86_64__ +#ifndef __i386__ char *base = (char*)GetModuleHandleW(NULL); #endif