diff --git a/dlls/ntdll/locale.c b/dlls/ntdll/locale.c index 19626a48b72..b3a225a30c3 100644 --- a/dlls/ntdll/locale.c +++ b/dlls/ntdll/locale.c @@ -100,8 +100,6 @@ struct norm_table /* WORD[] composition character sequences */ }; -LCID user_lcid = 0, system_lcid = 0; - static NLSTABLEINFO nls_info; static HMODULE kernel32_handle; static struct norm_table *norm_tables[16]; diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 72340a171c9..b69ad762300 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -85,9 +85,6 @@ extern const struct unix_funcs *unix_funcs DECLSPEC_HIDDEN; extern struct _KUSER_SHARED_DATA *user_shared_data DECLSPEC_HIDDEN; -/* locale */ -extern LCID user_lcid, system_lcid; - extern int CDECL NTDLL__vsnprintf( char *str, SIZE_T len, const char *format, __ms_va_list args ) DECLSPEC_HIDDEN; extern int CDECL NTDLL__vsnwprintf( WCHAR *str, SIZE_T len, const WCHAR *format, __ms_va_list args ) DECLSPEC_HIDDEN; diff --git a/dlls/ntdll/resource.c b/dlls/ntdll/resource.c index 981c538a8e0..58a0fc7d2e2 100644 --- a/dlls/ntdll/resource.c +++ b/dlls/ntdll/resource.c @@ -175,6 +175,7 @@ static const IMAGE_RESOURCE_DIRECTORY *find_entry_by_name( const IMAGE_RESOURCE_ static NTSTATUS find_entry( HMODULE hmod, const LDR_RESOURCE_INFO *info, ULONG level, const void **ret, int want_dir ) { + static LCID user_lcid, system_lcid; ULONG size; const void *root; const IMAGE_RESOURCE_DIRECTORY *resdirptr; @@ -212,6 +213,8 @@ static NTSTATUS find_entry( HMODULE hmod, const LDR_RESOURCE_INFO *info, /* user defaults, unless SYS_DEFAULT sublanguage specified */ if (SUBLANGID(info->Language) != SUBLANG_SYS_DEFAULT) { + if (!user_lcid) NtQueryDefaultLocale( TRUE, &user_lcid ); + /* 4. current thread locale language */ pos = push_language( list, pos, LANGIDFROMLCID(NtCurrentTeb()->CurrentLocale) ); @@ -223,6 +226,7 @@ static NTSTATUS find_entry( HMODULE hmod, const LDR_RESOURCE_INFO *info, } /* now system defaults */ + if (!system_lcid) NtQueryDefaultLocale( FALSE, &system_lcid ); /* 7. system locale language */ pos = push_language( list, pos, LANGIDFROMLCID( system_lcid ) );