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.
8 /* INCLUDES ******************************************************************/
11 /* DATA **********************************************************************/
14 (WINAPI
*PDNS_ALLOC_FUNCTION
)(IN SIZE_T Size
);
16 (WINAPI
*PDNS_FREE_FUNCTION
)(IN PVOID Buffer
);
18 PDNS_ALLOC_FUNCTION pDnsAllocFunction
;
19 PDNS_FREE_FUNCTION pDnsFreeFunction
;
21 /* FUNCTIONS *****************************************************************/
25 Dns_Free(IN PVOID Address
)
27 /* Check if whoever imported us specified a special free function */
31 pDnsFreeFunction(Address
);
42 Dns_AllocZero(IN SIZE_T Size
)
46 /* Check if whoever imported us specified a special allocation function */
47 if (pDnsAllocFunction
)
49 /* Use it to allocate the memory */
50 Buffer
= pDnsAllocFunction(Size
);
54 RtlZeroMemory(Buffer
, Size
);
60 Buffer
= LocalAlloc(LMEM_ZEROINIT
, Size
);
63 /* Return the allocate pointer */