Author: akhaldi
Date: Mon Mar 30 21:45:18 2015
New Revision: 66985
URL: 
http://svn.reactos.org/svn/reactos?rev=66985&view=rev
Log:
[MLANG] Sync with Wine Staging 1.7.37. CORE-9246
Modified:
    trunk/reactos/dll/win32/mlang/mlang.c
    trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/mlang/mlang.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/mlang/mlang.c?re…
==============================================================================
--- trunk/reactos/dll/win32/mlang/mlang.c       [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/mlang/mlang.c       [iso-8859-1] Mon Mar 30 21:45:18 2015
@@ -68,6 +68,7 @@
     const char *web_charset;
     const char *header_charset;
     const char *body_charset;
+    const WCHAR *alias;
 } MIME_CP_INFO;
 /* These data are based on the codepage info in libs/unicode/cpmap.pl */
@@ -125,7 +126,13 @@
            MIMECONTF_IMPORT | MIMECONTF_SAVABLE_MAILNEWS |
            MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID_NLS |
            MIMECONTF_MIME_IE4 | MIMECONTF_MIME_LATEST,
-      "gb2312", "gb2312", "gb2312" }
+      "gb2312", "gb2312", "gb2312" },
+      { "Chinese Simplified (GBK)",
+      936, MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_MINIMAL |
+           MIMECONTF_IMPORT | MIMECONTF_SAVABLE_MAILNEWS |
+           MIMECONTF_SAVABLE_BROWSER | MIMECONTF_EXPORT | MIMECONTF_VALID_NLS |
+           MIMECONTF_MIME_IE4 | MIMECONTF_MIME_LATEST,
+      "gbk", "gbk", "gbk" }
 };
 static const MIME_CP_INFO chinese_traditional_cp[] =
 {
@@ -360,6 +367,9 @@
             MIMECONTF_MIME_LATEST,
       "windows-1258", "windows-1258", "windows-1258" }
 };
+
+static const WCHAR asciiW[] =
{'a','s','c','i','i',0};
+
 static const MIME_CP_INFO western_cp[] =
 {
     { "IBM EBCDIC (US-Canada)",
@@ -412,7 +422,7 @@
       20127, MIMECONTF_MAILNEWS | MIMECONTF_IMPORT | MIMECONTF_EXPORT |
              MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_VALID |
              MIMECONTF_VALID_NLS | MIMECONTF_MIME_LATEST,
-      "us-ascii", "us-ascii", "us-ascii" },
+      "us-ascii", "us-ascii", "us-ascii", asciiW },
     { "Western European (ISO)",
       28591, MIMECONTF_MAILNEWS | MIMECONTF_BROWSER | MIMECONTF_IMPORT |
              MIMECONTF_SAVABLE_MAILNEWS | MIMECONTF_SAVABLE_BROWSER |
@@ -956,7 +966,7 @@
             *pcDstSize = MultiByteToWideChar(dwEncoding, 0, pSrcStr, *pcSrcSize, NULL,
0);
         break;
     }
-
+
     if (!*pcDstSize)
         return E_FAIL;
@@ -1347,7 +1357,7 @@
     IClassFactoryImpl *This = impl_from_IClassFactory(iface);
     HRESULT hres;
     LPUNKNOWN punk;
-
+
     TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj);
     *ppobj = NULL;
@@ -2266,7 +2276,7 @@
     info->wszLocaleName[0] = 0;
     GetLocaleInfoW(info->lcid, LOCALE_SLANGUAGE, info->wszLocaleName,
MAX_LOCALE_NAME);
     TRACE("ISO639: %s SLANGUAGE: %s\n", wine_dbgstr_w(info->wszRfc1766),
wine_dbgstr_w(info->wszLocaleName));
-
+
     data->total++;
     return TRUE;
@@ -2597,6 +2607,13 @@
                 strcpyW(pCharsetInfo->wszCharset, csetW);
                 return S_OK;
             }
