ReactOS 0.4.16-dev-959-g2ec3a19
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}
#define EINVAL
Definition: acclib.h:90
#define ERANGE
Definition: acclib.h:92
size_t const size_in_elements
GLuint GLuint GLsizei count
Definition: gl.h:1545
wchar_t *__cdecl wmemset(_Out_writes_all_(_N) wchar_t *_S, _In_ wchar_t _C, _In_ size_t _N)
Definition: wchar.h:2663
#define _VALIDATE_RETURN_ERRCODE(expr, errorcode)