ReactOS 0.4.16-dev-1946-g52006dd
netcfgclass_iface.c File Reference
#include "precomp.h"
Include dependency graph for netcfgclass_iface.c:

Go to the source code of this file.

Classes

struct  INetCfgClassImpl
 

Typedefs

typedef struct INetCfgClassImplLPINetCfgClassImpl
 

Functions

static __inline LPINetCfgClassImpl impl_from_INetCfgClassSetup (INetCfgClassSetup *iface)
 
HRESULT WINAPI INetCfgClassSetup_fnQueryInterface (INetCfgClassSetup *iface, REFIID iid, LPVOID *ppvObj)
 
ULONG WINAPI INetCfgClassSetup_fnAddRef (INetCfgClassSetup *iface)
 
ULONG WINAPI INetCfgClassSetup_fnRelease (INetCfgClassSetup *iface)
 
HRESULT WINAPI INetCfgClassSetup_fnSelectAndInstall (_In_ INetCfgClassSetup *iface, _In_ HWND hwndParent, _In_opt_ OBO_TOKEN *pOboToken, _Out_opt_ INetCfgComponent **ppnccItem)
 
HRESULT WINAPI INetCfgClassSetup_fnInstall (_In_ INetCfgClassSetup *iface, _In_ LPCWSTR pszwComponentId, _In_opt_ OBO_TOKEN *pOboToken, _In_opt_ DWORD dwSetupFlags, _In_opt_ DWORD dwUpgradeFromBuildNo, _In_opt_ LPCWSTR pszwAnswerFile, _In_opt_ LPCWSTR pszwAnswerSections, _Out_opt_ INetCfgComponent **ppComponent)
 
HRESULT WINAPI INetCfgClassSetup_fnDeInstall (_In_ INetCfgClassSetup *iface, _In_ INetCfgComponent *pComponent, _In_opt_ OBO_TOKEN *pOboToken, _Out_opt_ LPWSTR *pmszwRefs)
 
HRESULT WINAPI INetCfgClass_fnQueryInterface (INetCfgClass *iface, REFIID iid, LPVOID *ppvObj)
 
ULONG WINAPI INetCfgClass_fnAddRef (INetCfgClass *iface)
 
ULONG WINAPI INetCfgClass_fnRelease (INetCfgClass *iface)
 
HRESULT WINAPI INetCfgClass_fnFindComponent (INetCfgClass *iface, LPCWSTR pszwComponentId, INetCfgComponent **pComponent)
 
HRESULT WINAPI INetCfgClass_fnEnumComponents (INetCfgClass *iface, IEnumNetCfgComponent **ppenumComponent)
 
HRESULT WINAPI INetCfgClass_Constructor (IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv, const GUID *pguidClass, INetCfg *pNetCfg)
 

Variables

static const INetCfgClassSetupVtbl vt_NetCfgClassSetup
 
static const INetCfgClassVtbl vt_NetCfgClass
 

Typedef Documentation

◆ LPINetCfgClassImpl

Function Documentation

◆ impl_from_INetCfgClassSetup()

static __inline LPINetCfgClassImpl impl_from_INetCfgClassSetup ( INetCfgClassSetup *  iface)
static

Definition at line 12 of file netcfgclass_iface.c.

13{
14 return (INetCfgClassImpl*)((char *)iface - FIELD_OFFSET(INetCfgClassImpl, lpVtblSetup));
15}
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by INetCfgClassSetup_fnAddRef(), INetCfgClassSetup_fnQueryInterface(), and INetCfgClassSetup_fnRelease().

◆ INetCfgClass_Constructor()

HRESULT WINAPI INetCfgClass_Constructor ( IUnknown pUnkOuter,
REFIID  riid,
LPVOID ppv,
const GUID pguidClass,
INetCfg *  pNetCfg 
)

Definition at line 233 of file netcfgclass_iface.c.

