Alexandre Julliard : kernelbase: Move get_language_sort() to avoid forward declarations.
Alexandre Julliard
julliard at winehq.org
Mon May 16 15:37:57 CDT 2022
Module: wine
Branch: master
Commit: 093f6cbb8cc7126d1624771f67619e54c43de53c
URL: https://source.winehq.org/git/wine.git/?a=commit;h=093f6cbb8cc7126d1624771f67619e54c43de53c
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon May 16 18:16:04 2022 +0200
kernelbase: Move get_language_sort() to avoid forward declarations.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/kernelbase/locale.c | 86 ++++++++++++++++++++++++------------------------
1 file changed, 43 insertions(+), 43 deletions(-)
diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c
index 73e6953ec51..5986e3537ee 100644
--- a/dlls/kernelbase/locale.c
+++ b/dlls/kernelbase/locale.c
@@ -439,49 +439,6 @@ static const struct sortguid *find_sortguid( const GUID *guid )
}
-static const struct sortguid *get_language_sort( const WCHAR *locale )
-{
- WCHAR *p, *end, buffer[LOCALE_NAME_MAX_LENGTH], guidstr[39];
- const struct sortguid *ret;
- UNICODE_STRING str;
- GUID guid;
- HKEY key = 0;
- DWORD size, type;
-
- if (locale == LOCALE_NAME_USER_DEFAULT)
- {
- if (current_locale_sort) return current_locale_sort;
- GetUserDefaultLocaleName( buffer, ARRAY_SIZE( buffer ));
- }
- else lstrcpynW( buffer, locale, LOCALE_NAME_MAX_LENGTH );
-
- if (buffer[0] && !RegOpenKeyExW( nls_key, L"Sorting\\Ids", 0, KEY_READ, &key ))
- {
- for (;;)
- {
- size = sizeof(guidstr);
- if (!RegQueryValueExW( key, buffer, NULL, &type, (BYTE *)guidstr, &size ) && type == REG_SZ)
- {
- RtlInitUnicodeString( &str, guidstr );
- if (!RtlGUIDFromString( &str, &guid ))
- {
- ret = find_sortguid( &guid );
- goto done;
- }
- break;
- }
- for (p = end = buffer; *p; p++) if (*p == '-' || *p == '_') end = p;
- if (end == buffer) break;
- *end = 0;
- }
- }
- ret = find_sortguid( &default_sort_guid );
-done:
- RegCloseKey( key );
- return ret;
-}
-
-
static const NLS_LOCALE_DATA *get_locale_data( UINT idx )
{
ULONG offset = locale_table->locales_offset + idx * locale_table->locale_size;
@@ -593,6 +550,49 @@ static const NLS_LOCALE_DATA *get_locale_by_name( const WCHAR *name, LCID *lcid
}
+static const struct sortguid *get_language_sort( const WCHAR *locale )
+{
+ WCHAR *p, *end, buffer[LOCALE_NAME_MAX_LENGTH], guidstr[39];
+ const struct sortguid *ret;
+ UNICODE_STRING str;
+ GUID guid;
+ HKEY key = 0;
+ DWORD size, type;
+
+ if (locale == LOCALE_NAME_USER_DEFAULT)
+ {
+ if (current_locale_sort) return current_locale_sort;
+ GetUserDefaultLocaleName( buffer, ARRAY_SIZE( buffer ));
+ }
+ else lstrcpynW( buffer, locale, LOCALE_NAME_MAX_LENGTH );
+
+ if (buffer[0] && !RegOpenKeyExW( nls_key, L"Sorting\\Ids", 0, KEY_READ, &key ))
+ {
+ for (;;)
+ {
+ size = sizeof(guidstr);
+ if (!RegQueryValueExW( key, buffer, NULL, &type, (BYTE *)guidstr, &size ) && type == REG_SZ)
+ {
+ RtlInitUnicodeString( &str, guidstr );
+ if (!RtlGUIDFromString( &str, &guid ))
+ {
+ ret = find_sortguid( &guid );
+ goto done;
+ }
+ break;
+ }
+ for (p = end = buffer; *p; p++) if (*p == '-' || *p == '_') end = p;
+ if (end == buffer) break;
+ *end = 0;
+ }
+ }
+ ret = find_sortguid( &default_sort_guid );
+done:
+ RegCloseKey( key );
+ return ret;
+}
+
+
/******************************************************************************
* NlsValidateLocale (kernelbase.@)
*
More information about the wine-cvs
mailing list