ReactOS  0.4.15-dev-499-g1f31905
heap.c File Reference
#include <precomp.h>
#include <debug.h>
Include dependency graph for heap.c:

Go to the source code of this file.

Functions

PVOID HEAP_alloc (DWORD len)
 
NTSTATUS HEAP_strdupA2W (LPWSTR *ppszW, LPCSTR lpszA)
 
VOID HEAP_free (LPVOID memory)
 

Variables

HANDLE hProcessHeap = NULL
 

Function Documentation

◆ HEAP_alloc()

PVOID HEAP_alloc ( DWORD  len)

Definition at line 35 of file heap.c.

36 {
37  /* make sure hProcessHeap gets initialized by GdiProcessSetup before we get here */
39  return RtlAllocateHeap ( hProcessHeap, 0, len );
40 }
#define assert(x)
Definition: debug.h:53
HANDLE hProcessHeap
Definition: heap.c:31
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
GLenum GLsizei len
Definition: glext.h:6722

Referenced by HEAP_strdupA2W().

◆ HEAP_free()

VOID HEAP_free ( LPVOID  memory)

Definition at line 63 of file heap.c.

64 {
65  /* make sure hProcessHeap gets initialized by GdiProcessSetup before we get here */
67 
69 }
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
#define assert(x)
Definition: debug.h:53
HANDLE hProcessHeap
Definition: heap.c:31
static char memory[1024 *256]
Definition: process.c:116

Referenced by AddFontResourceA(), AddFontResourceExA(), CreateDCA(), CreateICA(), EnumFontsA(), GetStringBitmapA(), GetTextExtentExPointA(), RemoveFontResourceExA(), and ResetDCA().

◆ HEAP_strdupA2W()

NTSTATUS HEAP_strdupA2W ( LPWSTR ppszW,
LPCSTR  lpszA 
)

Definition at line 43 of file heap.c.

44 {
45  ULONG len;
47 
48  *ppszW = NULL;
49  if ( !lpszA )
50  return STATUS_SUCCESS;
51  len = lstrlenA(lpszA);
52 
53  *ppszW = HEAP_alloc ( (len+1) * sizeof(WCHAR) );
54  if ( !*ppszW )
55  return STATUS_NO_MEMORY;
56  Status = RtlMultiByteToUnicodeN ( *ppszW, len*sizeof(WCHAR), NULL, (PCHAR)lpszA, len );
57  (*ppszW)[len] = L'\0';
58  return Status;
59 }
signed char * PCHAR
Definition: retypes.h:7
LONG NTSTATUS
Definition: precomp.h:26
PVOID HEAP_alloc(DWORD len)
Definition: heap.c:35
smooth NULL
Definition: ftsmooth.c:416
NTSYSAPI NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR, DWORD, LPDWORD, LPCSTR, DWORD)
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR L[]
Definition: oid.c:1250
GLenum GLsizei len
Definition: glext.h:6722
Status
Definition: gdiplustypes.h:24
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
unsigned int ULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:3014

Referenced by AddFontResourceA(), AddFontResourceExA(), CreateICA(), EnumFontsA(), GetStringBitmapA(), GetTextExtentExPointA(), and RemoveFontResourceExA().

Variable Documentation

◆ hProcessHeap

HANDLE hProcessHeap = NULL

Definition at line 31 of file heap.c.

Referenced by HEAP_alloc(), and HEAP_free().