239{
241
242 if (!ppv)
243 return E_POINTER;
244
246 if (!This)
247 return E_OUTOFMEMORY;
248
249 This->ref = 1;
250 This->lpVtbl = (const INetCfgClass*)&vt_NetCfgClass;
251 This->lpVtblSetup = (const INetCfgClassSetup*)&vt_NetCfgClassSetup;
252
253 memcpy(&This->ClassGuid, pguidClass, sizeof(GUID));
254 This->pNetCfg = pNetCfg;
255
256 if (!SUCCEEDED(INetCfgClass_QueryInterface((INetCfgClass*)This, riid, ppv)))
257 {
258 INetCfgClass_Release((INetCfgClass*)This);
259 return E_NOINTERFACE;
260 }
261
262 INetCfgClass_Release((INetCfgClass*)This);
263 return S_OK;
264}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static const INetCfgClassSetupVtbl vt_NetCfgClassSetup
static const INetCfgClassVtbl vt_NetCfgClass
#define INetCfgClass_Release(p)
Definition: netcfgx.h:335
#define INetCfgClass_QueryInterface(p, a, b)
Definition: netcfgx.h:333
#define E_NOINTERFACE
Definition: winerror.h:3479
#define E_POINTER
Definition: winerror.h:3480

Referenced by INetCfg_fnQueryNetCfgClass().

◆ INetCfgClass_fnAddRef()

ULONG WINAPI INetCfgClass_fnAddRef ( INetCfgClass *  iface)

Definition at line 142 of file netcfgclass_iface.c.

144{
146 ULONG refCount = InterlockedIncrement(&This->ref);
147
148 return refCount;
149}
#define InterlockedIncrement
Definition: armddk.h:53
uint32_t ULONG
Definition: typedefs.h:59

◆ INetCfgClass_fnEnumComponents()

HRESULT WINAPI INetCfgClass_fnEnumComponents ( INetCfgClass *  iface,
IEnumNetCfgComponent **  ppenumComponent 
)

Definition at line 201 of file netcfgclass_iface.c.

204{
206 NetCfgComponentItem *pHead;
207
208 if (IsEqualIID(&This->ClassGuid, &GUID_DEVCLASS_NET))
209 pHead = ((INetCfgImpl*)(This->pNetCfg))->pNet;
210 else if (IsEqualIID(&This->ClassGuid, &GUID_DEVCLASS_NETTRANS))
211 pHead = ((INetCfgImpl*)(This->pNetCfg))->pProtocol;
212 else if (IsEqualIID(&This->ClassGuid, &GUID_DEVCLASS_NETSERVICE))
213 pHead = ((INetCfgImpl*)(This->pNetCfg))->pService;
214 else if (IsEqualIID(&This->ClassGuid, &GUID_DEVCLASS_NETCLIENT))
215 pHead = ((INetCfgImpl*)(This->pNetCfg))->pClient;
216 else
217 return E_NOINTERFACE;
218
219 return IEnumNetCfgComponent_Constructor (NULL, &IID_IEnumNetCfgComponent, (LPVOID*)ppenumComponent, pHead, This->pNetCfg);
220}
#define NULL
Definition: types.h:112
HRESULT WINAPI IEnumNetCfgComponent_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv, NetCfgComponentItem *pItem, INetCfg *pNCfg)
EXTERN_C const IID IID_IEnumNetCfgComponent
Definition: netcfgx.h:266
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ INetCfgClass_fnFindComponent()

HRESULT WINAPI INetCfgClass_fnFindComponent ( INetCfgClass *  iface,
LPCWSTR  pszwComponentId,
INetCfgComponent **  pComponent 
)

Definition at line 168 of file netcfgclass_iface.c.

