MCPcopy Create free account
hub / github.com/WinDurango/WinDurango / XMemSetAllocationHooks

Function XMemSetAllocationHooks

projects/WinDurango.KernelX/src/kernelx.cpp:642–658  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

640 flAllocationType |= MEM_GRAPHICS;
641 }
642
643 return EraVirtualAlloc(nullptr, dwSize, flAllocationType, PAGE_READWRITE);
644 }
645
646 void *ptr = _aligned_malloc(dwSize, 1ULL << max(4, attr.s.dwAlignment));
647
648 if (ptr)
649 memset(ptr, 0, dwSize);
650
651 return ptr;
652}
653
654EXTERN_C void __stdcall XMemFreeDefault(PVOID lpAddress, ULONGLONG dwAttributes)
655{
656 auto attr = XALLOC_ATTRIBUTES { dwAttributes };
657
658 if (attr.s.dwMemoryType != XALLOC_MEMTYPE_HEAP)
659 {
660 EraVirtualFree(lpAddress, 0, MEM_RELEASE);
661 return;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected