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
3cd0834a
Commit
3cd0834a
authored
Jun 26, 2012
by
André Hentschel
Committed by
Alexandre Julliard
Jun 28, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Change LCMapStringW to LCMapStringEx and call it from LCMapStringW.
parent
823e214e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
15 deletions
+64
-15
kernel32.spec
dlls/kernel32/kernel32.spec
+1
-0
locale.c
dlls/kernel32/locale.c
+43
-13
locale.c
dlls/kernel32/tests/locale.c
+20
-2
No files found.
dlls/kernel32/kernel32.spec
View file @
3cd0834a
...
...
@@ -805,6 +805,7 @@
@ stdcall -i386 -private -register K32Thk1632Prolog() krnl386.exe16.K32Thk1632Prolog
@ stdcall LCIDToLocaleName(long ptr long long)
@ stdcall LCMapStringA(long long str long ptr long)
@ stdcall LCMapStringEx(wstr long wstr long ptr long ptr ptr long)
@ stdcall LCMapStringW(long long wstr long ptr long)
@ stdcall LZClose(long)
# @ stub LZCloseFile
...
...
dlls/kernel32/locale.c
View file @
3cd0834a
...
...
@@ -2493,17 +2493,35 @@ BOOL WINAPI GetStringTypeExA( LCID locale, DWORD type, LPCSTR src, INT count, LP
return
GetStringTypeA
(
locale
,
type
,
src
,
count
,
chartype
);
}
/*************************************************************************
* LCMapString
W
(KERNEL32.@)
* LCMapString
Ex
(KERNEL32.@)
*
* See LCMapStringA.
* Map characters in a locale sensitive string.
*
* PARAMS
* name [I] Locale name for the conversion.
* flags [I] Flags controlling the mapping (LCMAP_ constants from "winnls.h")
* src [I] String to map
* srclen [I] Length of src in chars, or -1 if src is NUL terminated
* dst [O] Destination for mapped string
* dstlen [I] Length of dst in characters
* version [I] reserved, must be NULL
* reserved [I] reserved, must be NULL
* lparam [I] reserved, must be 0
*
* RETURNS
* Success: The length of the mapped string in dst, including the NUL terminator.
* Failure: 0. Use GetLastError() to determine the cause.
*/
INT
WINAPI
LCMapString
W
(
LCID
lcid
,
DWORD
flags
,
LPCWSTR
src
,
INT
src
len
,
LPWSTR
dst
,
INT
dstlen
)
INT
WINAPI
LCMapString
Ex
(
LPCWSTR
name
,
DWORD
flags
,
LPCWSTR
src
,
INT
srclen
,
LPWSTR
dst
,
INT
dst
len
,
LPNLSVERSIONINFO
version
,
LPVOID
reserved
,
LPARAM
lparam
)
{
LPWSTR
dst_ptr
;
if
(
version
)
FIXME
(
"unsupported version structure %p
\n
"
,
version
);
if
(
reserved
)
FIXME
(
"unsupported reserved pointer %p
\n
"
,
reserved
);
if
(
lparam
)
FIXME
(
"unsupported lparam %lx
\n
"
,
lparam
);
if
(
!
src
||
!
srclen
||
dstlen
<
0
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
...
...
@@ -2522,8 +2540,6 @@ INT WINAPI LCMapStringW(LCID lcid, DWORD flags, LPCWSTR src, INT srclen,
if
(
!
dstlen
)
dst
=
NULL
;
lcid
=
ConvertDefaultLocale
(
lcid
);
if
(
flags
&
LCMAP_SORTKEY
)
{
INT
ret
;
...
...
@@ -2535,8 +2551,8 @@ INT WINAPI LCMapStringW(LCID lcid, DWORD flags, LPCWSTR src, INT srclen,
if
(
srclen
<
0
)
srclen
=
strlenW
(
src
);
TRACE
(
"(
0x%04x
,0x%08x,%s,%d,%p,%d)
\n
"
,
lcid
,
flags
,
debugstr_wn
(
src
,
srclen
),
srclen
,
dst
,
dstlen
);
TRACE
(
"(
%s
,0x%08x,%s,%d,%p,%d)
\n
"
,
debugstr_w
(
name
)
,
flags
,
debugstr_wn
(
src
,
srclen
),
srclen
,
dst
,
dstlen
);
ret
=
wine_get_sortkey
(
flags
,
src
,
srclen
,
(
char
*
)
dst
,
dstlen
);
if
(
ret
==
0
)
...
...
@@ -2555,8 +2571,8 @@ INT WINAPI LCMapStringW(LCID lcid, DWORD flags, LPCWSTR src, INT srclen,
if
(
srclen
<
0
)
srclen
=
strlenW
(
src
)
+
1
;
TRACE
(
"(
0x%04x
,0x%08x,%s,%d,%p,%d)
\n
"
,
lcid
,
flags
,
debugstr_wn
(
src
,
srclen
),
srclen
,
dst
,
dstlen
);
TRACE
(
"(
%s
,0x%08x,%s,%d,%p,%d)
\n
"
,
debugstr_w
(
name
)
,
flags
,
debugstr_wn
(
src
,
srclen
),
srclen
,
dst
,
dstlen
);
if
(
!
dst
)
/* return required string length */
{
...
...
@@ -2625,6 +2641,20 @@ INT WINAPI LCMapStringW(LCID lcid, DWORD flags, LPCWSTR src, INT srclen,
}
/*************************************************************************
* LCMapStringW (KERNEL32.@)
*
* See LCMapStringA.
*/
INT
WINAPI
LCMapStringW
(
LCID
lcid
,
DWORD
flags
,
LPCWSTR
src
,
INT
srclen
,
LPWSTR
dst
,
INT
dstlen
)
{
TRACE
(
"(0x%04x,0x%08x,%s,%d,%p,%d)
\n
"
,
lcid
,
flags
,
debugstr_wn
(
src
,
srclen
),
srclen
,
dst
,
dstlen
);
return
LCMapStringEx
(
NULL
,
flags
,
src
,
srclen
,
dst
,
dstlen
,
NULL
,
NULL
,
0
);
}
/*************************************************************************
* LCMapStringA (KERNEL32.@)
*
* Map characters in a locale sensitive string.
...
...
@@ -2693,7 +2723,7 @@ INT WINAPI LCMapStringA(LCID lcid, DWORD flags, LPCSTR src, INT srclen,
goto
map_string_exit
;
}
dstlenW
=
LCMapString
W
(
lcid
,
flags
,
srcW
,
srclenW
,
NULL
,
0
);
dstlenW
=
LCMapString
Ex
(
NULL
,
flags
,
srcW
,
srclenW
,
NULL
,
0
,
NULL
,
NULL
,
0
);
if
(
!
dstlenW
)
goto
map_string_exit
;
...
...
@@ -2704,7 +2734,7 @@ INT WINAPI LCMapStringA(LCID lcid, DWORD flags, LPCSTR src, INT srclen,
goto
map_string_exit
;
}
LCMapString
W
(
lcid
,
flags
,
srcW
,
srclenW
,
dstW
,
dstlenW
);
LCMapString
Ex
(
NULL
,
flags
,
srcW
,
srclenW
,
dstW
,
dstlenW
,
NULL
,
NULL
,
0
);
ret
=
WideCharToMultiByte
(
locale_cp
,
0
,
dstW
,
dstlenW
,
dst
,
dstlen
,
NULL
,
NULL
);
HeapFree
(
GetProcessHeap
(),
0
,
dstW
);
...
...
dlls/kernel32/tests/locale.c
View file @
3cd0834a
...
...
@@ -1652,8 +1652,18 @@ static INT LCMapStringW_wrapper(DWORD flags, LPCWSTR src, INT srclen, LPWSTR dst
static
void
test_LCMapStringW
(
void
)
{
int
ret
;
WCHAR
buf
[
256
];
trace
(
"testing LCMapStringW
\n
"
);
SetLastError
(
0xdeadbeef
);
ret
=
LCMapStringW
((
LCID
)
-
1
,
LCMAP_LOWERCASE
,
upper_case
,
-
1
,
buf
,
sizeof
(
buf
)
/
sizeof
(
WCHAR
));
todo_wine
{
ok
(
!
ret
,
"LCMapStringW should fail with bad lcid
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"unexpected error code %d
\n
"
,
GetLastError
());
}
test_lcmapstring_unicode
(
LCMapStringW_wrapper
,
"LCMapStringW:"
);
}
...
...
@@ -1665,16 +1675,24 @@ static INT LCMapStringEx_wrapper(DWORD flags, LPCWSTR src, INT srclen, LPWSTR ds
static
void
test_LCMapStringEx
(
void
)
{
int
ret
;
WCHAR
buf
[
256
];
WCHAR
buf
[
256
]
,
badname
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
't'
,
'e'
,
's'
,
't'
,
0
}
;
if
(
!
pLCMapStringEx
)
{
skip
(
"LCMapStringEx not available
\n
"
);
win_
skip
(
"LCMapStringEx not available
\n
"
);
return
;
}
trace
(
"testing LCMapStringEx
\n
"
);
SetLastError
(
0xdeadbeef
);
ret
=
pLCMapStringEx
(
badname
,
LCMAP_LOWERCASE
,
upper_case
,
-
1
,
buf
,
sizeof
(
buf
)
/
sizeof
(
WCHAR
),
NULL
,
NULL
,
0
);
todo_wine
{
ok
(
!
ret
,
"LCMapStringEx should fail with bad locale name
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"unexpected error code %d
\n
"
,
GetLastError
());
}
/* test reserved parameters */
ret
=
pLCMapStringEx
(
LOCALE_NAME_USER_DEFAULT
,
LCMAP_LOWERCASE
,
upper_case
,
-
1
,
buf
,
sizeof
(
buf
)
/
sizeof
(
WCHAR
),
NULL
,
NULL
,
1
);
...
...
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