4 * Copyright 1996 Alexandre Julliard
5 * Copyright 1998 Ulrich Weigand
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
36 #include "wine/unicode.h"
38 #include "wine/debug.h"
40 WINE_DEFAULT_DEBUG_CHANNEL(heap);
42 /***********************************************************************
43 * HeapLock (KERNEL32.@)
44 * Attempts to acquire the critical section object for a specified heap.
51 HANDLE heap /* [in] Handle of heap to lock for exclusive access */
53 return RtlLockHeap( heap );
57 /***********************************************************************
58 * HeapUnlock (KERNEL32.@)
59 * Releases ownership of the critical section object.
65 BOOL WINAPI HeapUnlock(
66 HANDLE heap /* [in] Handle to the heap to unlock */
68 return RtlUnlockHeap( heap );
72 /***********************************************************************
73 * GetProcessHeap (KERNEL32.@)
75 HANDLE WINAPI GetProcessHeap(void)
77 return NtCurrentTeb()->Peb->ProcessHeap;
81 /* FIXME: these functions are needed for dlls that aren't properly separated yet */
83 LPVOID WINAPI HeapAlloc( HANDLE heap, DWORD flags, SIZE_T size )
85 return RtlAllocateHeap( heap, flags, size );
88 BOOL WINAPI HeapFree( HANDLE heap, DWORD flags, LPVOID ptr )
90 return RtlFreeHeap( heap, flags, ptr );
93 LPVOID WINAPI HeapReAlloc( HANDLE heap, DWORD flags, LPVOID ptr, SIZE_T size )
95 return RtlReAllocateHeap( heap, flags, ptr, size );
98 SIZE_T WINAPI HeapSize( HANDLE heap, DWORD flags, LPVOID ptr )
100 return RtlSizeHeap( heap, flags, ptr );