Commit 635f59f2 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Move invalid_scheduler_policy_key to concurrency.c.

parent a8decf5c
...@@ -302,6 +302,9 @@ typedef struct { ...@@ -302,6 +302,9 @@ typedef struct {
typedef exception improper_lock; typedef exception improper_lock;
extern const vtable_ptr improper_lock_vtable; extern const vtable_ptr improper_lock_vtable;
typedef exception invalid_scheduler_policy_key;
extern const vtable_ptr invalid_scheduler_policy_key_vtable;
typedef struct { typedef struct {
exception e; exception e;
HRESULT hr; HRESULT hr;
...@@ -361,6 +364,33 @@ improper_lock * __thiscall improper_lock_copy_ctor(improper_lock *this, const im ...@@ -361,6 +364,33 @@ improper_lock * __thiscall improper_lock_copy_ctor(improper_lock *this, const im
return __exception_copy_ctor(this, rhs, &improper_lock_vtable); return __exception_copy_ctor(this, rhs, &improper_lock_vtable);
} }
/* ??0invalid_scheduler_policy_key@Concurrency@@QAE@PBD@Z */
/* ??0invalid_scheduler_policy_key@Concurrency@@QEAA@PEBD@Z */
DEFINE_THISCALL_WRAPPER(invalid_scheduler_policy_key_ctor_str, 8)
invalid_scheduler_policy_key* __thiscall invalid_scheduler_policy_key_ctor_str(
invalid_scheduler_policy_key *this, const char *str)
{
TRACE("(%p %p)\n", this, str);
return __exception_ctor(this, str, &invalid_scheduler_policy_key_vtable);
}
/* ??0invalid_scheduler_policy_key@Concurrency@@QAE@XZ */
/* ??0invalid_scheduler_policy_key@Concurrency@@QEAA@XZ */
DEFINE_THISCALL_WRAPPER(invalid_scheduler_policy_key_ctor, 4)
invalid_scheduler_policy_key* __thiscall invalid_scheduler_policy_key_ctor(
invalid_scheduler_policy_key *this)
{
return invalid_scheduler_policy_key_ctor_str(this, NULL);
}
DEFINE_THISCALL_WRAPPER(invalid_scheduler_policy_key_copy_ctor,8)
invalid_scheduler_policy_key * __thiscall invalid_scheduler_policy_key_copy_ctor(
invalid_scheduler_policy_key * _this, const invalid_scheduler_policy_key * rhs)
{
TRACE("(%p %p)\n", _this, rhs);
return __exception_copy_ctor(_this, rhs, &invalid_scheduler_policy_key_vtable);
}
/* ??0scheduler_resource_allocation_error@Concurrency@@QAE@PBDJ@Z */ /* ??0scheduler_resource_allocation_error@Concurrency@@QAE@PBDJ@Z */
/* ??0scheduler_resource_allocation_error@Concurrency@@QEAA@PEBDJ@Z */ /* ??0scheduler_resource_allocation_error@Concurrency@@QEAA@PEBDJ@Z */
DEFINE_THISCALL_WRAPPER(scheduler_resource_allocation_error_ctor_name, 12) DEFINE_THISCALL_WRAPPER(scheduler_resource_allocation_error_ctor_name, 12)
...@@ -408,16 +438,22 @@ HRESULT __thiscall scheduler_resource_allocation_error_get_error_code( ...@@ -408,16 +438,22 @@ HRESULT __thiscall scheduler_resource_allocation_error_get_error_code(
DEFINE_RTTI_DATA1(improper_lock, 0, &cexception_rtti_base_descriptor, DEFINE_RTTI_DATA1(improper_lock, 0, &cexception_rtti_base_descriptor,
".?AVimproper_lock@Concurrency@@") ".?AVimproper_lock@Concurrency@@")
DEFINE_RTTI_DATA1(invalid_scheduler_policy_key, 0, &cexception_rtti_base_descriptor,
".?AVinvalid_scheduler_policy_key@Concurrency@@")
DEFINE_RTTI_DATA1(scheduler_resource_allocation_error, 0, &cexception_rtti_base_descriptor, DEFINE_RTTI_DATA1(scheduler_resource_allocation_error, 0, &cexception_rtti_base_descriptor,
".?AVscheduler_resource_allocation_error@Concurrency@@") ".?AVscheduler_resource_allocation_error@Concurrency@@")
DEFINE_CXX_DATA1(improper_lock, &cexception_cxx_type_info, cexception_dtor) DEFINE_CXX_DATA1(improper_lock, &cexception_cxx_type_info, cexception_dtor)
DEFINE_CXX_DATA1(invalid_scheduler_policy_key, &cexception_cxx_type_info, cexception_dtor)
DEFINE_CXX_DATA1(scheduler_resource_allocation_error, &cexception_cxx_type_info, cexception_dtor) DEFINE_CXX_DATA1(scheduler_resource_allocation_error, &cexception_cxx_type_info, cexception_dtor)
__ASM_BLOCK_BEGIN(concurrency_exception_vtables) __ASM_BLOCK_BEGIN(concurrency_exception_vtables)
__ASM_VTABLE(improper_lock, __ASM_VTABLE(improper_lock,
VTABLE_ADD_FUNC(cexception_vector_dtor) VTABLE_ADD_FUNC(cexception_vector_dtor)
VTABLE_ADD_FUNC(cexception_what)); VTABLE_ADD_FUNC(cexception_what));
__ASM_VTABLE(invalid_scheduler_policy_key,
VTABLE_ADD_FUNC(cexception_vector_dtor)
VTABLE_ADD_FUNC(cexception_what));
__ASM_VTABLE(scheduler_resource_allocation_error, __ASM_VTABLE(scheduler_resource_allocation_error,
VTABLE_ADD_FUNC(cexception_vector_dtor) VTABLE_ADD_FUNC(cexception_vector_dtor)
VTABLE_ADD_FUNC(cexception_what)); VTABLE_ADD_FUNC(cexception_what));
...@@ -720,12 +756,21 @@ unsigned int __thiscall SchedulerPolicy_SetPolicyValue(SchedulerPolicy *this, ...@@ -720,12 +756,21 @@ unsigned int __thiscall SchedulerPolicy_SetPolicyValue(SchedulerPolicy *this,
TRACE("(%p %d %d)\n", this, policy, val); TRACE("(%p %d %d)\n", this, policy, val);
if (policy == MinConcurrency) if (policy == MinConcurrency) {
throw_exception(EXCEPTION_INVALID_SCHEDULER_POLICY_KEY, 0, "MinConcurrency"); invalid_scheduler_policy_key e;
if (policy == MaxConcurrency) invalid_scheduler_policy_key_ctor_str(&e, "MinConcurrency");
throw_exception(EXCEPTION_INVALID_SCHEDULER_POLICY_KEY, 0, "MaxConcurrency"); _CxxThrowException(&e, &invalid_scheduler_policy_key_exception_type);
if (policy >= last_policy_id) }
throw_exception(EXCEPTION_INVALID_SCHEDULER_POLICY_KEY, 0, "Invalid policy"); if (policy == MaxConcurrency) {
invalid_scheduler_policy_key e;
invalid_scheduler_policy_key_ctor_str(&e, "MaxConcurrency");
_CxxThrowException(&e, &invalid_scheduler_policy_key_exception_type);
}
if (policy >= last_policy_id) {
invalid_scheduler_policy_key e;
invalid_scheduler_policy_key_ctor_str(&e, "Invalid policy");
_CxxThrowException(&e, &invalid_scheduler_policy_key_exception_type);
}
switch(policy) { switch(policy) {
case SchedulerKind: case SchedulerKind:
...@@ -784,8 +829,11 @@ unsigned int __thiscall SchedulerPolicy_GetPolicyValue( ...@@ -784,8 +829,11 @@ unsigned int __thiscall SchedulerPolicy_GetPolicyValue(
{ {
TRACE("(%p %d)\n", this, policy); TRACE("(%p %d)\n", this, policy);
if (policy >= last_policy_id) if (policy >= last_policy_id) {
throw_exception(EXCEPTION_INVALID_SCHEDULER_POLICY_KEY, 0, "Invalid policy"); invalid_scheduler_policy_key e;
invalid_scheduler_policy_key_ctor_str(&e, "Invalid policy");
_CxxThrowException(&e, &invalid_scheduler_policy_key_exception_type);
}
return this->policy_container->policies[policy]; return this->policy_container->policies[policy];
} }
...@@ -2583,6 +2631,7 @@ void msvcrt_init_concurrency(void *base) ...@@ -2583,6 +2631,7 @@ void msvcrt_init_concurrency(void *base)
#ifdef __x86_64__ #ifdef __x86_64__
init_cexception_rtti(base); init_cexception_rtti(base);
init_improper_lock_rtti(base); init_improper_lock_rtti(base);
init_invalid_scheduler_policy_key_rtti(base);
init_scheduler_resource_allocation_error_rtti(base); init_scheduler_resource_allocation_error_rtti(base);
init_Context_rtti(base); init_Context_rtti(base);
init_ContextBase_rtti(base); init_ContextBase_rtti(base);
...@@ -2593,6 +2642,7 @@ void msvcrt_init_concurrency(void *base) ...@@ -2593,6 +2642,7 @@ void msvcrt_init_concurrency(void *base)
init_cexception_cxx_type_info(base); init_cexception_cxx_type_info(base);
init_improper_lock_cxx(base); init_improper_lock_cxx(base);
init_invalid_scheduler_policy_key_cxx(base);
init_scheduler_resource_allocation_error_cxx(base); init_scheduler_resource_allocation_error_cxx(base);
#endif #endif
} }
......
...@@ -551,36 +551,6 @@ void __thiscall bad_alloc_dtor(bad_alloc * _this) ...@@ -551,36 +551,6 @@ void __thiscall bad_alloc_dtor(bad_alloc * _this)
#if _MSVCR_VER >= 100 #if _MSVCR_VER >= 100
typedef exception invalid_scheduler_policy_key;
extern const vtable_ptr invalid_scheduler_policy_key_vtable;
/* ??0invalid_scheduler_policy_key@Concurrency@@QAE@PBD@Z */
/* ??0invalid_scheduler_policy_key@Concurrency@@QEAA@PEBD@Z */
DEFINE_THISCALL_WRAPPER(invalid_scheduler_policy_key_ctor_str, 8)
invalid_scheduler_policy_key* __thiscall invalid_scheduler_policy_key_ctor_str(
invalid_scheduler_policy_key *this, const char *str)
{
TRACE("(%p %p)\n", this, str);
return __exception_ctor(this, str, &invalid_scheduler_policy_key_vtable);
}
/* ??0invalid_scheduler_policy_key@Concurrency@@QAE@XZ */
/* ??0invalid_scheduler_policy_key@Concurrency@@QEAA@XZ */
DEFINE_THISCALL_WRAPPER(invalid_scheduler_policy_key_ctor, 4)
invalid_scheduler_policy_key* __thiscall invalid_scheduler_policy_key_ctor(
invalid_scheduler_policy_key *this)
{
return invalid_scheduler_policy_key_ctor_str(this, NULL);
}
DEFINE_THISCALL_WRAPPER(invalid_scheduler_policy_key_copy_ctor,8)
invalid_scheduler_policy_key * __thiscall invalid_scheduler_policy_key_copy_ctor(
invalid_scheduler_policy_key * _this, const invalid_scheduler_policy_key * rhs)
{
TRACE("(%p %p)\n", _this, rhs);
return __exception_copy_ctor(_this, rhs, &invalid_scheduler_policy_key_vtable);
}
typedef exception invalid_scheduler_policy_value; typedef exception invalid_scheduler_policy_value;
extern const vtable_ptr invalid_scheduler_policy_value_vtable; extern const vtable_ptr invalid_scheduler_policy_value_vtable;
...@@ -723,9 +693,6 @@ __ASM_VTABLE(__non_rtti_object, ...@@ -723,9 +693,6 @@ __ASM_VTABLE(__non_rtti_object,
VTABLE_ADD_FUNC(__non_rtti_object_vector_dtor) VTABLE_ADD_FUNC(__non_rtti_object_vector_dtor)
VTABLE_ADD_FUNC(exception_what)); VTABLE_ADD_FUNC(exception_what));
#if _MSVCR_VER >= 100 #if _MSVCR_VER >= 100
__ASM_VTABLE(invalid_scheduler_policy_key,
VTABLE_ADD_FUNC(exception_vector_dtor)
VTABLE_ADD_FUNC(exception_what));
__ASM_VTABLE(invalid_scheduler_policy_value, __ASM_VTABLE(invalid_scheduler_policy_value,
VTABLE_ADD_FUNC(exception_vector_dtor) VTABLE_ADD_FUNC(exception_vector_dtor)
VTABLE_ADD_FUNC(exception_what)); VTABLE_ADD_FUNC(exception_what));
...@@ -754,8 +721,6 @@ DEFINE_RTTI_DATA1( bad_cast, 0, &exception_rtti_base_descriptor, ".?AVbad_cast@@ ...@@ -754,8 +721,6 @@ DEFINE_RTTI_DATA1( bad_cast, 0, &exception_rtti_base_descriptor, ".?AVbad_cast@@
DEFINE_RTTI_DATA2( __non_rtti_object, 0, &bad_typeid_rtti_base_descriptor, &exception_rtti_base_descriptor, ".?AV__non_rtti_object@@" ) DEFINE_RTTI_DATA2( __non_rtti_object, 0, &bad_typeid_rtti_base_descriptor, &exception_rtti_base_descriptor, ".?AV__non_rtti_object@@" )
#endif #endif
#if _MSVCR_VER >= 100 #if _MSVCR_VER >= 100
DEFINE_RTTI_DATA1(invalid_scheduler_policy_key, 0, &exception_rtti_base_descriptor,
".?AVinvalid_scheduler_policy_key@Concurrency@@" )
DEFINE_RTTI_DATA1(invalid_scheduler_policy_value, 0, &exception_rtti_base_descriptor, DEFINE_RTTI_DATA1(invalid_scheduler_policy_value, 0, &exception_rtti_base_descriptor,
".?AVinvalid_scheduler_policy_value@Concurrency@@" ) ".?AVinvalid_scheduler_policy_value@Concurrency@@" )
DEFINE_RTTI_DATA1(invalid_scheduler_policy_thread_specification, 0, &exception_rtti_base_descriptor, DEFINE_RTTI_DATA1(invalid_scheduler_policy_thread_specification, 0, &exception_rtti_base_descriptor,
...@@ -775,7 +740,6 @@ DEFINE_CXX_DATA2( __non_rtti_object, &bad_typeid_cxx_type_info, ...@@ -775,7 +740,6 @@ DEFINE_CXX_DATA2( __non_rtti_object, &bad_typeid_cxx_type_info,
DEFINE_CXX_DATA1( bad_alloc, &exception_cxx_type_info, bad_alloc_dtor ) DEFINE_CXX_DATA1( bad_alloc, &exception_cxx_type_info, bad_alloc_dtor )
#endif #endif
#if _MSVCR_VER >= 100 #if _MSVCR_VER >= 100
DEFINE_CXX_DATA1(invalid_scheduler_policy_key, &exception_cxx_type_info, exception_dtor)
DEFINE_CXX_DATA1(invalid_scheduler_policy_value, &exception_cxx_type_info, exception_dtor) DEFINE_CXX_DATA1(invalid_scheduler_policy_value, &exception_cxx_type_info, exception_dtor)
DEFINE_CXX_DATA1(invalid_scheduler_policy_thread_specification, &exception_cxx_type_info, exception_dtor) DEFINE_CXX_DATA1(invalid_scheduler_policy_thread_specification, &exception_cxx_type_info, exception_dtor)
DEFINE_CXX_DATA1(improper_scheduler_attach, &exception_cxx_type_info, exception_dtor) DEFINE_CXX_DATA1(improper_scheduler_attach, &exception_cxx_type_info, exception_dtor)
...@@ -795,7 +759,6 @@ void msvcrt_init_exception(void *base) ...@@ -795,7 +759,6 @@ void msvcrt_init_exception(void *base)
init_bad_cast_rtti(base); init_bad_cast_rtti(base);
init___non_rtti_object_rtti(base); init___non_rtti_object_rtti(base);
#if _MSVCR_VER >= 100 #if _MSVCR_VER >= 100
init_invalid_scheduler_policy_key_rtti(base);
init_invalid_scheduler_policy_value_rtti(base); init_invalid_scheduler_policy_value_rtti(base);
init_invalid_scheduler_policy_thread_specification_rtti(base); init_invalid_scheduler_policy_thread_specification_rtti(base);
init_improper_scheduler_attach_rtti(base); init_improper_scheduler_attach_rtti(base);
...@@ -810,7 +773,6 @@ void msvcrt_init_exception(void *base) ...@@ -810,7 +773,6 @@ void msvcrt_init_exception(void *base)
init_bad_alloc_cxx(base); init_bad_alloc_cxx(base);
#endif #endif
#if _MSVCR_VER >= 100 #if _MSVCR_VER >= 100
init_invalid_scheduler_policy_key_cxx(base);
init_invalid_scheduler_policy_value_cxx(base); init_invalid_scheduler_policy_value_cxx(base);
init_invalid_scheduler_policy_thread_specification_cxx(base); init_invalid_scheduler_policy_thread_specification_cxx(base);
init_improper_scheduler_attach_cxx(base); init_improper_scheduler_attach_cxx(base);
...@@ -829,11 +791,6 @@ void throw_exception(exception_type et, HRESULT hr, const char *str) ...@@ -829,11 +791,6 @@ void throw_exception(exception_type et, HRESULT hr, const char *str)
_CxxThrowException(&e, &bad_alloc_exception_type); _CxxThrowException(&e, &bad_alloc_exception_type);
} }
#if _MSVCR_VER >= 100 #if _MSVCR_VER >= 100
case EXCEPTION_INVALID_SCHEDULER_POLICY_KEY: {
invalid_scheduler_policy_key e;
invalid_scheduler_policy_key_ctor_str(&e, str);
_CxxThrowException(&e, &invalid_scheduler_policy_key_exception_type);
}
case EXCEPTION_INVALID_SCHEDULER_POLICY_VALUE: { case EXCEPTION_INVALID_SCHEDULER_POLICY_VALUE: {
invalid_scheduler_policy_value e; invalid_scheduler_policy_value e;
invalid_scheduler_policy_value_ctor_str(&e, str); invalid_scheduler_policy_value_ctor_str(&e, str);
......
...@@ -190,7 +190,6 @@ void msvcrt_set_errno(int) DECLSPEC_HIDDEN; ...@@ -190,7 +190,6 @@ void msvcrt_set_errno(int) DECLSPEC_HIDDEN;
typedef enum { typedef enum {
EXCEPTION_BAD_ALLOC, EXCEPTION_BAD_ALLOC,
#if _MSVCR_VER >= 100 #if _MSVCR_VER >= 100
EXCEPTION_INVALID_SCHEDULER_POLICY_KEY,
EXCEPTION_INVALID_SCHEDULER_POLICY_VALUE, EXCEPTION_INVALID_SCHEDULER_POLICY_VALUE,
EXCEPTION_INVALID_SCHEDULER_POLICY_THREAD_SPECIFICATION, EXCEPTION_INVALID_SCHEDULER_POLICY_THREAD_SPECIFICATION,
EXCEPTION_IMPROPER_SCHEDULER_ATTACH, EXCEPTION_IMPROPER_SCHEDULER_ATTACH,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment