2019-10-27 12:45:52 +00:00
|
|
|
#ifndef _DNSRSLVR_PCH_
|
|
|
|
#define _DNSRSLVR_PCH_
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
2019-11-23 16:07:59 +00:00
|
|
|
#include <stdio.h>
|
2019-10-27 12:45:52 +00:00
|
|
|
|
|
|
|
#define WIN32_NO_STATUS
|
|
|
|
#define _INC_WINDOWS
|
|
|
|
#define COM_NO_WINDOWS_H
|
|
|
|
|
|
|
|
#include <windef.h>
|
|
|
|
#include <winbase.h>
|
2019-11-23 16:07:59 +00:00
|
|
|
#include <winnls.h>
|
|
|
|
#include <winreg.h>
|
2019-10-27 12:45:52 +00:00
|
|
|
#include <winsvc.h>
|
|
|
|
#include <windns.h>
|
2019-11-10 14:28:42 +00:00
|
|
|
#include <windns_undoc.h>
|
2019-10-27 12:45:52 +00:00
|
|
|
|
2019-11-23 16:07:59 +00:00
|
|
|
#define NTOS_MODE_USER
|
2019-10-27 12:45:52 +00:00
|
|
|
#include <ndk/rtlfuncs.h>
|
|
|
|
#include <ndk/obfuncs.h>
|
|
|
|
|
|
|
|
#include <dnsrslvr_s.h>
|
|
|
|
|
2019-11-23 16:07:59 +00:00
|
|
|
#include <strsafe.h>
|
|
|
|
|
2019-10-27 12:45:52 +00:00
|
|
|
typedef struct _RESOLVER_CACHE_ENTRY
|
|
|
|
{
|
|
|
|
LIST_ENTRY CacheLink;
|
2020-01-05 23:45:41 +00:00
|
|
|
BOOL bHostsFileEntry;
|
2019-10-27 12:45:52 +00:00
|
|
|
PDNS_RECORDW Record;
|
|
|
|
} RESOLVER_CACHE_ENTRY, *PRESOLVER_CACHE_ENTRY;
|
|
|
|
|
|
|
|
typedef struct _RESOLVER_CACHE
|
|
|
|
{
|
|
|
|
LIST_ENTRY RecordList;
|
|
|
|
CRITICAL_SECTION Lock;
|
|
|
|
} RESOLVER_CACHE, *PRESOLVER_CACHE;
|
|
|
|
|
|
|
|
|
|
|
|
/* cache.c */
|
|
|
|
|
|
|
|
VOID DnsIntCacheInitialize(VOID);
|
|
|
|
VOID DnsIntCacheRemoveEntryItem(PRESOLVER_CACHE_ENTRY CacheEntry);
|
|
|
|
VOID DnsIntCacheFree(VOID);
|
2020-01-05 23:45:41 +00:00
|
|
|
|
|
|
|
#define CACHE_FLUSH_HOSTS_FILE_ENTRIES 0x00000001
|
|
|
|
#define CACHE_FLUSH_NON_HOSTS_FILE_ENTRIES 0x00000002
|
|
|
|
#define CACHE_FLUSH_ALL 0x00000003
|
|
|
|
|
|
|
|
DNS_STATUS
|
|
|
|
DnsIntCacheFlush(
|
|
|
|
_In_ ULONG ulFlags);
|
2019-11-23 16:07:59 +00:00
|
|
|
|
2021-05-24 12:43:30 +00:00
|
|
|
DNS_STATUS
|
|
|
|
DnsIntFlushCacheEntry(
|
|
|
|
_In_ LPCWSTR pszName,
|
|
|
|
_In_ WORD wType);
|
|
|
|
|
2019-11-23 16:07:59 +00:00
|
|
|
DNS_STATUS
|
|
|
|
DnsIntCacheGetEntryByName(
|
|
|
|
LPCWSTR Name,
|
|
|
|
WORD wType,
|
|
|
|
DWORD dwFlags,
|
|
|
|
PDNS_RECORDW *Record);
|
|
|
|
|
2020-01-05 23:45:41 +00:00
|
|
|
VOID
|
|
|
|
DnsIntCacheAddEntry(
|
|
|
|
_In_ PDNS_RECORDW Record,
|
|
|
|
_In_ BOOL bHostsFileEntry);
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
DnsIntCacheRemoveEntryByName(
|
|
|
|
_In_ LPCWSTR Name);
|
2019-10-27 12:45:52 +00:00
|
|
|
|
2019-12-22 10:21:04 +00:00
|
|
|
DNS_STATUS
|
|
|
|
DnsIntCacheGetEntries(
|
|
|
|
_Out_ DNS_CACHE_ENTRY **ppCacheEntries);
|
2019-10-27 12:45:52 +00:00
|
|
|
|
2019-11-23 16:07:59 +00:00
|
|
|
|
|
|
|
/* hostsfile.c */
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
ReadHostsFile(VOID);
|
|
|
|
|
2019-10-27 12:45:52 +00:00
|
|
|
#endif /* _DNSRSLVR_PCH_ */
|