void* System::Memcpy (void* pvDst, size_t uiDstSize, const void* pvSrc,
size_t uiSrcSize)
{
#ifdef WM4_USING_VC80
errno_t uiError = memcpy_s(pvDst,uiDstSize,pvSrc,uiSrcSize);
if (uiError == 0)
{
return pvDst;
}
else
{
return 0;
}
#else
if (!pvDst || uiDstSize == 0 || !pvSrc || uiSrcSize == 0)
{
// Be consistent with the behavior of memcpy_s.
return 0;
}
if (uiSrcSize > uiDstSize)
{
// The source memory is too large to copy to the destination. To
// be consistent with memcpy_s, return null as an indication that the
// copy failed.
return 0;
}
memcpy(pvDst,pvSrc,uiSrcSize);
return pvDst;
#endif
}
// Microsoft Visual C++ specific pragmas. MSVC6 is version 12.00, MSVC7.0 is
// version 13.00, and MSVC7.1 is version 13.10. MSVC8.0 is version 14.00.
#if _MSC_VER < 1300
#define WM4_USING_VC6
#elif _MSC_VER < 1310
#define WM4_USING_VC70
#elif _MSC_VER < 1400
#define WM4_USING_VC71
#else
#define WM4_USING_VC80
#endif