ReactOS  0.4.14-dev-998-g623dd26
rpcserver.c File Reference
#include "precomp.h"
#include <debug.h>
Include dependency graph for rpcserver.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

DWORD WINAPI RpcThreadRoutine (LPVOID lpParameter)
 
DWORD __stdcall CRrReadCache (_In_ DNSRSLVR_HANDLE pwszServerName, _Out_ DNS_CACHE_ENTRY **ppCacheEntries)
 
DWORD __stdcall R_ResolverFlushCache (_In_ DNSRSLVR_HANDLE pwszServerName)
 
DWORD __stdcall R_ResolverQuery (_In_ DNSRSLVR_HANDLE pszServerName, _In_ LPCWSTR pszName, _In_ WORD wType, _In_ DWORD dwFlags, _Inout_ DWORD *dwRecords, _Out_ DNS_RECORDW **ppResultRecords)
 
void __RPC_FAR *__RPC_USER midl_user_allocate (SIZE_T len)
 
void __RPC_USER midl_user_free (void __RPC_FAR *ptr)
 
void __RPC_USER DNSRSLVR_RPC_HANDLE_rundown (DNSRSLVR_HANDLE hClientHandle)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 11 of file rpcserver.c.

Function Documentation

◆ CRrReadCache()

DWORD __stdcall CRrReadCache ( _In_ DNSRSLVR_HANDLE  pwszServerName,
_Out_ DNS_CACHE_ENTRY **  ppCacheEntries 
)

Definition at line 48 of file rpcserver.c.

51 {
52  DPRINT("CRrReadCache(%S %p)\n",
53  pwszServerName, ppCacheEntries);
54 
55  return DnsIntCacheGetEntries(ppCacheEntries);
56 }
void DPRINT(...)
Definition: polytest.cpp:61
DNS_STATUS DnsIntCacheGetEntries(_Out_ DNS_CACHE_ENTRY **ppCacheEntries)
Definition: cache.c:219

Referenced by DnsGetCacheDataTable().

◆ DNSRSLVR_RPC_HANDLE_rundown()

void __RPC_USER DNSRSLVR_RPC_HANDLE_rundown ( DNSRSLVR_HANDLE  hClientHandle)

Definition at line 164 of file rpcserver.c.

165 {
166 }

◆ midl_user_allocate()

void __RPC_FAR* __RPC_USER midl_user_allocate ( SIZE_T  len)

Definition at line 154 of file rpcserver.c.

155 {
157 }
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLenum GLsizei len
Definition: glext.h:6722
#define HEAP_ZERO_MEMORY
Definition: compat.h:123

Referenced by NetrJobEnum(), NetrJobGetInfo(), NetrRemoteTOD(), NetrServerGetInfo(), NetrServerStatisticsGet(), and NetrWorkstationStatisticsGet().

◆ midl_user_free()

void __RPC_USER midl_user_free ( void __RPC_FAR ptr)

Definition at line 159 of file rpcserver.c.

160 {
161  HeapFree(GetProcessHeap(), 0, ptr);
162 }
static PVOID ptr
Definition: dispmode.c:27
#define GetProcessHeap()
Definition: compat.h:403
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by NetrJobGetInfo().

◆ R_ResolverFlushCache()

DWORD __stdcall R_ResolverFlushCache ( _In_ DNSRSLVR_HANDLE  pwszServerName)

Definition at line 62 of file rpcserver.c.

64 {
65  DPRINT("R_ResolverFlushCache(%S)\n",
66  pwszServerName);
67 
69 }
DNS_STATUS DnsIntCacheFlush(_In_ ULONG ulFlags)
Definition: cache.c:69
void DPRINT(...)
Definition: polytest.cpp:61
#define CACHE_FLUSH_NON_HOSTS_FILE_ENTRIES
Definition: precomp.h:48

Referenced by DnsFlushResolverCache().

◆ R_ResolverQuery()

DWORD __stdcall R_ResolverQuery ( _In_ DNSRSLVR_HANDLE  pszServerName,
_In_ LPCWSTR  pszName,
_In_ WORD  wType,
_In_ DWORD  dwFlags,
_Inout_ DWORD dwRecords,
_Out_ DNS_RECORDW **  ppResultRecords 
)

Definition at line 75 of file rpcserver.c.

