ReactOS  0.4.15-dev-3294-ge98684e
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 14 of file memory.c.

◆ PDNS_FREE_FUNCTION

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

Definition at line 16 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 {
44  PVOID Buffer;
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 }
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
Definition: bufpool.h:45
#define LMEM_ZEROINIT
Definition: winbase.h:372
PDNS_ALLOC_FUNCTION pDnsAllocFunction
Definition: memory.c:18
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1373

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 */
28  if (pDnsFreeFunction)
29  {
30  /* Use it */
32  }
33  else
34  {
35  /* Use our own */
37  }
38 }
PDNS_FREE_FUNCTION pDnsFreeFunction
Definition: memory.c:19
static WCHAR Address[46]
Definition: ping.c:68
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577

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