5 const INetCfgBindingInterface
*lpVtbl
;
7 } INetCfgBindingInterfaceImpl
;
11 const IEnumNetCfgBindingInterface
*lpVtbl
;
13 } IEnumNetCfgBindingInterfaceImpl
;
16 /***************************************************************
17 * INetCfgBindingInterface
22 INetCfgBindingInterface_fnQueryInterface(
23 INetCfgBindingInterface
*iface
,
27 INetCfgBindingInterfaceImpl
*This
= (INetCfgBindingInterfaceImpl
*)iface
;
30 if (IsEqualIID (iid
, &IID_IUnknown
) ||
31 IsEqualIID (iid
, &IID_INetCfgBindingInterface
))
42 INetCfgBindingInterface_fnAddRef(
43 INetCfgBindingInterface
*iface
)
45 INetCfgBindingInterfaceImpl
*This
= (INetCfgBindingInterfaceImpl
*)iface
;
46 ULONG refCount
= InterlockedIncrement(&This
->ref
);
53 INetCfgBindingInterface_fnRelease(
54 INetCfgBindingInterface
*iface
)
56 INetCfgBindingInterfaceImpl
*This
= (INetCfgBindingInterfaceImpl
*)iface
;
57 ULONG refCount
= InterlockedDecrement(&This
->ref
);
68 INetCfgBindingInterface_fnGetName(
69 INetCfgBindingInterface
*iface
,
70 LPWSTR
*ppszwInterfaceName
)
77 INetCfgBindingInterface_fnGetUpperComponent(
78 INetCfgBindingInterface
*iface
,
79 INetCfgComponent
**ppnccItem
)
86 INetCfgBindingInterface_fnGetLowerComponent(
87 INetCfgBindingInterface
*iface
,
88 INetCfgComponent
**ppnccItem
)
93 static const INetCfgBindingInterfaceVtbl vt_NetCfgBindingInterface
=
95 INetCfgBindingInterface_fnQueryInterface
,
96 INetCfgBindingInterface_fnAddRef
,
97 INetCfgBindingInterface_fnRelease
,
98 INetCfgBindingInterface_fnGetName
,
99 INetCfgBindingInterface_fnGetUpperComponent
,
100 INetCfgBindingInterface_fnGetLowerComponent
,
105 INetCfgBindingInterface_Constructor(
110 INetCfgBindingInterfaceImpl
*This
;
115 This
= (INetCfgBindingInterfaceImpl
*)CoTaskMemAlloc(sizeof(INetCfgBindingInterfaceImpl
));
117 return E_OUTOFMEMORY
;
120 This
->lpVtbl
= (const INetCfgBindingInterface
*)&vt_NetCfgBindingInterface
;
122 if (!SUCCEEDED(INetCfgBindingInterface_QueryInterface((INetCfgBindingInterface
*)This
, riid
, ppv
)))
124 return E_NOINTERFACE
;
127 INetCfgBindingInterface_Release((INetCfgBindingInterface
*)This
);
132 /***************************************************************
133 * IEnumNetCfgBindingInterface
138 IEnumNetCfgBindingInterface_fnQueryInterface(
139 IEnumNetCfgBindingInterface
*iface
,
143 IEnumNetCfgBindingInterfaceImpl
*This
= (IEnumNetCfgBindingInterfaceImpl
*)iface
;
146 if (IsEqualIID (iid
, &IID_IUnknown
) ||
147 IsEqualIID (iid
, &IID_IEnumNetCfgBindingInterface
))
153 return E_NOINTERFACE
;
159 IEnumNetCfgBindingInterface_fnAddRef(
160 IEnumNetCfgBindingInterface
*iface
)
162 IEnumNetCfgBindingInterfaceImpl
*This
= (IEnumNetCfgBindingInterfaceImpl
*)iface
;
163 ULONG refCount
= InterlockedIncrement(&This
->ref
);
170 IEnumNetCfgBindingInterface_fnRelease(
171 IEnumNetCfgBindingInterface
*iface
)
173 IEnumNetCfgBindingInterfaceImpl
*This
= (IEnumNetCfgBindingInterfaceImpl
*)iface
;
174 ULONG refCount
= InterlockedDecrement(&This
->ref
);
181 IEnumNetCfgBindingInterface_fnNext(
182 IEnumNetCfgBindingInterface
*iface
,
184 INetCfgBindingInterface
**rgelt
,
188 IEnumNetCfgBindingInterfaceImpl
*This
= (IEnumNetCfgBindingInterfaceImpl
*)iface
;
191 if (!iface
|| !rgelt
)
200 hr
= INetCfgBindingInterface_Constructor(NULL
, &IID_INetCfgBindingInterface
, (LPVOID
*)rgelt
);
203 This
->pCurrent
= This
->pCurrent
->pNext
;
215 IEnumNetCfgBindingInterface_fnSkip(
216 IEnumNetCfgBindingInterface
*iface
,
220 IEnumNetCfgBindingInterfaceImpl
*This
= (IEnumNetCfgBindingInterfaceImpl
*)iface
;
225 while (celt
-- > 0 && This
->pCurrent
)
226 This
->pCurrent
= This
->pCurrent
->pNext
;
239 IEnumNetCfgBindingInterface_fnReset(
240 IEnumNetCfgBindingInterface
*iface
)
243 IEnumNetCfgBindingInterfaceImpl
*This
= (IEnumNetCfgBindingInterfaceImpl
*)iface
;
245 This
->pCurrent
= This
->pHead
;
254 IEnumNetCfgBindingInterface_fnClone(
255 IEnumNetCfgBindingInterface
*iface
,
256 IEnumNetCfgBindingInterface
**ppenum
)
261 static const IEnumNetCfgBindingInterfaceVtbl vt_EnumNetCfgBindingInterface
=
263 IEnumNetCfgBindingInterface_fnQueryInterface
,
264 IEnumNetCfgBindingInterface_fnAddRef
,
265 IEnumNetCfgBindingInterface_fnRelease
,
266 IEnumNetCfgBindingInterface_fnNext
,
267 IEnumNetCfgBindingInterface_fnSkip
,
268 IEnumNetCfgBindingInterface_fnReset
,
269 IEnumNetCfgBindingInterface_fnClone
274 IEnumNetCfgBindingInterface_Constructor(IUnknown
*pUnkOuter
, REFIID riid
, LPVOID
*ppv
)
276 IEnumNetCfgBindingInterfaceImpl
*This
;
281 This
= (IEnumNetCfgBindingInterfaceImpl
*)CoTaskMemAlloc(sizeof(IEnumNetCfgBindingInterfaceImpl
));
283 return E_OUTOFMEMORY
;
286 This
->lpVtbl
= (const IEnumNetCfgBindingInterface
*)&vt_EnumNetCfgBindingInterface
;
288 This
->pCurrent
= pItem
;
293 if (!SUCCEEDED (IEnumNetCfgBindingInterface_QueryInterface((INetCfgBindingInterface
*)This
, riid
, ppv
)))
295 IEnumNetCfgBindingInterface_Release((INetCfg
*)This
);
296 return E_NOINTERFACE
;
299 IEnumNetCfgBindingInterface_Release((IEnumNetCfgBindingInterface
*)This
);