ReactOS  0.4.15-dev-3173-g40ee59d
netcfgbindingpath_iface.c
Go to the documentation of this file.
1 #include "precomp.h"
2 
3 typedef struct
4 {
5  const INetCfgBindingPath *lpVtbl;
8 
9 typedef struct
10 {
11  const IEnumNetCfgBindingPath *lpVtbl;
14 
15 
16 /***************************************************************
17  * INetCfgBindingPath
18  */
19 
20 HRESULT
21 WINAPI
23  INetCfgBindingPath *iface,
24  REFIID iid,
25  LPVOID *ppvObj)
26 {
28  *ppvObj = NULL;
29 
30  if (IsEqualIID (iid, &IID_IUnknown) ||
32  {
33  *ppvObj = This;
34  return S_OK;
35  }
36 
37  return E_NOINTERFACE;
38 }
39 
40 ULONG
41 WINAPI
43  INetCfgBindingPath * iface)
44 {
46  ULONG refCount = InterlockedIncrement(&This->ref);
47 
48  return refCount;
49 }
50 
51 ULONG
52 WINAPI
54  INetCfgBindingPath *iface)
55 {
57  ULONG refCount = InterlockedDecrement(&This->ref);
58 
59  if (!refCount)
60  {
62  }
63  return refCount;
64 }
65 
66 HRESULT
67 WINAPI
69  INetCfgBindingPath *iface,
70  INetCfgBindingPath *pPath)
71 {
72  return E_NOTIMPL;
73 }
74 
75 HRESULT
76 WINAPI
78  INetCfgBindingPath *iface,
79  INetCfgBindingPath *pPath)
80 {
81  return E_NOTIMPL;
82 }
83 
84 HRESULT
85 WINAPI
87  INetCfgBindingPath *iface)
88 {
89  return E_NOTIMPL;
90 }
91 
92 HRESULT
93 WINAPI
95  INetCfgBindingPath *iface,
96  BOOL fEnable)
97 {
98  return E_NOTIMPL;
99 }
100 
101 HRESULT
102 WINAPI
104  INetCfgBindingPath *iface,
105  LPWSTR *ppszwPathToken)
106 {
107  return E_NOTIMPL;
108 }
109 
110 HRESULT
111 WINAPI
113  INetCfgBindingPath *iface,
114  INetCfgComponent **ppComponent)
115 {
116  return E_NOTIMPL;
117 }
118 
119 HRESULT
120 WINAPI
122  INetCfgBindingPath *iface,
123  ULONG *pcInterfaces)
124 {
125  return E_NOTIMPL;
126 }
127 
128 HRESULT
129 WINAPI
131  INetCfgBindingPath *iface,
132  IEnumNetCfgBindingInterface **ppenumInterface)
133 {
135 }
136 
137 static const INetCfgBindingPathVtbl vt_NetCfgBindingPath =
138 {
150 };
151 
152 HRESULT
153 WINAPI
155  IUnknown *pUnkOuter,
156  REFIID riid,
157  LPVOID *ppv)
158 {
160 
161  if (!ppv)
162  return E_POINTER;
163 
165  if (!This)
166  return E_OUTOFMEMORY;
167 
168  This->ref = 1;
169  This->lpVtbl = (const INetCfgBindingPath*)&vt_NetCfgBindingPath;
170 
171  if (!SUCCEEDED (INetCfgBindingPath_QueryInterface ((INetCfgBindingPath*)This, riid, ppv)))
172  {
173  return E_NOINTERFACE;
174  }
175 
176  INetCfgBindingPath_Release((INetCfgBindingPath*)This);
177  return S_OK;
178 }
179 
180 
181 /***************************************************************
182  * IEnumNetCfgBindingPath
183  */
184 
185 HRESULT
186 WINAPI
188  IEnumNetCfgBindingPath *iface,
189  REFIID iid,
190  LPVOID *ppvObj)
191 {
193  *ppvObj = NULL;
194 
195  if (IsEqualIID (iid, &IID_IUnknown) ||
197  {
198  *ppvObj = This;
199  return S_OK;
200  }
201 
202  return E_NOINTERFACE;
203 }
204 
205 
206 ULONG
207 WINAPI
209  IEnumNetCfgBindingPath *iface)
210 {
212  ULONG refCount = InterlockedIncrement(&This->ref);
213 
214  return refCount;
215 }
216 
217 ULONG
218 WINAPI
220  IEnumNetCfgBindingPath *iface)
221 {
223  ULONG refCount = InterlockedDecrement(&This->ref);
224 
225  return refCount;
226 }
227 
228 HRESULT
229 WINAPI
231  IEnumNetCfgBindingPath *iface,
232  ULONG celt,
233  INetCfgBindingPath **rgelt,
234  ULONG *pceltFetched)
235 {
236 #if 0
238  HRESULT hr;
239 
240  if (!iface || !rgelt)
241  return E_POINTER;
242 
243  if (celt != 1)
244  return E_INVALIDARG;
245 
246  if (!This->pCurrent)
247  return S_FALSE;
248 
250  if (SUCCEEDED(hr))
251  {
252  This->pCurrent = This->pCurrent->pNext;
253  if (pceltFetched)
254  *pceltFetched = 1;
255  }
256  return hr;
257 #endif
258 
259  return E_NOTIMPL;
260 }
261 
262 HRESULT
263 WINAPI
265  IEnumNetCfgBindingPath *iface,
266  ULONG celt)
267 {
268 #if 0
270 
271  if (!This->pCurrent)
272  return S_FALSE;
273 
274  while (celt-- > 0 && This->pCurrent)
275  This->pCurrent = This->pCurrent->pNext;
276 
277  if (!celt)
278  return S_OK;
279  else
280  return S_FALSE;
281 #endif
282 
283  return E_NOTIMPL;
284 }
285 
286 HRESULT
287 WINAPI
289  IEnumNetCfgBindingPath *iface)
290 {
291 #if 0
293 
294  This->pCurrent = This->pHead;
295  return S_OK;
296 #endif
297 
298  return E_NOTIMPL;
299 }
300 
301 HRESULT
302 WINAPI
304  IEnumNetCfgBindingPath *iface,
305  IEnumNetCfgBindingPath **ppenum)
306 {
307  return E_NOTIMPL;
308 }
309 
310 static const IEnumNetCfgBindingPathVtbl vt_EnumNetCfgBindingPath =
311 {
319 };
320 
321 HRESULT
322 WINAPI
324 {
326 
327  if (!ppv)
328  return E_POINTER;
329 
331  if (!This)
332  return E_OUTOFMEMORY;
333 
334  This->ref = 1;
335  This->lpVtbl = (const IEnumNetCfgBindingPath*)&vt_EnumNetCfgBindingPath;
336 #if 0
337  This->pCurrent = pItem;
338  This->pHead = pItem;
339  This->pNCfg = pNCfg;
340 #endif
341 
342  if (!SUCCEEDED (IEnumNetCfgBindingPath_QueryInterface((INetCfgBindingPath*)This, riid, ppv)))
343  {
345  return E_NOINTERFACE;
346  }
347 
348  IEnumNetCfgBindingPath_Release((IEnumNetCfgBindingPath*)This);
349  return S_OK;
350 }
#define REFIID
Definition: guiddef.h:118
HRESULT WINAPI INetCfgBindingPath_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
#define E_NOINTERFACE
Definition: winerror.h:2364
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
HRESULT hr
Definition: shlfolder.c:183
ULONG WINAPI INetCfgBindingPath_fnRelease(INetCfgBindingPath *iface)
HRESULT WINAPI INetCfgBindingPath_fnGetOwner(INetCfgBindingPath *iface, INetCfgComponent **ppComponent)
HRESULT WINAPI INetCfgBindingPath_fnIsEnabled(INetCfgBindingPath *iface)
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT WINAPI IEnumNetCfgBindingPath_fnQueryInterface(IEnumNetCfgBindingPath *iface, REFIID iid, LPVOID *ppvObj)
EXTERN_C const IID IID_IEnumNetCfgBindingPath
Definition: netcfgx.h:192
const INetCfgBindingPath * lpVtbl
ULONG WINAPI IEnumNetCfgBindingPath_fnAddRef(IEnumNetCfgBindingPath *iface)
HRESULT WINAPI IEnumNetCfgBindingPath_fnClone(IEnumNetCfgBindingPath *iface, IEnumNetCfgBindingPath **ppenum)
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
if SUCCEEDED(hr)
ULONG WINAPI INetCfgBindingPath_fnAddRef(INetCfgBindingPath *iface)
#define S_FALSE
Definition: winerror.h:2357
#define E_INVALIDARG
Definition: ddrawi.h:101
HRESULT WINAPI INetCfgBindingPath_fnGetPathToken(INetCfgBindingPath *iface, LPWSTR *ppszwPathToken)
HRESULT WINAPI IEnumNetCfgBindingPath_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv, DWORD dwFlags)
HRESULT WINAPI INetCfgBindingPath_fnEnable(INetCfgBindingPath *iface, BOOL fEnable)
HRESULT WINAPI IEnumNetCfgBindingPath_fnNext(IEnumNetCfgBindingPath *iface, ULONG celt, INetCfgBindingPath **rgelt, ULONG *pceltFetched)
EXTERN_C const IID IID_INetCfgComponent
Definition: netcfgx.h:77
#define IEnumNetCfgBindingPath_QueryInterface(p, a, b)
Definition: netcfgx.h:183
EXTERN_C const IID IID_INetCfgBindingPath
Definition: netcfgx.h:165
LONG HRESULT
Definition: typedefs.h:79
const GUID IID_IUnknown
#define WINAPI
Definition: msvc.h:6
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT WINAPI INetCfgBindingPath_fnGetDepth(INetCfgBindingPath *iface, ULONG *pcInterfaces)
HRESULT WINAPI IEnumNetCfgBindingPath_fnReset(IEnumNetCfgBindingPath *iface)
HRESULT WINAPI INetCfgBindingPath_fnQueryInterface(INetCfgBindingPath *iface, REFIID iid, LPVOID *ppvObj)
HRESULT WINAPI INetCfgBindingPath_fnIsSubPathOf(INetCfgBindingPath *iface, INetCfgBindingPath *pPath)
#define InterlockedDecrement
Definition: armddk.h:52
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
static const INetCfgBindingPathVtbl vt_NetCfgBindingPath
ULONG WINAPI IEnumNetCfgBindingPath_fnRelease(IEnumNetCfgBindingPath *iface)
HRESULT WINAPI IEnumNetCfgBindingInterface_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
#define S_OK
Definition: intsafe.h:52
#define InterlockedIncrement
Definition: armddk.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
#define IEnumNetCfgBindingPath_Release(p)
Definition: netcfgx.h:185
unsigned int ULONG
Definition: retypes.h:1
static const IEnumNetCfgBindingPathVtbl vt_EnumNetCfgBindingPath
const IEnumNetCfgBindingPath * lpVtbl
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define INetCfgBindingPath_Release(p)
Definition: netcfgx.h:154
#define E_POINTER
Definition: winerror.h:2365
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
HRESULT WINAPI IEnumNetCfgBindingPath_fnSkip(IEnumNetCfgBindingPath *iface, ULONG celt)
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
HRESULT WINAPI INetCfgBindingPath_fnEnumBindingInterfaces(INetCfgBindingPath *iface, IEnumNetCfgBindingInterface **ppenumInterface)
#define INetCfgBindingPath_QueryInterface(p, a, b)
Definition: netcfgx.h:152
EXTERN_C const IID IID_IEnumNetCfgBindingInterface
Definition: netcfgx.h:131
HRESULT WINAPI INetCfgBindingPath_fnIsSamePathAs(INetCfgBindingPath *iface, INetCfgBindingPath *pPath)