Piotr Caban : msvcp90: Added locale::_Addfac implementation.

Alexandre Julliard julliard at winehq.org
Fri Nov 25 10:27:32 CST 2011


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

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Fri Nov 25 10:45:55 2011 +0100

msvcp90: Added locale::_Addfac implementation.

---

 dlls/msvcp90/locale.c |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/dlls/msvcp90/locale.c b/dlls/msvcp90/locale.c
index 61a3353..f985136 100644
--- a/dlls/msvcp90/locale.c
+++ b/dlls/msvcp90/locale.c
@@ -579,8 +579,27 @@ MSVCP_bool __thiscall locale_operator_not_equal(const locale *this, locale const
 DEFINE_THISCALL_WRAPPER(locale__Addfac, 16)
 locale* __thiscall locale__Addfac(locale *this, locale_facet *facet, MSVCP_size_t id, MSVCP_size_t catmask)
 {
-    FIXME("(%p %p %lu %lu) stub\n", this, facet, id, catmask);
-    return NULL;
+    TRACE("(%p %p %lu %lu)\n", this, facet, id, catmask);
+
+    if(this->ptr->facet.refs > 1) {
+        locale__Locimp *new_ptr = MSVCRT_operator_new(sizeof(locale__Locimp));
+        if(!new_ptr) {
+            ERR("Out of memory\n");
+            throw_exception(EXCEPTION_BAD_ALLOC, NULL);
+            return NULL;
+        }
+        locale__Locimp_copy_ctor(new_ptr, this->ptr);
+        locale_facet__Decref(&this->ptr->facet);
+        this->ptr = new_ptr;
+    }
+
+    locale__Locimp__Addfac(this->ptr, facet, id);
+
+    if(catmask) {
+        MSVCP_basic_string_char_dtor(&this->ptr->name);
+        MSVCP_basic_string_char_ctor_cstr(&this->ptr->name, "*");
+    }
+    return this;
 }
 
 /* ?_Getfacet at locale@std@@QBEPBVfacet at 12@I at Z */




More information about the wine-cvs mailing list