Since b780e5f5b1bd018629bfa31431e216c7579fe9aa, as get_language_sort is now called from init_locale, this raises an unexpected exception at process startup, before the initial breakpoint exception.
It was causing some kernel32 debugger test failures.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/kernelbase/locale.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c index 623cb01280b6..06ad6ad01683 100644 --- a/dlls/kernelbase/locale.c +++ b/dlls/kernelbase/locale.c @@ -658,7 +658,7 @@ static const struct sortguid *get_language_sort( const WCHAR *locale ) const struct sortguid *ret; UNICODE_STRING str; GUID guid; - HKEY key; + HKEY key = INVALID_HANDLE_VALUE; DWORD size, type;
if (locale == LOCALE_NAME_USER_DEFAULT) @@ -690,7 +690,8 @@ static const struct sortguid *get_language_sort( const WCHAR *locale ) } ret = find_sortguid( &default_sort_guid ); done: - RegCloseKey( key ); + if (key != INVALID_HANDLE_VALUE) + RegCloseKey( key ); return ret; }