1 /* $Id: stdlib.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
8 * This file is part of the ReactOS Operating System.
11 * Created by KJK::Hyperion <noog@libero.it>
13 * THIS SOFTWARE IS NOT COPYRIGHTED
15 * This source code is offered for use in the public domain. You may
16 * use, modify or distribute it freely.
18 * This code is distributed in the hope that it will be useful but
19 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
20 * DISCLAMED. This includes but is not limited to warranties of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24 #ifndef __PSX_STDLIB_H_INCLUDED__
25 #define __PSX_STDLIB_H_INCLUDED__
28 #include <ddk/ntddk.h>
29 #include <ntos/heap.h>
41 /* FIXME? Windows NT's ntdll doesn't export RtlGetProcessHeap() */
42 #define RtlGetProcessHeap() ((HANDLE)NtCurrentPeb()->ProcessHeap)
44 #define __malloc(SIZE) (RtlAllocateHeap(RtlGetProcessHeap(), 0, (SIZE)))
45 #define __realloc(PTR,SIZE) (RtlReAllocateHeap(RtlGetProcessHeap(), 0, (PTR), (SIZE)))
46 #define __free(PTR) (RtlFreeHeap(RtlGetProcessHeap(), 0, (PTR)))
48 #endif /* __PSX_STDLIB_H_INCLUDED__ */