Author: akhaldi
Date: Wed Oct 22 17:52:18 2014
New Revision: 64896
URL:
http://svn.reactos.org/svn/reactos?rev=64896&view=rev
Log:
[KERNEL32]
* Sync LCMapString{A,W} with Wine 1.7.27.
CORE-8540
Modified:
trunk/reactos/dll/win32/kernel32/winnls/string/lang.c
Modified: trunk/reactos/dll/win32/kernel32/winnls/string/lang.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/winnls/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/winnls/string/lang.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/winnls/string/lang.c [iso-8859-1] Wed Oct 22 17:52:18
2014
@@ -1386,16 +1386,34 @@
return GetStringTypeA(locale, type, src, count, chartype);
}
-
/*************************************************************************
- * LCMapStringW (KERNEL32.@)
- *
- * See LCMapStringA.
- */
-INT WINAPI LCMapStringW(LCID lcid, DWORD flags, LPCWSTR src, INT srclen,
- LPWSTR dst, INT dstlen)
+ * LCMapStringEx (KERNEL32.@)
+ *
+ * Map characters in a locale sensitive string.
+ *
+ * PARAMS
+ * name [I] Locale name for the conversion.
+ * flags [I] Flags controlling the mapping (LCMAP_ constants from
"winnls.h")
+ * src [I] String to map
+ * srclen [I] Length of src in chars, or -1 if src is NUL terminated
+ * dst [O] Destination for mapped string
+ * dstlen [I] Length of dst in characters
+ * version [I] reserved, must be NULL
+ * reserved [I] reserved, must be NULL
+ * lparam [I] reserved, must be 0
+ *
+ * RETURNS
+ * Success: The length of the mapped string in dst, including the NUL terminator.
+ * Failure: 0. Use GetLastError() to determine the cause.
+ */
+INT WINAPI LCMapStringEx(LPCWSTR name, DWORD flags, LPCWSTR src, INT srclen, LPWSTR dst,
INT dstlen,
+ LPNLSVERSIONINFO version, LPVOID reserved, LPARAM lparam)
{
LPWSTR dst_ptr;
+
+ if (version) FIXME("unsupported version structure %p\n", version);
+ if (reserved) FIXME("unsupported reserved pointer %p\n", reserved);
+ if (lparam) FIXME("unsupported lparam %lx\n", lparam);
if (!src || !srclen || dstlen < 0)
{
@@ -1414,8 +1432,6 @@
}
if (!dstlen) dst = NULL;
-
- lcid = ConvertDefaultLocale(lcid);
if (flags & LCMAP_SORTKEY)
{
@@ -1428,8 +1444,8 @@
if (srclen < 0) srclen = strlenW(src);
- TRACE("(0x%04x,0x%08x,%s,%d,%p,%d)\n",
- lcid, flags, debugstr_wn(src, srclen), srclen, dst, dstlen);
+ TRACE("(%s,0x%08x,%s,%d,%p,%d)\n",
+ debugstr_w(name), flags, debugstr_wn(src, srclen), srclen, dst, dstlen);
ret = wine_get_sortkey(flags, src, srclen, (char *)dst, dstlen);
if (ret == 0)
@@ -1448,8 +1464,8 @@
if (srclen < 0) srclen = strlenW(src) + 1;
- TRACE("(0x%04x,0x%08x,%s,%d,%p,%d)\n",
- lcid, flags, debugstr_wn(src, srclen), srclen, dst, dstlen);
+ TRACE("(%s,0x%08x,%s,%d,%p,%d)\n",
+ debugstr_w(name), flags, debugstr_wn(src, srclen), srclen, dst, dstlen);
if (!dst) /* return required string length */
{
@@ -1518,6 +1534,20 @@
}
/*************************************************************************
+ * LCMapStringW (KERNEL32.@)
+ *
+ * See LCMapStringA.
+ */
+INT WINAPI LCMapStringW(LCID lcid, DWORD flags, LPCWSTR src, INT srclen,
+ LPWSTR dst, INT dstlen)
+{
+ TRACE("(0x%04x,0x%08x,%s,%d,%p,%d)\n",
+ lcid, flags, debugstr_wn(src, srclen), srclen, dst, dstlen);
+
+ return LCMapStringEx(NULL, flags, src, srclen, dst, dstlen, NULL, NULL, 0);
+}
+
+/*************************************************************************
* LCMapStringA (KERNEL32.@)
*
* Map characters in a locale sensitive string.
@@ -1586,7 +1616,7 @@
goto map_string_exit;
}
- dstlenW = LCMapStringW(lcid, flags, srcW, srclenW, NULL, 0);
+ dstlenW = LCMapStringEx(NULL, flags, srcW, srclenW, NULL, 0, NULL, NULL, 0);
if (!dstlenW)
goto map_string_exit;
@@ -1597,7 +1627,7 @@
goto map_string_exit;
}
- LCMapStringW(lcid, flags, srcW, srclenW, dstW, dstlenW);
+ LCMapStringEx(NULL, flags, srcW, srclenW, dstW, dstlenW, NULL, NULL, 0);
ret = WideCharToMultiByte(locale_cp, 0, dstW, dstlenW, dst, dstlen, NULL, NULL);
HeapFree(GetProcessHeap(), 0, dstW);