17#pragma warning(disable: _UCRT_DISABLED_WARNINGS)
31#define _CRTDBG_MODE_FILE 0x1
32#define _CRTDBG_MODE_DEBUG 0x2
33#define _CRTDBG_MODE_WNDW 0x4
34#define _CRTDBG_REPORT_MODE -1
36#define _CRTDBG_INVALID_HFILE ((_HFILE)(intptr_t)-1)
37#define _CRTDBG_HFILE_ERROR ((_HFILE)(intptr_t)-2)
38#define _CRTDBG_FILE_STDOUT ((_HFILE)(intptr_t)-4)
39#define _CRTDBG_FILE_STDERR ((_HFILE)(intptr_t)-5)
40#define _CRTDBG_REPORT_FILE ((_HFILE)(intptr_t)-6)
53#define _CRT_RPTHOOK_INSTALL 0
54#define _CRT_RPTHOOK_REMOVE 1
64#define _HOOK_REALLOC 2
76#define _CRTDBG_ALLOC_MEM_DF 0x01
77#define _CRTDBG_DELAY_FREE_MEM_DF 0x02
78#define _CRTDBG_CHECK_ALWAYS_DF 0x04
79#define _CRTDBG_RESERVED_DF 0x08
80#define _CRTDBG_CHECK_CRT_DF 0x10
81#define _CRTDBG_LEAK_CHECK_DF 0x20
85#define _CRTDBG_CHECK_EVERY_16_DF 0x00100000
86#define _CRTDBG_CHECK_EVERY_128_DF 0x00800000
87#define _CRTDBG_CHECK_EVERY_1024_DF 0x04000000
91#define _CRTDBG_CHECK_DEFAULT_DF 0
93#define _CRTDBG_REPORT_FLAG -1
95#define _BLOCK_TYPE(block) (block & 0xFFFF)
96#define _BLOCK_SUBTYPE(block) (block >> 16 & 0xFFFF)
100#define _NORMAL_BLOCK 1
102#define _IGNORE_BLOCK 3
103#define _CLIENT_BLOCK 4
111#define _UNKNOWN_BLOCK (-1)
116 typedef void (__clrcall* _CRT_DUMP_CLIENT_M)(
void*,
size_t);
132 #define _CrtGetAllocHook() ((_CRT_ALLOC_HOOK)0)
133 #define _CrtSetAllocHook(f) ((_CRT_ALLOC_HOOK)0)
135 #define _CrtGetDumpClient() ((_CRT_DUMP_CLIENT)0)
136 #define _CrtSetDumpClient(f) ((_CRT_DUMP_CLIENT)0)
138 #define _CrtCheckMemory() ((int)1)
139 #define _CrtDoForAllClientObjects(f, c) ((void)0)
140 #define _CrtDumpMemoryLeaks() ((int)0)
141 #define _CrtIsMemoryBlock(p, t, r, f, l) ((int)1)
142 #define _CrtIsValidHeapPointer(p) ((int)1)
143 #define _CrtIsValidPointer(p, n, r) ((int)1)
144 #define _CrtMemCheckpoint(s) ((void)0)
145 #define _CrtMemDifference(s1, s2, s3) ((int)0)
146 #define _CrtMemDumpAllObjectsSince(s) ((void)0)
147 #define _CrtMemDumpStatistics(s) ((void)0)
148 #define _CrtReportBlockType(p) ((int)-1)
149 #define _CrtSetBreakAlloc(a) ((long)0)
150 #define _CrtSetDbgFlag(f) ((int)0)
160 #define _crtDbgFlag (*__p__crtDbgFlag())
161 #define _crtBreakAlloc (*__p__crtBreakAlloc())
179 typedef void (
__cdecl* _CrtDoForAllClientObjectsCallback)(
void*,
void*);
182 _In_ _CrtDoForAllClientObjectsCallback _Callback,
250 #define _calloc_dbg(c, s, t, f, l) calloc(c, s)
251 #define _expand_dbg(p, s, t, f, l) _expand(p, s)
252 #define _free_dbg(p, t) free(p)
253 #define _malloc_dbg(s, t, f, l) malloc(s)
254 #define _msize_dbg(p, t) _msize(p)
255 #define _realloc_dbg(p, s, t, f, l) realloc(p, s)
256 #define _recalloc_dbg(p, c, s, t, f, l) _recalloc(p, c, s)
258 #define _aligned_free_dbg(p) _aligned_free(p)
259 #define _aligned_malloc_dbg(s, a, f, l) _aligned_malloc(s, a)
260 #define _aligned_msize_dbg(p, a, o) _aligned_msize(p, a, o)
261 #define _aligned_offset_malloc_dbg(s, a, o, f, l) _aligned_offset_malloc(s, a, o)
262 #define _aligned_offset_realloc_dbg(p, s, a, o, f, l) _aligned_offset_realloc(p, s, a, o)
263 #define _aligned_offset_recalloc_dbg(p, c, s, a, o, f, l) _aligned_offset_recalloc(p, c, s, a, o)
264 #define _aligned_realloc_dbg(p, s, a, f, l) _aligned_realloc(p, s, a)
265 #define _aligned_recalloc_dbg(p, c, s, a, f, l) _aligned_recalloc(p, c, s, a)
267 #define _freea_dbg(p, t) _freea(p)
268 #define _malloca_dbg(s, t, f, l) _malloca(s)
270 #define _dupenv_s_dbg(ps1, size, s2, t, f, l) _dupenv_s(ps1, size, s2)
271 #define _fullpath_dbg(s1, s2, le, t, f, l) _fullpath(s1, s2, le)
272 #define _getcwd_dbg(s, le, t, f, l) _getcwd(s, le)
273 #define _getdcwd_dbg(d, s, le, t, f, l) _getdcwd(d, s, le)
274 #define _getdcwd_lk_dbg(d, s, le, t, f, l) _getdcwd(d, s, le)
275 #define _mbsdup_dbg(s, t, f, l) _mbsdup(s)
276 #define _strdup_dbg(s, t, f, l) _strdup(s)
277 #define _tempnam_dbg(s1, s2, t, f, l) _tempnam(s1, s2)
278 #define _wcsdup_dbg(s, t, f, l) _wcsdup(s)
279 #define _wdupenv_s_dbg(ps1, size, s2, t, f, l) _wdupenv_s(ps1, size, s2)
280 #define _wfullpath_dbg(s1, s2, le, t, f, l) _wfullpath(s1, s2, le)
281 #define _wgetcwd_dbg(s, le, t, f, l) _wgetcwd(s, le)
282 #define _wgetdcwd_dbg(d, s, le, t, f, l) _wgetdcwd(d, s, le)
283 #define _wgetdcwd_lk_dbg(d, s, le, t, f, l) _wgetdcwd(d, s, le)
284 #define _wtempnam_dbg(s1, s2, t, f, l) _wtempnam(s1, s2)
288 #ifdef _CRTDBG_MAP_ALLOC
290 #define calloc(c, s) _calloc_dbg(c, s, _NORMAL_BLOCK, __FILE__, __LINE__)
291 #define _expand(p, s) _expand_dbg(p, s, _NORMAL_BLOCK, __FILE__, __LINE__)
292 #define free(p) _free_dbg(p, _NORMAL_BLOCK)
293 #define malloc(s) _malloc_dbg(s, _NORMAL_BLOCK, __FILE__, __LINE__)
294 #define _msize(p) _msize_dbg(p, _NORMAL_BLOCK)
295 #define realloc(p, s) _realloc_dbg(p, s, _NORMAL_BLOCK, __FILE__, __LINE__)
296 #define _recalloc(p, c, s) _recalloc_dbg(p, c, s, _NORMAL_BLOCK, __FILE__, __LINE__)
298 #define _aligned_free(p) _aligned_free_dbg(p)
299 #define _aligned_malloc(s, a) _aligned_malloc_dbg(s, a, __FILE__, __LINE__)
300 #define _aligned_msize(p, a, o) _aligned_msize_dbg(p, a, o)
301 #define _aligned_offset_malloc(s, a, o) _aligned_offset_malloc_dbg(s, a, o, __FILE__, __LINE__)
302 #define _aligned_offset_realloc(p, s, a, o) _aligned_offset_realloc_dbg(p, s, a, o, __FILE__, __LINE__)
303 #define _aligned_offset_recalloc(p, c, s, a, o) _aligned_offset_recalloc_dbg(p, c, s, a, o, __FILE__, __LINE__)
304 #define _aligned_realloc(p, s, a) _aligned_realloc_dbg(p, s, a, __FILE__, __LINE__)
305 #define _aligned_recalloc(p, c, s, a) _aligned_recalloc_dbg(p, c, s, a, __FILE__, __LINE__)
307 #define _freea(p) _freea_dbg(p, _NORMAL_BLOCK)
308 #define _malloca(s) _malloca_dbg(s, _NORMAL_BLOCK, __FILE__, __LINE__)
310 #define _dupenv_s(ps1, size, s2) _dupenv_s_dbg(ps1, size, s2, _NORMAL_BLOCK, __FILE__, __LINE__)
311 #define _fullpath(s1, s2, le) _fullpath_dbg(s1, s2, le, _NORMAL_BLOCK, __FILE__, __LINE__)
312 #define _getcwd(s, le) _getcwd_dbg(s, le, _NORMAL_BLOCK, __FILE__, __LINE__)
313 #define _getdcwd(d, s, le) _getdcwd_dbg(d, s, le, _NORMAL_BLOCK, __FILE__, __LINE__)
314 #define _mbsdup(s) _strdup_dbg(s, _NORMAL_BLOCK, __FILE__, __LINE__)
315 #define _strdup(s) _strdup_dbg(s, _NORMAL_BLOCK, __FILE__, __LINE__)
316 #define _tempnam(s1, s2) _tempnam_dbg(s1, s2, _NORMAL_BLOCK, __FILE__, __LINE__)
317 #define _wcsdup(s) _wcsdup_dbg(s, _NORMAL_BLOCK, __FILE__, __LINE__)
318 #define _wdupenv_s(ps1, size, s2) _wdupenv_s_dbg(ps1, size, s2, _NORMAL_BLOCK, __FILE__, __LINE__)
319 #define _wfullpath(s1, s2, le) _wfullpath_dbg(s1, s2, le, _NORMAL_BLOCK, __FILE__, __LINE__)
320 #define _wgetcwd(s, le) _wgetcwd_dbg(s, le, _NORMAL_BLOCK, __FILE__, __LINE__)
321 #define _wgetdcwd(d, s, le) _wgetdcwd_dbg(d, s, le, _NORMAL_BLOCK, __FILE__, __LINE__)
322 #define _wtempnam(s1, s2) _wtempnam_dbg(s1, s2, _NORMAL_BLOCK, __FILE__, __LINE__)
324 #if defined(_CRT_INTERNAL_NONSTDC_NAMES) && _CRT_INTERNAL_NONSTDC_NAMES
325 #define strdup(s) _strdup_dbg(s, _NORMAL_BLOCK, __FILE__, __LINE__)
326 #define wcsdup(s) _wcsdup_dbg(s, _NORMAL_BLOCK, __FILE__, __LINE__)
327 #define tempnam(s1, s2) _tempnam_dbg(s1, s2, _NORMAL_BLOCK, __FILE__, __LINE__)
328 #define getcwd(s, le) _getcwd_dbg(s, le, _NORMAL_BLOCK, __FILE__, __LINE__)
577 #define _malloca_dbg(s, t, f, l) _malloc_dbg(s, t, f, l)
578 #define _freea_dbg(p, t) _free_dbg(p, t)
580 #if defined __cplusplus && defined _CRTDBG_MAP_ALLOC
586 using ::_realloc_dbg;
602 #define _CrtSetDebugFillThreshold(t) ((size_t)0)
603 #define _CrtSetReportFile(t, f) ((_HFILE)0)
604 #define _CrtSetReportMode(t, f) ((int)0)
605 #define _CrtGetReportHook() ((_CRT_REPORT_HOOK)0)
606 #define _CrtSetReportHook(f) ((_CRT_REPORT_HOOK)0)
607 #define _CrtSetReportHook2(t, f) ((int)0)
608 #define _CrtSetReportHookW2(t, f) ((int)0)
613 _In_ int _ReportType,
615 _In_ int _Linenumber,
621 _In_ int _ReportType,
623 _In_ int _LineNumber,
630 _In_ int _ReportType,
633 _In_ int _LineNumber,
640 _In_ int _ReportType,
643 _In_ int _LineNumber,
650 _In_ size_t _NewDebugFillThreshold
656 _In_ int _ReportType,
661 _In_ int _ReportType,
702 #define _CrtDbgBreak() ((void)0)
705 #define _ASSERT_EXPR(expr, msg) ((void)0)
709 #define _ASSERT(expr) ((void)0)
713 #define _ASSERTE(expr) ((void)0)
716 #define _RPT0(rptno, msg)
717 #define _RPTN(rptno, msg, ...)
719 #define _RPTW0(rptno, msg)
720 #define _RPTWN(rptno, msg, ...)
722 #define _RPTF0(rptno, msg)
723 #define _RPTFN(rptno, msg, ...)
725 #define _RPTFW0(rptno, msg)
726 #define _RPTFWN(rptno, msg, ...)
730 #define _CrtDbgBreak() __debugbreak()
735 #define _ASSERT_EXPR(expr, msg) \
738 (1 != _CrtDbgReportW(_CRT_ASSERT, _CRT_WIDE(__FILE__), __LINE__, NULL, L"%ls", msg)) || \
739 (_CrtDbgBreak(), 0) \
744 #define _ASSERT(expr) _ASSERT_EXPR((expr), NULL)
748 #define _ASSERTE(expr) _ASSERT_EXPR((expr), _CRT_WIDE(#expr))
751 #define _RPT_BASE(...) \
752 (void) ((1 != _CrtDbgReport(__VA_ARGS__)) || \
755 #define _RPT_BASE_W(...) \
756 (void) ((1 != _CrtDbgReportW(__VA_ARGS__)) || \
759 #define _RPT0(rptno, msg) _RPT_BASE(rptno, NULL, 0, NULL, "%s", msg)
760 #define _RPTN(rptno, msg, ...) _RPT_BASE(rptno, NULL, 0, NULL, msg, __VA_ARGS__)
762 #define _RPTW0(rptno, msg) _RPT_BASE_W(rptno, NULL, 0, NULL, L"%ls", msg)
763 #define _RPTWN(rptno, msg, ...) _RPT_BASE_W(rptno, NULL, 0, NULL, msg, __VA_ARGS__)
765 #define _RPTF0(rptno, msg) _RPT_BASE(rptno, __FILE__, __LINE__, NULL, "%s", msg)
766 #define _RPTFN(rptno, msg, ...) _RPT_BASE(rptno, __FILE__, __LINE__, NULL, msg, __VA_ARGS__)
768 #define _RPTFW0(rptno, msg) _RPT_BASE_W(rptno, _CRT_WIDE(__FILE__), __LINE__, NULL, L"%ls", msg)
769 #define _RPTFWN(rptno, msg, ...) _RPT_BASE_W(rptno, _CRT_WIDE(__FILE__), __LINE__, NULL, msg, __VA_ARGS__)
774#define _ASSERT_AND_INVOKE_WATSON(expr) \
779 _invoke_watson(_CRT_WIDE(#expr), __FUNCTIONW__, __FILEW__, __LINE__, 0); \
785 #define _ASSERT_BASE _ASSERT_EXPR
806#define _RPTFW1 _RPTFWN
807#define _RPTFW2 _RPTFWN
808#define _RPTFW3 _RPTFWN
809#define _RPTFW4 _RPTFWN
810#define _RPTFW5 _RPTFWN
_Check_return_ _In_z_ wchar_t const _Inout_opt_ _Deref_prepost_opt_z_ wchar_t ** _Context
struct _CrtMemState _CrtMemState
void(__cdecl * _CRT_DUMP_CLIENT)(void *, size_t)
#define _CrtSetReportMode(t, f)
int(__cdecl * _CRT_REPORT_HOOKW)(int, wchar_t *, int *)
int(__cdecl * _CRT_ALLOC_HOOK)(int, void *, size_t, int, long, const unsigned char *, int)
#define _CrtSetReportFile(t, f)
int(__cdecl * _CRT_REPORT_HOOK)(int, char *, int *)
_Check_return_ _Ret_maybenull_ _In_ size_t _Alignment
_Check_return_ _Ret_maybenull_ _In_ size_t _In_ size_t _Size
_Check_return_ _Ret_maybenull_ _In_ size_t _In_ size_t _Offset
_Check_return_ _Ret_maybenull_ _In_ size_t _Count
EXTERN_C int __cdecl _VCrtDbgReportA(int reportType, const char *filename, int linenumber, const char *moduleName, const char *format, va_list arglist)
EXTERN_C int __cdecl _VCrtDbgReportW(int reportType, const wchar_t *filename, int linenumber, const wchar_t *moduleName, const wchar_t *format, va_list arglist)
EXTERN_C int __cdecl _CrtDbgReportW(int reportType, const wchar_t *filename, int linenumber, const wchar_t *moduleName, const wchar_t *format,...)
EXTERN_C int __cdecl _CrtDbgReport(int reportType, const char *filename, int linenumber, const char *moduleName, const char *format,...)
size_t __cdecl _CrtGetDebugFillThreshold()
long * __p__crtBreakAlloc()
_In_z_ _Printf_format_string_ char const *const _Format
_In_z_ _Printf_format_string_ char const *const va_list _ArgList
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
_Pre_notnull_ _In_opt_z_ char const _Drive
_In_z_ char const * _Path
#define _Outptr_result_buffer_maybenull_(size)
#define _Post_writable_byte_size_(s)
#define _Out_writes_opt_z_(s)
#define _Ret_maybenull_z_
struct _CrtMemBlockHeader * pBlockHeader
size_t lCounts[_MAX_BLOCKS]
size_t lSizes[_MAX_BLOCKS]
#define _UCRT_DISABLE_CLANG_WARNINGS
#define _UCRT_RESTORE_CLANG_WARNINGS
#define _Check_return_wat_
#define _CrtSetAllocHook(f)
#define _CrtGetDumpClient()
#define _CrtMemDumpAllObjectsSince(s)
#define _realloc_dbg(p, s, t, f, l)
#define _aligned_offset_malloc_dbg(s, a, o, f, l)
#define _wgetdcwd_dbg(d, s, le, t, f, l)
#define _CrtSetReportHook2(t, f)
#define _wcsdup_dbg(s, t, f, l)
#define _CrtSetDebugFillThreshold(t)
#define _CrtIsValidHeapPointer(p)
#define _tempnam_dbg(s1, s2, t, f, l)
#define _wtempnam_dbg(s1, s2, t, f, l)
#define _aligned_recalloc_dbg(p, c, s, a, f, l)
#define _CrtCheckMemory()
#define _CrtIsValidPointer(p, n, r)
#define _CrtSetReportHookW2(t, f)
#define _wfullpath_dbg(s1, s2, le, t, f, l)
#define _getdcwd_dbg(d, s, le, t, f, l)
#define _CrtDoForAllClientObjects(f, c)
#define _CrtDumpMemoryLeaks()
#define _malloc_dbg(s, t, f, l)
#define _aligned_offset_realloc_dbg(p, s, a, o, f, l)
#define _aligned_realloc_dbg(p, s, a, f, l)
#define _aligned_malloc_dbg(s, a, f, l)
#define _recalloc_dbg(p, c, s, t, f, l)
#define _dupenv_s_dbg(ps1, size, s2, t, f, l)
#define _CrtGetAllocHook()
#define _CrtSetBreakAlloc(a)
#define _CrtMemDifference(s1, s2, s3)
#define _calloc_dbg(c, s, t, f, l)
#define _aligned_msize_dbg(p, a, o)
#define _aligned_free_dbg(p)
#define _aligned_offset_recalloc_dbg(p, c, s, a, o, f, l)
#define _CrtSetDbgFlag(f)
#define _wgetcwd_dbg(s, le, t, f, l)
#define _CrtSetDumpClient(f)
#define _CrtSetReportHook(f)
#define _expand_dbg(p, s, t, f, l)
#define _wdupenv_s_dbg(ps1, size, s2, t, f, l)
#define _CrtIsMemoryBlock(p, t, r, f, l)
#define _fullpath_dbg(s1, s2, le, t, f, l)
#define _strdup_dbg(s, t, f, l)
#define _CrtMemDumpStatistics(s)
#define _CrtReportBlockType(p)
#define _CrtGetReportHook()
#define _getcwd_dbg(s, le, t, f, l)
#define _CrtMemCheckpoint(s)
#define _CRT_END_C_HEADER
#define _CRT_BEGIN_C_HEADER