https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1270e0a4fc0d3e22795aa25aa6a57e7689e7a38b

commit 1270e0a4fc0d3e22795aa25aa6a57e7689e7a38b
Author:     Eric Kohl <eric.k...@reactos.org>
AuthorDate: Mon Jun 17 14:57:08 2019 +0200
Commit:     Eric Kohl <eric.k...@reactos.org>
CommitDate: Mon Jun 17 14:57:08 2019 +0200

    [NETCFGX] Add the INetCfgComponentBindings interface to the NetCfgComponent 
class.
---
 dll/win32/netcfgx/inetcfgcomp_iface.c | 150 +++++++++++++++++++++++++++++++++-
 1 file changed, 147 insertions(+), 3 deletions(-)

diff --git a/dll/win32/netcfgx/inetcfgcomp_iface.c 
b/dll/win32/netcfgx/inetcfgcomp_iface.c
index 71b5e028da2..76c8f8dda15 100644
--- a/dll/win32/netcfgx/inetcfgcomp_iface.c
+++ b/dll/win32/netcfgx/inetcfgcomp_iface.c
@@ -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;

Reply via email to