Skip to content
Snippets Groups Projects
Commit 2458f063 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard
Browse files

msvcrt: Throw throw_scheduler_resource_allocation_error on Context tls index allocation error.

parent 27185abe
Branches
Tags
No related merge requests found
......@@ -843,6 +843,15 @@ void throw_bad_alloc(const char *str)
}
#endif
#if _MSVCR_VER >= 100
void throw_scheduler_resource_allocation_error(const char *str, HRESULT hr)
{
scheduler_resource_allocation_error e;
scheduler_resource_allocation_error_ctor_name(&e, str, hr);
_CxxThrowException(&e.e, &scheduler_resource_allocation_error_exception_type);
}
#endif
/******************************************************************
* ?set_terminate@@YAP6AXXZP6AXXZ@Z (MSVCRT.@)
*
......
......@@ -285,6 +285,9 @@ void msvcrt_set_errno(int) DECLSPEC_HIDDEN;
#if _MSVCR_VER >= 80
void throw_bad_alloc(const char*) DECLSPEC_HIDDEN;
#endif
#if _MSVCR_VER >= 100
void throw_scheduler_resource_allocation_error(const char*, HRESULT) DECLSPEC_HIDDEN;
#endif
void __cdecl _purecall(void);
void __cdecl _amsg_exit(int errnum);
......
......@@ -87,7 +87,8 @@ static Context* get_current_context(void)
if (context_tls_index == TLS_OUT_OF_INDEXES) {
int tls_index = TlsAlloc();
if (tls_index == TLS_OUT_OF_INDEXES) {
/* throw scheduler_resource_allocation_error */
throw_scheduler_resource_allocation_error(NULL,
HRESULT_FROM_WIN32(GetLastError()));
return NULL;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment