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
3af24fe1
Commit
3af24fe1
authored
Dec 23, 2014
by
Piotr Caban
Committed by
Alexandre Julliard
Dec 23, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Add _wcsset_s implementation.
parent
8bfbe613
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
64 additions
and
7 deletions
+64
-7
msvcr100.spec
dlls/msvcr100/msvcr100.spec
+1
-1
msvcr110.spec
dlls/msvcr110/msvcr110.spec
+1
-1
msvcr120.spec
dlls/msvcr120/msvcr120.spec
+1
-1
msvcr120_app.spec
dlls/msvcr120_app/msvcr120_app.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
+37
-0
wcs.c
dlls/msvcrt/wcs.c
+20
-0
No files found.
dlls/msvcr100/msvcr100.spec
View file @
3af24fe1
...
...
@@ -1509,7 +1509,7 @@
@ stub _wcsnset_s
@ cdecl _wcsrev(wstr) MSVCRT__wcsrev
@ cdecl _wcsset(wstr long) MSVCRT__wcsset
@
stub
_wcsset_s
@
cdecl _wcsset_s(wstr long long) MSVCRT_
_wcsset_s
@ cdecl _wcstod_l(wstr ptr) MSVCRT__wcstod_l
@ cdecl -ret64 _wcstoi64(wstr ptr long) MSVCRT__wcstoi64
@ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) MSVCRT__wcstoi64_l
...
...
dlls/msvcr110/msvcr110.spec
View file @
3af24fe1
...
...
@@ -1868,7 +1868,7 @@
@ stub _wcsnset_s
@ cdecl _wcsrev(wstr) MSVCRT__wcsrev
@ cdecl _wcsset(wstr long) MSVCRT__wcsset
@
stub
_wcsset_s
@
cdecl _wcsset_s(wstr long long) MSVCRT_
_wcsset_s
@ cdecl _wcstod_l(wstr ptr) MSVCRT__wcstod_l
@ cdecl -ret64 _wcstoi64(wstr ptr long) MSVCRT__wcstoi64
@ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) MSVCRT__wcstoi64_l
...
...
dlls/msvcr120/msvcr120.spec
View file @
3af24fe1
...
...
@@ -1883,7 +1883,7 @@
@ stub _wcsnset_s
@ cdecl _wcsrev(wstr) MSVCRT__wcsrev
@ cdecl _wcsset(wstr long) MSVCRT__wcsset
@
stub
_wcsset_s
@
cdecl _wcsset_s(wstr long long) MSVCRT_
_wcsset_s
@ cdecl _wcstod_l(wstr ptr) MSVCRT__wcstod_l
@ stub _wcstof_l
@ cdecl -ret64 _wcstoi64(wstr ptr long) MSVCRT__wcstoi64
...
...
dlls/msvcr120_app/msvcr120_app.spec
View file @
3af24fe1
...
...
@@ -1579,7 +1579,7 @@
@ stub _wcsnset_s
@ cdecl _wcsrev(wstr) msvcr120._wcsrev
@ cdecl _wcsset(wstr long) msvcr120._wcsset
@
stub
_wcsset_s
@
cdecl _wcsset_s(wstr long long) msvcr120.
_wcsset_s
@ cdecl _wcstod_l(wstr ptr) msvcr120._wcstod_l
@ stub _wcstof_l
@ cdecl -ret64 _wcstoi64(wstr ptr long) msvcr120._wcstoi64
...
...
dlls/msvcr80/msvcr80.spec
View file @
3af24fe1
...
...
@@ -1189,7 +1189,7 @@
@ stub _wcsnset_s
@ cdecl _wcsrev(wstr) MSVCRT__wcsrev
@ cdecl _wcsset(wstr long) MSVCRT__wcsset
@
stub
_wcsset_s
@
cdecl _wcsset_s(wstr long long) MSVCRT_
_wcsset_s
@ cdecl _wcstod_l(wstr ptr) MSVCRT__wcstod_l
@ cdecl -ret64 _wcstoi64(wstr ptr long) MSVCRT__wcstoi64
@ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) MSVCRT__wcstoi64_l
...
...
dlls/msvcr90/msvcr90.spec
View file @
3af24fe1
...
...
@@ -1164,7 +1164,7 @@
@ stub _wcsnset_s
@ cdecl _wcsrev(wstr) MSVCRT__wcsrev
@ cdecl _wcsset(wstr long) MSVCRT__wcsset
@
stub
_wcsset_s
@
cdecl _wcsset_s(wstr long long) MSVCRT_
_wcsset_s
@ cdecl _wcstod_l(wstr ptr) MSVCRT__wcstod_l
@ cdecl -ret64 _wcstoi64(wstr ptr long) MSVCRT__wcstoi64
@ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) MSVCRT__wcstoi64_l
...
...
dlls/msvcrt/msvcrt.spec
View file @
3af24fe1
...
...
@@ -1120,7 +1120,7 @@
# stub _wcsnset_s(wstr long long)
@ cdecl _wcsrev(wstr) MSVCRT__wcsrev
@ cdecl _wcsset(wstr long) MSVCRT__wcsset
# stub _wcsset_s(wstr long)
@ cdecl _wcsset_s(wstr long long) MSVCRT__wcsset_s
@ cdecl _wcstod_l(wstr ptr) MSVCRT__wcstod_l
@ cdecl -ret64 _wcstoi64(wstr ptr long) MSVCRT__wcstoi64
@ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) MSVCRT__wcstoi64_l
...
...
dlls/msvcrt/tests/string.c
View file @
3af24fe1
...
...
@@ -90,6 +90,7 @@ static size_t (__cdecl *p_mbrlen)(const char*, size_t, mbstate_t*);
static
size_t
(
__cdecl
*
p_mbrtowc
)(
wchar_t
*
,
const
char
*
,
size_t
,
mbstate_t
*
);
static
int
(
__cdecl
*
p__atodbl_l
)(
_CRT_DOUBLE
*
,
char
*
,
_locale_t
);
static
int
(
__cdecl
*
p__strnset_s
)(
char
*
,
size_t
,
int
,
size_t
);
static
int
(
__cdecl
*
p__wcsset_s
)(
wchar_t
*
,
size_t
,
wchar_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)
...
...
@@ -2749,6 +2750,40 @@ static void test__strnset_s(void)
ok
(
!
buf
[
0
]
&&
buf
[
1
]
==
'c'
&&
buf
[
2
]
==
'b'
,
"buf = %s
\n
"
,
buf
);
}
static
void
test__wcsset_s
(
void
)
{
wchar_t
str
[
10
];
int
r
;
if
(
!
p__wcsset_s
)
{
win_skip
(
"_wcsset_s not available
\n
"
);
return
;
}
r
=
p__wcsset_s
(
NULL
,
0
,
'a'
);
ok
(
r
==
EINVAL
,
"r = %d
\n
"
,
r
);
str
[
0
]
=
'a'
;
r
=
p__wcsset_s
(
str
,
0
,
'a'
);
ok
(
r
==
EINVAL
,
"r = %d
\n
"
,
r
);
ok
(
str
[
0
]
==
'a'
,
"str[0] = %d
\n
"
,
str
[
0
]);
str
[
0
]
=
'a'
;
str
[
1
]
=
'b'
;
r
=
p__wcsset_s
(
str
,
2
,
'c'
);
ok
(
r
==
EINVAL
,
"r = %d
\n
"
,
r
);
ok
(
!
str
[
0
],
"str[0] = %d
\n
"
,
str
[
0
]);
ok
(
str
[
1
]
==
'b'
,
"str[1] = %d
\n
"
,
str
[
1
]);
str
[
0
]
=
'a'
;
str
[
1
]
=
0
;
str
[
2
]
=
'b'
;
r
=
p__wcsset_s
(
str
,
3
,
'c'
);
ok
(
str
[
0
]
==
'c'
,
"str[0] = %d
\n
"
,
str
[
0
]);
ok
(
str
[
1
]
==
0
,
"str[1] = %d
\n
"
,
str
[
1
]);
ok
(
str
[
2
]
==
'b'
,
"str[2] = %d
\n
"
,
str
[
2
]);
}
START_TEST
(
string
)
{
char
mem
[
100
];
...
...
@@ -2797,6 +2832,7 @@ START_TEST(string)
p_mbsrtowcs
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"mbsrtowcs"
);
p__atodbl_l
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"_atodbl_l"
);
p__strnset_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"_strnset_s"
);
p__wcsset_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"_wcsset_s"
);
/* MSVCRT memcpy behaves like memmove for overlapping moves,
MFC42 CString::Insert seems to rely on that behaviour */
...
...
@@ -2851,4 +2887,5 @@ START_TEST(string)
test_strncpy
();
test_strxfrm
();
test__strnset_s
();
test__wcsset_s
();
}
dlls/msvcrt/wcs.c
View file @
3af24fe1
...
...
@@ -185,6 +185,26 @@ MSVCRT_wchar_t* CDECL MSVCRT__wcsrev( MSVCRT_wchar_t* str )
}
/*********************************************************************
* _wcsset_s (MSVCRT.@)
*/
int
CDECL
MSVCRT__wcsset_s
(
MSVCRT_wchar_t
*
str
,
MSVCRT_size_t
n
,
MSVCRT_wchar_t
c
)
{
MSVCRT_wchar_t
*
p
=
str
;
if
(
!
MSVCRT_CHECK_PMT
(
str
!=
NULL
))
return
MSVCRT_EINVAL
;
if
(
!
MSVCRT_CHECK_PMT
(
n
))
return
MSVCRT_EINVAL
;
while
(
*
p
&&
--
n
)
*
p
++
=
c
;
if
(
!
n
)
{
str
[
0
]
=
0
;
MSVCRT__invalid_parameter
(
NULL
,
NULL
,
NULL
,
0
,
0
);
*
MSVCRT__errno
()
=
MSVCRT_EINVAL
;
return
MSVCRT_EINVAL
;
}
return
0
;
}
/*********************************************************************
* _wcsset (MSVCRT.@)
*/
MSVCRT_wchar_t
*
CDECL
MSVCRT__wcsset
(
MSVCRT_wchar_t
*
str
,
MSVCRT_wchar_t
c
)
...
...
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