12#if _UCRT_HEAP_MISMATCH_ANY && (defined _M_IX86 || defined _M_AMD64)
18 static HANDLE global_msvcrt_heap_handle_cache =
reinterpret_cast<HANDLE>(1);
20 HANDLE const cached_msvcrt_heap_handle = __crt_interlocked_read_pointer(&global_msvcrt_heap_handle_cache);
21 if (cached_msvcrt_heap_handle !=
reinterpret_cast<HANDLE>(1))
23 return cached_msvcrt_heap_handle;
27 if (!msvcrt_module_handle)
30 __crt_interlocked_exchange_pointer(&global_msvcrt_heap_handle_cache,
nullptr);
37 fp_get_heap_handle
const get_msvcrt_heap_handle =
42 if (!get_msvcrt_heap_handle)
44 __crt_interlocked_exchange_pointer(&global_msvcrt_heap_handle_cache,
nullptr);
48 HANDLE const new_msvcrt_heap_handle =
reinterpret_cast<HANDLE>(get_msvcrt_heap_handle());
49 __crt_interlocked_exchange_pointer(&global_msvcrt_heap_handle_cache, new_msvcrt_heap_handle);
50 return new_msvcrt_heap_handle;
55#if _UCRT_HEAP_MISMATCH_RECOVERY && (defined _M_IX86 || defined _M_AMD64)
59 HANDLE const msvcrt_heap_handle = __acrt_get_msvcrt_heap_handle();
60 if (!msvcrt_heap_handle)
72 return msvcrt_heap_handle;
100 if (
block ==
nullptr)
int __cdecl __acrt_errno_from_os_error(unsigned long)
_ACRTIMP void __cdecl _free_base(_Pre_maybenull_ _Post_invalid_ void *_Block)
#define GetProcAddress(x, y)
#define HeapFree(x, y, z)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
void __declspec(noinline) __cdecl _free_base(void *const block)
static __forceinline HANDLE __cdecl select_heap(void *const block)
BOOL WINAPI HeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem)
#define UNREFERENCED_PARAMETER(P)
DWORD WINAPI GetLastError(void)
static unsigned int block