Commit 9b94e4c8 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

ucrtbase: Change ptd fields offsets to match with native.

Makes it possible to use native vcruntime140_1.dll. Signed-off-by: 's avatarPiotr Caban <piotr@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 9cc04495
...@@ -1139,8 +1139,7 @@ struct __thread_data { ...@@ -1139,8 +1139,7 @@ struct __thread_data {
void* terminate_handler; void* terminate_handler;
void* unexpected_handler; void* unexpected_handler;
void* se_translator; void* se_translator;
void *unk6[3]; void *unk6;
int unk7;
EXCEPTION_RECORD *exc_record; EXCEPTION_RECORD *exc_record;
}; };
......
...@@ -285,9 +285,8 @@ struct __thread_data { ...@@ -285,9 +285,8 @@ struct __thread_data {
int unk5[1]; int unk5[1];
MSVCRT_terminate_function terminate_handler; MSVCRT_terminate_function terminate_handler;
MSVCRT_unexpected_function unexpected_handler; MSVCRT_unexpected_function unexpected_handler;
MSVCRT__se_translator_function se_translator; MSVCRT__se_translator_function se_translator; /* preserve offset to exc_record and processing_throw */
void *unk6[3]; void *unk6;
int unk7;
EXCEPTION_RECORD *exc_record; EXCEPTION_RECORD *exc_record;
CONTEXT *ctx_record; CONTEXT *ctx_record;
int processing_throw; int processing_throw;
......
...@@ -100,12 +100,17 @@ typedef struct { ...@@ -100,12 +100,17 @@ typedef struct {
const wchar_t *locnameW; const wchar_t *locnameW;
} __lc_time_data; } __lc_time_data;
typedef void (__cdecl *_se_translator_function)(unsigned int code, struct _EXCEPTION_POINTERS *info);
static LONGLONG crt_init_end; static LONGLONG crt_init_end;
_ACRTIMP int __cdecl _o__initialize_onexit_table(_onexit_table_t *table); _ACRTIMP int __cdecl _o__initialize_onexit_table(_onexit_table_t *table);
_ACRTIMP int __cdecl _o__register_onexit_function(_onexit_table_t *table, _onexit_t func); _ACRTIMP int __cdecl _o__register_onexit_function(_onexit_table_t *table, _onexit_t func);
_ACRTIMP int __cdecl _o__execute_onexit_table(_onexit_table_t *table); _ACRTIMP int __cdecl _o__execute_onexit_table(_onexit_table_t *table);
_ACRTIMP void *__cdecl _o_malloc(size_t); _ACRTIMP void *__cdecl _o_malloc(size_t);
_se_translator_function __cdecl _set_se_translator(_se_translator_function func);
void** __cdecl __current_exception(void);
int* __cdecl __processing_throw(void);
static void test__initialize_onexit_table(void) static void test__initialize_onexit_table(void)
{ {
...@@ -1297,6 +1302,26 @@ static void test_clock(void) ...@@ -1297,6 +1302,26 @@ static void test_clock(void)
c, expect_min - thresh, expect_min + max_load_delay); c, expect_min - thresh, expect_min + max_load_delay);
} }
static void __cdecl se_translator(unsigned int u, EXCEPTION_POINTERS *ep)
{
}
static void test_thread_storage(void)
{
void **current_exception;
void *processing_throw;
_set_se_translator(se_translator);
current_exception = __current_exception();
processing_throw = __processing_throw();
ok(current_exception+2 == processing_throw,
"current_exception = %p, processing_throw = %p\n",
current_exception, processing_throw);
ok(current_exception[-2] == se_translator,
"can't find se_translator in thread storage\n");
}
START_TEST(misc) START_TEST(misc)
{ {
int arg_c; int arg_c;
...@@ -1335,4 +1360,5 @@ START_TEST(misc) ...@@ -1335,4 +1360,5 @@ START_TEST(misc)
test__stat32(); test__stat32();
test__o_malloc(); test__o_malloc();
test_clock(); test_clock();
test_thread_storage();
} }
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