From: Torge Matthies tmatthies@codeweavers.com
Signed-off-by: Torge Matthies tmatthies@codeweavers.com --- dlls/msvcrt/concurrency.c | 7 ++++++- dlls/msvcrt/cxx.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/msvcrt/concurrency.c b/dlls/msvcrt/concurrency.c index 400efd89cc8..dc51ba47542 100644 --- a/dlls/msvcrt/concurrency.c +++ b/dlls/msvcrt/concurrency.c @@ -686,7 +686,7 @@ DEFINE_CXX_DATA1(invalid_multiple_scheduling, &cexception_cxx_type_info, cexcept DEFINE_CXX_DATA1(invalid_scheduler_policy_key, &cexception_cxx_type_info, cexception_dtor) DEFINE_CXX_DATA1(invalid_scheduler_policy_thread_specification, &cexception_cxx_type_info, cexception_dtor) DEFINE_CXX_DATA1(invalid_scheduler_policy_value, &cexception_cxx_type_info, cexception_dtor) -#if defined(__x86_64__) && _MSVCR_VER >= 120 +#if _MSVCR_VER >= 120 DEFINE_CXX_DATA1(missing_wait, &cexception_cxx_type_info, cexception_dtor) #endif DEFINE_CXX_DATA1(scheduler_resource_allocation_error, &cexception_cxx_type_info, cexception_dtor) @@ -1933,6 +1933,11 @@ DEFINE_THISCALL_WRAPPER(_StructuredTaskCollection_dtor, 4) void __thiscall _StructuredTaskCollection_dtor(_StructuredTaskCollection *this) { FIXME("(%p): stub!\n", this); + if (this->count && !__uncaught_exception()) { + missing_wait e; + missing_wait_ctor_str(&e, "Missing call to _RunAndWait"); + _CxxThrowException(&e, &missing_wait_exception_type); + } }
#endif /* _MSVCR_VER >= 120 */ diff --git a/dlls/msvcrt/cxx.h b/dlls/msvcrt/cxx.h index c2558974b73..aa73aabf797 100644 --- a/dlls/msvcrt/cxx.h +++ b/dlls/msvcrt/cxx.h @@ -321,3 +321,5 @@ void exception_ptr_from_record(exception_ptr*,EXCEPTION_RECORD*) DECLSPEC_HIDDEN void __cdecl __ExceptionPtrCreate(exception_ptr*); void __cdecl __ExceptionPtrDestroy(exception_ptr*); void __cdecl __ExceptionPtrRethrow(const exception_ptr*); + +BOOL __cdecl __uncaught_exception(void);