From: Vibhav Pant vibhavp@gmail.com
--- dlls/vccorlib140/except.c | 24 ++++++++++++++++++++++++ dlls/vccorlib140/vccorlib140.spec | 5 ++--- 2 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/dlls/vccorlib140/except.c b/dlls/vccorlib140/except.c index d00f35c71f1..c771554e72f 100644 --- a/dlls/vccorlib140/except.c +++ b/dlls/vccorlib140/except.c @@ -33,6 +33,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(vccorlib);
extern void WINAPI DECLSPEC_NORETURN _CxxThrowException(void *, const cxx_exception_type *); +extern const void **__cdecl __current_exception(void);
#ifdef _WIN64 #define EXCEPTION_REF_NAME(name) ".PE$AAV" #name "Exception@Platform@@" @@ -501,3 +502,26 @@ void init_exception(void *base) WINRT_EXCEPTIONS #undef WINRT_EXCEPTION } + +HRESULT WINAPI __abi_translateCurrentException(bool unknown) +{ + const struct Exception *excp; + const EXCEPTION_RECORD *record; + const cxx_exception_type *type; + + FIXME("(%d): semi-stub!\n", unknown); + + record = *__current_exception(); + /* Native aborts if: + * There is no exception being currently handled. + * There is no associated exception object (_CxxThrowException(NULL, ...) was called). + * There is no associated cxx_exception_type param (_CxxThrowException(..., NULL) was called). + * A non C++/CX exception has been thrown. */ + if (!record || !record->ExceptionInformation[1] || + !(excp = *(struct Exception **)record->ExceptionInformation[1]) || + !(type = (cxx_exception_type *)record->ExceptionInformation[2]) || + !(type->flags & TYPE_FLAG_WINRT)) + abort(); + return excp->inner.hr; +} + diff --git a/dlls/vccorlib140/vccorlib140.spec b/dlls/vccorlib140/vccorlib140.spec index 64b01047337..99b32fd1571 100644 --- a/dlls/vccorlib140/vccorlib140.spec +++ b/dlls/vccorlib140/vccorlib140.spec @@ -338,9 +338,8 @@ @ stdcall -arch=win64 ?__abi_make_type_id@@YAPE$AAVType@Platform@@AEBU__abi_type_descriptor@@@Z(ptr) __abi_make_type_id @ stub -arch=win32 ??0IntPtr@Platform@@QAA@PAX@Z @ stub -arch=win64 ??0IntPtr@Platform@@QEAA@PEAX@Z -@ stub -arch=i386 ?__abi_translateCurrentException@@YGJ_N@Z -@ stub -arch=arm ?__abi_translateCurrentException@@YAJ_N@Z -@ stub -arch=win64 ?__abi_translateCurrentException@@YAJ_N@Z +@ stdcall -arch=i386 ?__abi_translateCurrentException@@YGJ_N@Z(long) __abi_translateCurrentException +@ stdcall -arch=arm,win64 ?__abi_translateCurrentException@@YAJ_N@Z(long) __abi_translateCurrentException @ stub -arch=i386 ?__getActivationFactoryByHSTRING@@YGJPAUHSTRING__@@AAVGuid@Platform@@PAPAX@Z @ stub -arch=arm ?__getActivationFactoryByHSTRING@@YAJPAUHSTRING__@@AAVGuid@Platform@@PAPAX@Z @ stub -arch=win64 ?__getActivationFactoryByHSTRING@@YAJPEAUHSTRING__@@AEAVGuid@Platform@@PEAPEAX@Z