ReactOS 0.4.16-dev-329-g9223134
netcfgbindinginterface_iface.c
Go to the documentation of this file.
1#include "precomp.h"
2
3typedef struct
4{
5 const INetCfgBindingInterface *lpVtbl;
8
9typedef struct
10{
11 const IEnumNetCfgBindingInterface *lpVtbl;
14
15
16/***************************************************************
17 * INetCfgBindingInterface
18 */
19
23 INetCfgBindingInterface *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
43 INetCfgBindingInterface *iface)
44{
46 ULONG refCount = InterlockedIncrement(&This->ref);
47
48 return refCount;
49}
50
54 INetCfgBindingInterface *iface)
55{
57 ULONG refCount = InterlockedDecrement(&This->ref);
58
59 if (!refCount)
60 {
62 }
63 return refCount;
64}
65
69 INetCfgBindingInterface *iface,
70 LPWSTR *ppszwInterfaceName)
71{
72 return E_NOTIMPL;
73}
74
78 INetCfgBindingInterface *iface,
79 INetCfgComponent **ppnccItem)
80{
81 return E_NOTIMPL;
82}
83
87 INetCfgBindingInterface *iface,
88 INetCfgComponent **ppnccItem)
89{
90 return E_NOTIMPL;
91}
92
93static const INetCfgBindingInterfaceVtbl vt_NetCfgBindingInterface =
94{
101};
102
104WINAPI
106 IUnknown *pUnkOuter,
107 REFIID riid,
108 LPVOID *ppv)
109{
111
112 if (!ppv)
113 return E_POINTER;
114
116 if (!This)
117 return E_OUTOFMEMORY;
118
119 This->ref = 1;
120 This->lpVtbl = (const INetCfgBindingInterface*)&vt_NetCfgBindingInterface;
121
122 if (!SUCCEEDED(INetCfgBindingInterface_QueryInterface((INetCfgBindingInterface*)This, riid, ppv)))
123 {
124 return E_NOINTERFACE;
125 }
126
127 INetCfgBindingInterface_Release((INetCfgBindingInterface*)This);
128 return S_OK;
129}
130
131
132/***************************************************************
133 * IEnumNetCfgBindingInterface
134 */
135
137WINAPI
139 IEnumNetCfgBindingInterface *iface,
140 REFIID iid,
141 LPVOID *ppvObj)
142{
144 *ppvObj = NULL;
145
146 if (IsEqualIID (iid, &IID_IUnknown) ||
148 {
149 *ppvObj = This;
150 return S_OK;
151 }
152
153 return E_NOINTERFACE;
154}
155
156
157ULONG
158WINAPI
160 IEnumNetCfgBindingInterface *iface)
161{
163 ULONG refCount = InterlockedIncrement(&This->ref);
164
165 return refCount;
166}
167
168ULONG
169WINAPI
171 IEnumNetCfgBindingInterface *iface)
172{
174 ULONG refCount = InterlockedDecrement(&This->ref);
175
176 return refCount;
177}
178
180WINAPI
182 IEnumNetCfgBindingInterface *iface,
183 ULONG celt,
184 INetCfgBindingInterface **rgelt,
185 ULONG *pceltFetched)
186{
187#if 0
189 HRESULT hr;
190
191 if (!iface || !rgelt)
192 return E_POINTER;
193
194 if (celt != 1)
195 return E_INVALIDARG;
196
197 if (!This->pCurrent)
198 return S_FALSE;
199
201 if (SUCCEEDED(hr))
202 {
203 This->pCurrent = This->pCurrent->pNext;
204 if (pceltFetched)
205 *pceltFetched = 1;
206 }
207 return hr;
208#endif
209
210 return E_NOTIMPL;
211}
212
214WINAPI
216 IEnumNetCfgBindingInterface *iface,
217 ULONG celt)
218{
219#if 0
221
222 if (!This->pCurrent)
223 return S_FALSE;
224
225 while (celt-- > 0 && This->pCurrent)
226 This->pCurrent = This->pCurrent->pNext;
227
228 if (!celt)
229 return S_OK;
230 else
231 return S_FALSE;
232#endif
233
234 return E_NOTIMPL;
235}
236
238WINAPI
240 IEnumNetCfgBindingInterface *iface)
241{
242#if 0
244
245 This->pCurrent = This->pHead;
246 return S_OK;
247#endif
248
249 return E_NOTIMPL;
250}
251
253WINAPI
255 IEnumNetCfgBindingInterface *iface,
256 IEnumNetCfgBindingInterface **ppenum)
257{
258 return E_NOTIMPL;
259}
260
261static const IEnumNetCfgBindingInterfaceVtbl vt_EnumNetCfgBindingInterface =
262{
270};
271
273WINAPI
275{
277
278 if (!ppv)
279 return E_POINTER;
280
282 if (!This)
283 return E_OUTOFMEMORY;
284
285 This->ref = 1;
286 This->lpVtbl = (const IEnumNetCfgBindingInterface*)&vt_EnumNetCfgBindingInterface;
287#if 0
288 This->pCurrent = pItem;
289 This->pHead = pItem;
290 This->pNCfg = pNCfg;
291#endif
292
293 if (!SUCCEEDED (IEnumNetCfgBindingInterface_QueryInterface((INetCfgBindingInterface*)This, riid, ppv)))
294 {
296 return E_NOINTERFACE;
297 }
298
299 IEnumNetCfgBindingInterface_Release((IEnumNetCfgBindingInterface*)This);
300 return S_OK;
301}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
const GUID IID_IUnknown
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT WINAPI INetCfgBindingInterface_fnGetLowerComponent(INetCfgBindingInterface *iface, INetCfgComponent **ppnccItem)
HRESULT WINAPI INetCfgBindingInterface_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
HRESULT WINAPI INetCfgBindingInterface_fnGetUpperComponent(INetCfgBindingInterface *iface, INetCfgComponent **ppnccItem)
HRESULT WINAPI IEnumNetCfgBindingInterface_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
HRESULT WINAPI IEnumNetCfgBindingInterface_fnClone(IEnumNetCfgBindingInterface *iface, IEnumNetCfgBindingInterface **ppenum)
static const IEnumNetCfgBindingInterfaceVtbl vt_EnumNetCfgBindingInterface
HRESULT WINAPI INetCfgBindingInterface_fnGetName(INetCfgBindingInterface *iface, LPWSTR *ppszwInterfaceName)
HRESULT WINAPI IEnumNetCfgBindingInterface_fnReset(IEnumNetCfgBindingInterface *iface)
HRESULT WINAPI IEnumNetCfgBindingInterface_fnNext(IEnumNetCfgBindingInterface *iface, ULONG celt, INetCfgBindingInterface **rgelt, ULONG *pceltFetched)
HRESULT WINAPI INetCfgBindingInterface_fnQueryInterface(INetCfgBindingInterface *iface, REFIID iid, LPVOID *ppvObj)
ULONG WINAPI INetCfgBindingInterface_fnAddRef(INetCfgBindingInterface *iface)
ULONG WINAPI INetCfgBindingInterface_fnRelease(INetCfgBindingInterface *iface)
HRESULT WINAPI IEnumNetCfgBindingInterface_fnQueryInterface(IEnumNetCfgBindingInterface *iface, REFIID iid, LPVOID *ppvObj)
static const INetCfgBindingInterfaceVtbl vt_NetCfgBindingInterface
ULONG WINAPI IEnumNetCfgBindingInterface_fnAddRef(IEnumNetCfgBindingInterface *iface)
ULONG WINAPI IEnumNetCfgBindingInterface_fnRelease(IEnumNetCfgBindingInterface *iface)
HRESULT WINAPI IEnumNetCfgBindingInterface_fnSkip(IEnumNetCfgBindingInterface *iface, ULONG celt)
EXTERN_C const IID IID_IEnumNetCfgBindingInterface
Definition: netcfgx.h:131
#define INetCfgBindingInterface_Release(p)
Definition: netcfgx.h:97
#define INetCfgBindingInterface_QueryInterface(p, a, b)
Definition: netcfgx.h:95
#define IEnumNetCfgBindingInterface_QueryInterface(p, a, b)
Definition: netcfgx.h:122
#define IEnumNetCfgBindingInterface_Release(p)
Definition: netcfgx.h:124
EXTERN_C const IID IID_INetCfgBindingInterface
Definition: netcfgx.h:103
long LONG
Definition: pedump.c:60
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
HRESULT hr
Definition: shlfolder.c:183
const IEnumNetCfgBindingInterface * lpVtbl
const INetCfgBindingInterface * lpVtbl
uint32_t ULONG
Definition: typedefs.h:59
#define WINAPI
Definition: msvc.h:6
#define S_FALSE
Definition: winerror.h:2357
#define E_NOINTERFACE
Definition: winerror.h:2364
#define E_POINTER
Definition: winerror.h:2365
WCHAR * LPWSTR
Definition: xmlstorage.h:184