ReactOS 0.4.15-dev-7842-g558ab78
memory.c File Reference
#include "precomp.h"
Include dependency graph for memory.c:

Go to the source code of this file.

Typedefs

typedef PVOID(WINAPIPDNS_ALLOC_FUNCTION) (IN SIZE_T Size)
 
typedef VOID(WINAPIPDNS_FREE_FUNCTION) (IN PVOID Buffer)
 

Functions

VOID WINAPI Dns_Free (IN PVOID Address)
 
PVOID WINAPI Dns_AllocZero (IN SIZE_T Size)
 

Variables

PDNS_ALLOC_FUNCTION pDnsAllocFunction
 
PDNS_FREE_FUNCTION pDnsFreeFunction
 

Typedef Documentation

◆ PDNS_ALLOC_FUNCTION

typedef PVOID(WINAPI * PDNS_ALLOC_FUNCTION) (IN SIZE_T Size)

Definition at line 13 of file memory.c.

◆ PDNS_FREE_FUNCTION

typedef VOID(WINAPI * PDNS_FREE_FUNCTION) (IN PVOID Buffer)

Definition at line 15 of file memory.c.

Function Documentation

◆ Dns_AllocZero()

PVOID WINAPI Dns_AllocZero ( IN SIZE_T  Size)

Definition at line 42 of file memory.c.

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}
Definition: bufpool.h:45
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
PDNS_ALLOC_FUNCTION pDnsAllocFunction
Definition: memory.c:18
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_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

Referenced by Dns_CreateStringCopy_W(), DnsAddrArray_Create(), SaBlob_Create(), and SaBlob_CreateHostent().

◆ Dns_Free()

VOID WINAPI Dns_Free ( IN PVOID  Address)

Definition at line 25 of file memory.c.

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}
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

Referenced by DnsAddrArray_Free(), and SaBlob_Free().

Variable Documentation

◆ pDnsAllocFunction

PDNS_ALLOC_FUNCTION pDnsAllocFunction

Definition at line 18 of file memory.c.

Referenced by Dns_AllocZero().

◆ pDnsFreeFunction

PDNS_FREE_FUNCTION pDnsFreeFunction

Definition at line 19 of file memory.c.

Referenced by Dns_Free().