Commit 46fd718e authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Fetch locale information from the Unix side in resource loading.

parent 40e1000f
...@@ -100,8 +100,6 @@ struct norm_table ...@@ -100,8 +100,6 @@ struct norm_table
/* WORD[] composition character sequences */ /* WORD[] composition character sequences */
}; };
LCID user_lcid = 0, system_lcid = 0;
static NLSTABLEINFO nls_info; static NLSTABLEINFO nls_info;
static HMODULE kernel32_handle; static HMODULE kernel32_handle;
static struct norm_table *norm_tables[16]; static struct norm_table *norm_tables[16];
......
...@@ -85,9 +85,6 @@ extern const struct unix_funcs *unix_funcs DECLSPEC_HIDDEN; ...@@ -85,9 +85,6 @@ extern const struct unix_funcs *unix_funcs DECLSPEC_HIDDEN;
extern struct _KUSER_SHARED_DATA *user_shared_data 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__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; extern int CDECL NTDLL__vsnwprintf( WCHAR *str, SIZE_T len, const WCHAR *format, __ms_va_list args ) DECLSPEC_HIDDEN;
......
...@@ -175,6 +175,7 @@ static const IMAGE_RESOURCE_DIRECTORY *find_entry_by_name( const IMAGE_RESOURCE_ ...@@ -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, static NTSTATUS find_entry( HMODULE hmod, const LDR_RESOURCE_INFO *info,
ULONG level, const void **ret, int want_dir ) ULONG level, const void **ret, int want_dir )
{ {
static LCID user_lcid, system_lcid;
ULONG size; ULONG size;
const void *root; const void *root;
const IMAGE_RESOURCE_DIRECTORY *resdirptr; const IMAGE_RESOURCE_DIRECTORY *resdirptr;
...@@ -212,6 +213,8 @@ static NTSTATUS find_entry( HMODULE hmod, const LDR_RESOURCE_INFO *info, ...@@ -212,6 +213,8 @@ static NTSTATUS find_entry( HMODULE hmod, const LDR_RESOURCE_INFO *info,
/* user defaults, unless SYS_DEFAULT sublanguage specified */ /* user defaults, unless SYS_DEFAULT sublanguage specified */
if (SUBLANGID(info->Language) != SUBLANG_SYS_DEFAULT) if (SUBLANGID(info->Language) != SUBLANG_SYS_DEFAULT)
{ {
if (!user_lcid) NtQueryDefaultLocale( TRUE, &user_lcid );
/* 4. current thread locale language */ /* 4. current thread locale language */
pos = push_language( list, pos, LANGIDFROMLCID(NtCurrentTeb()->CurrentLocale) ); pos = push_language( list, pos, LANGIDFROMLCID(NtCurrentTeb()->CurrentLocale) );
...@@ -223,6 +226,7 @@ static NTSTATUS find_entry( HMODULE hmod, const LDR_RESOURCE_INFO *info, ...@@ -223,6 +226,7 @@ static NTSTATUS find_entry( HMODULE hmod, const LDR_RESOURCE_INFO *info,
} }
/* now system defaults */ /* now system defaults */
if (!system_lcid) NtQueryDefaultLocale( FALSE, &system_lcid );
/* 7. system locale language */ /* 7. system locale language */
pos = push_language( list, pos, LANGIDFROMLCID( system_lcid ) ); pos = push_language( list, pos, LANGIDFROMLCID( system_lcid ) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment