ReactOS 0.4.16-dev-197-g92996da
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}
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:590
#define assert(x)
Definition: debug.h:53
GLenum GLsizei len
Definition: glext.h:6722
HANDLE hProcessHeap
Definition: heap.c:31

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:608
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}
LONG NTSTATUS
Definition: precomp.h:26
#define STATUS_NO_MEMORY
Definition: d3dkmdt.h:51
#define NULL
Definition: types.h:112
Status
Definition: gdiplustypes.h:25
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
_Use_decl_annotations_ NTSTATUS NTAPI RtlMultiByteToUnicodeN(_Out_ PWCH UnicodeString, _In_ ULONG UnicodeSize, _Out_opt_ PULONG ResultSize, _In_ PCCH MbString, _In_ ULONG MbSize)
Definition: nlsboot.c:62
#define L(x)
Definition: ntvdm.h:50
#define STATUS_SUCCESS
Definition: shellext.h:65
uint32_t ULONG
Definition: typedefs.h:59
char * PCHAR
Definition: typedefs.h:51
PVOID HEAP_alloc(DWORD len)
Definition: heap.c:35
__wchar_t WCHAR
Definition: xmlstorage.h:180

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().