172{
174 NetCfgComponentItem *pHead;
175
176 if (IsEqualIID(&This->ClassGuid, &GUID_DEVCLASS_NET))
177 pHead = ((INetCfgImpl*)(This->pNetCfg))->pNet;
178 else if (IsEqualIID(&This->ClassGuid, &GUID_DEVCLASS_NETTRANS))
179 pHead = ((INetCfgImpl*)(This->pNetCfg))->pProtocol;
180 else if (IsEqualIID(&This->ClassGuid, &GUID_DEVCLASS_NETSERVICE))
181 pHead = ((INetCfgImpl*)(This->pNetCfg))->pService;
182 else if (IsEqualIID(&This->ClassGuid, &GUID_DEVCLASS_NETCLIENT))
183 pHead = ((INetCfgImpl*)(This->pNetCfg))->pClient;
184 else
185 return E_NOINTERFACE;
186
187 while (pHead)
188 {
189 if (!_wcsicmp(pHead->szId, pszwComponentId))
190 {
191 return INetCfgComponent_Constructor(NULL, &IID_INetCfgComponent, (LPVOID*)pComponent, pHead, This->pNetCfg);
192 }
193 pHead = pHead->pNext;
194 }
195
196 return S_FALSE;
197}
HRESULT WINAPI INetCfgComponent_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv, NetCfgComponentItem *pItem, INetCfg *pNCfg)
EXTERN_C const IID IID_INetCfgComponent
Definition: netcfgx.h:77
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
struct tagNetCfgComponentItem * pNext
Definition: precomp.h:54
#define S_FALSE
Definition: winerror.h:3451

◆ INetCfgClass_fnQueryInterface()

HRESULT WINAPI INetCfgClass_fnQueryInterface ( INetCfgClass *  iface,
REFIID  iid,
LPVOID ppvObj 
)

Definition at line 115 of file netcfgclass_iface.c.

