Aric Stewart : mlang: Implementation of base functionality of IMultiLanguage2:: ValidateCodePage and IMultiLanguage2::ValidateCodePageEx.

Alexandre Julliard julliard at winehq.org
Fri Jan 30 07:58:25 CST 2009


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

Author: Aric Stewart <aric at codeweavers.com>
Date:   Wed Jan 28 07:38:11 2009 -0600

mlang: Implementation of base functionality of IMultiLanguage2::ValidateCodePage and IMultiLanguage2::ValidateCodePageEx.

Does not handle automatically installing language packs.
With help from Dmitry Timoshkov.

---

 dlls/mlang/mlang.c |   25 ++++++++++++++++++++++---
 include/mlang.idl  |    3 +++
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/dlls/mlang/mlang.c b/dlls/mlang/mlang.c
index 375f102..e002046 100644
--- a/dlls/mlang/mlang.c
+++ b/dlls/mlang/mlang.c
@@ -2910,8 +2910,7 @@ static HRESULT WINAPI fnIMultiLanguage2_ValidateCodePage(
     UINT uiCodePage,
     HWND hwnd)
 {
-    FIXME("%u, %p\n", uiCodePage, hwnd);
-    return E_NOTIMPL;
+    return IMultiLanguage2_ValidateCodePageEx(iface,uiCodePage,hwnd,0);
 }
 
 static HRESULT WINAPI fnIMultiLanguage2_GetCodePageDescription(
@@ -2989,8 +2988,28 @@ static HRESULT WINAPI fnIMultiLanguage2_ValidateCodePageEx(
     HWND hwnd,
     DWORD dwfIODControl)
 {
+    int i;
     ICOM_THIS_MULTI(MLang_impl, vtbl_IMultiLanguage3, iface);
-    FIXME("%p %u %p %08x: stub!\n", This, uiCodePage, hwnd, dwfIODControl);
+
+    TRACE("%p %u %p %08x\n", This, uiCodePage, hwnd, dwfIODControl);
+
+    /* quick check for kernel32 supported code pages */
+    if (IsValidCodePage(uiCodePage))
+        return S_OK;
+
+    /* check for mlang supported code pages */
+    for (i = 0; i < sizeof(mlang_data)/sizeof(mlang_data[0]); i++)
+    {
+        int n;
+        for (n = 0; n < mlang_data[i].number_of_cp; n++)
+        {
+            if (mlang_data[i].mime_cp_info[n].cp == uiCodePage)
+                return S_OK;
+        }
+    }
+
+    if (dwfIODControl != CPIOD_PEEK)
+        FIXME("Request to install codepage language pack not handled\n");
 
     return S_FALSE;
 }
diff --git a/include/mlang.idl b/include/mlang.idl
index 6f00734..bcc0917 100644
--- a/include/mlang.idl
+++ b/include/mlang.idl
@@ -27,6 +27,9 @@ cpp_quote("#ifndef _WINNT_")
 typedef WORD LANGID;
 cpp_quote("#endif")
 
+cpp_quote("#define CPIOD_PEEK          0x40000000")
+cpp_quote("#define CPIOD_FORCE_PROMPT  0x80000000")
+
 [
   object,
   uuid(359f3443-bd4a-11d0-b188-00aa0038c969),




More information about the wine-cvs mailing list