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
9f17544b
Commit
9f17544b
authored
May 19, 2014
by
Piotr Caban
Committed by
Alexandre Julliard
May 19, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Add _mbscpy_s implementation.
parent
aebe1c69
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
66 additions
and
10 deletions
+66
-10
msvcr100.spec
dlls/msvcr100/msvcr100.spec
+2
-2
msvcr110.spec
dlls/msvcr110/msvcr110.spec
+2
-2
msvcr80.spec
dlls/msvcr80/msvcr80.spec
+2
-2
msvcr90.spec
dlls/msvcr90/msvcr90.spec
+2
-2
mbcs.c
dlls/msvcrt/mbcs.c
+17
-0
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+2
-2
string.c
dlls/msvcrt/tests/string.c
+39
-0
No files found.
dlls/msvcr100/msvcr100.spec
View file @
9f17544b
...
@@ -1101,8 +1101,8 @@
...
@@ -1101,8 +1101,8 @@
@ stub _mbscmp_l
@ stub _mbscmp_l
@ cdecl _mbscoll(str str)
@ cdecl _mbscoll(str str)
@ cdecl _mbscoll_l(str str ptr)
@ cdecl _mbscoll_l(str str ptr)
@
stub _mbscpy_s
@
cdecl _mbscpy_s(ptr long str)
@
stub _mbscpy_s_l
@
cdecl _mbscpy_s_l(ptr long str ptr)
@ cdecl _mbscspn(str str)
@ cdecl _mbscspn(str str)
@ stub _mbscspn_l
@ stub _mbscspn_l
@ cdecl _mbsdec(ptr ptr)
@ cdecl _mbsdec(ptr ptr)
...
...
dlls/msvcr110/msvcr110.spec
View file @
9f17544b
...
@@ -1459,8 +1459,8 @@
...
@@ -1459,8 +1459,8 @@
@ stub _mbscmp_l
@ stub _mbscmp_l
@ cdecl _mbscoll(str str)
@ cdecl _mbscoll(str str)
@ cdecl _mbscoll_l(str str ptr)
@ cdecl _mbscoll_l(str str ptr)
@
stub _mbscpy_s
@
cdecl _mbscpy_s(ptr long str)
@
stub _mbscpy_s_l
@
cdecl _mbscpy_s_l(ptr long str ptr)
@ cdecl _mbscspn(str str)
@ cdecl _mbscspn(str str)
@ stub _mbscspn_l
@ stub _mbscspn_l
@ cdecl _mbsdec(ptr ptr)
@ cdecl _mbsdec(ptr ptr)
...
...
dlls/msvcr80/msvcr80.spec
View file @
9f17544b
...
@@ -773,8 +773,8 @@
...
@@ -773,8 +773,8 @@
@ stub _mbscmp_l
@ stub _mbscmp_l
@ cdecl _mbscoll(str str)
@ cdecl _mbscoll(str str)
@ cdecl _mbscoll_l(str str ptr)
@ cdecl _mbscoll_l(str str ptr)
@
stub _mbscpy_s
@
cdecl _mbscpy_s(ptr long str)
@
stub _mbscpy_s_l
@
cdecl _mbscpy_s_l(ptr long str ptr)
@ cdecl _mbscspn(str str)
@ cdecl _mbscspn(str str)
@ stub _mbscspn_l
@ stub _mbscspn_l
@ cdecl _mbsdec(ptr ptr)
@ cdecl _mbsdec(ptr ptr)
...
...
dlls/msvcr90/msvcr90.spec
View file @
9f17544b
...
@@ -751,8 +751,8 @@
...
@@ -751,8 +751,8 @@
@ stub _mbscmp_l
@ stub _mbscmp_l
@ cdecl _mbscoll(str str)
@ cdecl _mbscoll(str str)
@ cdecl _mbscoll_l(str str ptr)
@ cdecl _mbscoll_l(str str ptr)
@
stub _mbscpy_s
@
cdecl _mbscpy_s(ptr long str)
@
stub _mbscpy_s_l
@
cdecl _mbscpy_s_l(ptr long str ptr)
@ cdecl _mbscspn(str str)
@ cdecl _mbscspn(str str)
@ stub _mbscspn_l
@ stub _mbscspn_l
@ cdecl _mbsdec(ptr ptr)
@ cdecl _mbsdec(ptr ptr)
...
...
dlls/msvcrt/mbcs.c
View file @
9f17544b
...
@@ -712,6 +712,23 @@ int CDECL _mbsnbcpy_s(unsigned char* dst, MSVCRT_size_t size, const unsigned cha
...
@@ -712,6 +712,23 @@ int CDECL _mbsnbcpy_s(unsigned char* dst, MSVCRT_size_t size, const unsigned cha
}
}
/*********************************************************************
/*********************************************************************
* _mbscpy_s_l(MSVCRT.@)
*/
int
CDECL
_mbscpy_s_l
(
unsigned
char
*
dst
,
MSVCRT_size_t
size
,
const
unsigned
char
*
src
,
MSVCRT__locale_t
locale
)
{
return
_mbsnbcpy_s_l
(
dst
,
size
,
src
,
-
1
,
locale
);
}
/*********************************************************************
* _mbscpy_s(MSVCRT.@)
*/
int
CDECL
_mbscpy_s
(
unsigned
char
*
dst
,
MSVCRT_size_t
size
,
const
unsigned
char
*
src
)
{
return
_mbscpy_s_l
(
dst
,
size
,
src
,
NULL
);
}
/*********************************************************************
* _mbsnbcpy(MSVCRT.@)
* _mbsnbcpy(MSVCRT.@)
* REMARKS
* REMARKS
* Like strncpy this function doesn't enforce the string to be
* Like strncpy this function doesn't enforce the string to be
...
...
dlls/msvcrt/msvcrt.spec
View file @
9f17544b
...
@@ -722,8 +722,8 @@
...
@@ -722,8 +722,8 @@
@ cdecl _mbscoll(str str)
@ cdecl _mbscoll(str str)
@ cdecl _mbscoll_l(str str ptr)
@ cdecl _mbscoll_l(str str ptr)
@ cdecl _mbscpy(ptr str)
@ cdecl _mbscpy(ptr str)
# stub
_mbscpy_s(ptr long str)
@ cdecl
_mbscpy_s(ptr long str)
# stub
_mbscpy_s_l(ptr long str ptr)
@ cdecl
_mbscpy_s_l(ptr long str ptr)
@ cdecl _mbscspn(str str)
@ cdecl _mbscspn(str str)
# stub _mbscspn_l(str str ptr)
# stub _mbscspn_l(str str ptr)
@ cdecl _mbsdec(ptr ptr)
@ cdecl _mbsdec(ptr ptr)
...
...
dlls/msvcrt/tests/string.c
View file @
9f17544b
...
@@ -60,6 +60,7 @@ static int (__cdecl *pstrcpy_s)(char *dst, size_t len, const char *src);
...
@@ -60,6 +60,7 @@ static int (__cdecl *pstrcpy_s)(char *dst, size_t len, const char *src);
static
int
(
__cdecl
*
pstrcat_s
)(
char
*
dst
,
size_t
len
,
const
char
*
src
);
static
int
(
__cdecl
*
pstrcat_s
)(
char
*
dst
,
size_t
len
,
const
char
*
src
);
static
int
(
__cdecl
*
p_mbsnbcat_s
)(
unsigned
char
*
dst
,
size_t
size
,
const
unsigned
char
*
src
,
size_t
count
);
static
int
(
__cdecl
*
p_mbsnbcat_s
)(
unsigned
char
*
dst
,
size_t
size
,
const
unsigned
char
*
src
,
size_t
count
);
static
int
(
__cdecl
*
p_mbsnbcpy_s
)(
unsigned
char
*
dst
,
size_t
size
,
const
unsigned
char
*
src
,
size_t
count
);
static
int
(
__cdecl
*
p_mbsnbcpy_s
)(
unsigned
char
*
dst
,
size_t
size
,
const
unsigned
char
*
src
,
size_t
count
);
static
int
(
__cdecl
*
p__mbscpy_s
)(
unsigned
char
*
,
size_t
,
const
unsigned
char
*
);
static
int
(
__cdecl
*
p_wcscpy_s
)(
wchar_t
*
wcDest
,
size_t
size
,
const
wchar_t
*
wcSrc
);
static
int
(
__cdecl
*
p_wcscpy_s
)(
wchar_t
*
wcDest
,
size_t
size
,
const
wchar_t
*
wcSrc
);
static
int
(
__cdecl
*
p_wcsncpy_s
)(
wchar_t
*
wcDest
,
size_t
size
,
const
wchar_t
*
wcSrc
,
size_t
count
);
static
int
(
__cdecl
*
p_wcsncpy_s
)(
wchar_t
*
wcDest
,
size_t
size
,
const
wchar_t
*
wcSrc
,
size_t
count
);
static
int
(
__cdecl
*
p_wcsncat_s
)(
wchar_t
*
dst
,
size_t
elem
,
const
wchar_t
*
src
,
size_t
count
);
static
int
(
__cdecl
*
p_wcsncat_s
)(
wchar_t
*
dst
,
size_t
elem
,
const
wchar_t
*
src
,
size_t
count
);
...
@@ -774,6 +775,42 @@ static void test__mbsnbcpy_s(void)
...
@@ -774,6 +775,42 @@ static void test__mbsnbcpy_s(void)
dest
[
0
],
dest
[
1
],
dest
[
2
],
dest
[
3
],
dest
[
4
],
dest
[
5
],
dest
[
6
],
dest
[
7
]);
dest
[
0
],
dest
[
1
],
dest
[
2
],
dest
[
3
],
dest
[
4
],
dest
[
5
],
dest
[
6
],
dest
[
7
]);
}
}
static
void
test__mbscpy_s
(
void
)
{
const
unsigned
char
src
[]
=
"source string"
;
unsigned
char
dest
[
16
];
int
ret
;
if
(
!
p__mbscpy_s
)
{
win_skip
(
"_mbscpy_s not found
\n
"
);
return
;
}
ret
=
p__mbscpy_s
(
NULL
,
0
,
src
);
ok
(
ret
==
EINVAL
,
"got %d
\n
"
,
ret
);
ret
=
p__mbscpy_s
(
NULL
,
sizeof
(
dest
),
src
);
ok
(
ret
==
EINVAL
,
"got %d
\n
"
,
ret
);
ret
=
p__mbscpy_s
(
dest
,
0
,
src
);
ok
(
ret
==
EINVAL
,
"got %d
\n
"
,
ret
);
dest
[
0
]
=
'x'
;
ret
=
p__mbscpy_s
(
dest
,
sizeof
(
dest
),
NULL
);
ok
(
ret
==
EINVAL
,
"got %d
\n
"
,
ret
);
ok
(
!
dest
[
0
],
"dest buffer was not modified on invalid argument
\n
"
);
memset
(
dest
,
'X'
,
sizeof
(
dest
));
ret
=
p__mbscpy_s
(
dest
,
sizeof
(
dest
),
src
);
ok
(
!
ret
,
"got %d
\n
"
,
ret
);
ok
(
!
memcmp
(
dest
,
src
,
sizeof
(
src
)),
"dest = %s
\n
"
,
dest
);
ok
(
dest
[
sizeof
(
src
)]
==
'X'
,
"unused part of buffer was modified
\n
"
);
memset
(
dest
,
'X'
,
sizeof
(
dest
));
ret
=
p__mbscpy_s
(
dest
,
4
,
src
);
ok
(
ret
==
ERANGE
,
"got %d
\n
"
,
ret
);
ok
(
!
dest
[
0
],
"incorrect dest buffer (%d)
\n
"
,
dest
[
0
]);
ok
(
dest
[
1
]
==
src
[
1
],
"incorrect dest buffer (%d)
\n
"
,
dest
[
1
]);
}
static
void
test_wcscpy_s
(
void
)
static
void
test_wcscpy_s
(
void
)
{
{
static
const
WCHAR
szLongText
[]
=
{
'T'
,
'h'
,
'i'
,
's'
,
'A'
,
'L'
,
'o'
,
'n'
,
'g'
,
's'
,
't'
,
'r'
,
'i'
,
'n'
,
'g'
,
0
};
static
const
WCHAR
szLongText
[]
=
{
'T'
,
'h'
,
'i'
,
's'
,
'A'
,
'L'
,
'o'
,
'n'
,
'g'
,
's'
,
't'
,
'r'
,
'i'
,
'n'
,
'g'
,
0
};
...
@@ -2632,6 +2669,7 @@ START_TEST(string)
...
@@ -2632,6 +2669,7 @@ START_TEST(string)
pstrcat_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"strcat_s"
);
pstrcat_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"strcat_s"
);
p_mbsnbcat_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"_mbsnbcat_s"
);
p_mbsnbcat_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"_mbsnbcat_s"
);
p_mbsnbcpy_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"_mbsnbcpy_s"
);
p_mbsnbcpy_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"_mbsnbcpy_s"
);
p__mbscpy_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"_mbscpy_s"
);
p_wcscpy_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"wcscpy_s"
);
p_wcscpy_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"wcscpy_s"
);
p_wcsncpy_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"wcsncpy_s"
);
p_wcsncpy_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"wcsncpy_s"
);
p_wcsncat_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"wcsncat_s"
);
p_wcsncat_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"wcsncat_s"
);
...
@@ -2679,6 +2717,7 @@ START_TEST(string)
...
@@ -2679,6 +2717,7 @@ START_TEST(string)
test_memmove_s
();
test_memmove_s
();
test_strcat_s
();
test_strcat_s
();
test__mbsnbcpy_s
();
test__mbsnbcpy_s
();
test__mbscpy_s
();
test_mbcjisjms
();
test_mbcjisjms
();
test_mbcjmsjis
();
test_mbcjmsjis
();
test_mbbtombc
();
test_mbbtombc
();
...
...
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