39 WideLen *
sizeof(
WCHAR));
40 if (WideString ==
NULL)
100 WCHAR szReverseName[32];
105 ARecord.
pName = pszHostName;
110 ARecord.
dwTtl = 86400;
116 L"%u.%u.%u.%u.in-addr.arpa.",
124 PtrRecord.
pName = szReverseName;
129 PtrRecord.
dwTtl = 86400;
145 WCHAR szReverseName[80];
151 AAAARecord.
pName = pszHostName;
156 AAAARecord.
dwTtl = 86400;
163 ZeroMemory(szReverseName,
sizeof(szReverseName));
170 szReverseName[
j + 1] =
L'.';
172 szReverseName[
j + 3] =
L'.';
174 wcscat(szReverseName,
L"ip6.arpa.");
178 PtrRecord.
pName = szReverseName;
183 PtrRecord.
dwTtl = 86400;
205 if (ExpandedPath ==
NULL)
210 L"System\\CurrentControlSet\\Services\\Tcpip\\Parameters",
261 if (ExpandedPath[StringLength - 1] !=
L'\\')
272 if (ExpandedPath[StringLength - 1] !=
L'\\')
282 pHostsFile =
_wfopen(ExpandedPath,
L"r");
293 CHAR szLineBuffer[512];
295 CHAR *
Ptr, *NameStart, *NameEnd, *AddressStart, *AddressEnd;
301 if (pHostFile ==
NULL)
307 if (
fgets(szLineBuffer,
sizeof(szLineBuffer), pHostFile) ==
NULL)
310 NameStart = NameEnd =
NULL;
311 AddressStart = AddressEnd =
NULL;
317 if (*
Ptr == 0 || *
Ptr ==
'#')
333 if (*
Ptr == 0 || *
Ptr ==
'#')
349 if (*
Ptr == 0 || *
Ptr ==
'#')
365 if (*
Ptr == 0 || *
Ptr ==
'#')
377 if (AddressStart ==
NULL || AddressEnd ==
NULL ||
378 NameStart ==
NULL || NameEnd ==
NULL)
384 DPRINT(
"%s ==> %s\n", NameStart, AddressStart);
388 DPRINT(
"IPv4: %s\n", AddressStart);
391 if (pszHostName !=
NULL)
399 DPRINT(
"IPv6: %s\n", AddressStart);
402 if (pszHostName !=
NULL)
VOID DnsIntCacheAddEntry(_In_ PDNS_RECORDW Record, _In_ BOOL bHostsFileEntry)
#define RegCloseKey(hKey)
#define NT_SUCCESS(StatCode)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
#define HeapFree(x, y, z)
#define MultiByteToWideChar
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
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
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 GLint GLint j
static BOOL ParseIpv6Address(_In_ LPCSTR AddressString, _Out_ PIN6_ADDR pAddress)
static FILE * OpenHostsFile(VOID)
static VOID AddIpv4HostEntries(PWSTR pszHostName, PIN_ADDR pAddress)
static BOOL ParseIpv4Address(_In_ PCSTR AddressString, _Out_ PIN_ADDR pAddress)
static PWSTR AnsiToUnicode(PSTR NarrowString)
static VOID AddIpv6HostEntries(PWSTR pszHostName, PIN6_ADDR pAddress)
_Check_return_ _CRTIMP FILE *__cdecl _wfopen(_In_z_ const wchar_t *_Filename, _In_z_ const wchar_t *_Mode)
_Check_return_opt_ _CRTIMP char *__cdecl fgets(_Out_writes_z_(_MaxCount) char *_Buf, _In_ int _MaxCount, _Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
NTSYSAPI NTSTATUS NTAPI RtlIpv4StringToAddressA(_In_ PCSTR String, _In_ BOOLEAN Strict, _Out_ PCSTR *Terminator, _Out_ struct in_addr *Addr)
NTSYSAPI NTSTATUS NTAPI RtlIpv6StringToAddressA(_In_ PCSTR String, _Out_ PCSTR *Terminator, _Out_ struct in6_addr *Addr)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
STRSAFEAPI StringCchLengthW(STRSAFE_LPCWSTR psz, size_t cchMax, size_t *pcchLength)
DNS_IP6_ADDRESS Ip6Address
union _DnsRecordW::@3299 Flags
union _DnsRecordW::@3300 Data
struct in_addr::@1029::@1030 S_un_b
union in_addr::@1029 S_un
#define HKEY_LOCAL_MACHINE