ReactOS 0.4.16-dev-297-gc569aee
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 DPRINT("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
50void __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
67{
69}
70
71void __RPC_USER
73{
75}
#define DPRINT1
Definition: precomp.h:8
handle_t hBinding
Definition: ctx_c.c:54
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
void __RPC_USER DNSRSLVR_HANDLE_unbind(DNSRSLVR_HANDLE pszMachineName, handle_t hBinding)
Definition: rpc.c:51
handle_t __RPC_USER DNSRSLVR_HANDLE_bind(DNSRSLVR_HANDLE pszMachineName)
Definition: rpc.c:13
LPWSTR DNSRSLVR_HANDLE
Definition: dnsrslvr.idl:17
Status
Definition: gdiplustypes.h:25
GLenum GLsizei len
Definition: glext.h:6722
static PVOID ptr
Definition: dispmode.c:27
#define L(x)
Definition: ntvdm.h:50
RPC_STATUS WINAPI RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:880
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
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:787
#define RPC_S_OK
Definition: rpcnterr.h:22
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:175
#define midl_user_free
Definition: rpc.h:45
#define __RPC_FAR
Definition: rpc.h:56
long RPC_STATUS
Definition: rpc.h:52
#define __RPC_USER
Definition: rpc.h:65
#define midl_user_allocate
Definition: rpc.h:44
#define DPRINT
Definition: sndvol32.h:73
ULONG_PTR SIZE_T
Definition: typedefs.h:80
WCHAR * LPWSTR
Definition: xmlstorage.h:184