1
0
mirror of https://github.com/UzixLS/KernelEx.git synced 2025-07-19 07:21:20 +03:00

import KernelEx-4.5-Beta1

This commit is contained in:
UzixLS
2018-11-03 16:21:13 +03:00
parent d6aad6c6c5
commit 09929b2b7d
392 changed files with 17832 additions and 2491 deletions

33
kexcrt/memory.c Executable file
View File

@ -0,0 +1,33 @@
#include <windows.h>
void* malloc(size_t size)
{
return HeapAlloc(GetProcessHeap(), 0, size);
}
void* calloc(size_t count, size_t size)
{
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, count * size);
}
void free(void* ptr)
{
if (ptr)
HeapFree(GetProcessHeap(), 0, ptr);
}
void* realloc(void* ptr, size_t size)
{
if (ptr)
return HeapReAlloc(GetProcessHeap(), 0, ptr, size);
else
return HeapAlloc(GetProcessHeap(), 0, size);
}
void* recalloc(void* ptr, size_t size)
{
if (ptr)
return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ptr, size);
else
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
}