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
59ee8787
Commit
59ee8787
authored
Jul 16, 2020
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Improve __crtLCMapStringA implementation.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2aa58e43
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
6 deletions
+46
-6
locale.c
dlls/msvcrt/locale.c
+46
-6
No files found.
dlls/msvcrt/locale.c
View file @
59ee8787
...
...
@@ -713,12 +713,52 @@ int CDECL __crtLCMapStringA(
LCID
lcid
,
DWORD
mapflags
,
const
char
*
src
,
int
srclen
,
char
*
dst
,
int
dstlen
,
unsigned
int
codepage
,
int
xflag
)
{
FIXME
(
"(lcid %x, flags %x, %s(%d), %p(%d), %x, %d), partial stub!
\n
"
,
lcid
,
mapflags
,
src
,
srclen
,
dst
,
dstlen
,
codepage
,
xflag
);
/* FIXME: A bit incorrect. But msvcrt itself just converts its
* arguments to wide strings and then calls LCMapStringW
*/
return
LCMapStringA
(
lcid
,
mapflags
,
src
,
srclen
,
dst
,
dstlen
);
WCHAR
buf_in
[
32
],
*
in
=
buf_in
;
WCHAR
buf_out
[
32
],
*
out
=
buf_out
;
int
in_len
,
out_len
,
r
;
TRACE
(
"(lcid %x, flags %x, %s(%d), %p(%d), %x, %d), partial stub!
\n
"
,
lcid
,
mapflags
,
src
,
srclen
,
dst
,
dstlen
,
codepage
,
xflag
);
in_len
=
MultiByteToWideChar
(
codepage
,
MB_ERR_INVALID_CHARS
,
src
,
srclen
,
NULL
,
0
);
if
(
!
in_len
)
return
0
;
if
(
in_len
>
ARRAY_SIZE
(
buf_in
))
{
in
=
malloc
(
in_len
*
sizeof
(
WCHAR
));
if
(
!
in
)
return
0
;
}
r
=
MultiByteToWideChar
(
codepage
,
MB_ERR_INVALID_CHARS
,
src
,
srclen
,
in
,
in_len
);
if
(
!
r
)
goto
done
;
if
(
mapflags
&
LCMAP_SORTKEY
)
{
r
=
LCMapStringW
(
lcid
,
mapflags
,
in
,
in_len
,
(
WCHAR
*
)
dst
,
dstlen
);
goto
done
;
}
r
=
LCMapStringW
(
lcid
,
mapflags
,
in
,
in_len
,
NULL
,
0
);
if
(
!
r
)
goto
done
;
out_len
=
r
;
if
(
r
>
ARRAY_SIZE
(
buf_out
))
{
out
=
malloc
(
r
*
sizeof
(
WCHAR
));
if
(
!
out
)
{
r
=
0
;
goto
done
;
}
}
r
=
LCMapStringW
(
lcid
,
mapflags
,
in
,
in_len
,
out
,
out_len
);
if
(
!
r
)
goto
done
;
r
=
WideCharToMultiByte
(
codepage
,
0
,
out
,
out_len
,
dst
,
dstlen
,
NULL
,
NULL
);
done:
if
(
in
!=
buf_in
)
free
(
in
);
if
(
out
!=
buf_out
)
free
(
out
);
return
r
;
}
/*********************************************************************
...
...
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