ReactOS 0.4.15-dev-7934-g1dc8d80
precomp.h File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winnls.h>
#include <windns.h>
#include <reactos/windns_undoc.h>
#include <ndk/rtlfuncs.h>
#include <dnsrslvr_c.h>
#include <adns.h>
Include dependency graph for precomp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  WINDNS_CONTEXT
 

Macros

#define WIN32_NO_STATUS
 
#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 
#define NTOS_MODE_USER
 

Typedefs

typedef struct WINDNS_CONTEXTPWINDNS_CONTEXT
 

Functions

static LPWSTR dns_strdup_uw (const char *str)
 
static LPWSTR dns_strdup_aw (LPCSTR str)
 
static LPSTR dns_strdup_a (LPCSTR src)
 
static chardns_strdup_u (const char *src)
 
static LPWSTR dns_strdup_w (LPCWSTR src)
 
static LPSTR dns_strdup_wa (LPCWSTR str)
 
static chardns_strdup_wu (LPCWSTR str)
 
static chardns_strdup_au (LPCSTR src)
 
static LPSTR dns_strdup_ua (const char *src)
 
DNS_STATUS DnsIntTranslateAdnsToDNS_STATUS (int Status)
 
void DnsIntFreeRecordList (PDNS_RECORD ToFree)
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 18 of file precomp.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 19 of file precomp.h.

◆ NTOS_MODE_USER

#define NTOS_MODE_USER

Definition at line 25 of file precomp.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 17 of file precomp.h.

Typedef Documentation

◆ PWINDNS_CONTEXT

Function Documentation

◆ dns_strdup_a()

static LPSTR dns_strdup_a ( LPCSTR  src)
inlinestatic

Definition at line 61 of file precomp.h.

62{
63 LPSTR dst;
64
65 if (!src) return NULL;
66 dst = HeapAlloc(GetProcessHeap(), 0, (lstrlenA( src ) + 1) * sizeof(char) );
67 if (dst) lstrcpyA( dst, src );
68 return dst;
69}
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
char * LPSTR
Definition: xmlstorage.h:182

Referenced by dns_strcpyX().

◆ dns_strdup_au()

static char * dns_strdup_au ( LPCSTR  src)
inlinestatic

Definition at line 115 of file precomp.h.

116{
117 char *dst = NULL;
119
120 if (ret)
121 {
122 dst = dns_strdup_wu( ret );
123 HeapFree( GetProcessHeap(), 0, ret );
124 }
125 return dst;
126}
#define HeapFree(x, y, z)
Definition: compat.h:735
static char * dns_strdup_wu(LPCWSTR str)
Definition: precomp.h:103
static LPWSTR dns_strdup_aw(LPCSTR str)
Definition: precomp.h:49
int ret
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by dns_strcpyX().

◆ dns_strdup_aw()

static LPWSTR dns_strdup_aw ( LPCSTR  str)
inlinestatic

Definition at line 49 of file precomp.h.

50{
51 LPWSTR ret = NULL;
52 if (str)
53 {
54 DWORD len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
55 if ((ret = HeapAlloc(GetProcessHeap(), 0, ( len * sizeof(WCHAR) ))))
57 }
58 return ret;
59}
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
const WCHAR * str
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by dns_strcpyX(), dns_strdup_au(), DnsNameCompare_A(), and DnsValidateName_A().

◆ dns_strdup_u()

static char * dns_strdup_u ( const char src)
inlinestatic

Definition at line 71 of file precomp.h.

72{
73 char *dst;
74
75 if (!src) return NULL;
76 dst = HeapAlloc(GetProcessHeap(), 0, (strlen( src ) + 1) * sizeof(char) );
77 if (dst) strcpy( dst, src );
78 return dst;
79}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388

Referenced by dns_strcpyX().

◆ dns_strdup_ua()

static LPSTR dns_strdup_ua ( const char src)
inlinestatic

Definition at line 128 of file precomp.h.

129{
130 LPSTR dst = NULL;
132
133 if (ret)
134 {
135 dst = dns_strdup_wa( ret );
136 HeapFree( GetProcessHeap(), 0, ret );
137 }
138 return dst;
139}
static LPWSTR dns_strdup_uw(const char *str)
Definition: precomp.h:37
static LPSTR dns_strdup_wa(LPCWSTR str)
Definition: precomp.h:91

Referenced by dns_strcpyX().

◆ dns_strdup_uw()

static LPWSTR dns_strdup_uw ( const char str)
inlinestatic

Definition at line 37 of file precomp.h.

38{
39 LPWSTR ret = NULL;
40 if (str)
41 {
43 if ((ret = HeapAlloc(GetProcessHeap(),0,( len * sizeof(WCHAR) ))))
45 }
46 return ret;
47}
#define CP_UTF8
Definition: nls.h:20

Referenced by dns_strcpyX(), dns_strdup_ua(), and DnsValidateName_UTF8().

