From 1e580320987aec8ba3d10142be0ef2b027c50f9b Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Thu, 30 Mar 2017 22:47:18 +0200 Subject: [PATCH] msvcrt: Add improper_scheduler_attach class implementation. Signed-off-by: Piotr Caban Signed-off-by: Alexandre Julliard --- dlls/concrt140/concrt140.spec | 8 ++--- dlls/msvcr100/msvcr100.spec | 8 ++--- dlls/msvcr110/msvcr110.spec | 12 +++---- dlls/msvcr120/msvcr120.spec | 12 +++---- dlls/msvcr120_app/msvcr120_app.spec | 12 +++---- dlls/msvcrt/cpp.c | 55 +++++++++++++++++++++++++++++ dlls/msvcrt/msvcrt.h | 1 + 7 files changed, 82 insertions(+), 26 deletions(-) diff --git a/dlls/concrt140/concrt140.spec b/dlls/concrt140/concrt140.spec index c54d7ae7729..f8a2b476e2b 100644 --- a/dlls/concrt140/concrt140.spec +++ b/dlls/concrt140/concrt140.spec @@ -80,10 +80,10 @@ @ cdecl -arch=win64 ??0improper_lock@Concurrency@@QEAA@PEBD@Z(ptr str) msvcr120.??0improper_lock@Concurrency@@QEAA@PEBD@Z @ thiscall -arch=i386 ??0improper_lock@Concurrency@@QAE@XZ(ptr) msvcr120.??0improper_lock@Concurrency@@QAE@XZ @ cdecl -arch=win64 ??0improper_lock@Concurrency@@QEAA@XZ(ptr) msvcr120.??0improper_lock@Concurrency@@QEAA@XZ -@ stub -arch=i386 ??0improper_scheduler_attach@Concurrency@@QAE@PBD@Z -@ stub -arch=win64 ??0improper_scheduler_attach@Concurrency@@QEAA@PEBD@Z -@ stub -arch=i386 ??0improper_scheduler_attach@Concurrency@@QAE@XZ -@ stub -arch=win64 ??0improper_scheduler_attach@Concurrency@@QEAA@XZ +@ thiscall -arch=i386 ??0improper_scheduler_attach@Concurrency@@QAE@PBD@Z(ptr str) msvcr120.??0improper_scheduler_attach@Concurrency@@QAE@PBD@Z +@ cdecl -arch=win64 ??0improper_scheduler_attach@Concurrency@@QEAA@PEBD@Z(ptr str) msvcr120.??0improper_scheduler_attach@Concurrency@@QEAA@PEBD@Z +@ thiscall -arch=i386 ??0improper_scheduler_attach@Concurrency@@QAE@XZ(ptr) msvcr120.??0improper_scheduler_attach@Concurrency@@QAE@XZ +@ cdecl -arch=win64 ??0improper_scheduler_attach@Concurrency@@QEAA@XZ(ptr) msvcr120.??0improper_scheduler_attach@Concurrency@@QEAA@XZ @ stub -arch=i386 ??0improper_scheduler_detach@Concurrency@@QAE@PBD@Z @ stub -arch=win64 ??0improper_scheduler_detach@Concurrency@@QEAA@PEBD@Z @ stub -arch=i386 ??0improper_scheduler_detach@Concurrency@@QAE@XZ diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index 9cf3b5b7704..f36247e860b 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -78,10 +78,10 @@ @ cdecl -arch=win64 ??0improper_lock@Concurrency@@QEAA@PEBD@Z(ptr str) improper_lock_ctor_str @ thiscall -arch=i386 ??0improper_lock@Concurrency@@QAE@XZ(ptr) improper_lock_ctor @ cdecl -arch=win64 ??0improper_lock@Concurrency@@QEAA@XZ(ptr) improper_lock_ctor -@ stub -arch=win32 ??0improper_scheduler_attach@Concurrency@@QAE@PBD@Z -@ stub -arch=win64 ??0improper_scheduler_attach@Concurrency@@QEAA@PEBD@Z -@ stub -arch=win32 ??0improper_scheduler_attach@Concurrency@@QAE@XZ -@ stub -arch=win64 ??0improper_scheduler_attach@Concurrency@@QEAA@XZ +@ thiscall -arch=i386 ??0improper_scheduler_attach@Concurrency@@QAE@PBD@Z(ptr str) improper_scheduler_attach_ctor_str +@ cdecl -arch=win64 ??0improper_scheduler_attach@Concurrency@@QEAA@PEBD@Z(ptr str) improper_scheduler_attach_ctor_str +@ thiscall -arch=i386 ??0improper_scheduler_attach@Concurrency@@QAE@XZ(ptr) improper_scheduler_attach_ctor +@ cdecl -arch=win64 ??0improper_scheduler_attach@Concurrency@@QEAA@XZ(ptr) improper_scheduler_attach_ctor @ stub -arch=win32 ??0improper_scheduler_detach@Concurrency@@QAE@PBD@Z @ stub -arch=win64 ??0improper_scheduler_detach@Concurrency@@QEAA@PEBD@Z @ stub -arch=win32 ??0improper_scheduler_detach@Concurrency@@QAE@XZ diff --git a/dlls/msvcr110/msvcr110.spec b/dlls/msvcr110/msvcr110.spec index bb20bcbc49f..e0384465816 100644 --- a/dlls/msvcr110/msvcr110.spec +++ b/dlls/msvcr110/msvcr110.spec @@ -143,12 +143,12 @@ @ cdecl -arch=arm ??0improper_lock@Concurrency@@QAA@XZ(ptr) improper_lock_ctor @ thiscall -arch=i386 ??0improper_lock@Concurrency@@QAE@XZ(ptr) improper_lock_ctor @ cdecl -arch=win64 ??0improper_lock@Concurrency@@QEAA@XZ(ptr) improper_lock_ctor -@ stub -arch=arm ??0improper_scheduler_attach@Concurrency@@QAA@PBD@Z -@ stub -arch=i386 ??0improper_scheduler_attach@Concurrency@@QAE@PBD@Z -@ stub -arch=win64 ??0improper_scheduler_attach@Concurrency@@QEAA@PEBD@Z -@ stub -arch=arm ??0improper_scheduler_attach@Concurrency@@QAA@XZ -@ stub -arch=i386 ??0improper_scheduler_attach@Concurrency@@QAE@XZ -@ stub -arch=win64 ??0improper_scheduler_attach@Concurrency@@QEAA@XZ +@ cdecl -arch=arm ??0improper_scheduler_attach@Concurrency@@QAA@PBD@Z(ptr str) improper_scheduler_attach_ctor_str +@ thiscall -arch=i386 ??0improper_scheduler_attach@Concurrency@@QAE@PBD@Z(ptr str) improper_scheduler_attach_ctor_str +@ cdecl -arch=win64 ??0improper_scheduler_attach@Concurrency@@QEAA@PEBD@Z(ptr str) improper_scheduler_attach_ctor_str +@ cdecl -arch=arm ??0improper_scheduler_attach@Concurrency@@QAA@XZ(ptr) improper_scheduler_attach_ctor +@ thiscall -arch=i386 ??0improper_scheduler_attach@Concurrency@@QAE@XZ(ptr) improper_scheduler_attach_ctor +@ cdecl -arch=win64 ??0improper_scheduler_attach@Concurrency@@QEAA@XZ(ptr) improper_scheduler_attach_ctor @ stub -arch=arm ??0improper_scheduler_detach@Concurrency@@QAA@PBD@Z @ stub -arch=i386 ??0improper_scheduler_detach@Concurrency@@QAE@PBD@Z @ stub -arch=win64 ??0improper_scheduler_detach@Concurrency@@QEAA@PEBD@Z diff --git a/dlls/msvcr120/msvcr120.spec b/dlls/msvcr120/msvcr120.spec index 521e795c949..8ae93833907 100644 --- a/dlls/msvcr120/msvcr120.spec +++ b/dlls/msvcr120/msvcr120.spec @@ -140,12 +140,12 @@ @ cdecl -arch=arm ??0improper_lock@Concurrency@@QAA@XZ(ptr) improper_lock_ctor @ thiscall -arch=i386 ??0improper_lock@Concurrency@@QAE@XZ(ptr) improper_lock_ctor @ cdecl -arch=win64 ??0improper_lock@Concurrency@@QEAA@XZ(ptr) improper_lock_ctor -@ stub -arch=arm ??0improper_scheduler_attach@Concurrency@@QAA@PBD@Z -@ stub -arch=i386 ??0improper_scheduler_attach@Concurrency@@QAE@PBD@Z -@ stub -arch=win64 ??0improper_scheduler_attach@Concurrency@@QEAA@PEBD@Z -@ stub -arch=arm ??0improper_scheduler_attach@Concurrency@@QAA@XZ -@ stub -arch=i386 ??0improper_scheduler_attach@Concurrency@@QAE@XZ -@ stub -arch=win64 ??0improper_scheduler_attach@Concurrency@@QEAA@XZ +@ cdecl -arch=arm ??0improper_scheduler_attach@Concurrency@@QAA@PBD@Z(ptr str) improper_scheduler_attach_ctor_str +@ thiscall -arch=i386 ??0improper_scheduler_attach@Concurrency@@QAE@PBD@Z(ptr str) improper_scheduler_attach_ctor_str +@ cdecl -arch=win64 ??0improper_scheduler_attach@Concurrency@@QEAA@PEBD@Z(ptr str) improper_scheduler_attach_ctor_str +@ cdecl -arch=arm ??0improper_scheduler_attach@Concurrency@@QAA@XZ(ptr) improper_scheduler_attach_ctor +@ thiscall -arch=i386 ??0improper_scheduler_attach@Concurrency@@QAE@XZ(ptr) improper_scheduler_attach_ctor +@ cdecl -arch=win64 ??0improper_scheduler_attach@Concurrency@@QEAA@XZ(ptr) improper_scheduler_attach_ctor @ stub -arch=arm ??0improper_scheduler_detach@Concurrency@@QAA@PBD@Z @ stub -arch=i386 ??0improper_scheduler_detach@Concurrency@@QAE@PBD@Z @ stub -arch=win64 ??0improper_scheduler_detach@Concurrency@@QEAA@PEBD@Z diff --git a/dlls/msvcr120_app/msvcr120_app.spec b/dlls/msvcr120_app/msvcr120_app.spec index 79adc7845d5..7a5e3f32da5 100644 --- a/dlls/msvcr120_app/msvcr120_app.spec +++ b/dlls/msvcr120_app/msvcr120_app.spec @@ -138,12 +138,12 @@ @ cdecl -arch=arm ??0improper_lock@Concurrency@@QAA@XZ(ptr) msvcr120.??0improper_lock@Concurrency@@QAA@XZ @ thiscall -arch=i386 ??0improper_lock@Concurrency@@QAE@XZ(ptr) msvcr120.??0improper_lock@Concurrency@@QAE@XZ @ cdecl -arch=win64 ??0improper_lock@Concurrency@@QEAA@XZ(ptr) msvcr120.??0improper_lock@Concurrency@@QEAA@XZ -@ stub -arch=arm ??0improper_scheduler_attach@Concurrency@@QAA@PBD@Z -@ stub -arch=i386 ??0improper_scheduler_attach@Concurrency@@QAE@PBD@Z -@ stub -arch=win64 ??0improper_scheduler_attach@Concurrency@@QEAA@PEBD@Z -@ stub -arch=arm ??0improper_scheduler_attach@Concurrency@@QAA@XZ -@ stub -arch=i386 ??0improper_scheduler_attach@Concurrency@@QAE@XZ -@ stub -arch=win64 ??0improper_scheduler_attach@Concurrency@@QEAA@XZ +@ cdecl -arch=arm ??0improper_scheduler_attach@Concurrency@@QAA@PBD@Z(ptr str) msvcr120.??0improper_scheduler_attach@Concurrency@@QAA@PBD@Z +@ thiscall -arch=i386 ??0improper_scheduler_attach@Concurrency@@QAE@PBD@Z(ptr str) msvcr120.??0improper_scheduler_attach@Concurrency@@QAE@PBD@Z +@ cdecl -arch=win64 ??0improper_scheduler_attach@Concurrency@@QEAA@PEBD@Z(ptr str) msvcr120.??0improper_scheduler_attach@Concurrency@@QEAA@PEBD@Z +@ cdecl -arch=arm ??0improper_scheduler_attach@Concurrency@@QAA@XZ(ptr) msvcr120.??0improper_scheduler_attach@Concurrency@@QAA@XZ +@ thiscall -arch=i386 ??0improper_scheduler_attach@Concurrency@@QAE@XZ(ptr) msvcr120.??0improper_scheduler_attach@Concurrency@@QAE@XZ +@ cdecl -arch=win64 ??0improper_scheduler_attach@Concurrency@@QEAA@XZ(ptr) msvcr120.??0improper_scheduler_attach@Concurrency@@QEAA@XZ @ stub -arch=arm ??0improper_scheduler_detach@Concurrency@@QAA@PBD@Z @ stub -arch=i386 ??0improper_scheduler_detach@Concurrency@@QAE@PBD@Z @ stub -arch=win64 ??0improper_scheduler_detach@Concurrency@@QEAA@PEBD@Z diff --git a/dlls/msvcrt/cpp.c b/dlls/msvcrt/cpp.c index 81a255a499c..5436a0f6f8b 100644 --- a/dlls/msvcrt/cpp.c +++ b/dlls/msvcrt/cpp.c @@ -901,6 +901,48 @@ void __thiscall MSVCRT_invalid_scheduler_policy_thread_specification_dtor( TRACE("(%p)\n", _this); MSVCRT_exception_dtor(_this); } + +typedef exception improper_scheduler_attach; +extern const vtable_ptr MSVCRT_improper_scheduler_attach_vtable; + +/* ??0improper_scheduler_attach@Concurrency@@QAE@PBD@Z */ +/* ??0improper_scheduler_attach@Concurrency@@QEAA@PEBD@Z */ +DEFINE_THISCALL_WRAPPER(improper_scheduler_attach_ctor_str, 8) +improper_scheduler_attach* __thiscall improper_scheduler_attach_ctor_str( + improper_scheduler_attach *this, const char *str) +{ + TRACE("(%p %p)\n", this, str); + MSVCRT_exception_ctor(this, &str); + this->vtable = &MSVCRT_improper_scheduler_attach_vtable; + return this; +} + +/* ??0improper_scheduler_attach@Concurrency@@QAE@XZ */ +/* ??0improper_scheduler_attach@Concurrency@@QEAA@XZ */ +DEFINE_THISCALL_WRAPPER(improper_scheduler_attach_ctor, 4) +improper_scheduler_attach* __thiscall improper_scheduler_attach_ctor( + improper_scheduler_attach *this) +{ + return improper_scheduler_attach_ctor_str(this, NULL); +} + +DEFINE_THISCALL_WRAPPER(MSVCRT_improper_scheduler_attach_copy_ctor,8) +improper_scheduler_attach * __thiscall MSVCRT_improper_scheduler_attach_copy_ctor( + improper_scheduler_attach * _this, const improper_scheduler_attach * rhs) +{ + TRACE("(%p %p)\n", _this, rhs); + MSVCRT_exception_copy_ctor(_this, rhs); + _this->vtable = &MSVCRT_improper_scheduler_attach_vtable; + return _this; +} + +DEFINE_THISCALL_WRAPPER(MSVCRT_improper_scheduler_attach_dtor,4) +void __thiscall MSVCRT_improper_scheduler_attach_dtor( + improper_scheduler_attach * _this) +{ + TRACE("(%p)\n", _this); + MSVCRT_exception_dtor(_this); +} #endif #ifndef __GNUC__ @@ -945,6 +987,9 @@ __ASM_VTABLE(invalid_scheduler_policy_value, __ASM_VTABLE(invalid_scheduler_policy_thread_specification, VTABLE_ADD_FUNC(MSVCRT_exception_vector_dtor) VTABLE_ADD_FUNC(MSVCRT_what_exception)); +__ASM_VTABLE(improper_scheduler_attach, + VTABLE_ADD_FUNC(MSVCRT_exception_vector_dtor) + VTABLE_ADD_FUNC(MSVCRT_what_exception)); #endif #ifndef __GNUC__ @@ -975,6 +1020,8 @@ DEFINE_RTTI_DATA1(invalid_scheduler_policy_value, 0, &exception_rtti_base_descri ".?AVinvalid_scheduler_policy_value@Concurrency@@" ) DEFINE_RTTI_DATA1(invalid_scheduler_policy_thread_specification, 0, &exception_rtti_base_descriptor, ".?AVinvalid_scheduler_policy_thread_specification@Concurrency@@" ) +DEFINE_RTTI_DATA1(improper_scheduler_attach, 0, &exception_rtti_base_descriptor, + ".?AVimproper_scheduler_attach@Concurrency@@" ) #endif DEFINE_EXCEPTION_TYPE_INFO( exception, 0, NULL, NULL ) @@ -990,6 +1037,7 @@ DEFINE_EXCEPTION_TYPE_INFO(improper_lock, 1, &exception_cxx_type_info, NULL) DEFINE_EXCEPTION_TYPE_INFO(invalid_scheduler_policy_key, 1, &exception_cxx_type_info, NULL) DEFINE_EXCEPTION_TYPE_INFO(invalid_scheduler_policy_value, 1, &exception_cxx_type_info, NULL) DEFINE_EXCEPTION_TYPE_INFO(invalid_scheduler_policy_thread_specification, 1, &exception_cxx_type_info, NULL) +DEFINE_EXCEPTION_TYPE_INFO(improper_scheduler_attach, 1, &exception_cxx_type_info, NULL) #endif void msvcrt_init_exception(void *base) @@ -1010,6 +1058,7 @@ void msvcrt_init_exception(void *base) init_invalid_scheduler_policy_key_rtti(base); init_invalid_scheduler_policy_value_rtti(base); init_invalid_scheduler_policy_thread_specification_rtti(base); + init_improper_scheduler_attach_rtti(base); #endif init_exception_cxx(base); @@ -1025,6 +1074,7 @@ void msvcrt_init_exception(void *base) init_invalid_scheduler_policy_key_cxx(base); init_invalid_scheduler_policy_value_cxx(base); init_invalid_scheduler_policy_thread_specification_cxx(base); + init_improper_scheduler_attach_cxx(base); #endif #endif } @@ -1064,6 +1114,11 @@ void throw_exception(exception_type et, HRESULT hr, const char *str) invalid_scheduler_policy_thread_specification_ctor_str(&e, str); _CxxThrowException(&e, &invalid_scheduler_policy_thread_specification_exception_type); } + case EXCEPTION_IMPROPER_SCHEDULER_ATTACH: { + improper_scheduler_attach e; + improper_scheduler_attach_ctor_str(&e, str); + _CxxThrowException(&e, &improper_scheduler_attach_exception_type); + } #endif } } diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index e24f5000051..95b6a1f24f9 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -291,6 +291,7 @@ typedef enum { EXCEPTION_INVALID_SCHEDULER_POLICY_KEY, EXCEPTION_INVALID_SCHEDULER_POLICY_VALUE, EXCEPTION_INVALID_SCHEDULER_POLICY_THREAD_SPECIFICATION, + EXCEPTION_IMPROPER_SCHEDULER_ATTACH, #endif } exception_type; void throw_exception(exception_type, HRESULT, const char*) DECLSPEC_HIDDEN;