ReactOS 0.4.16-dev-2104-gb84fa49
wmemcpy_s.cpp File Reference
#include <corecrt_internal.h>
#include <wchar.h>
Include dependency graph for wmemcpy_s.cpp:

Go to the source code of this file.

Functions

errno_t __cdecl wmemcpy_s (wchar_t *const destination, size_t const size_in_elements, wchar_t const *const source, size_t const count)
 

Function Documentation

◆ wmemcpy_s()

errno_t __cdecl wmemcpy_s ( wchar_t *const  destination,
size_t const  size_in_elements,
wchar_t const *const  source,
size_t const  count 
)

Definition at line 18 of file wmemcpy_s.cpp.

24{
25 if (count == 0)
26 return 0;
27
28 _VALIDATE_RETURN_ERRCODE(destination != nullptr, EINVAL);
29
30 if (source == nullptr || size_in_elements < count)
31 {
32 // Zero the destination buffer:
33 wmemset(destination, 0, size_in_elements);
34
37
38 // Useless, but prefast is confused:
39 return EINVAL;
40 }
41
42#pragma warning(suppress:__WARNING_BANNED_API_USAGEL2) /* 28726 */
43 wmemcpy(destination, source, count);
44 return 0;
45}
size_t const size_in_elements
#define EINVAL
Definition: errno.h:44
#define ERANGE
Definition: errno.h:55
static wchar_t *__cdecl wmemset(wchar_t *s, wchar_t c, size_t n)
Definition: wchar.h:77
static wchar_t *__cdecl wmemcpy(wchar_t *dst, const wchar_t *src, size_t n)
Definition: wchar.h:67
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define _VALIDATE_RETURN_ERRCODE(expr, errorcode)