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
bf83236b
Commit
bf83236b
authored
Apr 06, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Simplify GetGeoInfoA() implementation.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8091f3a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
23 deletions
+3
-23
locale.c
dlls/kernel32/locale.c
+3
-23
No files found.
dlls/kernel32/locale.c
View file @
bf83236b
...
...
@@ -381,30 +381,10 @@ BOOL WINAPI EnumUILanguagesA( UILANGUAGE_ENUMPROCA proc, DWORD flags, LONG_PTR p
*/
INT
WINAPI
GetGeoInfoA
(
GEOID
geoid
,
GEOTYPE
geotype
,
LPSTR
data
,
int
data_len
,
LANGID
lang
)
{
WCHAR
*
buffW
;
INT
len
;
WCHAR
buffer
[
256
];
TRACE
(
"%ld %ld %p %d %d
\n
"
,
geoid
,
geotype
,
data
,
data_len
,
lang
);
len
=
GetGeoInfoW
(
geoid
,
geotype
,
NULL
,
0
,
lang
);
if
(
!
len
)
return
0
;
buffW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
if
(
!
buffW
)
return
0
;
GetGeoInfoW
(
geoid
,
geotype
,
buffW
,
len
,
lang
);
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
buffW
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
if
(
!
data
||
!
data_len
)
{
HeapFree
(
GetProcessHeap
(),
0
,
buffW
);
return
len
;
}
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
buffW
,
-
1
,
data
,
data_len
,
NULL
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
buffW
);
if
(
data_len
<
len
)
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
data_len
<
len
?
0
:
len
;
if
(
!
GetGeoInfoW
(
geoid
,
geotype
,
buffer
,
ARRAY_SIZE
(
buffer
),
lang
))
return
0
;
return
WideCharToMultiByte
(
CP_ACP
,
0
,
buffer
,
-
1
,
data
,
data_len
,
NULL
,
NULL
);
}
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