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
cbf5ad74
Commit
cbf5ad74
authored
Jun 29, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add memcpy_s and memmove_s.
Implementation copied from msvcrt. Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
25f4760e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
+38
-0
ntdll.spec
dlls/ntdll/ntdll.spec
+2
-0
string.c
dlls/ntdll/string.c
+36
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
cbf5ad74
...
...
@@ -1581,7 +1581,9 @@
@ cdecl memchr(ptr long long)
@ cdecl memcmp(ptr ptr long)
@ cdecl memcpy(ptr ptr long)
@ cdecl memcpy_s(ptr long ptr long)
@ cdecl memmove(ptr ptr long)
@ cdecl memmove_s(ptr long ptr long)
@ cdecl memset(ptr long long)
@ cdecl pow(double double)
@ cdecl qsort(ptr long long ptr)
...
...
dlls/ntdll/string.c
View file @
cbf5ad74
...
...
@@ -142,6 +142,42 @@ void * __cdecl memmove( void *dst, const void *src, size_t n )
}
/*********************************************************************
* memcpy_s (MSVCRT.@)
*/
errno_t
__cdecl
memcpy_s
(
void
*
dst
,
size_t
len
,
const
void
*
src
,
size_t
count
)
{
if
(
!
count
)
return
0
;
if
(
!
dst
)
return
EINVAL
;
if
(
!
src
)
{
memset
(
dst
,
0
,
len
);
return
EINVAL
;
}
if
(
count
>
len
)
{
memset
(
dst
,
0
,
len
);
return
ERANGE
;
}
memmove
(
dst
,
src
,
count
);
return
0
;
}
/*********************************************************************
* memmove_s (MSVCRT.@)
*/
errno_t
__cdecl
memmove_s
(
void
*
dst
,
size_t
len
,
const
void
*
src
,
size_t
count
)
{
if
(
!
count
)
return
0
;
if
(
!
dst
)
return
EINVAL
;
if
(
!
src
)
return
EINVAL
;
if
(
count
>
len
)
return
ERANGE
;
memmove
(
dst
,
src
,
count
);
return
0
;
}
static
inline
void
memset_aligned_32
(
unsigned
char
*
d
,
uint64_t
v
,
size_t
n
)
{
unsigned
char
*
end
=
d
+
n
;
...
...
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