mirror of
https://github.com/winfsp/winfsp.git
synced 2025-06-16 00:32:46 -05:00
dll: MemAlloc/MemFree
This commit is contained in:
@ -21,4 +21,24 @@
|
||||
#define DEBUGLOG(fmt, ...) ((void)0)
|
||||
#endif
|
||||
|
||||
static inline PVOID MemAlloc(SIZE_T Size)
|
||||
{
|
||||
extern HANDLE ProcessHeap;
|
||||
return HeapAlloc(ProcessHeap, 0, Size);
|
||||
}
|
||||
static inline PVOID MemAllocSLE(SIZE_T Size)
|
||||
{
|
||||
extern HANDLE ProcessHeap;
|
||||
PVOID Pointer = HeapAlloc(ProcessHeap, 0, Size);
|
||||
if (0 == Pointer)
|
||||
SetLastError(ERROR_NO_SYSTEM_RESOURCES);
|
||||
return Pointer;
|
||||
}
|
||||
static inline VOID MemFree(PVOID Pointer)
|
||||
{
|
||||
extern HANDLE ProcessHeap;
|
||||
if (0 != Pointer)
|
||||
HeapFree(ProcessHeap, 0, Pointer);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user