xref: /reactos/base/services/dnsrslvr/precomp.h (revision 3e1f4074)
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 DnsIntFlushCacheEntry(
57     _In_ LPCWSTR pszName,
58     _In_ WORD wType);
59 
60 DNS_STATUS
61 DnsIntCacheGetEntryByName(
62     LPCWSTR Name,
63     WORD wType,
64     DWORD dwFlags,
65     PDNS_RECORDW *Record);
66 
67 VOID
68 DnsIntCacheAddEntry(
69     _In_ PDNS_RECORDW Record,
70     _In_ BOOL bHostsFileEntry);
71 
72 BOOL
73 DnsIntCacheRemoveEntryByName(
74     _In_ LPCWSTR Name);
75 
76 DNS_STATUS
77 DnsIntCacheGetEntries(
78     _Out_ DNS_CACHE_ENTRY **ppCacheEntries);
79 
80 
81 /* hostsfile.c */
82 
83 BOOL
84 ReadHostsFile(VOID);
85 
86 #endif /* _DNSRSLVR_PCH_ */
87