File Index Symbol Index

//
// corecrt_memcpy_s.h
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// Inline definitions of memcpy_s and memmove_s
//
#pragma once
#include <corecrt.h> #include <errno.h> #include <vcruntime_string.h>
#ifndef _CRT_MEMCPY_S_INLINE
#define _CRT_MEMCPY_S_INLINE static __inline #endif
#define _CRT_MEMCPY_S_VALIDATE_RETURN_ERRCODE(expr, errorcode) \
{ \
int _Expr_val=!!(expr); \
if (!(_Expr_val)) \
{ \
errno = errorcode; \
_invalid_parameter_noinfo(); \
return errorcode; \
} \
}
#if !defined RC_INVOKED && !defined __midl && __STDC_WANT_SECURE_LIB__
_Success_(return == 0)
_Check_return_opt_
) {
if
(
_SourceSize
==
0
) {
return
0
; } {
memset
(
_Destination
,
0
,
_DestinationSize
);
// Unreachable, but required to suppress /analyze warnings:
}
memcpy
(
_Destination
,
_Source
,
_SourceSize
);
return
0
; }
_Check_return_wat_
) {
if
(
_SourceSize
==
0
) {
return
0
; }
memmove
(
_Destination
,
_Source
,
_SourceSize
);
return
0
; }
#endif
#undef _CRT_MEMCPY_S_VALIDATE_RETURN_ERRCODE