+            if (mlang_data[i].mime_cp_info[n].alias && !lstrcmpiW(Charset,
mlang_data[i].mime_cp_info[n].alias))
+            {
+                pCharsetInfo->uiCodePage = mlang_data[i].family_codepage;
+                pCharsetInfo->uiInternetEncoding = mlang_data[i].mime_cp_info[n].cp;
+                strcpyW(pCharsetInfo->wszCharset,
mlang_data[i].mime_cp_info[n].alias);
+                return S_OK;
+            }
         }
     }
@@ -2872,7 +2889,7 @@
  *
  * PARAMS
  *   see ConvertStringToUnicode
- *   dwFlag
+ *   dwFlag
  *   lpFallBack if dwFlag contains MLCONVCHARF_USEDEFCHAR, lpFallBack string used
  *              instead unconvertible characters.
  *
@@ -3050,10 +3067,17 @@
 {
     MLang_impl *This = impl_from_IMultiLanguage3( iface );
-    FIXME("(%p)->(%08x %s %u %p %u %p %p %p)\n", This, dwFlags,
debugstr_w(lpWideCharStr),
-          cchWideChar, puiPreferredCodePages, nPreferredCodePages, puiDetectedCodePages,
-          pnDetectedCodePages, lpSpecialChar);
-    return E_NOTIMPL;
+    FIXME("(%p)->(%08x %s %p %u %p %p(%u) %s)\n", This, dwFlags,
debugstr_w(lpWideCharStr),
+          puiPreferredCodePages, nPreferredCodePages, puiDetectedCodePages,
+          pnDetectedCodePages, pnDetectedCodePages ? *pnDetectedCodePages : 0,
+          debugstr_w(lpSpecialChar));
+
+    if (!puiDetectedCodePages || !pnDetectedCodePages || !*pnDetectedCodePages)
+        return E_INVALIDARG;
+
+    puiDetectedCodePages[0] = CP_UTF8;
+    *pnDetectedCodePages = 1;
+    return S_OK;
 }
 static HRESULT WINAPI fnIMultiLanguage3_DetectOutboundCodePageInIStream(
@@ -3068,10 +3092,17 @@
 {
     MLang_impl *This = impl_from_IMultiLanguage3( iface );
-    FIXME("(%p)->(%08x %p %p %u %p %p %p)\n", This, dwFlags, pStrIn,
+    FIXME("(%p)->(%08x %p %p %u %p %p(%u) %s)\n", This, dwFlags, pStrIn,
           puiPreferredCodePages, nPreferredCodePages, puiDetectedCodePages,
-          pnDetectedCodePages, lpSpecialChar);
-    return E_NOTIMPL;
+          pnDetectedCodePages, pnDetectedCodePages ? *pnDetectedCodePages : 0,
+          debugstr_w(lpSpecialChar));
+
+    if (!puiDetectedCodePages || !pnDetectedCodePages || !*pnDetectedCodePages)
+        return E_INVALIDARG;
+
+    puiDetectedCodePages[0] = CP_UTF8;
+    *pnDetectedCodePages = 1;
+    return S_OK;
 }
 static const IMultiLanguage3Vtbl IMultiLanguage3_vtbl =
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Mon Mar 30 21:45:18 2015
@@ -107,7 +107,7 @@
 reactos/dll/win32/mciseq              # Synced to WineStaging-1.7.37
 reactos/dll/win32/mciwave             # Synced to WineStaging-1.7.37
 reactos/dll/win32/mgmtapi             # Synced to Wine-1.7.27
-reactos/dll/win32/mlang               # Synced to Wine-1.7.27
+reactos/dll/win32/mlang               # Synced to WineStaging-1.7.37
 reactos/dll/win32/mmdevapi            # Synced to Wine-1.7.27
 reactos/dll/win32/mpr                 # Synced to Wine-1.7.27
 reactos/dll/win32/mprapi              # Synced to Wine-1.7.27