ReactOS  0.4.15-dev-506-ga3ec01c
rpc.c
Go to the documentation of this file.
1 #define WIN32_NO_STATUS
2 #define _INC_WINDOWS
3 #define COM_NO_WINDOWS_H
4 #include <stdarg.h>
5 #include <windef.h>
6 #include <winbase.h>
7 #include <dnsrslvr_c.h>
8 
9 #define NDEBUG
10 #include <debug.h>
11 
14 {
16  LPWSTR pszStringBinding;
18 
19  DPRINT1("DNSRSLVR_HANDLE_bind(%S)\n", pszMachineName);
20 
22  L"ncalrpc",
23  pszMachineName,
24  L"DNSResolver",
25  NULL,
26  &pszStringBinding);
27  if (Status != RPC_S_OK)
28  {
29  DPRINT1("RpcStringBindingCompose returned 0x%x\n", Status);
30  return NULL;
31  }
32 
33  /* Set the binding handle that will be used to bind to the server. */
34  Status = RpcBindingFromStringBindingW(pszStringBinding,
35  &hBinding);
36  if (Status != RPC_S_OK)
37  {
38  DPRINT1("RpcBindingFromStringBinding returned 0x%x\n", Status);
39  }
40 
41  Status = RpcStringFreeW(&pszStringBinding);
42  if (Status != RPC_S_OK)
43  {
44  DPRINT1("RpcStringFree returned 0x%x\n", Status);
45  }
46 
47  return hBinding;
48 }
49 
50 void __RPC_USER
53 {
55 
56  DPRINT("DNSRSLVR_HANDLE_unbind(%S)\n", pszMachineName);
57 
59  if (Status != RPC_S_OK)
60  {
61  DPRINT1("RpcBindingFree returned 0x%x\n", Status);
62  }
63 }
64 
65 void __RPC_FAR * __RPC_USER
67 {
69 }
70 
71 void __RPC_USER
73 {
75 }
RPC_STATUS WINAPI RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:876
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:783
handle_t hBinding
Definition: ctx_c.c:54
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:174
RPC_STATUS WINAPI RpcStringBindingComposeW(RPC_WSTR ObjUuid, RPC_WSTR Protseq, RPC_WSTR NetworkAddr, RPC_WSTR Endpoint, RPC_WSTR Options, RPC_WSTR *StringBinding)
Definition: rpc_binding.c:510
long RPC_STATUS
Definition: rpc.h:52
void __RPC_USER midl_user_free(void __RPC_FAR *ptr)
Definition: rpc.c:1266
LPWSTR DNSRSLVR_HANDLE
Definition: dnsrslvr.idl:17
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define __RPC_FAR
Definition: rpc.h:56
#define __RPC_USER
Definition: rpc.h:65
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static const WCHAR L[]
Definition: oid.c:1250
GLenum GLsizei len
Definition: glext.h:6722
void __RPC_FAR *__RPC_USER midl_user_allocate(SIZE_T len)
Definition: rpc.c:1260
Status
Definition: gdiplustypes.h:24
ULONG_PTR SIZE_T
Definition: typedefs.h:79
void __RPC_USER DNSRSLVR_HANDLE_unbind(DNSRSLVR_HANDLE pszMachineName, handle_t hBinding)
Definition: rpc.c:51
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define DPRINT1
Definition: precomp.h:8
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:403
handle_t __RPC_USER DNSRSLVR_HANDLE_bind(DNSRSLVR_HANDLE pszMachineName)
Definition: rpc.c:13
#define RPC_S_OK
Definition: rpcnterr.h:22