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
f989011b
Commit
f989011b
authored
Apr 05, 2011
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 06, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Added wctob implementation.
parent
2ab5b833
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
59 additions
and
5 deletions
+59
-5
msvcr100.spec
dlls/msvcr100/msvcr100.spec
+1
-1
msvcr80.spec
dlls/msvcr80/msvcr80.spec
+1
-1
msvcr90.spec
dlls/msvcr90/msvcr90.spec
+1
-1
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+1
-1
string.c
dlls/msvcrt/tests/string.c
+39
-0
wcs.c
dlls/msvcrt/wcs.c
+16
-1
No files found.
dlls/msvcr100/msvcr100.spec
View file @
f989011b
...
...
@@ -1659,7 +1659,7 @@
@ cdecl wcstombs_s(ptr ptr long wstr long) msvcrt.wcstombs_s
@ cdecl wcstoul(wstr ptr long) msvcrt.wcstoul
@ stub wcsxfrm
@
stub
wctob
@
cdecl wctob(long) msvcrt.
wctob
@ cdecl wctomb(ptr long) msvcrt.wctomb
@ stub wctomb_s
@ stub wmemcpy_s
...
...
dlls/msvcr80/msvcr80.spec
View file @
f989011b
...
...
@@ -1513,7 +1513,7 @@
@ cdecl wcstombs_s(ptr ptr long wstr long) msvcrt.wcstombs_s
@ cdecl wcstoul(wstr ptr long) msvcrt.wcstoul
@ stub wcsxfrm
@
stub
wctob
@
cdecl wctob(long) msvcrt.
wctob
@ cdecl wctomb(ptr long) msvcrt.wctomb
@ stub wctomb_s
@ varargs wprintf(wstr) msvcrt.wprintf
...
...
dlls/msvcr90/msvcr90.spec
View file @
f989011b
...
...
@@ -1497,7 +1497,7 @@
@ cdecl wcstombs_s(ptr ptr long wstr long) msvcrt.wcstombs_s
@ cdecl wcstoul(wstr ptr long) msvcrt.wcstoul
@ stub wcsxfrm
@
stub
wctob
@
cdecl wctob(long) msvcrt.
wctob
@ cdecl wctomb(ptr long) msvcrt.wctomb
@ stub wctomb_s
@ varargs wprintf(wstr) msvcrt.wprintf
...
...
dlls/msvcrt/msvcrt.spec
View file @
f989011b
...
...
@@ -1468,7 +1468,7 @@
@ cdecl wcstombs_s(ptr ptr long wstr long) MSVCRT_wcstombs_s
@ cdecl wcstoul(wstr ptr long) ntdll.wcstoul
@ stub wcsxfrm #(ptr wstr long) MSVCRT_wcsxfrm
# stub
wctob
@ cdecl wctob(long) MSVCRT_
wctob
@ cdecl wctomb(ptr long) MSVCRT_wctomb
# stub wctomb_s
@ varargs wprintf(wstr) MSVCRT_wprintf
...
...
dlls/msvcrt/tests/string.c
View file @
f989011b
...
...
@@ -78,6 +78,7 @@ static _invalid_parameter_handler (__cdecl *p_set_invalid_parameter_handler)(_in
static
int
(
__cdecl
*
p_wcslwr_s
)(
wchar_t
*
,
size_t
);
static
errno_t
(
__cdecl
*
p_mbsupr_s
)(
unsigned
char
*
str
,
size_t
numberOfElements
);
static
errno_t
(
__cdecl
*
p_mbslwr_s
)(
unsigned
char
*
str
,
size_t
numberOfElements
);
static
int
(
__cdecl
*
p_wctob
)(
wint_t
);
#define SETNOFAIL(x,y) x = (void*)GetProcAddress(hMsvcrt,y)
#define SET(x,y) SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y)
...
...
@@ -1913,6 +1914,40 @@ static void test__ultoa_s(void)
buffer
);
}
static
void
test_wctob
(
void
)
{
int
ret
;
if
(
!
p_wctob
||
!
setlocale
(
LC_ALL
,
"chinese-traditional"
))
{
win_skip
(
"Skipping wctob tests
\n
"
);
return
;
}
ret
=
p_wctob
(
0x8141
);
ok
(
ret
==
EOF
,
"ret = %x
\n
"
,
ret
);
ret
=
p_wctob
(
0x81
);
ok
(
ret
==
EOF
,
"ret = %x
\n
"
,
ret
);
ret
=
p_wctob
(
0xe0
);
ok
(
ret
==
0x61
,
"ret = %x
\n
"
,
ret
);
_setmbcp
(
1250
);
ret
=
p_wctob
(
0x81
);
/* wctob should not be affected by _setmbcp */
todo_wine
ok
(
ret
==
EOF
,
"ret = %x
\n
"
,
ret
);
setlocale
(
LC_ALL
,
"C"
);
ret
=
p_wctob
(
0x8141
);
ok
(
ret
==
EOF
,
"ret = %x
\n
"
,
ret
);
ret
=
p_wctob
(
0x81
);
ok
(
ret
==
(
int
)(
char
)
0x81
,
"ret = %x
\n
"
,
ret
);
ret
=
p_wctob
(
0xe0
);
ok
(
ret
==
(
int
)(
char
)
0xe0
,
"ret = %x
\n
"
,
ret
);
}
START_TEST
(
string
)
{
char
mem
[
100
];
...
...
@@ -1947,6 +1982,7 @@ START_TEST(string)
p_wcslwr_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"_wcslwr_s"
);
p_mbsupr_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"_mbsupr_s"
);
p_mbslwr_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"_mbslwr_s"
);
p_wctob
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"wctob"
);
/* MSVCRT memcpy behaves like memmove for overlapping moves,
MFC42 CString::Insert seems to rely on that behaviour */
...
...
@@ -1989,4 +2025,7 @@ START_TEST(string)
test__wcslwr_s
();
test__mbsupr_s
();
test__mbslwr_s
();
/* This test is changing locale */
test_wctob
();
}
dlls/msvcrt/wcs.c
View file @
f989011b
...
...
@@ -1501,11 +1501,26 @@ MSVCRT_wchar_t * CDECL MSVCRT_wcstok( MSVCRT_wchar_t *str, const MSVCRT_wchar_t
}
/*********************************************************************
* wctob (MSVCRT.@)
*/
INT
CDECL
MSVCRT_wctob
(
MSVCRT_wint_t
wchar
)
{
MSVCRT__locale_t
locale
=
get_locale
();
char
out
;
BOOL
error
;
if
(
WideCharToMultiByte
(
locale
->
locinfo
->
lc_codepage
,
0
,
&
wchar
,
1
,
&
out
,
1
,
NULL
,
&
error
)
&&
!
error
)
return
(
INT
)
out
;
return
MSVCRT_EOF
;
}
/*********************************************************************
* wctomb (MSVCRT.@)
*/
INT
CDECL
MSVCRT_wctomb
(
char
*
dst
,
MSVCRT_wchar_t
ch
)
{
return
WideCharToMultiByte
(
CP_ACP
,
0
,
&
ch
,
1
,
dst
,
6
,
NULL
,
NULL
);
MSVCRT__locale_t
locale
=
get_locale
();
return
WideCharToMultiByte
(
locale
->
locinfo
->
lc_codepage
,
0
,
&
ch
,
1
,
dst
,
6
,
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