Piotr Caban : msvcp110: Add _Pad implementation.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Feb 24 11:01:42 CST 2016


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Tue Feb 23 13:13:18 2016 +0100

msvcp110: Add _Pad implementation.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/msvcp90/misc.c | 61 ++++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 46 insertions(+), 15 deletions(-)

diff --git a/dlls/msvcp90/misc.c b/dlls/msvcp90/misc.c
index c911867..fa4ff7b 100644
--- a/dlls/msvcp90/misc.c
+++ b/dlls/msvcp90/misc.c
@@ -892,8 +892,14 @@ extern const vtable_ptr MSVCP__Pad_vtable;
 DEFINE_THISCALL_WRAPPER(_Pad_ctor, 4)
 _Pad* __thiscall _Pad_ctor(_Pad *this)
 {
-    FIXME("(%p) stub\n", this);
-    return NULL;
+    TRACE("(%p)\n", this);
+
+    this->vtable = &MSVCP__Pad_vtable;
+    _Cnd_init(&this->cnd);
+    _Mtx_init(&this->mtx, 0);
+    this->launched = FALSE;
+    _Mtx_lock(&this->mtx);
+    return this;
 }
 
 /* ??4_Pad at std@@QAEAAV01 at ABV01@@Z */
@@ -901,8 +907,12 @@ _Pad* __thiscall _Pad_ctor(_Pad *this)
 DEFINE_THISCALL_WRAPPER(_Pad_op_assign, 8)
 _Pad* __thiscall _Pad_op_assign(_Pad *this, const _Pad *copy)
 {
-    FIXME("(%p %p) stub\n", this, copy);
-    return NULL;
+    TRACE("(%p %p)\n", this, copy);
+
+    this->cnd = copy->cnd;
+    this->mtx = copy->mtx;
+    this->launched = copy->launched;
+    return this;
 }
 
 /* ??0_Pad at std@@QAE at ABV01@@Z */
@@ -910,8 +920,10 @@ _Pad* __thiscall _Pad_op_assign(_Pad *this, const _Pad *copy)
 DEFINE_THISCALL_WRAPPER(_Pad_copy_ctor, 8)
 _Pad* __thiscall _Pad_copy_ctor(_Pad *this, const _Pad *copy)
 {
-    FIXME("(%p %p) stub\n", this, copy);
-    return NULL;
+    TRACE("(%p %p)\n", this, copy);
+
+    this->vtable = &MSVCP__Pad_vtable;
+    return _Pad_op_assign(this, copy);
 }
 
 /* ??1_Pad at std@@QAE at XZ */
@@ -919,7 +931,25 @@ _Pad* __thiscall _Pad_copy_ctor(_Pad *this, const _Pad *copy)
 DEFINE_THISCALL_WRAPPER(_Pad_dtor, 4)
 void __thiscall _Pad_dtor(_Pad *this)
 {
-    FIXME("(%p) stub\n", this);
+    TRACE("(%p)\n", this);
+
+    _Mtx_unlock(&this->mtx);
+    _Mtx_destroy(&this->mtx);
+    _Cnd_destroy(&this->cnd);
+}
+
+DEFINE_THISCALL_WRAPPER(_Pad__Go, 4)
+#define call__Pad__Go(this) CALL_VTBL_FUNC(this, 0, unsigned int, (_Pad*), (this))
+unsigned int __thiscall _Pad__Go(_Pad *this)
+{
+    ERR("(%p) should not be called\n", this);
+    return 0;
+}
+
+static DWORD WINAPI launch_thread_proc(void *arg)
+{
+    _Pad *this = arg;
+    return call__Pad__Go(this);
 }
 
 /* ?_Launch at _Pad@std@@QAEXPAU_Thrd_imp_t@@@Z */
@@ -927,7 +957,10 @@ void __thiscall _Pad_dtor(_Pad *this)
 DEFINE_THISCALL_WRAPPER(_Pad__Launch, 8)
 void __thiscall _Pad__Launch(_Pad *this, _Thrd_t *thr)
 {
-    FIXME("(%p %p) stub\n", this, thr);
+    TRACE("(%p %p)\n", this, thr);
+
+    _Thrd_start(thr, launch_thread_proc, this);
+    _Cnd_wait(&this->cnd, &this->mtx);
 }
 
 /* ?_Release at _Pad@std@@QAEXXZ */
@@ -935,14 +968,12 @@ void __thiscall _Pad__Launch(_Pad *this, _Thrd_t *thr)
 DEFINE_THISCALL_WRAPPER(_Pad__Release, 4)
 void __thiscall _Pad__Release(_Pad *this)
 {
-    FIXME("(%p) stub\n", this);
-}
+    TRACE("(%p)\n", this);
 
-DEFINE_THISCALL_WRAPPER(_Pad__Go, 4)
-unsigned int __thiscall _Pad__Go(_Pad *this)
-{
-    ERR("(%p) should not be called\n", this);
-    return 0;
+    _Mtx_lock(&this->mtx);
+    this->launched = TRUE;
+    _Cnd_signal(&this->cnd);
+    _Mtx_unlock(&this->mtx);
 }
 #endif
 




More information about the wine-cvs mailing list