Commit d20c5965 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcp120: Add _Do_call implementation.

parent a7a3cd84
...@@ -3742,7 +3742,7 @@ ...@@ -3742,7 +3742,7 @@
@ extern _Denorm @ extern _Denorm
@ stub _Dint @ stub _Dint
@ stub _Dnorm @ stub _Dnorm
@ stub _Do_call @ cdecl _Do_call(ptr)
@ stub _Dscale @ stub _Dscale
@ stub _Dtento @ stub _Dtento
@ stub _Dtest @ stub _Dtest
......
...@@ -3683,7 +3683,7 @@ ...@@ -3683,7 +3683,7 @@
@ extern _Denorm @ extern _Denorm
@ stub _Dint @ stub _Dint
@ stub _Dnorm @ stub _Dnorm
@ stub _Do_call @ cdecl _Do_call(ptr)
@ stub _Dscale @ stub _Dscale
@ stub _Dtento @ stub _Dtento
@ stub _Dtest @ stub _Dtest
......
...@@ -45,6 +45,7 @@ static int (__cdecl *p_xtime_get)(xtime*, int); ...@@ -45,6 +45,7 @@ static int (__cdecl *p_xtime_get)(xtime*, int);
static _Cvtvec* (__cdecl *p__Getcvt)(_Cvtvec*); static _Cvtvec* (__cdecl *p__Getcvt)(_Cvtvec*);
static void (CDECL *p__Call_once)(int *once, void (CDECL *func)(void)); static void (CDECL *p__Call_once)(int *once, void (CDECL *func)(void));
static void (CDECL *p__Call_onceEx)(int *once, void (CDECL *func)(void*), void *argv); static void (CDECL *p__Call_onceEx)(int *once, void (CDECL *func)(void*), void *argv);
static void (CDECL *p__Do_call)(void *this);
static HMODULE msvcp; static HMODULE msvcp;
...@@ -64,6 +65,7 @@ static BOOL init(void) ...@@ -64,6 +65,7 @@ static BOOL init(void)
p__Getcvt = (void*)GetProcAddress(msvcp, "_Getcvt"); p__Getcvt = (void*)GetProcAddress(msvcp, "_Getcvt");
p__Call_once = (void*)GetProcAddress(msvcp, "_Call_once"); p__Call_once = (void*)GetProcAddress(msvcp, "_Call_once");
p__Call_onceEx = (void*)GetProcAddress(msvcp, "_Call_onceEx"); p__Call_onceEx = (void*)GetProcAddress(msvcp, "_Call_onceEx");
p__Do_call = (void*)GetProcAddress(msvcp, "_Do_call");
msvcr = GetModuleHandleA("msvcr120.dll"); msvcr = GetModuleHandleA("msvcr120.dll");
p_setlocale = (void*)GetProcAddress(msvcr, "setlocale"); p_setlocale = (void*)GetProcAddress(msvcr, "setlocale");
...@@ -244,6 +246,31 @@ static void test__Call_once(void) ...@@ -244,6 +246,31 @@ static void test__Call_once(void)
ok(once == 1, "once = %x\n", once); ok(once == 1, "once = %x\n", once);
} }
static void **vtbl_func0;
#ifdef __i386__
/* TODO: this should be a __thiscall function */
static void __stdcall thiscall_func(void)
{
cnt = 1;
}
#else
static void __cdecl thiscall_func(void *this)
{
ok(this == &vtbl_func0, "incorrect this value\n");
cnt = 1;
}
#endif
static void test__Do_call(void)
{
void *pfunc = thiscall_func;
cnt = 0;
vtbl_func0 = &pfunc;
p__Do_call(&vtbl_func0);
ok(cnt == 1, "func was not called\n");
}
START_TEST(msvcp120) START_TEST(msvcp120)
{ {
if(!init()) return; if(!init()) return;
...@@ -251,6 +278,7 @@ START_TEST(msvcp120) ...@@ -251,6 +278,7 @@ START_TEST(msvcp120)
test_xtime_get(); test_xtime_get();
test__Getcvt(); test__Getcvt();
test__Call_once(); test__Call_once();
test__Do_call();
FreeLibrary(msvcp); FreeLibrary(msvcp);
} }
...@@ -3683,7 +3683,7 @@ ...@@ -3683,7 +3683,7 @@
@ extern _Denorm msvcp120._Denorm @ extern _Denorm msvcp120._Denorm
@ stub _Dint @ stub _Dint
@ stub _Dnorm @ stub _Dnorm
@ stub _Do_call @ cdecl _Do_call(ptr) msvcp120._Do_call
@ stub _Dscale @ stub _Dscale
@ stub _Dtento @ stub _Dtento
@ stub _Dtest @ stub _Dtest
......
...@@ -663,6 +663,11 @@ void __cdecl _Call_once(int *once, void (__cdecl *func)(void)) ...@@ -663,6 +663,11 @@ void __cdecl _Call_once(int *once, void (__cdecl *func)(void))
TRACE("%p %p\n", once, func); TRACE("%p %p\n", once, func);
_Call_onceEx(once, call_once_func_wrapper, func); _Call_onceEx(once, call_once_func_wrapper, func);
} }
void __cdecl _Do_call(void *this)
{
CALL_VTBL_FUNC(this, 0, void, (void*), (this));
}
#endif #endif
void init_misc(void *base) void init_misc(void *base)
......
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