◆ dns_strdup_w()

static LPWSTR dns_strdup_w ( LPCWSTR  src)
inlinestatic

Definition at line 81 of file precomp.h.

82{
83 LPWSTR dst;
84
85 if (!src) return NULL;
86 dst = HeapAlloc(GetProcessHeap(), 0, (lstrlenW( src ) + 1) * sizeof(WCHAR) );
87 if (dst) lstrcpyW( dst, src );
88 return dst;
89}
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750

Referenced by dns_strcpyX().

◆ dns_strdup_wa()

static LPSTR dns_strdup_wa ( LPCWSTR  str)
inlinestatic

Definition at line 91 of file precomp.h.

92{
93 LPSTR ret = NULL;
94 if (str)
95 {
97 if ((ret = HeapAlloc(GetProcessHeap(), 0, len )))
99 }
100 return ret;
101}
#define WideCharToMultiByte
Definition: compat.h:111

Referenced by dns_strcpyX(), and dns_strdup_ua().

◆ dns_strdup_wu()

static char * dns_strdup_wu ( LPCWSTR  str)
inlinestatic

Definition at line 103 of file precomp.h.

104{
105 LPSTR ret = NULL;
106 if (str)
107 {
109 if ((ret = HeapAlloc(GetProcessHeap(), 0, len )))
111 }
112 return ret;
113}

Referenced by dns_strcpyX(), and dns_strdup_au().

◆ DnsIntFreeRecordList()

void DnsIntFreeRecordList ( PDNS_RECORD  ToFree)

Definition at line 889 of file query.c.

890{
891 UINT i;
892 PDNS_RECORD next = 0;
893
894 while(ToDelete)
895 {
896 if(ToDelete->pName)
897 RtlFreeHeap(RtlGetProcessHeap(), 0, ToDelete->pName);
898
899 switch(ToDelete->wType)
900 {
901 case DNS_TYPE_CNAME:
902 case DNS_TYPE_PTR:
903 case DNS_TYPE_NS:
904 case DNS_TYPE_MB:
905 case DNS_TYPE_MD:
906 case DNS_TYPE_MF:
907 case DNS_TYPE_MG:
908 case DNS_TYPE_MR:
909 RtlFreeHeap(RtlGetProcessHeap(), 0, ToDelete->Data.PTR.pNameHost);
910 break;
911
912 case DNS_TYPE_MINFO:
913 case DNS_TYPE_MX:
914 RtlFreeHeap(RtlGetProcessHeap(), 0, ToDelete->Data.MX.pNameExchange);
915 break;
916
917 case DNS_TYPE_HINFO:
918 for(i = 0; i < ToDelete->Data.TXT.dwStringCount; i++)
919 RtlFreeHeap(RtlGetProcessHeap(), 0, ToDelete->Data.TXT.pStringArray[i]);
920
921 RtlFreeHeap(RtlGetProcessHeap(), 0, ToDelete->Data.TXT.pStringArray);
922 break;
923 }
924
925 next = ToDelete->pNext;
926 RtlFreeHeap(RtlGetProcessHeap(), 0, ToDelete);
927 ToDelete = next;
928 }
929}
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:608
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: ndis.h:50
static unsigned __int64 next
Definition: rand_nt.c:6
#define DNS_TYPE_MINFO
Definition: windns.h:54
#define DNS_TYPE_HINFO
Definition: windns.h:53
#define DNS_TYPE_MX
Definition: windns.h:55
#define DNS_TYPE_PTR
Definition: windns.h:52
#define DNS_TYPE_MB
Definition: windns.h:47
#define DNS_TYPE_MG
Definition: windns.h:48
#define DNS_TYPE_CNAME
Definition: windns.h:45
#define DNS_TYPE_NS
Definition: windns.h:42
#define DNS_TYPE_MD
Definition: windns.h:43
#define DNS_TYPE_MF
Definition: windns.h:44
#define PDNS_RECORD
Definition: windns.h:636
#define DNS_TYPE_MR
Definition: windns.h:49

Referenced by DnsFree(), and DnsQuery_CodePage().

◆ DnsIntTranslateAdnsToDNS_STATUS()

DNS_STATUS DnsIntTranslateAdnsToDNS_STATUS ( int  Status)

Definition at line 17 of file adns.c.

18{
19 switch(Status)
20 {
21 case adns_s_ok:
22 return ERROR_SUCCESS;
23
24 case adns_s_nomemory:
26 default: /* There really aren't any general errors in the dns part. */
27 return ERROR_OUTOFMEMORY;
28 }
29}
@ adns_s_ok
Definition: adns.h:216
@ adns_s_systemfail
Definition: adns.h:221
@ adns_s_nomemory
Definition: adns.h:219
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
#define ERROR_SUCCESS
Definition: deptool.c:10
Status
Definition: gdiplustypes.h:25

Referenced by DnsAcquireContextHandle_W(), and Query_Main().