ReactOS  0.4.13-dev-551-gf37fb1f
precomp.h File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winnls.h>
#include <windns.h>
#include <ndk/rtlfuncs.h>
#include <internal/windns.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.

Macros

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

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)
 

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 24 of file precomp.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 17 of file precomp.h.

Function Documentation

◆ dns_strdup_a()

static LPSTR dns_strdup_a ( LPCSTR  src)
inlinestatic

Definition at line 54 of file precomp.h.

55 {
56  LPSTR dst;
57 
58  if (!src) return NULL;
59  dst = HeapAlloc(GetProcessHeap(), 0, (lstrlenA( src ) + 1) * sizeof(char) );
60  if (dst) lstrcpyA( dst, src );
61  return dst;
62 }
char * LPSTR
Definition: xmlstorage.h:182
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
GLenum src
Definition: glext.h:6340
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
GLenum GLenum dst
Definition: glext.h:6340

Referenced by dns_strcpyX().

◆ dns_strdup_au()

static char* dns_strdup_au ( LPCSTR  src)
inlinestatic

Definition at line 108 of file precomp.h.

109 {
110  char *dst = NULL;
112 
113  if (ret)
114  {
115  dst = dns_strdup_wu( ret );
116  HeapFree( GetProcessHeap(), 0, ret );
117  }
118  return dst;
119 }
static LPWSTR dns_strdup_aw(LPCSTR str)
Definition: precomp.h:42
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
int ret
static char * dns_strdup_wu(LPCWSTR str)
Definition: precomp.h:96
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by dns_strcpyX().

◆ dns_strdup_aw()

static LPWSTR dns_strdup_aw ( LPCSTR  str)
inlinestatic

Definition at line 42 of file precomp.h.

43 {
44  LPWSTR ret = NULL;
45  if (str)
46  {
47  DWORD len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
48  if ((ret = HeapAlloc(GetProcessHeap(), 0, ( len * sizeof(WCHAR) ))))
49  MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len );
50  }
51  return ret;
52 }
#define CP_ACP
Definition: compat.h:99
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define MultiByteToWideChar
Definition: compat.h:100
WCHAR * LPWSTR
Definition: xmlstorage.h:184

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 64 of file precomp.h.

65 {
66  char *dst;
67 
68  if (!src) return NULL;
69  dst = HeapAlloc(GetProcessHeap(), 0, (strlen( src ) + 1) * sizeof(char) );
70  if (dst) strcpy( dst, src );
71  return dst;
72 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
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 121 of file precomp.h.

122 {
123  LPSTR dst = NULL;
125 
126  if (ret)
127  {
128  dst = dns_strdup_wa( ret );
129  HeapFree( GetProcessHeap(), 0, ret );
130  }
131  return dst;
132 }
char * LPSTR
Definition: xmlstorage.h:182
smooth NULL
Definition: ftsmooth.c:416
static LPWSTR dns_strdup_uw(const char *str)
Definition: precomp.h:30
#define GetProcessHeap()
Definition: compat.h:395
int ret
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
static LPSTR dns_strdup_wa(LPCWSTR str)
Definition: precomp.h:84
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by dns_strcpyX().

◆ dns_strdup_uw()

static LPWSTR dns_strdup_uw ( const char str)
inlinestatic

Definition at line 30 of file precomp.h.

31 {
32  LPWSTR ret = NULL;
33  if (str)
34  {
35  DWORD len = MultiByteToWideChar( CP_UTF8, 0, str, -1, NULL, 0 );
36  if ((ret = HeapAlloc(GetProcessHeap(),0,( len * sizeof(WCHAR) ))))
37  MultiByteToWideChar( CP_UTF8, 0, str, -1, ret, len );
38  }
39  return ret;
40 }
#define CP_UTF8
Definition: nls.h:20
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define MultiByteToWideChar
Definition: compat.h:100
WCHAR * LPWSTR
Definition: xmlstorage.h:184

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

◆ dns_strdup_w()

static LPWSTR dns_strdup_w ( LPCWSTR  src)
inlinestatic

Definition at line 74 of file precomp.h.

75 {
76  LPWSTR dst;
77 
78  if (!src) return NULL;
79  dst = HeapAlloc(GetProcessHeap(), 0, (lstrlenW( src ) + 1) * sizeof(WCHAR) );
80  if (dst) lstrcpyW( dst, src );
81  return dst;
82 }
#define lstrlenW
Definition: compat.h:407
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLenum src
Definition: glext.h:6340
#define lstrcpyW
Definition: compat.h:406
GLenum GLenum dst
Definition: glext.h:6340
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by dns_strcpyX().

◆ dns_strdup_wa()

static LPSTR dns_strdup_wa ( LPCWSTR  str)
inlinestatic

Definition at line 84 of file precomp.h.

85 {
86  LPSTR ret = NULL;
87  if (str)
88  {
89  DWORD len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL );
90  if ((ret = HeapAlloc(GetProcessHeap(), 0, len )))
91  WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL );
92  }
93  return ret;
94 }
#define WideCharToMultiByte
Definition: compat.h:101
#define CP_ACP
Definition: compat.h:99
char * LPSTR
Definition: xmlstorage.h:182
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722

Referenced by dns_strcpyX(), and dns_strdup_ua().

◆ dns_strdup_wu()

static char* dns_strdup_wu ( LPCWSTR  str)
inlinestatic

Definition at line 96 of file precomp.h.

97 {
98  LPSTR ret = NULL;
99  if (str)
100  {
101  DWORD len = WideCharToMultiByte( CP_UTF8, 0, str, -1, NULL, 0, NULL, NULL );
102  if ((ret = HeapAlloc(GetProcessHeap(), 0, len )))
103  WideCharToMultiByte( CP_UTF8, 0, str, -1, ret, len, NULL, NULL );
104  }
105  return ret;
106 }
#define WideCharToMultiByte
Definition: compat.h:101
char * LPSTR
Definition: xmlstorage.h:182
#define CP_UTF8
Definition: nls.h:20
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722

Referenced by dns_strcpyX(), and dns_strdup_au().