[KERNEL32] Convert default locales to actual locale identifiers, before passing to...
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 7 Aug 2010 22:41:23 +0000 (22:41 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 7 Aug 2010 22:41:23 +0000 (22:41 +0000)
[SHLWAPI] Fix some comments (As usual: "should be sent to wine")
Patch by Rafal HarabieÅ„, <rafalh1992 AT o2 DOT pl>

See issue #5557 for more details.

svn path=/trunk/; revision=48482

reactos/dll/win32/kernel32/misc/lcformat.c
reactos/dll/win32/shlwapi/string.c

index 72f909d..132452b 100644 (file)
@@ -1044,8 +1044,10 @@ INT WINAPI GetNumberFormatW(LCID lcid, DWORD dwFlags,
   TRACE("(0x%04x,0x%08x,%s,%p,%p,%d)\n", lcid, dwFlags, debugstr_w(lpszValue),
         lpFormat, lpNumberStr, cchOut);
 
+  lcid = ConvertDefaultLocale(lcid);
+
   if (!lpszValue || cchOut < 0 || (cchOut > 0 && !lpNumberStr) ||
-      !IsValidLocale(lcid, 0) ||
+      !IsValidLocale(lcid, LCID_INSTALLED) ||
       (lpFormat && (dwFlags || !lpFormat->lpDecimalSep || !lpFormat->lpThousandSep)))
   {
     goto error;
@@ -1415,8 +1417,10 @@ INT WINAPI GetCurrencyFormatW(LCID lcid, DWORD dwFlags,
   TRACE("(0x%04x,0x%08x,%s,%p,%p,%d)\n", lcid, dwFlags, debugstr_w(lpszValue),
         lpFormat, lpCurrencyStr, cchOut);
 
+  lcid = ConvertDefaultLocale(lcid);
+
   if (!lpszValue || cchOut < 0 || (cchOut > 0 && !lpCurrencyStr) ||
-      !IsValidLocale(lcid, 0) ||
+      !IsValidLocale(lcid, LCID_INSTALLED) ||
       (lpFormat && (dwFlags || !lpFormat->lpDecimalSep || !lpFormat->lpThousandSep ||
       !lpFormat->lpCurrencySymbol || lpFormat->NegativeOrder > 15 ||
       lpFormat->PositiveOrder > 3)))
index 6102f3c..1609c38 100644 (file)
@@ -91,7 +91,7 @@ static void FillNumberFmt(NUMBERFMTW *fmt, LPWSTR decimal_buffer, int decimal_bu
  * Format an integer according to the current locale
  *
  * RETURNS
- *  The number of bytes written on success or 0 on failure
+ *  The number of characters written on success or 0 on failure
  */
 static int FormatInt(LONGLONG qdwValue, LPWSTR pszBuf, int cchBuf)
 {
@@ -124,7 +124,7 @@ static int FormatInt(LONGLONG qdwValue, LPWSTR pszBuf, int cchBuf)
  * after the decimal point
  *
  * RETURNS
- *  The number of bytes written on success or 0 on failure
+ *  The number of characters written on success or 0 on failure
  */
 static int FormatDouble(double value, int decimals, LPWSTR pszBuf, int cchBuf)
 {