1 #ifndef _DNSRSLVR_PCH_ 2 #define _DNSRSLVR_PCH_ 3 4 #include <stdarg.h> 5 #include <stdio.h> 6 7 #define WIN32_NO_STATUS 8 #define _INC_WINDOWS 9 #define COM_NO_WINDOWS_H 10 11 #include <windef.h> 12 #include <winbase.h> 13 #include <winnls.h> 14 #include <winreg.h> 15 #include <winsvc.h> 16 #include <windns.h> 17 #include <windns_undoc.h> 18 19 #define NTOS_MODE_USER 20 #include <ndk/rtlfuncs.h> 21 #include <ndk/obfuncs.h> 22 23 #include <dnsrslvr_s.h> 24 25 #include <strsafe.h> 26 27 typedef struct _RESOLVER_CACHE_ENTRY 28 { 29 LIST_ENTRY CacheLink; 30 BOOL bHostsFileEntry; 31 PDNS_RECORDW Record; 32 } RESOLVER_CACHE_ENTRY, *PRESOLVER_CACHE_ENTRY; 33 34 typedef struct _RESOLVER_CACHE 35 { 36 LIST_ENTRY RecordList; 37 CRITICAL_SECTION Lock; 38 } RESOLVER_CACHE, *PRESOLVER_CACHE; 39 40 41 /* cache.c */ 42 43 VOID DnsIntCacheInitialize(VOID); 44 VOID DnsIntCacheRemoveEntryItem(PRESOLVER_CACHE_ENTRY CacheEntry); 45 VOID DnsIntCacheFree(VOID); 46 47 #define CACHE_FLUSH_HOSTS_FILE_ENTRIES 0x00000001 48 #define CACHE_FLUSH_NON_HOSTS_FILE_ENTRIES 0x00000002 49 #define CACHE_FLUSH_ALL 0x00000003 50 51 DNS_STATUS 52 DnsIntCacheFlush( 53 _In_ ULONG ulFlags); 54 55 DNS_STATUS 56 DnsIntCacheGetEntryByName( 57 LPCWSTR Name, 58 WORD wType, 59 DWORD dwFlags, 60 PDNS_RECORDW *Record); 61 62 VOID 63 DnsIntCacheAddEntry( 64 _In_ PDNS_RECORDW Record, 65 _In_ BOOL bHostsFileEntry); 66 67 BOOL 68 DnsIntCacheRemoveEntryByName( 69 _In_ LPCWSTR Name); 70 71 DNS_STATUS 72 DnsIntCacheGetEntries( 73 _Out_ DNS_CACHE_ENTRY **ppCacheEntries); 74 75 76 /* hostsfile.c */ 77 78 BOOL 79 ReadHostsFile(VOID); 80 81 #endif /* _DNSRSLVR_PCH_ */ 82