wincompat.h is a stripped down version coming from linapple-pie with the bare minimum common types. Each group of functions in its own file. Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
17 lines
482 B
C++
17 lines
482 B
C++
#include "linux/windows/memory.h"
|
|
#include <cstdlib>
|
|
|
|
LPVOID VirtualAlloc(LPVOID lpAddress, size_t dwSize,
|
|
DWORD flAllocationType, DWORD flProtect) {
|
|
/* just malloc and alles? 0_0 */
|
|
void* mymemory = realloc(lpAddress, dwSize);
|
|
if (flAllocationType & MEM_COMMIT)
|
|
ZeroMemory(mymemory, dwSize); // original VirtualAlloc does this (if..)
|
|
return mymemory;
|
|
}
|
|
|
|
BOOL VirtualFree(LPVOID lpAddress, size_t dwSize,
|
|
DWORD dwFreeType) {
|
|
free(lpAddress);
|
|
return TRUE;
|
|
}
|