Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
fffbe3fc
Commit
fffbe3fc
authored
Mar 24, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Load the locale.nls file at startup.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
55b45d00
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
8 deletions
+36
-8
locale.c
dlls/kernelbase/locale.c
+36
-8
No files found.
dlls/kernelbase/locale.c
View file @
fffbe3fc
...
...
@@ -571,9 +571,15 @@ struct norm_table
static
NLSTABLEINFO
nls_info
;
static
UINT
unix_cp
=
CP_UTF8
;
static
UINT
mac_cp
=
10000
;
static
LCID
system_lcid
;
static
LCID
user_lcid
;
static
HKEY
intl_key
;
static
HKEY
nls_key
;
static
HKEY
tz_key
;
static
const
NLS_LOCALE_LCID_INDEX
*
lcids_index
;
static
const
NLS_LOCALE_LCNAME_INDEX
*
lcnames_index
;
static
const
NLS_LOCALE_HEADER
*
locale_table
;
static
const
WCHAR
*
locale_strings
;
static
CPTABLEINFO
codepages
[
128
];
static
unsigned
int
nb_codepages
;
...
...
@@ -620,6 +626,30 @@ static CRITICAL_SECTION_DEBUG critsect_debug =
static
CRITICAL_SECTION
locale_section
=
{
&
critsect_debug
,
-
1
,
0
,
0
,
0
,
0
};
static
void
load_locale_nls
(
void
)
{
struct
{
UINT
ctypes
;
UINT
unknown1
;
UINT
unknown2
;
UINT
unknown3
;
UINT
locales
;
UINT
charmaps
;
UINT
geoids
;
UINT
scripts
;
}
*
header
;
LCID
lcid
;
LARGE_INTEGER
dummy
;
RtlGetLocaleFileMappingAddress
(
(
void
**
)
&
header
,
&
lcid
,
&
dummy
);
locale_table
=
(
const
NLS_LOCALE_HEADER
*
)((
char
*
)
header
+
header
->
locales
);
lcids_index
=
(
const
NLS_LOCALE_LCID_INDEX
*
)((
char
*
)
locale_table
+
locale_table
->
lcids_offset
);
lcnames_index
=
(
const
NLS_LOCALE_LCNAME_INDEX
*
)((
char
*
)
locale_table
+
locale_table
->
lcnames_offset
);
locale_strings
=
(
const
WCHAR
*
)((
char
*
)
locale_table
+
locale_table
->
strings_offset
);
}
static
void
init_sortkeys
(
DWORD
*
ptr
)
{
WORD
*
ctype
;
...
...
@@ -707,7 +737,6 @@ void init_locale(void)
UINT
ansi_cp
=
0
,
oem_cp
=
0
;
USHORT
*
ansi_ptr
,
*
oem_ptr
;
void
*
sort_ptr
;
LCID
user_lcid
;
WCHAR
bufferW
[
LOCALE_NAME_MAX_LENGTH
];
DYNAMIC_TIME_ZONE_INFORMATION
timezone
;
GEOID
geoid
=
GEOID_NOT_AVAILABLE
;
...
...
@@ -715,6 +744,10 @@ void init_locale(void)
SIZE_T
size
;
HKEY
hkey
;
load_locale_nls
();
NtQueryDefaultLocale
(
FALSE
,
&
system_lcid
);
NtQueryDefaultLocale
(
FALSE
,
&
user_lcid
);
if
(
GetEnvironmentVariableW
(
L"WINEUNIXCP"
,
bufferW
,
ARRAY_SIZE
(
bufferW
)
))
unix_cp
=
wcstoul
(
bufferW
,
NULL
,
10
);
...
...
@@ -775,7 +808,6 @@ void init_locale(void)
/* Update registry contents if the user locale has changed.
* This simulates the action of the Windows control panel. */
user_lcid
=
GetUserDefaultLCID
();
count
=
sizeof
(
bufferW
);
if
(
!
RegQueryValueExW
(
intl_key
,
L"Locale"
,
NULL
,
NULL
,
(
BYTE
*
)
bufferW
,
&
count
))
{
...
...
@@ -4671,9 +4703,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH GetStringTypeExW( LCID locale, DWORD type, const W
*/
LCID
WINAPI
DECLSPEC_HOTPATCH
GetSystemDefaultLCID
(
void
)
{
LCID
lcid
;
NtQueryDefaultLocale
(
FALSE
,
&
lcid
);
return
lcid
;
return
system_lcid
;
}
...
...
@@ -4820,9 +4850,7 @@ done:
*/
LCID
WINAPI
DECLSPEC_HOTPATCH
GetUserDefaultLCID
(
void
)
{
LCID
lcid
;
NtQueryDefaultLocale
(
TRUE
,
&
lcid
);
return
lcid
;
return
user_lcid
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment