From 00c23e843305a39e53fe72c8b6978b3fa4993fe4 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Thu, 1 Aug 2013 16:15:11 +0000 Subject: [PATCH] [KERNEL32] * Sync GetLocaleInfoW with Wine 1.5.26. CORE-7281 svn path=/trunk/; revision=59614 --- reactos/dll/win32/kernel32/winnls/string/lang.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/kernel32/winnls/string/lang.c b/reactos/dll/win32/kernel32/winnls/string/lang.c index 7e77fa62167..4cd0b42c86b 100644 --- a/reactos/dll/win32/kernel32/winnls/string/lang.c +++ b/reactos/dll/win32/kernel32/winnls/string/lang.c @@ -754,6 +754,10 @@ INT WINAPI GetLocaleInfoA( LCID lcid, LCTYPE lctype, LPSTR buffer, INT len ) return ret; } +static int get_value_base_by_lctype( LCTYPE lctype ) +{ + return lctype == LOCALE_ILANGUAGE || lctype == LOCALE_IDEFAULTLANGUAGE ? 16 : 10; +} /****************************************************************************** * GetLocaleInfoW (KERNEL32.@) @@ -807,7 +811,7 @@ INT WINAPI GetLocaleInfoW( LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len ) if (ret > 0) { WCHAR *end; - UINT number = strtolW( tmp, &end, 10 ); + UINT number = strtolW( tmp, &end, get_value_base_by_lctype( lctype ) ); if (*end) /* invalid number */ { SetLastError( ERROR_INVALID_FLAGS ); @@ -880,7 +884,7 @@ INT WINAPI GetLocaleInfoW( LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len ) if (!tmp) return 0; memcpy( tmp, p + 1, *p * sizeof(WCHAR) ); tmp[*p] = 0; - number = strtolW( tmp, &end, 10 ); + number = strtolW( tmp, &end, get_value_base_by_lctype( lctype ) ); if (!*end) memcpy( buffer, &number, sizeof(number) ); else /* invalid number */