[PATCH v4 0/1] MR2554: msvcp110: semi-stub _Rethrow_future_exception
https://bugs.winehq.org/show_bug.cgi?id=54110 -- v4: msvcp110: Add std::_Rethrow_future_exception implementation. https://gitlab.winehq.org/wine/wine/-/merge_requests/2554
From: Vijay Kiran Kamuju <infyquest(a)gmail.com> --- dlls/msvcp110/msvcp110.spec | 2 +- dlls/msvcp120/msvcp120.spec | 2 +- dlls/msvcp120_app/msvcp120_app.spec | 2 +- dlls/msvcp140/msvcp140.spec | 2 +- dlls/msvcp90/exception.c | 53 ++++++++++++++++++----------- dlls/msvcp_win/msvcp_win.spec | 2 +- 6 files changed, 38 insertions(+), 25 deletions(-) diff --git a/dlls/msvcp110/msvcp110.spec b/dlls/msvcp110/msvcp110.spec index 2de95bf94ef..074ca946b19 100644 --- a/dlls/msvcp110/msvcp110.spec +++ b/dlls/msvcp110/msvcp110.spec @@ -1732,7 +1732,7 @@ @ cdecl -arch=win64 ?_Rep@?$num_put(a)GV?$ostreambuf_iterator(a)GU?$char_traits(a)G@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator(a)GU?$char_traits(a)G@std@@@2(a)V32@G_K(a)Z(ptr ptr ptr long long) num_put_wchar__Rep @ cdecl -arch=win32 ?_Rep@?$num_put(a)_WV?$ostreambuf_iterator(a)_WU?$char_traits(a)_W@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator(a)_WU?$char_traits(a)_W@std@@@2(a)V32@_WI(a)Z(ptr ptr long ptr long long) num_put_wchar__Rep @ cdecl -arch=win64 ?_Rep@?$num_put(a)_WV?$ostreambuf_iterator(a)_WU?$char_traits(a)_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator(a)_WU?$char_traits(a)_W@std@@@2(a)V32@_W_K(a)Z(ptr ptr ptr long long) num_put_wchar__Rep -@ stub ?_Rethrow_future_exception(a)std@@YAXVexception_ptr(a)1@@Z +@ cdecl -norelay ?_Rethrow_future_exception(a)std@@YAXVexception_ptr(a)1@@Z() _Rethrow_future_exception @ stub -arch=win32 ?_Rng_abort(a)std@@YAXPBD(a)Z @ stub -arch=win64 ?_Rng_abort(a)std@@YAXPEBD(a)Z @ cdecl -arch=win32 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KAII(a)Z(long) _vector_base_v4__Segment_index_of diff --git a/dlls/msvcp120/msvcp120.spec b/dlls/msvcp120/msvcp120.spec index e0adc83113f..0d2a5fe0fca 100644 --- a/dlls/msvcp120/msvcp120.spec +++ b/dlls/msvcp120/msvcp120.spec @@ -1693,7 +1693,7 @@ @ cdecl -arch=win64 ?_Rep@?$num_put(a)GV?$ostreambuf_iterator(a)GU?$char_traits(a)G@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator(a)GU?$char_traits(a)G@std@@@2(a)V32@G_K(a)Z(ptr ptr ptr long long) num_put_wchar__Rep @ cdecl -arch=win32 ?_Rep@?$num_put(a)_WV?$ostreambuf_iterator(a)_WU?$char_traits(a)_W@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator(a)_WU?$char_traits(a)_W@std@@@2(a)V32@_WI(a)Z(ptr ptr long ptr long long) num_put_wchar__Rep @ cdecl -arch=win64 ?_Rep@?$num_put(a)_WV?$ostreambuf_iterator(a)_WU?$char_traits(a)_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator(a)_WU?$char_traits(a)_W@std@@@2(a)V32@_W_K(a)Z(ptr ptr ptr long long) num_put_wchar__Rep -@ stub ?_Rethrow_future_exception(a)std@@YAXVexception_ptr(a)1@@Z +@ cdecl -norelay ?_Rethrow_future_exception(a)std@@YAXVexception_ptr(a)1@@Z() _Rethrow_future_exception @ stub -arch=win32 ?_Rng_abort(a)std@@YAXPBD(a)Z @ stub -arch=win64 ?_Rng_abort(a)std@@YAXPEBD(a)Z @ cdecl -arch=win32 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KAII(a)Z(long) _vector_base_v4__Segment_index_of diff --git a/dlls/msvcp120_app/msvcp120_app.spec b/dlls/msvcp120_app/msvcp120_app.spec index dd8e3ebf173..d11ba788898 100644 --- a/dlls/msvcp120_app/msvcp120_app.spec +++ b/dlls/msvcp120_app/msvcp120_app.spec @@ -1693,7 +1693,7 @@ @ cdecl -arch=win64 ?_Rep@?$num_put(a)GV?$ostreambuf_iterator(a)GU?$char_traits(a)G@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator(a)GU?$char_traits(a)G@std@@@2(a)V32@G_K(a)Z(ptr ptr ptr long long) msvcp120.?_Rep@?$num_put(a)GV?$ostreambuf_iterator(a)GU?$char_traits(a)G@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator(a)GU?$char_traits(a)G@std@@@2(a)V32@G_K(a)Z @ cdecl -arch=win32 ?_Rep@?$num_put(a)_WV?$ostreambuf_iterator(a)_WU?$char_traits(a)_W@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator(a)_WU?$char_traits(a)_W@std@@@2(a)V32@_WI(a)Z(ptr ptr long ptr long long) msvcp120.?_Rep@?$num_put(a)_WV?$ostreambuf_iterator(a)_WU?$char_traits(a)_W@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator(a)_WU?$char_traits(a)_W@std@@@2(a)V32@_WI(a)Z @ cdecl -arch=win64 ?_Rep@?$num_put(a)_WV?$ostreambuf_iterator(a)_WU?$char_traits(a)_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator(a)_WU?$char_traits(a)_W@std@@@2(a)V32@_W_K(a)Z(ptr ptr ptr long long) msvcp120.?_Rep@?$num_put(a)_WV?$ostreambuf_iterator(a)_WU?$char_traits(a)_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator(a)_WU?$char_traits(a)_W@std@@@2(a)V32@_W_K(a)Z -@ stub ?_Rethrow_future_exception(a)std@@YAXVexception_ptr(a)1@@Z +@ cdecl -norelay ?_Rethrow_future_exception(a)std@@YAXVexception_ptr(a)1@@Z() msvcp120.?_Rethrow_future_exception(a)std@@YAXVexception_ptr(a)1@@Z @ stub -arch=win32 ?_Rng_abort(a)std@@YAXPBD(a)Z @ stub -arch=win64 ?_Rng_abort(a)std@@YAXPEBD(a)Z @ cdecl -arch=win32 ?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KAII(a)Z(long) msvcp120.?_Segment_index_of(a)_Concurrent_vector_base_v4@details(a)Concurrency@@KAII(a)Z diff --git a/dlls/msvcp140/msvcp140.spec b/dlls/msvcp140/msvcp140.spec index dd619c637e1..8e57b828182 100644 --- a/dlls/msvcp140/msvcp140.spec +++ b/dlls/msvcp140/msvcp140.spec @@ -1595,7 +1595,7 @@ @ cdecl -arch=arm ?_Reset(a)_ContextCallback@details(a)Concurrency@@AAAXXZ(ptr) _ContextCallback__Reset @ thiscall -arch=i386 ?_Reset(a)_ContextCallback@details(a)Concurrency@@AAEXXZ(ptr) _ContextCallback__Reset @ cdecl -arch=win64 ?_Reset(a)_ContextCallback@details(a)Concurrency@@AEAAXXZ(ptr) _ContextCallback__Reset -@ stub ?_Rethrow_future_exception(a)std@@YAXVexception_ptr(a)1@@Z +@ cdecl -norelay ?_Rethrow_future_exception(a)std@@YAXVexception_ptr(a)1@@Z() _Rethrow_future_exception @ stub -arch=win32 ?_Rng_abort(a)std@@YAXPBD(a)Z @ stub -arch=win64 ?_Rng_abort(a)std@@YAXPEBD(a)Z @ cdecl -arch=win32 ?_Schedule_chore(a)details@Concurrency@@YAHPAU_Threadpool_chore(a)12@@Z(ptr) _Schedule_chore diff --git a/dlls/msvcp90/exception.c b/dlls/msvcp90/exception.c index 8ceaa91e884..66a5061a4f0 100644 --- a/dlls/msvcp90/exception.c +++ b/dlls/msvcp90/exception.c @@ -947,6 +947,38 @@ bool __cdecl MSVCP__uncaught_exception(void) return __uncaught_exception(); } +#if _MSVCP_VER >= 110 +typedef struct +{ + EXCEPTION_RECORD *rec; + LONG *ref; /* not binary compatible with native */ +} exception_ptr; + +static void exception_ptr_rethrow(const exception_ptr *ep) +{ + TRACE("(%p)\n", ep); + + if (!ep->rec) + { + static const char *exception_msg = "bad exception"; + exception e; + + MSVCP_exception_ctor(&e, &exception_msg); + _CxxThrowException(&e, &exception_cxx_type); + return; + } + + RaiseException(ep->rec->ExceptionCode, ep->rec->ExceptionFlags & (~EH_UNWINDING), + ep->rec->NumberParameters, ep->rec->ExceptionInformation); +} + +/* ?_Rethrow_future_exception(a)std@@YAXVexception_ptr(a)1@@Z */ +void __cdecl _Rethrow_future_exception(const exception_ptr ep) +{ + exception_ptr_rethrow(&ep); +} +#endif + #if _MSVCP_VER >= 140 void** CDECL __current_exception(void); @@ -1002,12 +1034,6 @@ int __cdecl __uncaught_exceptions(void) return *__processing_throw(); } -typedef struct -{ - EXCEPTION_RECORD *rec; - LONG *ref; /* not binary compatible with native */ -} exception_ptr; - /********************************************************************* * ?__ExceptionPtrCreate@@YAXPAX(a)Z * ?__ExceptionPtrCreate@@YAXPEAX(a)Z @@ -1102,20 +1128,7 @@ void __cdecl __ExceptionPtrAssign(exception_ptr *ep, const exception_ptr *assign */ void __cdecl __ExceptionPtrRethrow(const exception_ptr *ep) { - TRACE("(%p)\n", ep); - - if (!ep->rec) - { - static const char *exception_msg = "bad exception"; - exception e; - - MSVCP_exception_ctor(&e, &exception_msg); - _CxxThrowException(&e, &exception_cxx_type); - return; - } - - RaiseException(ep->rec->ExceptionCode, ep->rec->ExceptionFlags & (~EH_UNWINDING), - ep->rec->NumberParameters, ep->rec->ExceptionInformation); + exception_ptr_rethrow(ep); } /********************************************************************* diff --git a/dlls/msvcp_win/msvcp_win.spec b/dlls/msvcp_win/msvcp_win.spec index d2fae9f1e14..0e05582e251 100644 --- a/dlls/msvcp_win/msvcp_win.spec +++ b/dlls/msvcp_win/msvcp_win.spec @@ -1595,7 +1595,7 @@ @ cdecl -arch=arm ?_Reset(a)_ContextCallback@details(a)Concurrency@@AAAXXZ(ptr) msvcp140.?_Reset(a)_ContextCallback@details(a)Concurrency@@AAAXXZ @ thiscall -arch=i386 ?_Reset(a)_ContextCallback@details(a)Concurrency@@AAEXXZ(ptr) msvcp140.?_Reset(a)_ContextCallback@details(a)Concurrency@@AAEXXZ @ cdecl -arch=win64 ?_Reset(a)_ContextCallback@details(a)Concurrency@@AEAAXXZ(ptr) msvcp140.?_Reset(a)_ContextCallback@details(a)Concurrency@@AEAAXXZ -@ stub ?_Rethrow_future_exception(a)std@@YAXVexception_ptr(a)1@@Z +@ cdecl -norelay ?_Rethrow_future_exception(a)std@@YAXVexception_ptr(a)1@@Z() msvcp140.?_Rethrow_future_exception(a)std@@YAXVexception_ptr(a)1@@Z @ stub -arch=win32 ?_Rng_abort(a)std@@YAXPBD(a)Z @ stub -arch=win64 ?_Rng_abort(a)std@@YAXPEBD(a)Z @ cdecl -arch=win32 ?_Schedule_chore(a)details@Concurrency@@YAHPAU_Threadpool_chore(a)12@@Z(ptr) msvcp140.?_Schedule_chore(a)details@Concurrency@@YAHPAU_Threadpool_chore(a)12@@Z -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/2554
This merge request was approved by Piotr Caban. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2554
participants (3)
-
Piotr Caban (@piotr) -
Vijay Kiran Kamuju -
Vijay Kiran Kamuju (@infyquest)