ReactOS  0.4.13-dev-235-g7373cb3
rpc.c
Go to the documentation of this file.
1 /*
2  * RPC support routines
3  *
4  * Copyright 2005 Eric Kohl
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 
21 #include "setupapi_private.h"
22 
25 
26 
28 PnpBindRpc(LPCWSTR pszMachine,
30 {
31  PWSTR pszStringBinding = NULL;
33 
35  L"ncacn_np",
36  (LPWSTR)pszMachine,
37  L"\\pipe\\plugplay",
38  NULL,
39  &pszStringBinding);
40  if (Status != RPC_S_OK)
41  return Status;
42 
43  Status = RpcBindingFromStringBindingW(pszStringBinding,
45 
46  RpcStringFreeW(&pszStringBinding);
47 
48  return Status;
49 }
50 
51 
54 {
55  if (BindingHandle != NULL)
56  {
59  }
60 
61  return RPC_S_OK;
62 }
63 
64 
65 BOOL
67  HSTRING_TABLE *StringTable)
68 {
69  if (LocalBindingHandle != NULL)
70  {
71  if (BindingHandle != NULL)
73 
74  if (StringTable != NULL)
75  *StringTable = LocalStringTable;
76 
77  return TRUE;
78  }
79 
81  if (LocalStringTable == NULL)
82  return FALSE;
83 
85  {
87  return FALSE;
88  }
89 
91 
92  if (BindingHandle != NULL)
94 
95  if (StringTable != NULL)
96  *StringTable = LocalStringTable;
97 
98  return TRUE;
99 }
100 
101 
104 {
108 }
109 
110 
111 void __RPC_FAR * __RPC_USER
113 {
115 }
116 
117 
118 void __RPC_USER
120 {
121  HeapFree(GetProcessHeap(), 0, ptr);
122 }
123 
124 /* EOF */
RPC_STATUS WINAPI RpcBindingFromStringBindingW(RPC_WSTR StringBinding, RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:877
RPC_STATUS WINAPI RpcBindingFree(RPC_BINDING_HANDLE *Binding)
Definition: rpc_binding.c:784
#define TRUE
Definition: types.h:120
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
HSTRING_TABLE WINAPI pSetupStringTableInitialize(VOID)
Definition: stringtable.c:54
RPC_STATUS WINAPI RpcStringFreeW(RPC_WSTR *String)
Definition: rpcrt4_main.c:177
uint16_t * PWSTR
Definition: typedefs.h:54
RPC_STATUS PnpBindRpc(LPCWSTR pszMachine, RPC_BINDING_HANDLE *BindingHandle)
Definition: rpc.c:28
_In_ ULONG _Out_ HANDLE * BindingHandle
Definition: tdikrnl.h:1146
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:511
RPC_STATUS PnpUnbindRpc(RPC_BINDING_HANDLE *BindingHandle)
Definition: rpc.c:53
static RPC_BINDING_HANDLE LocalBindingHandle
Definition: rpc.c:23
long RPC_STATUS
Definition: rpc.h:52
BOOL PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle, HSTRING_TABLE *StringTable)
Definition: rpc.c:66
void __RPC_USER midl_user_free(void __RPC_FAR *ptr)
Definition: rpc.c:1266
unsigned int BOOL
Definition: ntddk_ex.h:94
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
#define __RPC_FAR
Definition: rpc.h:56
#define __RPC_USER
Definition: rpc.h:65
DWORD WINAPI pSetupStringTableAddString(HSTRING_TABLE hStringTable, LPWSTR lpString, DWORD dwFlags)
Definition: stringtable.c:196
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static HSTRING_TABLE LocalStringTable
Definition: rpc.c:24
static const WCHAR L[]
Definition: oid.c:1250
RPC_STATUS PnpUnbindLocalBindingHandle(VOID)
Definition: rpc.c:103
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
VOID WINAPI pSetupStringTableDestroy(HSTRING_TABLE hStringTable)
Definition: stringtable.c:145
ULONG_PTR SIZE_T
Definition: typedefs.h:78
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define HeapFree(x, y, z)
Definition: compat.h:394
#define RPC_S_OK
Definition: rpcnterr.h:22