82 {
84  DNS_STATUS Status = ERROR_SUCCESS;
85 
86  DPRINT("R_ResolverQuery(%S %S %x %lx %p %p)\n",
87  pszServerName, pszName, wType, dwFlags, dwRecords, ppResultRecords);
88 
89  if (pszName == NULL || wType == 0 || ppResultRecords == NULL)
91 
94 
96  {
97  DPRINT("DNS query!\n");
98  Status = Query_Main(pszName,
99  wType,
100  dwFlags,
101  ppResultRecords);
102  }
103  else if (dwFlags & DNS_QUERY_NO_WIRE_QUERY)
104  {
105  DPRINT("DNS cache query!\n");
107  wType,
108  dwFlags,
109  ppResultRecords);
110  }
111  else
112  {
113  DPRINT("DNS cache query!\n");
115  wType,
116  dwFlags,
117  ppResultRecords);
119  {
120  DPRINT("DNS query!\n");
121  Status = Query_Main(pszName,
122  wType,
123  dwFlags,
124  ppResultRecords);
125  if (Status == ERROR_SUCCESS)
126  {
127  DPRINT("DNS query successful!\n");
128  DnsIntCacheAddEntry(*ppResultRecords, FALSE);
129  }
130  }
131  }
132 
133  if (dwRecords)
134  {
135  *dwRecords = 0;
136 
137  if (Status == ERROR_SUCCESS)
138  {
139  Record = *ppResultRecords;
140  while (Record)
141  {
142  DPRINT("Record: %S\n", Record->pName);
143  (*dwRecords)++;
144  Record = Record->pNext;
145  }
146  }
147  }
148 
149  DPRINT("R_ResolverQuery result %ld %ld\n", Status, *dwRecords);
150 
151  return Status;
152 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define ERROR_SUCCESS
Definition: deptool.c:10
#define DNS_INFO_NO_RECORDS
Definition: winerror.h:1861
_In_ struct _KBUGCHECK_REASON_CALLBACK_RECORD * Record
Definition: ketypes.h:256
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define DNS_QUERY_WIRE_ONLY
Definition: windns.h:18
DNS_STATUS DnsIntCacheGetEntryByName(LPCWSTR Name, WORD wType, DWORD dwFlags, PDNS_RECORDW *Record)
Definition: cache.c:105
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
Status
Definition: gdiplustypes.h:24
#define DNS_QUERY_NO_WIRE_QUERY
Definition: windns.h:13
DNS_STATUS WINAPI Query_Main(LPCWSTR Name, WORD Type, DWORD Options, PDNS_RECORD *QueryResultSet)
Definition: query.c:654
VOID DnsIntCacheAddEntry(_In_ PDNS_RECORDW Record, _In_ BOOL bHostsFileEntry)
Definition: cache.c:188

Referenced by DnsQuery_W().

◆ RpcThreadRoutine()

DWORD WINAPI RpcThreadRoutine ( LPVOID  lpParameter)

Definition at line 16 of file rpcserver.c.

17 {
19 
20  Status = RpcServerUseProtseqEpW(L"ncalrpc", 20, L"DNSResolver", NULL);
21  if (Status != RPC_S_OK)
22  {
23  DPRINT("RpcServerUseProtseqEpW() failed (Status %lx)\n", Status);
24  return 0;
25  }
26 
27  Status = RpcServerRegisterIf(DnsResolver_v2_0_s_ifspec, NULL, NULL);
28  if (Status != RPC_S_OK)
29  {
30  DPRINT("RpcServerRegisterIf() failed (Status %lx)\n", Status);
31  return 0;
32  }
33 
35  if (Status != RPC_S_OK)
36  {
37  DPRINT("RpcServerListen() failed (Status %lx)\n", Status);
38  }
39 
40  DPRINT("RpcServerListen finished\n");
41  return 0;
42 }
long RPC_STATUS
Definition: rpc.h:52
RPC_STATUS WINAPI RpcServerListen(UINT MinimumCallThreads, UINT MaxCalls, UINT DontWait)
Definition: rpc_server.c:1520
#define RPC_C_LISTEN_MAX_CALLS_DEFAULT
Definition: rpcdce.h:122
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
RPC_STATUS WINAPI RpcServerRegisterIf(RPC_IF_HANDLE IfSpec, UUID *MgrTypeUuid, RPC_MGR_EPV *MgrEpv)
Definition: rpc_server.c:1116
static const WCHAR L[]
Definition: oid.c:1250
Status
Definition: gdiplustypes.h:24
RPC_STATUS WINAPI RpcServerUseProtseqEpW(RPC_WSTR Protseq, UINT MaxCalls, RPC_WSTR Endpoint, LPVOID SecurityDescriptor)
Definition: rpc_server.c:927
#define RPC_S_OK
Definition: rpcnterr.h:22