-
Notifications
You must be signed in to change notification settings - Fork 265
Closed
Description
wil/include/wil/result_macros.h
Lines 1301 to 1310 in fd91a81
__declspec(selectany) NTSTATUS(__stdcall *g_pfnRtlDisownModuleHeapAllocation)(_In_ HANDLE heapHandle, _In_ PVOID address) WI_PFN_NOEXCEPT = nullptr; | |
// Allocate and disown the allocation so that Appverifier does not complain about a false leak | |
inline PVOID ProcessHeapAlloc(_In_ DWORD flags, _In_ size_t size) | |
{ | |
PVOID allocation = ::HeapAlloc(::GetProcessHeap(), flags, size); | |
if (g_pfnRtlDisownModuleHeapAllocation) | |
{ | |
(void)g_pfnRtlDisownModuleHeapAllocation(::GetProcessHeap(), allocation); |
This API is now publicly documented - https://docs.microsoft.com/en-us/windows/win32/DevNotes/rtlsupportapi/nf-rtlsupportapi-rtldisownmoduleheapallocation
Move the setting of the function pointer to the global init path when available so apps using appverifier and wil no longer get a "leak" warning.
Metadata
Metadata
Assignees
Labels
No labels