ReactOS 0.4.15-dev-8093-g3285f69
memory.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS DNS Shared Library
4 * FILE: lib/dnslib/memory.c
5 * PURPOSE: DNS Memory Manager Implementation and Heap.
6 */
7
8/* INCLUDES ******************************************************************/
9#include "precomp.h"
10
11/* DATA **********************************************************************/
12
13typedef PVOID
15typedef VOID
17
20
21/* FUNCTIONS *****************************************************************/
22
23VOID
26{
27 /* Check if whoever imported us specified a special free function */
29 {
30 /* Use it */
32 }
33 else
34 {
35 /* Use our own */
37 }
38}
39
43{
45
46 /* Check if whoever imported us specified a special allocation function */
48 {
49 /* Use it to allocate the memory */
51 if (Buffer)
52 {
53 /* Zero it out */
55 }
56 }
57 else
58 {
59 /* Use our default */
61 }
62
63 /* Return the allocate pointer */
64 return Buffer;
65}
66
#define VOID
Definition: acefi.h:82
Definition: bufpool.h:45
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
static WCHAR Address[46]
Definition: ping.c:68
PDNS_FREE_FUNCTION pDnsFreeFunction
Definition: memory.c:19
PVOID(WINAPI * PDNS_ALLOC_FUNCTION)(IN SIZE_T Size)
Definition: memory.c:14
PVOID WINAPI Dns_AllocZero(IN SIZE_T Size)
Definition: memory.c:42
PDNS_ALLOC_FUNCTION pDnsAllocFunction
Definition: memory.c:18
VOID WINAPI Dns_Free(IN PVOID Address)
Definition: memory.c:25
VOID(WINAPI * PDNS_FREE_FUNCTION)(IN PVOID Buffer)
Definition: memory.c:16
void * PVOID
Definition: typedefs.h:50
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define IN
Definition: typedefs.h:39
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
#define LMEM_ZEROINIT
Definition: winbase.h:375
#define WINAPI
Definition: msvc.h:6