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
fd2ecee0
Commit
fd2ecee0
authored
Apr 11, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Avoid redundant locale lookups in GetLocaleInfoA().
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
23834ee3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
+13
-5
locale.c
dlls/kernelbase/locale.c
+13
-5
No files found.
dlls/kernelbase/locale.c
View file @
fd2ecee0
...
...
@@ -5098,6 +5098,7 @@ INT WINAPI DECLSPEC_HOTPATCH GetGeoInfoW( GEOID id, GEOTYPE type, WCHAR *data, i
*/
INT
WINAPI
DECLSPEC_HOTPATCH
GetLocaleInfoA
(
LCID
lcid
,
LCTYPE
lctype
,
char
*
buffer
,
INT
len
)
{
const
NLS_LOCALE_DATA
*
locale
;
WCHAR
*
bufferW
;
INT
lenW
,
ret
;
...
...
@@ -5113,19 +5114,26 @@ INT WINAPI DECLSPEC_HOTPATCH GetLocaleInfoA( LCID lcid, LCTYPE lctype, char *buf
SetLastError
(
ERROR_INVALID_FLAGS
);
return
0
;
}
if
(
!
(
locale
=
NlsValidateLocale
(
&
lcid
,
0
)))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
if
(
LOWORD
(
lctype
)
==
LOCALE_FONTSIGNATURE
||
(
lctype
&
LOCALE_RETURN_NUMBER
))
return
GetLocaleInfoW
(
lcid
,
lctype
,
(
WCHAR
*
)
buffer
,
len
/
sizeof
(
WCHAR
)
)
*
sizeof
(
WCHAR
);
{
ret
=
get_locale_info
(
locale
,
lcid
,
lctype
,
(
WCHAR
*
)
buffer
,
len
/
sizeof
(
WCHAR
)
);
return
ret
*
sizeof
(
WCHAR
);
}
if
(
!
(
lenW
=
GetLocaleInfoW
(
lcid
,
lctype
,
NULL
,
0
)))
return
0
;
if
(
!
(
lenW
=
get_locale_info
(
locale
,
lcid
,
lctype
,
NULL
,
0
)))
return
0
;
if
(
!
(
bufferW
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
lenW
*
sizeof
(
WCHAR
)
)))
{
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
return
0
;
}
ret
=
GetLocaleInfoW
(
lcid
,
lctype
,
bufferW
,
lenW
);
if
(
ret
)
ret
=
WideCharToMultiByte
(
get_l
cid_codepage
(
lcid
,
lctype
),
0
,
ret
=
get_locale_info
(
locale
,
lcid
,
lctype
,
bufferW
,
lenW
);
if
(
ret
)
ret
=
WideCharToMultiByte
(
get_l
ocale_codepage
(
locale
,
lctype
),
0
,
bufferW
,
ret
,
buffer
,
len
,
NULL
,
NULL
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
bufferW
);
return
ret
;
...
...
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