Commit 27b5c936 authored by Michael Müller's avatar Michael Müller Committed by Alexandre Julliard

msvcp90: Basic_string_wchar_dtor should set EAX to 0 on i386.

parent 9d5173f7
...@@ -94,7 +94,7 @@ basic_string_char* __thiscall MSVCP_basic_string_char_ctor(basic_string_char*); ...@@ -94,7 +94,7 @@ basic_string_char* __thiscall MSVCP_basic_string_char_ctor(basic_string_char*);
basic_string_char* __thiscall MSVCP_basic_string_char_ctor_cstr(basic_string_char*, const char*); basic_string_char* __thiscall MSVCP_basic_string_char_ctor_cstr(basic_string_char*, const char*);
basic_string_char* __thiscall MSVCP_basic_string_char_ctor_cstr_len(basic_string_char*, const char*, MSVCP_size_t); basic_string_char* __thiscall MSVCP_basic_string_char_ctor_cstr_len(basic_string_char*, const char*, MSVCP_size_t);
basic_string_char* __thiscall MSVCP_basic_string_char_copy_ctor(basic_string_char*, const basic_string_char*); basic_string_char* __thiscall MSVCP_basic_string_char_copy_ctor(basic_string_char*, const basic_string_char*);
void __thiscall MSVCP_basic_string_char_dtor(basic_string_char*); void* __thiscall MSVCP_basic_string_char_dtor(basic_string_char*);
const char* __thiscall MSVCP_basic_string_char_c_str(const basic_string_char*); const char* __thiscall MSVCP_basic_string_char_c_str(const basic_string_char*);
void __thiscall MSVCP_basic_string_char_clear(basic_string_char*); void __thiscall MSVCP_basic_string_char_clear(basic_string_char*);
basic_string_char* __thiscall MSVCP_basic_string_char_append_ch(basic_string_char*, char); basic_string_char* __thiscall MSVCP_basic_string_char_append_ch(basic_string_char*, char);
...@@ -123,7 +123,7 @@ typedef struct ...@@ -123,7 +123,7 @@ typedef struct
basic_string_wchar* __thiscall MSVCP_basic_string_wchar_ctor(basic_string_wchar*); basic_string_wchar* __thiscall MSVCP_basic_string_wchar_ctor(basic_string_wchar*);
basic_string_wchar* __thiscall MSVCP_basic_string_wchar_ctor_cstr(basic_string_wchar*, const wchar_t*); basic_string_wchar* __thiscall MSVCP_basic_string_wchar_ctor_cstr(basic_string_wchar*, const wchar_t*);
basic_string_wchar* __thiscall MSVCP_basic_string_wchar_ctor_cstr_len(basic_string_wchar*, const wchar_t*, MSVCP_size_t); basic_string_wchar* __thiscall MSVCP_basic_string_wchar_ctor_cstr_len(basic_string_wchar*, const wchar_t*, MSVCP_size_t);
void __thiscall MSVCP_basic_string_wchar_dtor(basic_string_wchar*); void* __thiscall MSVCP_basic_string_wchar_dtor(basic_string_wchar*);
const wchar_t* __thiscall MSVCP_basic_string_wchar_c_str(const basic_string_wchar*); const wchar_t* __thiscall MSVCP_basic_string_wchar_c_str(const basic_string_wchar*);
void __thiscall MSVCP_basic_string_wchar_clear(basic_string_wchar*); void __thiscall MSVCP_basic_string_wchar_clear(basic_string_wchar*);
basic_string_wchar* __thiscall MSVCP_basic_string_wchar_append_ch(basic_string_wchar*, wchar_t); basic_string_wchar* __thiscall MSVCP_basic_string_wchar_append_ch(basic_string_wchar*, wchar_t);
......
...@@ -973,10 +973,11 @@ basic_string_char* __thiscall MSVCP_basic_string_char_ctor_ptr_ptr(basic_string_ ...@@ -973,10 +973,11 @@ basic_string_char* __thiscall MSVCP_basic_string_char_ctor_ptr_ptr(basic_string_
/* ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ */ /* ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ */
/* ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ */ /* ??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QEAA@XZ */
DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_dtor, 4) DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_char_dtor, 4)
void __thiscall MSVCP_basic_string_char_dtor(basic_string_char *this) void* __thiscall MSVCP_basic_string_char_dtor(basic_string_char *this)
{ {
TRACE("%p\n", this); TRACE("%p\n", this);
basic_string_char_tidy(this, TRUE, 0); basic_string_char_tidy(this, TRUE, 0);
return NULL; /* FEAR 1 installer expects EAX set to 0 */
} }
/* ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ */ /* ?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ */
...@@ -2785,10 +2786,11 @@ basic_string_wchar* __thiscall MSVCP_basic_string_wchar_ctor_ptr_ptr(basic_strin ...@@ -2785,10 +2786,11 @@ basic_string_wchar* __thiscall MSVCP_basic_string_wchar_ctor_ptr_ptr(basic_strin
/* ??1?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@XZ */ /* ??1?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QAE@XZ */
/* ??1?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@XZ */ /* ??1?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@QEAA@XZ */
DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_dtor, 4) DEFINE_THISCALL_WRAPPER(MSVCP_basic_string_wchar_dtor, 4)
void __thiscall MSVCP_basic_string_wchar_dtor(basic_string_wchar *this) void* __thiscall MSVCP_basic_string_wchar_dtor(basic_string_wchar *this)
{ {
TRACE("%p\n", this); TRACE("%p\n", this);
basic_string_wchar_tidy(this, TRUE, 0); basic_string_wchar_tidy(this, TRUE, 0);
return NULL; /* FEAR 1 installer expects EAX set to 0 */
} }
/* ?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIXZ */ /* ?size@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@QBEIXZ */
......
...@@ -63,7 +63,7 @@ static basic_string_char* (__cdecl *p_basic_string_char_concatenate_cstr)(basic_ ...@@ -63,7 +63,7 @@ static basic_string_char* (__cdecl *p_basic_string_char_concatenate_cstr)(basic_
static basic_string_char* (__thiscall *p_basic_string_char_ctor)(basic_string_char*); static basic_string_char* (__thiscall *p_basic_string_char_ctor)(basic_string_char*);
static basic_string_char* (__thiscall *p_basic_string_char_copy_ctor)(basic_string_char*, basic_string_char*); static basic_string_char* (__thiscall *p_basic_string_char_copy_ctor)(basic_string_char*, basic_string_char*);
static basic_string_char* (__thiscall *p_basic_string_char_ctor_cstr)(basic_string_char*, const char*); static basic_string_char* (__thiscall *p_basic_string_char_ctor_cstr)(basic_string_char*, const char*);
static void (__thiscall *p_basic_string_char_dtor)(basic_string_char*); static void* (__thiscall *p_basic_string_char_dtor)(basic_string_char*);
static basic_string_char* (__thiscall *p_basic_string_char_erase)(basic_string_char*, size_t, size_t); static basic_string_char* (__thiscall *p_basic_string_char_erase)(basic_string_char*, size_t, size_t);
static basic_string_char* (__thiscall *p_basic_string_char_assign_cstr_len)(basic_string_char*, const char*, size_t); static basic_string_char* (__thiscall *p_basic_string_char_assign_cstr_len)(basic_string_char*, const char*, size_t);
static const char* (__thiscall *p_basic_string_char_cstr)(basic_string_char*); static const char* (__thiscall *p_basic_string_char_cstr)(basic_string_char*);
...@@ -85,7 +85,7 @@ static size_t *p_basic_string_char_npos; ...@@ -85,7 +85,7 @@ static size_t *p_basic_string_char_npos;
static basic_string_wchar* (__thiscall *p_basic_string_wchar_ctor)(basic_string_wchar*); static basic_string_wchar* (__thiscall *p_basic_string_wchar_ctor)(basic_string_wchar*);
static basic_string_wchar* (__thiscall *p_basic_string_wchar_copy_ctor)(basic_string_wchar*, basic_string_wchar*); static basic_string_wchar* (__thiscall *p_basic_string_wchar_copy_ctor)(basic_string_wchar*, basic_string_wchar*);
static basic_string_wchar* (__thiscall *p_basic_string_wchar_ctor_cstr)(basic_string_wchar*, const wchar_t*); static basic_string_wchar* (__thiscall *p_basic_string_wchar_ctor_cstr)(basic_string_wchar*, const wchar_t*);
static void (__thiscall *p_basic_string_wchar_dtor)(basic_string_wchar*); static void* (__thiscall *p_basic_string_wchar_dtor)(basic_string_wchar*);
static basic_string_wchar* (__thiscall *p_basic_string_wchar_erase)(basic_string_wchar*, size_t, size_t); static basic_string_wchar* (__thiscall *p_basic_string_wchar_erase)(basic_string_wchar*, size_t, size_t);
static basic_string_wchar* (__thiscall *p_basic_string_wchar_assign_cstr_len)(basic_string_wchar*, const wchar_t*, size_t); static basic_string_wchar* (__thiscall *p_basic_string_wchar_assign_cstr_len)(basic_string_wchar*, const wchar_t*, size_t);
static const wchar_t* (__thiscall *p_basic_string_wchar_cstr)(basic_string_wchar*); static const wchar_t* (__thiscall *p_basic_string_wchar_cstr)(basic_string_wchar*);
...@@ -767,6 +767,26 @@ static void test_basic_string_char_find_last_not_of(void) { ...@@ -767,6 +767,26 @@ static void test_basic_string_char_find_last_not_of(void) {
} }
} }
static void test_basic_string_dtor(void) {
#ifdef __i386__
static const wchar_t qwerty[] = { 'q','w','e','r','t','y',0 };
basic_string_wchar str1;
basic_string_char str2;
void *ret;
/* FEAR 1 installer expects that string destructors set EAX to
* zero on return (see bug 37358). */
call_func2(p_basic_string_wchar_ctor_cstr, &str1, qwerty);
ret = call_func1(p_basic_string_wchar_dtor, &str1);
ok(ret == NULL, "expected NULL, got %p\n", ret);
call_func2(p_basic_string_char_ctor_cstr, &str2, "qwerty");
ret = call_func1(p_basic_string_char_dtor, &str2);
ok(ret == NULL, "expected NULL, got %p\n", ret);
#endif
}
START_TEST(string) START_TEST(string)
{ {
if(!init()) if(!init())
...@@ -783,6 +803,7 @@ START_TEST(string) ...@@ -783,6 +803,7 @@ START_TEST(string)
test_basic_string_wchar(); test_basic_string_wchar();
test_basic_string_wchar_swap(); test_basic_string_wchar_swap();
test_basic_string_char_find_last_not_of(); test_basic_string_char_find_last_not_of();
test_basic_string_dtor();
ok(!invalid_parameter, "invalid_parameter_handler was invoked too many times\n"); ok(!invalid_parameter, "invalid_parameter_handler was invoked too many times\n");
......
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