ReactOS  0.4.15-dev-2703-g05fb0f1
netcfgbindinginterface_iface.c
Go to the documentation of this file.
1 #include "precomp.h"
2 
3 typedef struct
4 {
5  const INetCfgBindingInterface *lpVtbl;
8 
9 typedef struct
10 {
11  const IEnumNetCfgBindingInterface *lpVtbl;
14 
15 
16 /***************************************************************
17  * INetCfgBindingInterface
18  */
19 
20 HRESULT
21 WINAPI
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 
40 ULONG
41 WINAPI
43  INetCfgBindingInterface *iface)
44 {
46  ULONG refCount = InterlockedIncrement(&This->ref);
47 
48  return refCount;
49 }
50 
51 ULONG
52 WINAPI
54  INetCfgBindingInterface *iface)
55 {
57  ULONG refCount = InterlockedDecrement(&This->ref);
58 
59  if (!refCount)
60  {
62  }
63  return refCount;
64 }
65 
66 HRESULT
67 WINAPI
69  INetCfgBindingInterface *iface,
70  LPWSTR *ppszwInterfaceName)
71 {
72  return E_NOTIMPL;
73 }
74 
75 HRESULT
76 WINAPI
78  INetCfgBindingInterface *iface,
79  INetCfgComponent **ppnccItem)
80 {
81  return E_NOTIMPL;
82 }
83 
84 HRESULT
85 WINAPI
87  INetCfgBindingInterface *iface,
88  INetCfgComponent **ppnccItem)
89 {
90  return E_NOTIMPL;
91 }
92 
93 static const INetCfgBindingInterfaceVtbl vt_NetCfgBindingInterface =
94 {
101 };
102 
103 HRESULT
104 WINAPI
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 
136 HRESULT
137 WINAPI
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 
157 ULONG
158 WINAPI
160  IEnumNetCfgBindingInterface *iface)
161 {
163  ULONG refCount = InterlockedIncrement(&This->ref);
164 
165  return refCount;
166 }
167 
168 ULONG
169 WINAPI
171  IEnumNetCfgBindingInterface *iface)
172 {
174  ULONG refCount = InterlockedDecrement(&This->ref);
175 
176  return refCount;
177 }
178 
179 HRESULT
180 WINAPI
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 
213 HRESULT
214 WINAPI
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 
237 HRESULT
238 WINAPI
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 
252 HRESULT
253 WINAPI
255  IEnumNetCfgBindingInterface *iface,
256  IEnumNetCfgBindingInterface **ppenum)
257 {
258  return E_NOTIMPL;
259 }
260 
261 static const IEnumNetCfgBindingInterfaceVtbl vt_EnumNetCfgBindingInterface =
262 {
270 };
271 
272 HRESULT
273 WINAPI
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 REFIID
Definition: guiddef.h:118
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT WINAPI INetCfgBindingInterface_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
HRESULT WINAPI IEnumNetCfgBindingInterface_fnSkip(IEnumNetCfgBindingInterface *iface, ULONG celt)
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define INetCfgBindingInterface_Release(p)
Definition: netcfgx.h:97
ULONG WINAPI IEnumNetCfgBindingInterface_fnAddRef(IEnumNetCfgBindingInterface *iface)
static const IEnumNetCfgBindingInterfaceVtbl vt_EnumNetCfgBindingInterface
#define INetCfgBindingInterface_QueryInterface(p, a, b)
Definition: netcfgx.h:95
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
HRESULT WINAPI IEnumNetCfgBindingInterface_fnNext(IEnumNetCfgBindingInterface *iface, ULONG celt, INetCfgBindingInterface **rgelt, ULONG *pceltFetched)
long LONG
Definition: pedump.c:60
HRESULT WINAPI IEnumNetCfgBindingInterface_fnClone(IEnumNetCfgBindingInterface *iface, IEnumNetCfgBindingInterface **ppenum)
if SUCCEEDED(hr)
#define S_FALSE
Definition: winerror.h:2357
ULONG WINAPI INetCfgBindingInterface_fnAddRef(INetCfgBindingInterface *iface)
#define E_INVALIDARG
Definition: ddrawi.h:101
HRESULT WINAPI INetCfgBindingInterface_fnQueryInterface(INetCfgBindingInterface *iface, REFIID iid, LPVOID *ppvObj)
HRESULT WINAPI IEnumNetCfgBindingInterface_fnQueryInterface(IEnumNetCfgBindingInterface *iface, REFIID iid, LPVOID *ppvObj)
LONG HRESULT
Definition: typedefs.h:79
const GUID IID_IUnknown
EXTERN_C const IID IID_INetCfgBindingInterface
Definition: netcfgx.h:103
#define WINAPI
Definition: msvc.h:6
const IEnumNetCfgBindingInterface * lpVtbl
ULONG WINAPI INetCfgBindingInterface_fnRelease(INetCfgBindingInterface *iface)
#define InterlockedDecrement
Definition: armddk.h:52
#define IEnumNetCfgBindingInterface_Release(p)
Definition: netcfgx.h:124
HRESULT WINAPI INetCfgBindingInterface_fnGetUpperComponent(INetCfgBindingInterface *iface, INetCfgComponent **ppnccItem)
ULONG WINAPI IEnumNetCfgBindingInterface_fnRelease(IEnumNetCfgBindingInterface *iface)
#define IEnumNetCfgBindingInterface_QueryInterface(p, a, b)
Definition: netcfgx.h:122
HRESULT WINAPI INetCfgBindingInterface_fnGetName(INetCfgBindingInterface *iface, LPWSTR *ppszwInterfaceName)
HRESULT WINAPI IEnumNetCfgBindingInterface_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
#define S_OK
Definition: intsafe.h:51
#define InterlockedIncrement
Definition: armddk.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1
static const INetCfgBindingInterfaceVtbl vt_NetCfgBindingInterface
const INetCfgBindingInterface * lpVtbl
HRESULT WINAPI INetCfgBindingInterface_fnGetLowerComponent(INetCfgBindingInterface *iface, INetCfgComponent **ppnccItem)
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define E_POINTER
Definition: winerror.h:2365
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
EXTERN_C const IID IID_IEnumNetCfgBindingInterface
Definition: netcfgx.h:131
HRESULT WINAPI IEnumNetCfgBindingInterface_fnReset(IEnumNetCfgBindingInterface *iface)