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
41f488a3
Commit
41f488a3
authored
Jun 29, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add strcpy_s and wcscpy_s.
Implementation copied from msvcrt. Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c948a6cf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
0 deletions
+44
-0
ntdll.spec
dlls/ntdll/ntdll.spec
+2
-0
string.c
dlls/ntdll/string.c
+21
-0
wcstring.c
dlls/ntdll/wcstring.c
+21
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
41f488a3
...
...
@@ -1590,6 +1590,7 @@
@ cdecl strchr(str long)
@ cdecl strcmp(str str)
@ cdecl strcpy(ptr str)
@ cdecl strcpy_s(ptr long str)
@ cdecl strcspn(str str)
@ cdecl strlen(str)
@ cdecl strncat(str str long)
...
...
@@ -1618,6 +1619,7 @@
@ cdecl wcschr(wstr long)
@ cdecl wcscmp(wstr wstr)
@ cdecl wcscpy(ptr wstr)
@ cdecl wcscpy_s(ptr long wstr)
@ cdecl wcscspn(wstr wstr)
@ cdecl wcslen(wstr)
@ cdecl wcsncat(wstr wstr long)
...
...
dlls/ntdll/string.c
View file @
41f488a3
...
...
@@ -21,6 +21,7 @@
*/
#include <limits.h>
#include <errno.h>
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
...
...
@@ -257,6 +258,26 @@ char * __cdecl strcpy( char *dst, const char *src )
/*********************************************************************
* strcpy_s (NTDLL.@)
*/
errno_t
__cdecl
strcpy_s
(
char
*
dst
,
size_t
len
,
const
char
*
src
)
{
size_t
i
;
if
(
!
dst
||
!
len
)
return
EINVAL
;
if
(
!
src
)
{
*
dst
=
0
;
return
EINVAL
;
}
for
(
i
=
0
;
i
<
len
;
i
++
)
if
(
!
(
dst
[
i
]
=
src
[
i
]))
return
0
;
*
dst
=
0
;
return
ERANGE
;
}
/*********************************************************************
* strcspn (NTDLL.@)
*/
size_t
__cdecl
strcspn
(
const
char
*
str
,
const
char
*
reject
)
...
...
dlls/ntdll/wcstring.c
View file @
41f488a3
...
...
@@ -21,6 +21,7 @@
*/
#include <ctype.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
...
...
@@ -162,6 +163,26 @@ LPWSTR __cdecl wcscpy( LPWSTR dst, LPCWSTR src )
}
/*********************************************************************
* wcscpy_s (NTDLL.@)
*/
errno_t
__cdecl
wcscpy_s
(
wchar_t
*
dst
,
size_t
len
,
const
wchar_t
*
src
)
{
size_t
i
;
if
(
!
dst
||
!
len
)
return
EINVAL
;
if
(
!
src
)
{
*
dst
=
0
;
return
EINVAL
;
}
for
(
i
=
0
;
i
<
len
;
i
++
)
if
(
!
(
dst
[
i
]
=
src
[
i
]))
return
0
;
*
dst
=
0
;
return
ERANGE
;
}
/***********************************************************************
* wcslen (NTDLL.@)
*/
...
...
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