From: Eric Kohl Date: Tue, 18 Jun 2019 20:35:46 +0000 (+0200) Subject: [NETCFGX] Add the interfaces INetCfgBindingPath and IEnumNetCfgBindingPath (stubs... X-Git-Tag: 0.4.14-dev~747 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=ec9c8fdf258b9204e9cb4d855989aaa776a31882 [NETCFGX] Add the interfaces INetCfgBindingPath and IEnumNetCfgBindingPath (stubs only). --- diff --git a/dll/win32/netcfgx/CMakeLists.txt b/dll/win32/netcfgx/CMakeLists.txt index 99313a57a41..79ff37cc4d8 100644 --- a/dll/win32/netcfgx/CMakeLists.txt +++ b/dll/win32/netcfgx/CMakeLists.txt @@ -9,6 +9,7 @@ list(APPEND SOURCE classfactory.c installer.c netcfg_iface.c + netcfgbindingpath_iface.c inetcfgcomp_iface.c tcpipconf_notify.c propertypage.c diff --git a/dll/win32/netcfgx/inetcfgcomp_iface.c b/dll/win32/netcfgx/inetcfgcomp_iface.c index 76c8f8dda15..3f72f980a12 100644 --- a/dll/win32/netcfgx/inetcfgcomp_iface.c +++ b/dll/win32/netcfgx/inetcfgcomp_iface.c @@ -111,7 +111,7 @@ INetCfgComponentBindings_fnEnumBindingPaths( DWORD dwFlags, IEnumNetCfgBindingPath **ppIEnum) { - return E_NOTIMPL; + return IEnumNetCfgBindingPath_Constructor(NULL, &IID_IEnumNetCfgBindingPath, (LPVOID *)ppIEnum, dwFlags); } HRESULT diff --git a/dll/win32/netcfgx/netcfgbindingpath_iface.c b/dll/win32/netcfgx/netcfgbindingpath_iface.c new file mode 100644 index 00000000000..ad5f982cb48 --- /dev/null +++ b/dll/win32/netcfgx/netcfgbindingpath_iface.c @@ -0,0 +1,350 @@ +#include "precomp.h" + +typedef struct +{ + const INetCfgBindingPath *lpVtbl; + LONG ref; +} INetCfgBindingPathImpl; + +typedef struct +{ + const IEnumNetCfgBindingPath *lpVtbl; + LONG ref; +} IEnumNetCfgBindingPathImpl; + + +/*************************************************************** + * INetCfgBindingPath + */ + +HRESULT +WINAPI +INetCfgBindingPath_fnQueryInterface( + INetCfgBindingPath *iface, + REFIID iid, + LPVOID *ppvObj) +{ + INetCfgBindingPathImpl *This = (INetCfgBindingPathImpl*)iface; + *ppvObj = NULL; + + if (IsEqualIID (iid, &IID_IUnknown) || + IsEqualIID (iid, &IID_INetCfgBindingPath)) + { + *ppvObj = This; + return S_OK; + } + + return E_NOINTERFACE; +} + +ULONG +WINAPI +INetCfgBindingPath_fnAddRef( + INetCfgBindingPath * iface) +{ + INetCfgBindingPathImpl * This = (INetCfgBindingPathImpl*)iface; + ULONG refCount = InterlockedIncrement(&This->ref); + + return refCount; +} + +ULONG +WINAPI +INetCfgBindingPath_fnRelease( + INetCfgBindingPath *iface) +{ + INetCfgBindingPathImpl *This = (INetCfgBindingPathImpl*)iface; + ULONG refCount = InterlockedDecrement(&This->ref); + + if (!refCount) + { + CoTaskMemFree(This); + } + return refCount; +} + +HRESULT +WINAPI +INetCfgBindingPath_fnIsSamePathAs( + INetCfgBindingPath *iface, + INetCfgBindingPath *pPath) +{ + return E_NOTIMPL; +} + +HRESULT +WINAPI +INetCfgBindingPath_fnIsSubPathOf( + INetCfgBindingPath *iface, + INetCfgBindingPath *pPath) +{ + return E_NOTIMPL; +} + +HRESULT +WINAPI +INetCfgBindingPath_fnIsEnabled( + INetCfgBindingPath *iface) +{ + return E_NOTIMPL; +} + +HRESULT +WINAPI +INetCfgBindingPath_fnEnable( + INetCfgBindingPath *iface, + BOOL fEnable) +{ + return E_NOTIMPL; +} + +HRESULT +WINAPI +INetCfgBindingPath_fnGetPathToken( + INetCfgBindingPath *iface, + LPWSTR *ppszwPathToken) +{ + return E_NOTIMPL; +} + +HRESULT +WINAPI +INetCfgBindingPath_fnGetOwner( + INetCfgBindingPath *iface, + INetCfgComponent **ppComponent) +{ + return E_NOTIMPL; +} + +HRESULT +WINAPI +INetCfgBindingPath_fnGetDepth( + INetCfgBindingPath *iface, + ULONG *pcInterfaces) +{ + return E_NOTIMPL; +} + +HRESULT +WINAPI +INetCfgBindingPath_fnEnumBindingInterfaces( + INetCfgBindingPath *iface, + IEnumNetCfgBindingInterface **ppenumInterface) +{ + return E_NOTIMPL; +} + +static const INetCfgBindingPathVtbl vt_NetCfgBindingPath = +{ + INetCfgBindingPath_fnQueryInterface, + INetCfgBindingPath_fnAddRef, + INetCfgBindingPath_fnRelease, + INetCfgBindingPath_fnIsSamePathAs, + INetCfgBindingPath_fnIsSubPathOf, + INetCfgBindingPath_fnIsEnabled, + INetCfgBindingPath_fnEnable, + INetCfgBindingPath_fnGetPathToken, + INetCfgBindingPath_fnGetOwner, + INetCfgBindingPath_fnGetDepth, + INetCfgBindingPath_fnEnumBindingInterfaces, +}; + +HRESULT +WINAPI +INetCfgBindingPath_Constructor( + IUnknown *pUnkOuter, + REFIID riid, + LPVOID *ppv) +{ + INetCfgBindingPathImpl *This; + + if (!ppv) + return E_POINTER; + + This = (INetCfgBindingPathImpl *)CoTaskMemAlloc(sizeof(INetCfgBindingPathImpl)); + if (!This) + return E_OUTOFMEMORY; + + This->ref = 1; + This->lpVtbl = (const INetCfgBindingPath*)&vt_NetCfgBindingPath; + + if (!SUCCEEDED (INetCfgBindingPath_QueryInterface ((INetCfgBindingPath*)This, riid, ppv))) + { + return E_NOINTERFACE; + } + + INetCfgBindingPath_Release((INetCfgBindingPath*)This); + return S_OK; +} + + +/*************************************************************** + * IEnumNetCfgBindingPath + */ + +HRESULT +WINAPI +IEnumNetCfgBindingPath_fnQueryInterface( + IEnumNetCfgBindingPath *iface, + REFIID iid, + LPVOID *ppvObj) +{ + IEnumNetCfgBindingPathImpl *This = (IEnumNetCfgBindingPathImpl*)iface; + *ppvObj = NULL; + + if (IsEqualIID (iid, &IID_IUnknown) || + IsEqualIID (iid, &IID_IEnumNetCfgBindingPath)) + { + *ppvObj = This; + return S_OK; + } + + return E_NOINTERFACE; +} + + +ULONG +WINAPI +IEnumNetCfgBindingPath_fnAddRef( + IEnumNetCfgBindingPath *iface) +{ + IEnumNetCfgBindingPathImpl *This = (IEnumNetCfgBindingPathImpl*)iface; + ULONG refCount = InterlockedIncrement(&This->ref); + + return refCount; +} + +ULONG +WINAPI +IEnumNetCfgBindingPath_fnRelease( + IEnumNetCfgBindingPath *iface) +{ + IEnumNetCfgBindingPathImpl *This = (IEnumNetCfgBindingPathImpl*)iface; + ULONG refCount = InterlockedDecrement(&This->ref); + + return refCount; +} + +HRESULT +WINAPI +IEnumNetCfgBindingPath_fnNext( + IEnumNetCfgBindingPath *iface, + ULONG celt, + INetCfgBindingPath **rgelt, + ULONG *pceltFetched) +{ +#if 0 + IEnumNetCfgBindingPathImpl *This = (IEnumNetCfgBindingPathImpl*)iface; + HRESULT hr; + + if (!iface || !rgelt) + return E_POINTER; + + if (celt != 1) + return E_INVALIDARG; + + if (!This->pCurrent) + return S_FALSE; + + hr = INetCfgBindingPath_Constructor (NULL, &IID_INetCfgComponent, (LPVOID*)rgelt); + if (SUCCEEDED(hr)) + { + This->pCurrent = This->pCurrent->pNext; + if (pceltFetched) + *pceltFetched = 1; + } + return hr; +#endif + + return E_NOTIMPL; +} + +HRESULT +WINAPI +IEnumNetCfgBindingPath_fnSkip( + IEnumNetCfgBindingPath *iface, + ULONG celt) +{ +#if 0 + IEnumNetCfgBindingPathImpl *This = (IEnumNetCfgBindingPathImpl*)iface; + + if (!This->pCurrent) + return S_FALSE; + + while (celt-- > 0 && This->pCurrent) + This->pCurrent = This->pCurrent->pNext; + + if (!celt) + return S_OK; + else + return S_FALSE; +#endif + + return E_NOTIMPL; +} + +HRESULT +WINAPI +IEnumNetCfgBindingPath_fnReset( + IEnumNetCfgBindingPath *iface) +{ +#if 0 + IEnumNetCfgBindingPathImpl *This = (IEnumNetCfgBindingPathImpl*)iface; + + This->pCurrent = This->pHead; + return S_OK; +#endif + + return E_NOTIMPL; +} + +HRESULT +WINAPI +IEnumNetCfgBindingPath_fnClone( + IEnumNetCfgBindingPath *iface, + IEnumNetCfgBindingPath **ppenum) +{ + return E_NOTIMPL; +} + +static const IEnumNetCfgBindingPathVtbl vt_EnumNetCfgBindingPath = +{ + IEnumNetCfgBindingPath_fnQueryInterface, + IEnumNetCfgBindingPath_fnAddRef, + IEnumNetCfgBindingPath_fnRelease, + IEnumNetCfgBindingPath_fnNext, + IEnumNetCfgBindingPath_fnSkip, + IEnumNetCfgBindingPath_fnReset, + IEnumNetCfgBindingPath_fnClone +}; + +HRESULT +WINAPI +IEnumNetCfgBindingPath_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv, DWORD dwFlags) +{ + IEnumNetCfgBindingPathImpl *This; + + if (!ppv) + return E_POINTER; + + This = (IEnumNetCfgBindingPathImpl *)CoTaskMemAlloc(sizeof(IEnumNetCfgBindingPathImpl)); + if (!This) + return E_OUTOFMEMORY; + + This->ref = 1; + This->lpVtbl = (const IEnumNetCfgBindingPath*)&vt_EnumNetCfgBindingPath; +#if 0 + This->pCurrent = pItem; + This->pHead = pItem; + This->pNCfg = pNCfg; +#endif + + if (!SUCCEEDED (IEnumNetCfgBindingPath_QueryInterface((INetCfgBindingPath*)This, riid, ppv))) + { + IEnumNetCfgBindingPath_Release((INetCfg*)This); + return E_NOINTERFACE; + } + + IEnumNetCfgBindingPath_Release((IEnumNetCfgBindingPath*)This); + return S_OK; +} diff --git a/dll/win32/netcfgx/precomp.h b/dll/win32/netcfgx/precomp.h index ceaa12e571a..efb5d6439f4 100644 --- a/dll/win32/netcfgx/precomp.h +++ b/dll/win32/netcfgx/precomp.h @@ -64,6 +64,10 @@ extern HINSTANCE netcfgx_hInstance; HRESULT WINAPI INetCfgComponent_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv, NetCfgComponentItem * pItem,INetCfg * iface); HRESULT WINAPI IEnumNetCfgComponent_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv, NetCfgComponentItem * pItem, INetCfg * iface); +/* netcfgbindingpath_iface.c */ +HRESULT WINAPI INetCfgBindingPath_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv); +HRESULT WINAPI IEnumNetCfgBindingPath_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv, DWORD dwFlags); + /* tcpipconf_notify.c */ HRESULT WINAPI TcpipConfigNotify_Constructor (IUnknown * pUnkOuter, REFIID riid, LPVOID * ppv);