119{
121 *ppvObj = NULL;
122
123 if (IsEqualIID (iid, &IID_IUnknown) ||
125 {
126 *ppvObj = This;
127 INetCfgClass_AddRef(iface);
128 return S_OK;
129 }
130 else if (IsEqualIID (iid, &IID_INetCfgClassSetup))
131 {
132 *ppvObj = (LPVOID)&This->lpVtblSetup;
133 INetCfgClass_AddRef(iface);
134 return S_OK;
135 }
136
137 return E_NOINTERFACE;
138}
const GUID IID_IUnknown
EXTERN_C const IID IID_INetCfgClassSetup
Definition: netcfgx.h:361
EXTERN_C const IID IID_INetCfgClass
Definition: netcfgx.h:317
#define INetCfgClass_AddRef(p)
Definition: netcfgx.h:334
#define LPVOID
Definition: nt_native.h:45

◆ INetCfgClass_fnRelease()

ULONG WINAPI INetCfgClass_fnRelease ( INetCfgClass *  iface)

Definition at line 153 of file netcfgclass_iface.c.

155{
157 ULONG refCount = InterlockedDecrement(&This->ref);
158
159 if (!refCount)
160 {
162 }
163 return refCount;
164}
#define InterlockedDecrement
Definition: armddk.h:52
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442

◆ INetCfgClassSetup_fnAddRef()

ULONG WINAPI INetCfgClassSetup_fnAddRef ( INetCfgClassSetup *  iface)

Definition at line 35 of file netcfgclass_iface.c.

37{
39 return INetCfgClass_AddRef((INetCfgClass*)This);
40}
static __inline LPINetCfgClassImpl impl_from_INetCfgClassSetup(INetCfgClassSetup *iface)

◆ INetCfgClassSetup_fnDeInstall()

HRESULT WINAPI INetCfgClassSetup_fnDeInstall ( _In_ INetCfgClassSetup *  iface,
_In_ INetCfgComponent *  pComponent,
_In_opt_ OBO_TOKEN pOboToken,
_Out_opt_ LPWSTR pmszwRefs 
)

Definition at line 88 of file netcfgclass_iface.c.

93{
94// INetCfgClassImpl *This = impl_from_INetCfgClassSetup(iface);
95
96 return S_OK;
97}

◆ INetCfgClassSetup_fnInstall()

HRESULT WINAPI INetCfgClassSetup_fnInstall ( _In_ INetCfgClassSetup *  iface,
_In_ LPCWSTR  pszwComponentId,
_In_opt_ OBO_TOKEN pOboToken,
_In_opt_ DWORD  dwSetupFlags,
_In_opt_ DWORD  dwUpgradeFromBuildNo,
_In_opt_ LPCWSTR  pszwAnswerFile,
_In_opt_ LPCWSTR  pszwAnswerSections,
_Out_opt_ INetCfgComponent **  ppComponent 
)

Definition at line 65 of file netcfgclass_iface.c.

74{
75// INetCfgClassImpl *This = impl_from_INetCfgClassSetup(iface);
76
77 if (ppComponent)
78 *ppComponent = NULL;
79
80 InstallNetworkComponent(pszwComponentId);
81
82 return S_OK;
83}
static HRESULT InstallNetworkComponent(LPWSTR pszComponentName, const GUID *pClassGuid)
Definition: setup.cpp:54

◆ INetCfgClassSetup_fnQueryInterface()

HRESULT WINAPI INetCfgClassSetup_fnQueryInterface ( INetCfgClassSetup *  iface,
REFIID  iid,
LPVOID ppvObj 
)

Definition at line 23 of file netcfgclass_iface.c.

27{
29 return INetCfgClass_QueryInterface((INetCfgClass*)This, iid, ppvObj);
30}

◆ INetCfgClassSetup_fnRelease()

ULONG WINAPI INetCfgClassSetup_fnRelease ( INetCfgClassSetup *  iface)

Definition at line 44 of file netcfgclass_iface.c.

46{
48 return INetCfgClass_Release((INetCfgClass*)This);
49}

◆ INetCfgClassSetup_fnSelectAndInstall()

HRESULT WINAPI INetCfgClassSetup_fnSelectAndInstall ( _In_ INetCfgClassSetup *  iface,
_In_ HWND  hwndParent,
_In_opt_ OBO_TOKEN pOboToken,
_Out_opt_ INetCfgComponent **  ppnccItem 
)

Definition at line 53 of file netcfgclass_iface.c.

58{
59// INetCfgClassImpl *This = impl_from_INetCfgClassSetup(iface);
60 return S_OK;
61}

Variable Documentation

◆ vt_NetCfgClass

const INetCfgClassVtbl vt_NetCfgClass
static
Initial value:
=
{
}
ULONG WINAPI INetCfgClass_fnAddRef(INetCfgClass *iface)
HRESULT WINAPI INetCfgClass_fnFindComponent(INetCfgClass *iface, LPCWSTR pszwComponentId, INetCfgComponent **pComponent)
HRESULT WINAPI INetCfgClass_fnEnumComponents(INetCfgClass *iface, IEnumNetCfgComponent **ppenumComponent)
ULONG WINAPI INetCfgClass_fnRelease(INetCfgClass *iface)
HRESULT WINAPI INetCfgClass_fnQueryInterface(INetCfgClass *iface, REFIID iid, LPVOID *ppvObj)

Definition at line 222 of file netcfgclass_iface.c.

Referenced by INetCfgClass_Constructor().

◆ vt_NetCfgClassSetup

const INetCfgClassSetupVtbl vt_NetCfgClassSetup
static
Initial value:
=
{
}
ULONG WINAPI INetCfgClassSetup_fnRelease(INetCfgClassSetup *iface)
HRESULT WINAPI INetCfgClassSetup_fnDeInstall(_In_ INetCfgClassSetup *iface, _In_ INetCfgComponent *pComponent, _In_opt_ OBO_TOKEN *pOboToken, _Out_opt_ LPWSTR *pmszwRefs)
HRESULT WINAPI INetCfgClassSetup_fnInstall(_In_ INetCfgClassSetup *iface, _In_ LPCWSTR pszwComponentId, _In_opt_ OBO_TOKEN *pOboToken, _In_opt_ DWORD dwSetupFlags, _In_opt_ DWORD dwUpgradeFromBuildNo, _In_opt_ LPCWSTR pszwAnswerFile, _In_opt_ LPCWSTR pszwAnswerSections, _Out_opt_ INetCfgComponent **ppComponent)
HRESULT WINAPI INetCfgClassSetup_fnSelectAndInstall(_In_ INetCfgClassSetup *iface, _In_ HWND hwndParent, _In_opt_ OBO_TOKEN *pOboToken, _Out_opt_ INetCfgComponent **ppnccItem)
HRESULT WINAPI INetCfgClassSetup_fnQueryInterface(INetCfgClassSetup *iface, REFIID iid, LPVOID *ppvObj)
ULONG WINAPI INetCfgClassSetup_fnAddRef(INetCfgClassSetup *iface)

Definition at line 99 of file netcfgclass_iface.c.

Referenced by INetCfgClass_Constructor().