Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
e9eec98d
Commit
e9eec98d
authored
Jun 24, 2015
by
Piotr Caban
Committed by
Alexandre Julliard
Jun 24, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Cache locale string to LCID conversion results.
parent
b9557e92
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
locale.c
dlls/msvcrt/locale.c
+13
-0
msvcrt.h
dlls/msvcrt/msvcrt.h
+6
-1
No files found.
dlls/msvcrt/locale.c
View file @
e9eec98d
...
...
@@ -217,10 +217,17 @@ extern int atoi(const char *);
/* Internal: Find the LCID for a locale specification */
LCID
MSVCRT_locale_to_LCID
(
const
char
*
locale
,
unsigned
short
*
codepage
)
{
thread_data_t
*
data
=
msvcrt_get_thread_data
();
LCID
lcid
;
locale_search_t
search
;
const
char
*
cp
,
*
region
;
if
(
!
strcmp
(
locale
,
data
->
cached_locale
))
{
if
(
codepage
)
*
codepage
=
data
->
cached_cp
;
return
data
->
cached_lcid
;
}
memset
(
&
search
,
0
,
sizeof
(
locale_search_t
));
cp
=
strchr
(
locale
,
'.'
);
...
...
@@ -292,6 +299,12 @@ LCID MSVCRT_locale_to_LCID(const char *locale, unsigned short *codepage)
if
(
codepage
)
*
codepage
=
atoi
(
search
.
found_codepage
);
if
(
strlen
(
locale
)
<
sizeof
(
data
->
cached_locale
))
{
strcpy
(
data
->
cached_locale
,
locale
);
data
->
cached_lcid
=
lcid
;
data
->
cached_cp
=
codepage
?
*
codepage
:
atoi
(
search
.
found_codepage
);
}
return
lcid
;
}
...
...
dlls/msvcrt/msvcrt.h
View file @
e9eec98d
...
...
@@ -237,7 +237,12 @@ struct __thread_data {
void
*
unk6
[
3
];
int
unk7
;
EXCEPTION_RECORD
*
exc_record
;
void
*
unk8
[
100
];
void
*
unk8
[
7
];
LCID
cached_lcid
;
int
unk9
[
3
];
DWORD
cached_cp
;
char
cached_locale
[
131
];
void
*
unk10
[
100
];
};
typedef
struct
__thread_data
thread_data_t
;
...
...
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