Piotr Caban : msvcp120: Add _Do_call implementation.

Alexandre Julliard julliard at wine.codeweavers.com
Fri May 22 04:48:25 CDT 2015


Module: wine
Branch: master
Commit: d20c5965f1a29a2469125beb36bda03e995d583d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d20c5965f1a29a2469125beb36bda03e995d583d

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Wed May 20 22:19:06 2015 +0200

msvcp120: Add _Do_call implementation.

---

 dlls/msvcp110/msvcp110.spec         |  2 +-
 dlls/msvcp120/msvcp120.spec         |  2 +-
 dlls/msvcp120/tests/msvcp120.c      | 28 ++++++++++++++++++++++++++++
 dlls/msvcp120_app/msvcp120_app.spec |  2 +-
 dlls/msvcp90/misc.c                 |  5 +++++
 5 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/dlls/msvcp110/msvcp110.spec b/dlls/msvcp110/msvcp110.spec
index c87eb66..f43ed92 100644
--- a/dlls/msvcp110/msvcp110.spec
+++ b/dlls/msvcp110/msvcp110.spec
@@ -3742,7 +3742,7 @@
 @ extern _Denorm
 @ stub _Dint
 @ stub _Dnorm
-@ stub _Do_call
+@ cdecl _Do_call(ptr)
 @ stub _Dscale
 @ stub _Dtento
 @ stub _Dtest
diff --git a/dlls/msvcp120/msvcp120.spec b/dlls/msvcp120/msvcp120.spec
index b84a380..f2330df 100644
--- a/dlls/msvcp120/msvcp120.spec
+++ b/dlls/msvcp120/msvcp120.spec
@@ -3683,7 +3683,7 @@
 @ extern _Denorm
 @ stub _Dint
 @ stub _Dnorm
-@ stub _Do_call
+@ cdecl _Do_call(ptr)
 @ stub _Dscale
 @ stub _Dtento
 @ stub _Dtest
diff --git a/dlls/msvcp120/tests/msvcp120.c b/dlls/msvcp120/tests/msvcp120.c
index f89543f..b5b4301 100644
--- a/dlls/msvcp120/tests/msvcp120.c
+++ b/dlls/msvcp120/tests/msvcp120.c
@@ -45,6 +45,7 @@ static int (__cdecl *p_xtime_get)(xtime*, int);
 static _Cvtvec* (__cdecl *p__Getcvt)(_Cvtvec*);
 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__Do_call)(void *this);
 
 static HMODULE msvcp;
 
@@ -64,6 +65,7 @@ static BOOL init(void)
     p__Getcvt = (void*)GetProcAddress(msvcp, "_Getcvt");
     p__Call_once = (void*)GetProcAddress(msvcp, "_Call_once");
     p__Call_onceEx = (void*)GetProcAddress(msvcp, "_Call_onceEx");
+    p__Do_call = (void*)GetProcAddress(msvcp, "_Do_call");
 
     msvcr = GetModuleHandleA("msvcr120.dll");
     p_setlocale = (void*)GetProcAddress(msvcr, "setlocale");
@@ -244,6 +246,31 @@ static void test__Call_once(void)
     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)
 {
     if(!init()) return;
@@ -251,6 +278,7 @@ START_TEST(msvcp120)
     test_xtime_get();
     test__Getcvt();
     test__Call_once();
+    test__Do_call();
 
     FreeLibrary(msvcp);
 }
diff --git a/dlls/msvcp120_app/msvcp120_app.spec b/dlls/msvcp120_app/msvcp120_app.spec
index bdfea8b..dd3f6df 100644
--- a/dlls/msvcp120_app/msvcp120_app.spec
+++ b/dlls/msvcp120_app/msvcp120_app.spec
@@ -3683,7 +3683,7 @@
 @ extern _Denorm msvcp120._Denorm
 @ stub _Dint
 @ stub _Dnorm
-@ stub _Do_call
+@ cdecl _Do_call(ptr) msvcp120._Do_call
 @ stub _Dscale
 @ stub _Dtento
 @ stub _Dtest
diff --git a/dlls/msvcp90/misc.c b/dlls/msvcp90/misc.c
index 22f90c8..c8bb2bd 100644
--- a/dlls/msvcp90/misc.c
+++ b/dlls/msvcp90/misc.c
@@ -663,6 +663,11 @@ void __cdecl _Call_once(int *once, void (__cdecl *func)(void))
     TRACE("%p %p\n", once, func);
     _Call_onceEx(once, call_once_func_wrapper, func);
 }
+
+void __cdecl _Do_call(void *this)
+{
+    CALL_VTBL_FUNC(this, 0, void, (void*), (this));
+}
 #endif
 
 void init_misc(void *base)




More information about the wine-cvs mailing list