Piotr Caban : msvcp90: Added locale::id class implementation.

Alexandre Julliard julliard at winehq.org
Wed Aug 24 14:05:26 CDT 2011


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Wed Aug 24 14:38:35 2011 +0200

msvcp90: Added locale::id class implementation.

---

 dlls/msvcp90/locale.c  |   29 +++++++++++++++++++++--------
 dlls/msvcp90/misc.c    |    5 -----
 dlls/msvcp90/msvcp90.h |    8 ++++++++
 3 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c
index af20c7e..c0279db 100644
--- a/dlls/msvcp90/locale.c
+++ b/dlls/msvcp90/locale.c
@@ -91,8 +91,10 @@ static const vtable_ptr MSVCP_locale_facet_vtable[];
 DEFINE_THISCALL_WRAPPER(locale_id_ctor_id, 8)
 locale_id* __thiscall locale_id_ctor_id(locale_id *this, MSVCP_size_t id)
 {
-    FIXME("(%p %lu) stub\n", this, id);
-    return NULL;
+    TRACE("(%p %lu)\n", this, id);
+
+    this->id = id;
+    return this;
 }
 
 /* ??_Fid at locale@std@@QAEXXZ */
@@ -100,8 +102,10 @@ locale_id* __thiscall locale_id_ctor_id(locale_id *this, MSVCP_size_t id)
 DEFINE_THISCALL_WRAPPER(locale_id_ctor, 4)
 locale_id* __thiscall locale_id_ctor(locale_id *this)
 {
-    FIXME("(%p) stub\n", this);
-    return NULL;
+    TRACE("(%p)\n", this);
+
+    this->id = 0;
+    return this;
 }
 
 /* ??Bid at locale@std@@QAEIXZ */
@@ -109,16 +113,25 @@ locale_id* __thiscall locale_id_ctor(locale_id *this)
 DEFINE_THISCALL_WRAPPER(locale_id_operator_size_t, 4)
 MSVCP_size_t __thiscall locale_id_operator_size_t(locale_id *this)
 {
-    FIXME("(%p) stub\n", this);
-    return 0;
+    _Lockit lock;
+
+    TRACE("(%p)\n", this);
+
+    if(!this->id) {
+        _Lockit_ctor_locktype(&lock, _LOCK_LOCALE);
+        this->id = ++locale_id__Id_cnt;
+        _Lockit_dtor(&lock);
+    }
+
+    return this->id;
 }
 
 /* ?_Id_cnt_func at id@locale at std@@CAAAHXZ */
 /* ?_Id_cnt_func at id@locale at std@@CAAEAHXZ */
 int* __cdecl locale_id__Id_cnt_func(void)
 {
-    FIXME("stub\n");
-    return NULL;
+    TRACE("\n");
+    return &locale_id__Id_cnt;
 }
 
 /* ??_Ffacet at locale@std@@QAEXXZ */
diff --git a/dlls/msvcp90/misc.c b/dlls/msvcp90/misc.c
index 19f76a0..3a3cb9f 100644
--- a/dlls/msvcp90/misc.c
+++ b/dlls/msvcp90/misc.c
@@ -87,11 +87,6 @@ void CDECL mutex_mutex_dtor(mutex *m)
     mutex_dtor(m);
 }
 
-#define _LOCK_LOCALE 0
-#define _LOCK_MALLOC 1
-#define _LOCK_STREAM 2
-#define _LOCK_DEBUG 3
-#define _MAX_LOCK 4
 static CRITICAL_SECTION lockit_cs[_MAX_LOCK];
 
 /* ?_Lockit_ctor at _Lockit@std@@SAXH at Z */
diff --git a/dlls/msvcp90/msvcp90.h b/dlls/msvcp90/msvcp90.h
index d848782..6bc81ba 100644
--- a/dlls/msvcp90/msvcp90.h
+++ b/dlls/msvcp90/msvcp90.h
@@ -200,8 +200,16 @@ typedef struct {
     int locktype;
 } _Lockit;
 
+#define _LOCK_LOCALE 0
+#define _LOCK_MALLOC 1
+#define _LOCK_STREAM 2
+#define _LOCK_DEBUG 3
+#define _MAX_LOCK 4
+
 void init_lockit(void);
 void free_lockit(void);
+_Lockit* __thiscall _Lockit_ctor_locktype(_Lockit*, int);
+void __thiscall _Lockit_dtor(_Lockit*);
 
 /* class mutex */
 typedef struct {




More information about the wine-cvs mailing list