[NETCFGX] Add the INetCfgComponentBindings interface to the NetCfgComponent class.
authorEric Kohl <eric.kohl@reactos.org>
Mon, 17 Jun 2019 12:57:08 +0000 (14:57 +0200)
committerEric Kohl <eric.kohl@reactos.org>
Mon, 17 Jun 2019 12:57:08 +0000 (14:57 +0200)
dll/win32/netcfgx/inetcfgcomp_iface.c

index 71b5e02..76c8f8d 100644 (file)
@@ -2,12 +2,13 @@
 
 typedef struct
 {
-    const INetCfgComponent * lpVtbl;
+    const INetCfgComponent *lpVtbl;
+    const INetCfgComponentBindings *lpVtblComponentBindings;
     LONG  ref;
     NetCfgComponentItem * pItem;
     INetCfgComponentPropertyUi * pProperty;
     INetCfg * pNCfg;
-}INetCfgComponentImpl;
+} INetCfgComponentImpl;
 
 typedef struct
 {
@@ -16,7 +17,143 @@ typedef struct
     NetCfgComponentItem * pCurrent;
     NetCfgComponentItem * pHead;
     INetCfg * pNCfg;
-}IEnumNetCfgComponentImpl;
+} IEnumNetCfgComponentImpl;
+
+static __inline INetCfgComponentImpl* impl_from_INetCfgComponentBindings(INetCfgComponentBindings *iface)
+{
+    return (INetCfgComponentImpl*)((char *)iface - FIELD_OFFSET(INetCfgComponentImpl, lpVtblComponentBindings));
+}
+
+
+/***************************************************************
+ * INetCfgComponentBindings
+ */
+
+HRESULT
+WINAPI
+INetCfgComponentBindings_fnQueryInterface(
+    INetCfgComponentBindings *iface,
+    REFIID iid,
+    LPVOID *ppvObj)
+{
+    INetCfgComponentImpl *This = impl_from_INetCfgComponentBindings(iface);
+    return INetCfgComponent_QueryInterface((INetCfgComponent*)This, iid, ppvObj);
+}
+
+ULONG
+WINAPI
+INetCfgComponentBindings_fnAddRef(
+    INetCfgComponentBindings *iface)
+{
+    INetCfgComponentImpl *This = impl_from_INetCfgComponentBindings(iface);
+    return INetCfgComponent_AddRef((INetCfgComponent*)This);
+}
+
+ULONG
+WINAPI
+INetCfgComponentBindings_fnRelease(
+    INetCfgComponentBindings *iface)
+{
+    INetCfgComponentImpl *This = impl_from_INetCfgComponentBindings(iface);
+    return INetCfgComponent_Release((INetCfgComponent*)This);
+}
+
+HRESULT
+WINAPI
+INetCfgComponentBindings_fnBindTo(
+    INetCfgComponentBindings *iface,
+    INetCfgComponent *pnccItem)
+{
+    return E_NOTIMPL;
+}
+
+HRESULT
+WINAPI
+INetCfgComponentBindings_fnUnbindFrom(
+    INetCfgComponentBindings *iface,
+    INetCfgComponent *pnccItem)
+{
+    return E_NOTIMPL;
+}
+
+HRESULT
+WINAPI
+INetCfgComponentBindings_fnSupportsBindingInterface(
+    INetCfgComponentBindings *iface,
+    DWORD dwFlags,
+    LPCWSTR pszwInterfaceName)
+{
+    return E_NOTIMPL;
+}
+
+HRESULT
+WINAPI
+INetCfgComponentBindings_fnIsBoundTo(
+    INetCfgComponentBindings *iface,
+    INetCfgComponent *pnccItem)
+{
+    return E_NOTIMPL;
+}
+
+HRESULT
+WINAPI
+INetCfgComponentBindings_fnIsBindableTo(
+    INetCfgComponentBindings *iface,
+    INetCfgComponent *pnccItem)
+{
+    return E_NOTIMPL;
+}
+
+HRESULT
+WINAPI
+INetCfgComponentBindings_fnEnumBindingPaths(
+    INetCfgComponentBindings *iface,
+    DWORD dwFlags,
+    IEnumNetCfgBindingPath **ppIEnum)
+{
+    return E_NOTIMPL;
+}
+
+HRESULT
+WINAPI
+INetCfgComponentBindings_fnMoveBefore(
+    INetCfgComponentBindings *iface,
+    DWORD dwFlags,
+    INetCfgBindingPath *pncbItemSrc,
+    INetCfgBindingPath *pncbItemDest)
+{
+    return E_NOTIMPL;
+}
+
+HRESULT
+WINAPI
+INetCfgComponentBindings_fnMoveAfter(
+    INetCfgComponentBindings *iface,
+    DWORD dwFlags,
+    INetCfgBindingPath *pncbItemSrc,
+    INetCfgBindingPath *pncbItemDest)
+{
+    return E_NOTIMPL;
+}
+
+static const INetCfgComponentBindingsVtbl vt_NetCfgComponentBindings =
+{
+    INetCfgComponentBindings_fnQueryInterface,
+    INetCfgComponentBindings_fnAddRef,
+    INetCfgComponentBindings_fnRelease,
+    INetCfgComponentBindings_fnBindTo,
+    INetCfgComponentBindings_fnUnbindFrom,
+    INetCfgComponentBindings_fnSupportsBindingInterface,
+    INetCfgComponentBindings_fnIsBoundTo,
+    INetCfgComponentBindings_fnIsBindableTo,
+    INetCfgComponentBindings_fnEnumBindingPaths,
+    INetCfgComponentBindings_fnMoveBefore,
+    INetCfgComponentBindings_fnMoveAfter,
+};
+
+/***************************************************************
+ * INetCfgComponent
+ */
 
 HRESULT
 WINAPI
@@ -35,6 +172,12 @@ INetCfgComponent_fnQueryInterface(
         INetCfg_AddRef(iface);
         return S_OK;
     }
+    else if (IsEqualIID (iid, &IID_INetCfgComponentBindings))
+    {
+        *ppvObj = (LPVOID)&This->lpVtblComponentBindings;
+        INetCfgComponentBindings_AddRef(iface);
+        return S_OK;
+    }
 
     return E_NOINTERFACE;
 }
@@ -527,6 +670,7 @@ INetCfgComponent_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv, N
 
     This->ref = 1;
     This->lpVtbl = (const INetCfgComponent*)&vt_NetCfgComponent;
+    This->lpVtblComponentBindings = (const INetCfgComponentBindings*)&vt_NetCfgComponentBindings;
     This->pProperty = NULL;
     This->pItem = pItem;
     This->pNCfg = pNCfg;