ReactOS 0.4.16-dev-814-g656a5dc
corecrt_memory.h
Go to the documentation of this file.
1//
2// corecrt_memory.h
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// The buffer (memory) manipulation library. These declarations are split out
7// so that they may be included by both <string.h> and <memory.h>. <string.h>
8// does not include <memory.h> to avoid introducing conflicts with other user
9// headers named <memory.h>.
10//
11#pragma once
12
13#include <corecrt.h>
14#include <corecrt_memcpy_s.h>
15#include <vcruntime_string.h>
16
17#pragma warning(push)
18#pragma warning(disable: _UCRT_DISABLED_WARNINGS)
20
21#ifndef __midl
22
24
25
26
29 _In_reads_bytes_opt_(_Size) void const* _Buf1,
30 _In_reads_bytes_opt_(_Size) void const* _Buf2,
31 _In_ size_t _Size
32 );
33
36 _In_reads_bytes_opt_(_Size) void const* _Buf1,
37 _In_reads_bytes_opt_(_Size) void const* _Buf2,
38 _In_ size_t _Size,
40 );
41
42
43
44#if !defined RC_INVOKED && __STDC_WANT_SECURE_LIB__
45
46 #if defined __cplusplus && _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_MEMORY
47 extern "C++"
48 {
49 template <size_t _Size, typename _DstType>
50 inline typename _CrtEnableIf<(_Size > 1), void *>::_Type __cdecl memcpy(
51 _DstType (&_Dst)[_Size],
52 _In_reads_bytes_opt_(_SrcSize) void const* _Src,
53 _In_ size_t _SrcSize
55 {
56 return memcpy_s(_Dst, _Size * sizeof(_DstType), _Src, _SrcSize) == 0 ? _Dst : 0;
57 }
58 }
59 #endif
60
61 #if defined __cplusplus && _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES_MEMORY
62 extern "C++"
63 {
64 template <size_t _Size, typename _DstType>
66 _DstType (&_Dst)[_Size],
67 _In_reads_bytes_opt_(_SrcSize) void const* _Src,
68 _In_ rsize_t _SrcSize
70 {
71 return memcpy_s(_Dst, _Size * sizeof(_DstType), _Src, _SrcSize);
72 }
73 }
74 #endif
75
76#endif // !defined RC_INVOKED && __STDC_WANT_SECURE_LIB__
77
78
79
80#if defined(_CRT_INTERNAL_NONSTDC_NAMES) && _CRT_INTERNAL_NONSTDC_NAMES
81
84 _Out_writes_bytes_opt_(_Size) void* _Dst,
85 _In_reads_bytes_opt_(_Size) void const* _Src,
86 _In_ int _Val,
87 _In_ size_t _Size
88 );
89
92 _In_reads_bytes_opt_(_Size) void const* _Buf1,
93 _In_reads_bytes_opt_(_Size) void const* _Buf2,
94 _In_ size_t _Size
95 );
96
97#endif // _CRT_INTERNAL_NONSTDC_NAMES
98
99
100
101#if defined __cplusplus
102
103 extern "C++" _Check_return_
104 inline void* __CRTDECL memchr(
105 _In_reads_bytes_opt_(_N) void* _Pv,
106 _In_ int _C,
107 _In_ size_t _N
108 )
109 {
110 void const* const _Pvc = _Pv;
111 return const_cast<void*>(memchr(_Pvc, _C, _N));
112 }
113
114#endif
115
116
117
119
120#endif // !__midl
122#pragma warning(pop) // _UCRT_DISABLED_WARNINGS
#define __cdecl
Definition: accygwin.h:79
_Check_return_ _ACRTIMP int __cdecl _memicmp_l(_In_reads_bytes_opt_(_Size) void const *_Buf1, _In_reads_bytes_opt_(_Size) void const *_Buf2, _In_ size_t _Size, _In_opt_ _locale_t _Locale)
_UCRT_DISABLE_CLANG_WARNINGS _CRT_BEGIN_C_HEADER _Check_return_ _ACRTIMP int __cdecl _memicmp(_In_reads_bytes_opt_(_Size) void const *_Buf1, _In_reads_bytes_opt_(_Size) void const *_Buf2, _In_ size_t _Size)
_Check_return_ _Ret_maybenull_ _In_ size_t _In_ size_t _Size
Definition: malloc.h:109
size_t rsize_t
Definition: stubs.c:780
_N
Definition: wchar.h:2530
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define memchr(s, c, n)
Definition: mkisofs.h:875
#define _Check_return_
Definition: no_sal2.h:60
#define _Out_writes_bytes_opt_(s)
Definition: no_sal2.h:228
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define _In_reads_bytes_opt_(s)
Definition: no_sal2.h:224
_Check_return_ _CRTIMP int __cdecl memicmp(_In_reads_bytes_opt_(_Size) const void *_Buf1, _In_reads_bytes_opt_(_Size) const void *_Buf2, _In_ size_t _Size)
_CRTIMP void *__cdecl memccpy(_Out_writes_bytes_opt_(_Size) void *_Dst, _In_reads_bytes_opt_(_Size) const void *_Src, _In_ int _Val, _In_ size_t _Size)
_In_ int _Val
Definition: memory.h:91
_CRTIMP void *__cdecl _memccpy(_Out_writes_bytes_opt_(_MaxCount) void *_Dst, _In_ const void *_Src, _In_ int _Val, _In_ size_t _MaxCount)
_In_ size_t _In_z_ _Printf_format_string_ const char _In_ const struct tm _In_opt_ _locale_t _Locale
Definition: time.h:159
int CDECL memcpy_s(void *dest, size_t numberOfElements, const void *src, size_t count)
Definition: heap.c:800
#define _CRT_NONSTDC_DEPRECATE(_NewName)
Definition: corecrt.h:439
#define _ACRTIMP
Definition: corecrt.h:138
#define _UCRT_DISABLE_CLANG_WARNINGS
Definition: corecrt.h:109
#define _UCRT_RESTORE_CLANG_WARNINGS
Definition: corecrt.h:117
#define _CRT_SECURE_CPP_NOTHROW
Definition: corecrt.h:605
int errno_t
Definition: corecrt.h:615
#define _CRT_END_C_HEADER
Definition: vcruntime.h:42
#define _CRT_BEGIN_C_HEADER
Definition: vcruntime.h:40
#define __CRTDECL
Definition: yvals.h:17