ReactOS 0.4.16-dev-329-g9223134
inetcfgcomp_iface.c File Reference
#include "precomp.h"
Include dependency graph for inetcfgcomp_iface.c:

Go to the source code of this file.

Classes

struct  INetCfgComponentImpl
 
struct  IEnumNetCfgComponentImpl
 

Functions

static __inline INetCfgComponentImplimpl_from_INetCfgComponentBindings (INetCfgComponentBindings *iface)
 
HRESULT WINAPI INetCfgComponentBindings_fnQueryInterface (INetCfgComponentBindings *iface, REFIID iid, LPVOID *ppvObj)
 
ULONG WINAPI INetCfgComponentBindings_fnAddRef (INetCfgComponentBindings *iface)
 
ULONG WINAPI INetCfgComponentBindings_fnRelease (INetCfgComponentBindings *iface)
 
HRESULT WINAPI INetCfgComponentBindings_fnBindTo (INetCfgComponentBindings *iface, INetCfgComponent *pnccItem)
 
HRESULT WINAPI INetCfgComponentBindings_fnUnbindFrom (INetCfgComponentBindings *iface, INetCfgComponent *pnccItem)
 
HRESULT WINAPI INetCfgComponentBindings_fnSupportsBindingInterface (INetCfgComponentBindings *iface, DWORD dwFlags, LPCWSTR pszwInterfaceName)
 
HRESULT WINAPI INetCfgComponentBindings_fnIsBoundTo (INetCfgComponentBindings *iface, INetCfgComponent *pnccItem)
 
HRESULT WINAPI INetCfgComponentBindings_fnIsBindableTo (INetCfgComponentBindings *iface, INetCfgComponent *pnccItem)
 
HRESULT WINAPI INetCfgComponentBindings_fnEnumBindingPaths (INetCfgComponentBindings *iface, DWORD dwFlags, IEnumNetCfgBindingPath **ppIEnum)
 
HRESULT WINAPI INetCfgComponentBindings_fnMoveBefore (INetCfgComponentBindings *iface, DWORD dwFlags, INetCfgBindingPath *pncbItemSrc, INetCfgBindingPath *pncbItemDest)
 
HRESULT WINAPI INetCfgComponentBindings_fnMoveAfter (INetCfgComponentBindings *iface, DWORD dwFlags, INetCfgBindingPath *pncbItemSrc, INetCfgBindingPath *pncbItemDest)
 
HRESULT WINAPI INetCfgComponent_fnQueryInterface (INetCfgComponent *iface, REFIID iid, LPVOID *ppvObj)
 
ULONG WINAPI INetCfgComponent_fnAddRef (INetCfgComponent *iface)
 
ULONG WINAPI INetCfgComponent_fnRelease (INetCfgComponent *iface)
 
HRESULT WINAPI INetCfgComponent_fnGetDisplayName (INetCfgComponent *iface, LPWSTR *ppszwDisplayName)
 
HRESULT WINAPI INetCfgComponent_fnSetDisplayName (INetCfgComponent *iface, LPCWSTR ppszwDisplayName)
 
HRESULT WINAPI INetCfgComponent_fnGetHelpText (INetCfgComponent *iface, LPWSTR *ppszwHelpText)
 
HRESULT WINAPI INetCfgComponent_fnGetId (INetCfgComponent *iface, LPWSTR *ppszwId)
 
HRESULT WINAPI INetCfgComponent_fnGetCharacteristics (INetCfgComponent *iface, DWORD *pdwCharacteristics)
 
HRESULT WINAPI INetCfgComponent_fnGetInstanceGuid (INetCfgComponent *iface, GUID *pGuid)
 
HRESULT WINAPI INetCfgComponent_fnGetPnpDevNodeId (INetCfgComponent *iface, LPWSTR *ppszwDevNodeId)
 
HRESULT WINAPI INetCfgComponent_fnGetClassGuid (INetCfgComponent *iface, GUID *pGuid)
 
HRESULT WINAPI INetCfgComponent_fnGetBindName (INetCfgComponent *iface, LPWSTR *ppszwBindName)
 
HRESULT WINAPI INetCfgComponent_fnGetDeviceStatus (INetCfgComponent *iface, ULONG *pStatus)
 
HRESULT WINAPI INetCfgComponent_fnOpenParamKey (INetCfgComponent *iface, HKEY *phkey)
 
HRESULT CreateNotificationObject (INetCfgComponentImpl *This, INetCfgComponent *iface, IUnknown *pUnk)
 
static int CALLBACK PropSheetProc (HWND hwndDlg, UINT uMsg, LPARAM lParam)
 
HRESULT WINAPI INetCfgComponent_fnRaisePropertyUi (INetCfgComponent *iface, IN HWND hwndParent, IN DWORD dwFlags, IN IUnknown *pUnk)
 
HRESULT WINAPI INetCfgComponent_Constructor (IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv, NetCfgComponentItem *pItem, INetCfg *pNCfg)
 
HRESULT WINAPI IEnumNetCfgComponent_fnQueryInterface (IEnumNetCfgComponent *iface, REFIID iid, LPVOID *ppvObj)
 
ULONG WINAPI IEnumNetCfgComponent_fnAddRef (IEnumNetCfgComponent *iface)
 
ULONG WINAPI IEnumNetCfgComponent_fnRelease (IEnumNetCfgComponent *iface)
 
HRESULT WINAPI IEnumNetCfgComponent_fnNext (IEnumNetCfgComponent *iface, ULONG celt, INetCfgComponent **rgelt, ULONG *pceltFetched)
 
HRESULT WINAPI IEnumNetCfgComponent_fnSkip (IEnumNetCfgComponent *iface, ULONG celt)
 
HRESULT WINAPI IEnumNetCfgComponent_fnReset (IEnumNetCfgComponent *iface)
 
HRESULT WINAPI IEnumNetCfgComponent_fnClone (IEnumNetCfgComponent *iface, IEnumNetCfgComponent **ppenum)
 
HRESULT WINAPI IEnumNetCfgComponent_Constructor (IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv, NetCfgComponentItem *pItem, INetCfg *pNCfg)
 

Variables

static const INetCfgComponentBindingsVtbl vt_NetCfgComponentBindings
 
static const INetCfgComponentVtbl vt_NetCfgComponent
 
static const IEnumNetCfgComponentVtbl vt_EnumNetCfgComponent
 

Function Documentation

◆ CreateNotificationObject()

HRESULT CreateNotificationObject ( INetCfgComponentImpl This,
INetCfgComponent *  iface,
IUnknown pUnk 
)

Definition at line 491 of file inetcfgcomp_iface.c.

495{
496 WCHAR szName[150];
497 HKEY hKey;
498 DWORD dwSize, dwType;
499 GUID CLSID_NotifyObject;
500 LPOLESTR pStr;
501 INetCfgComponentPropertyUi * pNCCPU;
502 INetCfgComponentControl * pNCCC;
503 HRESULT hr;
504 LONG lRet;
506 CLSID InstanceGUID;
507
508 wcscpy(szName,L"SYSTEM\\CurrentControlSet\\Control\\Network\\");
509
510 /* get the Class GUID */
512 if (FAILED(hr))
513 return hr;
514
515 hr = StringFromCLSID(&ClassGUID, &pStr);
516 if (FAILED(hr))
517 return hr;
518
519 wcscat(szName, pStr);
520 CoTaskMemFree(pStr);
521 wcscat(szName, L"\\");
522
523 /* get the Instance GUID */
524 hr = INetCfgComponent_GetInstanceGuid(iface, &InstanceGUID);
525 if (FAILED(hr))
526 return hr;
527
528 hr = StringFromCLSID(&InstanceGUID, &pStr);
529 if (FAILED(hr))
530 return hr;
531
532 wcscat(szName, pStr);
533 CoTaskMemFree(pStr);
534
535 wcscat(szName, L"\\NDI");
536
538 return E_FAIL;
539
540 dwSize = sizeof(szName);
541 lRet = RegQueryValueExW(hKey, L"ClsID", NULL, &dwType, (LPBYTE)szName, &dwSize);
543
544 if (lRet != ERROR_SUCCESS && dwType != REG_SZ)
545 return E_FAIL;
546
547 hr = CLSIDFromString(szName, &CLSID_NotifyObject);
548 if (FAILED(hr))
549 return E_FAIL;
550
551 hr = CoCreateInstance(&CLSID_NotifyObject, NULL, CLSCTX_INPROC_SERVER, &IID_INetCfgComponentPropertyUi, (LPVOID*)&pNCCPU);
552 if (FAILED(hr))
553 return E_FAIL;
554
556 if (FAILED(hr))
557 {
559 return hr;
560 }
561
563 if (FAILED(hr))
564 {
566 return hr;
567 }
568
569 hr = INetCfgComponentControl_Initialize(pNCCC, iface, This->pNCfg, FALSE);
570 if (FAILED(hr))
571 {
574 return hr;
575 }
576
578 if (FAILED(hr))
579 {
581 return hr;
582 }
583 This->pProperty = pNCCPU;
584 This->pItem->pNCCC = pNCCC;
585
586 return S_OK;
587}
#define RegCloseKey(hKey)
Definition: registry.h:49
#define E_FAIL
Definition: ddrawi.h:102
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2338
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2412
static const WCHAR ClassGUID[]
Definition: devclass.c:30
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
#define REG_SZ
Definition: layer.c:22
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
static LPOLESTR
Definition: stg_prop.c:27
#define INetCfgComponentPropertyUi_SetContext(p, a)
Definition: netcfgn.h:81
#define INetCfgComponentPropertyUi_QueryInterface(p, a, b)
Definition: netcfgn.h:77
EXTERN_C const IID IID_INetCfgComponentPropertyUi
Definition: netcfgn.h:88
#define INetCfgComponentPropertyUi_Release(p)
Definition: netcfgn.h:79
EXTERN_C const IID IID_INetCfgComponentControl
Definition: netcfgn.h:57
#define INetCfgComponentControl_Initialize(p, a, b, c)
Definition: netcfgn.h:51
#define INetCfgComponentPropertyUi_QueryPropertyUi(p, a)
Definition: netcfgn.h:80
#define INetCfgComponentControl_Release(p)
Definition: netcfgn.h:50
#define INetCfgComponent_GetClassGuid(p, a)
Definition: netcfgx.h:70
#define INetCfgComponent_GetInstanceGuid(p, a)
Definition: netcfgx.h:68
#define KEY_READ
Definition: nt_native.h:1023
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
static const WCHAR szName[]
Definition: powrprof.c:45
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
HRESULT hr
Definition: shlfolder.c:183
unsigned char * LPBYTE
Definition: typedefs.h:53
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by INetCfgComponent_fnRaisePropertyUi().

◆ IEnumNetCfgComponent_Constructor()

HRESULT WINAPI IEnumNetCfgComponent_Constructor ( IUnknown pUnkOuter,
REFIID  riid,
LPVOID ppv,
NetCfgComponentItem pItem,
INetCfg *  pNCfg 
)

Definition at line 843 of file inetcfgcomp_iface.c.

844{
846
847 if (!ppv)
848 return E_POINTER;
849
851 if (!This)
852 return E_OUTOFMEMORY;
853
854 This->ref = 1;
855 This->lpVtbl = (const IEnumNetCfgComponent*)&vt_EnumNetCfgComponent;
856 This->pCurrent = pItem;
857 This->pHead = pItem;
858 This->pNCfg = pNCfg;
859
860 if (!SUCCEEDED (IEnumNetCfgComponent_QueryInterface ((INetCfgComponent*)This, riid, ppv)))
861 {
863 return E_NOINTERFACE;
864 }
865
866 IEnumNetCfgComponent_Release((IEnumNetCfgComponent*)This);
867 return S_OK;
868}
#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
static const IEnumNetCfgComponentVtbl vt_EnumNetCfgComponent
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define IEnumNetCfgComponent_QueryInterface(p, a, b)
Definition: netcfgx.h:257
#define IEnumNetCfgComponent_Release(p)
Definition: netcfgx.h:259
#define E_NOINTERFACE
Definition: winerror.h:2364
#define E_POINTER
Definition: winerror.h:2365

Referenced by INetCfg_fnEnumComponents().

◆ IEnumNetCfgComponent_fnAddRef()

ULONG WINAPI IEnumNetCfgComponent_fnAddRef ( IEnumNetCfgComponent *  iface)

Definition at line 740 of file inetcfgcomp_iface.c.

742{
744 ULONG refCount = InterlockedIncrement(&This->ref);
745
746 return refCount;
747}
#define InterlockedIncrement
Definition: armddk.h:53
uint32_t ULONG
Definition: typedefs.h:59

◆ IEnumNetCfgComponent_fnClone()

HRESULT WINAPI IEnumNetCfgComponent_fnClone ( IEnumNetCfgComponent *  iface,
IEnumNetCfgComponent **  ppenum 
)

Definition at line 823 of file inetcfgcomp_iface.c.

826{
827 return E_NOTIMPL;
828}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ IEnumNetCfgComponent_fnNext()

HRESULT WINAPI IEnumNetCfgComponent_fnNext ( IEnumNetCfgComponent *  iface,
ULONG  celt,
INetCfgComponent **  rgelt,
ULONG pceltFetched 
)

Definition at line 762 of file inetcfgcomp_iface.c.

767{
768 HRESULT hr;
770
771 if (!iface || !rgelt)
772 return E_POINTER;
773
774 if (celt != 1)
775 return E_INVALIDARG;
776
777 if (!This->pCurrent)
778 return S_FALSE;
779
780 hr = INetCfgComponent_Constructor (NULL, &IID_INetCfgComponent, (LPVOID*)rgelt, This->pCurrent, This->pNCfg);
781 if (SUCCEEDED(hr))
782 {
783 This->pCurrent = This->pCurrent->pNext;
784 if (pceltFetched)
785 *pceltFetched = 1;
786 }
787 return hr;
788}
#define E_INVALIDARG
Definition: ddrawi.h:101
HRESULT WINAPI INetCfgComponent_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv, NetCfgComponentItem *pItem, INetCfg *pNCfg)
EXTERN_C const IID IID_INetCfgComponent
Definition: netcfgx.h:77
#define S_FALSE
Definition: winerror.h:2357

◆ IEnumNetCfgComponent_fnQueryInterface()

HRESULT WINAPI IEnumNetCfgComponent_fnQueryInterface ( IEnumNetCfgComponent *  iface,
REFIID  iid,
LPVOID ppvObj 
)

Definition at line 718 of file inetcfgcomp_iface.c.

722{
724 *ppvObj = NULL;
725
726 if (IsEqualIID (iid, &IID_IUnknown) ||
728 {
729 *ppvObj = This;
730 INetCfg_AddRef(iface);
731 return S_OK;
732 }
733
734 return E_NOINTERFACE;
735}
const GUID IID_IUnknown
#define INetCfg_AddRef(p)
Definition: netcfgx.h:288
EXTERN_C const IID IID_IEnumNetCfgComponent
Definition: netcfgx.h:266
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ IEnumNetCfgComponent_fnRelease()

ULONG WINAPI IEnumNetCfgComponent_fnRelease ( IEnumNetCfgComponent *  iface)

Definition at line 751 of file inetcfgcomp_iface.c.

753{
755 ULONG refCount = InterlockedDecrement(&This->ref);
756
757 return refCount;
758}
#define InterlockedDecrement
Definition: armddk.h:52

◆ IEnumNetCfgComponent_fnReset()

HRESULT WINAPI IEnumNetCfgComponent_fnReset ( IEnumNetCfgComponent *  iface)

Definition at line 812 of file inetcfgcomp_iface.c.

814{
816
817 This->pCurrent = This->pHead;
818 return S_OK;
819}

◆ IEnumNetCfgComponent_fnSkip()

HRESULT WINAPI IEnumNetCfgComponent_fnSkip ( IEnumNetCfgComponent *  iface,
ULONG  celt 
)

Definition at line 792 of file inetcfgcomp_iface.c.

795{
797
798 if (!This->pCurrent)
799 return S_FALSE;
800
801 while(celt-- > 0 && This->pCurrent)
802 This->pCurrent = This->pCurrent->pNext;
803
804 if (!celt)
805 return S_OK;
806 else
807 return S_FALSE;
808}

◆ impl_from_INetCfgComponentBindings()

static __inline INetCfgComponentImpl * impl_from_INetCfgComponentBindings ( INetCfgComponentBindings *  iface)
static

◆ INetCfgComponent_Constructor()

HRESULT WINAPI INetCfgComponent_Constructor ( IUnknown pUnkOuter,
REFIID  riid,
LPVOID ppv,
NetCfgComponentItem pItem,
INetCfg *  pNCfg 
)

Definition at line 683 of file inetcfgcomp_iface.c.

684{
686
687 if (!ppv)
688 return E_POINTER;
689
691 if (!This)
692 return E_OUTOFMEMORY;
693
694 This->ref = 1;
695 This->lpVtbl = (const INetCfgComponent*)&vt_NetCfgComponent;
696 This->lpVtblComponentBindings = (const INetCfgComponentBindings*)&vt_NetCfgComponentBindings;
697 This->pProperty = NULL;
698 This->pItem = pItem;
699 This->pNCfg = pNCfg;
700
701 if (!SUCCEEDED (INetCfgComponent_QueryInterface ((INetCfgComponent*)This, riid, ppv)))
702 {
704 return E_NOINTERFACE;
705 }
706
707 INetCfgComponent_Release((INetCfgComponent*)This);
708 return S_OK;
709}
static const INetCfgComponentBindingsVtbl vt_NetCfgComponentBindings
static const INetCfgComponentVtbl vt_NetCfgComponent
#define INetCfgComponent_QueryInterface(p, a, b)
Definition: netcfgx.h:60
#define INetCfgComponent_Release(p)
Definition: netcfgx.h:62

Referenced by FindNetworkComponent(), and IEnumNetCfgComponent_fnNext().

◆ INetCfgComponent_fnAddRef()

ULONG WINAPI INetCfgComponent_fnAddRef ( INetCfgComponent *  iface)

Definition at line 215 of file inetcfgcomp_iface.c.

217{
219 ULONG refCount = InterlockedIncrement(&This->ref);
220
221 return refCount;
222}

◆ INetCfgComponent_fnGetBindName()

HRESULT WINAPI INetCfgComponent_fnGetBindName ( INetCfgComponent *  iface,
LPWSTR ppszwBindName 
)

Definition at line 429 of file inetcfgcomp_iface.c.

432{
433 LPWSTR szBind;
435
436 if (This == NULL || ppszwBindName == NULL)
437 return E_POINTER;
438
439 szBind = CoTaskMemAlloc((wcslen(This->pItem->szBindName)+1) * sizeof(WCHAR));
440 if (!szBind)
441 return E_OUTOFMEMORY;
442
443 wcscpy(szBind, This->pItem->szBindName);
444 *ppszwBindName = szBind;
445
446 return S_OK;
447}
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ INetCfgComponent_fnGetCharacteristics()

HRESULT WINAPI INetCfgComponent_fnGetCharacteristics ( INetCfgComponent *  iface,
DWORD pdwCharacteristics 
)

Definition at line 359 of file inetcfgcomp_iface.c.

362{
364
365 if (This == NULL || pdwCharacteristics == NULL)
366 return E_POINTER;
367
368 *pdwCharacteristics = This->pItem->dwCharacteristics;
369
370 return S_OK;
371}

◆ INetCfgComponent_fnGetClassGuid()

HRESULT WINAPI INetCfgComponent_fnGetClassGuid ( INetCfgComponent *  iface,
GUID pGuid 
)

Definition at line 414 of file inetcfgcomp_iface.c.

417{
419
420 if (This == NULL || pGuid == NULL)
421 return E_POINTER;
422
423 CopyMemory(pGuid, &This->pItem->ClassGUID, sizeof(GUID));
424 return S_OK;
425}
#define CopyMemory
Definition: winbase.h:1735

◆ INetCfgComponent_fnGetDeviceStatus()

HRESULT WINAPI INetCfgComponent_fnGetDeviceStatus ( INetCfgComponent *  iface,
ULONG pStatus 
)

Definition at line 451 of file inetcfgcomp_iface.c.

454{
456
457 if (This == NULL || pStatus == NULL)
458 return E_POINTER;
459
460 if (!IsEqualGUID(&GUID_DEVCLASS_NET, &This->pItem->ClassGUID))
461 return E_UNEXPECTED;
462
463 *pStatus = This->pItem->Status;
464
465 return S_OK;
466}
__in WDFDMATRANSACTION __out NTSTATUS * pStatus
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_UNEXPECTED
Definition: winerror.h:2456

◆ INetCfgComponent_fnGetDisplayName()

HRESULT WINAPI INetCfgComponent_fnGetDisplayName ( INetCfgComponent *  iface,
LPWSTR ppszwDisplayName 
)

Definition at line 241 of file inetcfgcomp_iface.c.

244{
246 UINT Length;
248
249 if (This == NULL || ppszwDisplayName == NULL)
250 return E_POINTER;
251
252 if (This->pItem->szDisplayName)
253 Length = wcslen(This->pItem->szDisplayName)+1;
254 else
255 Length = 1;
256
257 szName = CoTaskMemAlloc(Length * sizeof(WCHAR));
258 if (!szName)
259 return E_OUTOFMEMORY;
260
261 if (Length > 1)
262 wcscpy(szName, This->pItem->szDisplayName);
263 else
264 szName[0] = L'\0';
265
266 *ppszwDisplayName = szName;
267
268 return S_OK;
269}
unsigned int UINT
Definition: ndis.h:50
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102

◆ INetCfgComponent_fnGetHelpText()

HRESULT WINAPI INetCfgComponent_fnGetHelpText ( INetCfgComponent *  iface,
LPWSTR ppszwHelpText 
)

Definition at line 305 of file inetcfgcomp_iface.c.

308{
309 LPWSTR szHelp;
310 UINT Length;
312
313 if (This == NULL || ppszwHelpText == NULL)
314 return E_POINTER;
315
316 if (This->pItem->szHelpText)
317 Length = wcslen(This->pItem->szHelpText)+1;
318 else
319 Length = 1;
320
321 szHelp = CoTaskMemAlloc(Length * sizeof(WCHAR));
322 if (!szHelp)
323 return E_OUTOFMEMORY;
324
325 if (Length > 1)
326 wcscpy(szHelp, This->pItem->szHelpText);
327 else
328 szHelp[0] = L'\0';
329
330 *ppszwHelpText = szHelp;
331
332 return S_OK;
333}

◆ INetCfgComponent_fnGetId()

HRESULT WINAPI INetCfgComponent_fnGetId ( INetCfgComponent *  iface,
LPWSTR ppszwId 
)

Definition at line 337 of file inetcfgcomp_iface.c.

340{
341 LPWSTR szId;
343
344 if (This == NULL || ppszwId == NULL)
345 return E_POINTER;
346
347 szId = CoTaskMemAlloc((wcslen(This->pItem->szId)+1) * sizeof(WCHAR));
348 if (!szId)
349 return E_OUTOFMEMORY;
350
351 wcscpy(szId, This->pItem->szId);
352 *ppszwId = szId;
353
354 return S_OK;
355}

◆ INetCfgComponent_fnGetInstanceGuid()

HRESULT WINAPI INetCfgComponent_fnGetInstanceGuid ( INetCfgComponent *  iface,
GUID pGuid 
)

Definition at line 375 of file inetcfgcomp_iface.c.

378{
380
381 if (This == NULL || pGuid == NULL)
382 return E_POINTER;
383
384 CopyMemory(pGuid, &This->pItem->InstanceId, sizeof(GUID));
385 return S_OK;
386}

◆ INetCfgComponent_fnGetPnpDevNodeId()

HRESULT WINAPI INetCfgComponent_fnGetPnpDevNodeId ( INetCfgComponent *  iface,
LPWSTR ppszwDevNodeId 
)

Definition at line 390 of file inetcfgcomp_iface.c.

393{
394 LPWSTR szNode;
396
397 if (This == NULL || ppszwDevNodeId == NULL)
398 return E_POINTER;
399
400 if (!IsEqualGUID(&GUID_DEVCLASS_NET, &This->pItem->ClassGUID))
401 return E_NOTIMPL;
402
403 szNode = CoTaskMemAlloc((wcslen(This->pItem->szNodeId)+1) * sizeof(WCHAR));
404 if (!szNode)
405 return E_OUTOFMEMORY;
406
407 wcscpy(szNode, This->pItem->szNodeId);
408 *ppszwDevNodeId = szNode;
409 return S_OK;
410}

◆ INetCfgComponent_fnOpenParamKey()

HRESULT WINAPI INetCfgComponent_fnOpenParamKey ( INetCfgComponent *  iface,
HKEY phkey 
)

Definition at line 470 of file inetcfgcomp_iface.c.

473{
474 WCHAR szBuffer[200] = L"SYSTEM\\CurrentControlSet\\Services\\";
476
477 if (This == NULL || phkey == NULL)
478 return E_POINTER;
479
480 wcscat(szBuffer, This->pItem->szBindName);
481 wcscat(szBuffer, L"\\Parameters");
482
483 if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szBuffer, 0, KEY_READ | KEY_WRITE, phkey) == ERROR_SUCCESS)
484 return S_OK;
485 else
486 return E_FAIL;
487}
#define KEY_WRITE
Definition: nt_native.h:1031

◆ INetCfgComponent_fnQueryInterface()

HRESULT WINAPI INetCfgComponent_fnQueryInterface ( INetCfgComponent *  iface,
REFIID  iid,
LPVOID ppvObj 
)

Definition at line 188 of file inetcfgcomp_iface.c.

192{
194 *ppvObj = NULL;
195
196 if (IsEqualIID (iid, &IID_IUnknown) ||
198 {
199 *ppvObj = This;
200 INetCfg_AddRef(iface);
201 return S_OK;
202 }
204 {
205 *ppvObj = (LPVOID)&This->lpVtblComponentBindings;
207 return S_OK;
208 }
209
210 return E_NOINTERFACE;
211}
EXTERN_C const IID IID_INetCfgComponentBindings
Definition: netcfgx.h:239
#define INetCfgComponentBindings_AddRef(p)
Definition: netcfgx.h:227
#define LPVOID
Definition: nt_native.h:45

◆ INetCfgComponent_fnRaisePropertyUi()

HRESULT WINAPI INetCfgComponent_fnRaisePropertyUi ( INetCfgComponent *  iface,
IN HWND  hwndParent,
IN DWORD  dwFlags,
IN IUnknown pUnk 
)

Definition at line 608 of file inetcfgcomp_iface.c.

613{
614 HRESULT hr;
615 DWORD dwDefPages;
616 UINT Pages;
617 PROPSHEETHEADERW pinfo;
618 HPROPSHEETPAGE * hppages;
619 INT_PTR iResult;
621
622 if (!This->pProperty)
623 {
625 if (FAILED(hr))
626 return hr;
627 }
628
630 return S_OK;
631
632 dwDefPages = 0;
633 Pages = 0;
634
635 hr = INetCfgComponentPropertyUi_MergePropPages(This->pProperty, &dwDefPages, (BYTE**)&hppages, &Pages, hwndParent, NULL);
636 if (FAILED(hr) || !Pages)
637 {
638 return hr;
639 }
640 ZeroMemory(&pinfo, sizeof(PROPSHEETHEADERW));
641 pinfo.dwSize = sizeof(PROPSHEETHEADERW);
642 pinfo.dwFlags = PSH_NOCONTEXTHELP | PSH_PROPTITLE | PSH_NOAPPLYNOW |
644 pinfo.u3.phpage = hppages;
645 pinfo.hwndParent = hwndParent;
646 pinfo.nPages = Pages;
648 pinfo.pszCaption = This->pItem->szDisplayName;
651
652 iResult = PropertySheetW(&pinfo);
653 CoTaskMemFree(hppages);
654 if (iResult > 0)
655 {
656 /* indicate that settings should be stored */
657 This->pItem->bChanged = TRUE;
658 return S_OK;
659 }
660 return S_FALSE;
661}
#define IDI_INTERNET
Definition: resource.h:23
static HWND hwndParent
Definition: cryptui.c:300
#define TRUE
Definition: types.h:120
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2916
HINSTANCE netcfgx_hInstance
Definition: netcfgx.c:15
HRESULT CreateNotificationObject(INetCfgComponentImpl *This, INetCfgComponent *iface, IUnknown *pUnk)
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
#define INetCfgComponentPropertyUi_MergePropPages(p, a, b, c, d, e)
Definition: netcfgn.h:82
@ NCRP_QUERY_PROPERTY_UI
Definition: netcfgx.h:31
#define PSH_PROPTITLE
Definition: prsht.h:40
#define PSH_USECALLBACK
Definition: prsht.h:48
#define PSH_USEICONID
Definition: prsht.h:42
struct _PROPSHEETHEADERW PROPSHEETHEADERW
#define PSH_NOAPPLYNOW
Definition: prsht.h:47
HINSTANCE hInstance
Definition: prsht.h:296
DWORD dwSize
Definition: prsht.h:293
DWORD dwFlags
Definition: prsht.h:294
LPCWSTR pszIcon
Definition: prsht.h:299
HWND hwndParent
Definition: prsht.h:295
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:311
HPROPSHEETPAGE * phpage
Definition: prsht.h:309
LPCWSTR pszCaption
Definition: prsht.h:301
int32_t INT_PTR
Definition: typedefs.h:64
#define ZeroMemory
Definition: winbase.h:1737
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
unsigned char BYTE
Definition: xxhash.c:193

◆ INetCfgComponent_fnRelease()

ULONG WINAPI INetCfgComponent_fnRelease ( INetCfgComponent *  iface)

Definition at line 226 of file inetcfgcomp_iface.c.

228{
230 ULONG refCount = InterlockedDecrement(&This->ref);
231
232 if (!refCount)
233 {
235 }
236 return refCount;
237}

◆ INetCfgComponent_fnSetDisplayName()

HRESULT WINAPI INetCfgComponent_fnSetDisplayName ( INetCfgComponent *  iface,
LPCWSTR  ppszwDisplayName 
)

FIXME check for invalid characters check for write lock

Definition at line 273 of file inetcfgcomp_iface.c.

276{
279
280 if (This == NULL || ppszwDisplayName == NULL)
281 return E_POINTER;
282
283 /* setting name is only supported for network cards */
284 if (!IsEqualGUID(&This->pItem->ClassGUID, &GUID_DEVCLASS_NET))
285 return E_NOTIMPL;
286
290
291 szName = CoTaskMemAlloc((wcslen(ppszwDisplayName)+1) * sizeof(WCHAR));
292 if (!szName)
293 return E_OUTOFMEMORY;
294
295 wcscpy(szName, ppszwDisplayName);
296 CoTaskMemFree(This->pItem->szDisplayName);
297 This->pItem->szDisplayName = szName;
298 This->pItem->bChanged = TRUE;
299
300 return S_OK;
301}

◆ INetCfgComponentBindings_fnAddRef()

ULONG WINAPI INetCfgComponentBindings_fnAddRef ( INetCfgComponentBindings *  iface)

Definition at line 45 of file inetcfgcomp_iface.c.

47{
49 return INetCfgComponent_AddRef((INetCfgComponent*)This);
50}
static __inline INetCfgComponentImpl * impl_from_INetCfgComponentBindings(INetCfgComponentBindings *iface)
#define INetCfgComponent_AddRef(p)
Definition: netcfgx.h:61

◆ INetCfgComponentBindings_fnBindTo()

HRESULT WINAPI INetCfgComponentBindings_fnBindTo ( INetCfgComponentBindings *  iface,
INetCfgComponent *  pnccItem 
)

Definition at line 63 of file inetcfgcomp_iface.c.

66{
67 return E_NOTIMPL;
68}

◆ INetCfgComponentBindings_fnEnumBindingPaths()

HRESULT WINAPI INetCfgComponentBindings_fnEnumBindingPaths ( INetCfgComponentBindings *  iface,
DWORD  dwFlags,
IEnumNetCfgBindingPath **  ppIEnum 
)

Definition at line 137 of file inetcfgcomp_iface.c.

141{
143}
HRESULT WINAPI IEnumNetCfgBindingPath_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv, DWORD dwFlags)
EXTERN_C const IID IID_IEnumNetCfgBindingPath
Definition: netcfgx.h:192

◆ INetCfgComponentBindings_fnIsBindableTo()

HRESULT WINAPI INetCfgComponentBindings_fnIsBindableTo ( INetCfgComponentBindings *  iface,
INetCfgComponent *  pnccItem 
)

Definition at line 128 of file inetcfgcomp_iface.c.

131{
132 return E_NOTIMPL;
133}

◆ INetCfgComponentBindings_fnIsBoundTo()

HRESULT WINAPI INetCfgComponentBindings_fnIsBoundTo ( INetCfgComponentBindings *  iface,
INetCfgComponent *  pnccItem 
)

Definition at line 91 of file inetcfgcomp_iface.c.

94{
95 INetCfgComponentImpl *pComponent;
96 PWSTR pszBindName, ptr;
97 INT len;
98
99 pComponent = impl_from_INetCfgComponentBindings(iface);
100 if (pComponent == NULL ||
101 pComponent->pItem == NULL ||
102 pComponent->pItem->pszBinding == NULL)
103 return E_POINTER;
104
105 if (pnccItem == NULL ||
106 ((INetCfgComponentImpl*)pnccItem)->pItem == NULL ||
107 ((INetCfgComponentImpl*)pnccItem)->pItem->szBindName == NULL)
108 return E_POINTER;
109
110 pszBindName = ((INetCfgComponentImpl*)pnccItem)->pItem->szBindName;
111
112 ptr = pComponent->pItem->pszBinding;
113 while (*ptr != UNICODE_NULL)
114 {
115 len = wcslen(ptr);
116
117 if (len > 8 && _wcsicmp(&ptr[8], pszBindName) == 0)
118 return S_OK;
119
120 ptr = ptr + len + 1;
121 }
122
123 return S_FALSE;
124}
GLenum GLsizei len
Definition: glext.h:6722
static PVOID ptr
Definition: dispmode.c:27
#define UNICODE_NULL
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
NetCfgComponentItem * pItem
uint16_t * PWSTR
Definition: typedefs.h:56
int32_t INT
Definition: typedefs.h:58

◆ INetCfgComponentBindings_fnMoveAfter()

HRESULT WINAPI INetCfgComponentBindings_fnMoveAfter ( INetCfgComponentBindings *  iface,
DWORD  dwFlags,
INetCfgBindingPath *  pncbItemSrc,
INetCfgBindingPath *  pncbItemDest 
)

Definition at line 158 of file inetcfgcomp_iface.c.

163{
164 return E_NOTIMPL;
165}

◆ INetCfgComponentBindings_fnMoveBefore()

HRESULT WINAPI INetCfgComponentBindings_fnMoveBefore ( INetCfgComponentBindings *  iface,
DWORD  dwFlags,
INetCfgBindingPath *  pncbItemSrc,
INetCfgBindingPath *  pncbItemDest 
)

Definition at line 147 of file inetcfgcomp_iface.c.

152{
153 return E_NOTIMPL;
154}

◆ INetCfgComponentBindings_fnQueryInterface()

HRESULT WINAPI INetCfgComponentBindings_fnQueryInterface ( INetCfgComponentBindings *  iface,
REFIID  iid,
LPVOID ppvObj 
)

Definition at line 34 of file inetcfgcomp_iface.c.

38{
40 return INetCfgComponent_QueryInterface((INetCfgComponent*)This, iid, ppvObj);
41}

◆ INetCfgComponentBindings_fnRelease()

ULONG WINAPI INetCfgComponentBindings_fnRelease ( INetCfgComponentBindings *  iface)

Definition at line 54 of file inetcfgcomp_iface.c.

56{
58 return INetCfgComponent_Release((INetCfgComponent*)This);
59}

◆ INetCfgComponentBindings_fnSupportsBindingInterface()

HRESULT WINAPI INetCfgComponentBindings_fnSupportsBindingInterface ( INetCfgComponentBindings *  iface,
DWORD  dwFlags,
LPCWSTR  pszwInterfaceName 
)

Definition at line 81 of file inetcfgcomp_iface.c.

85{
86 return E_NOTIMPL;
87}

◆ INetCfgComponentBindings_fnUnbindFrom()

HRESULT WINAPI INetCfgComponentBindings_fnUnbindFrom ( INetCfgComponentBindings *  iface,
INetCfgComponent *  pnccItem 
)

Definition at line 72 of file inetcfgcomp_iface.c.

75{
76 return E_NOTIMPL;
77}

◆ PropSheetProc()

static int CALLBACK PropSheetProc ( HWND  hwndDlg,
UINT  uMsg,
LPARAM  lParam 
)
static

Definition at line 590 of file inetcfgcomp_iface.c.

591{
592 // NOTE: This callback is needed to set large icon correctly.
593 HICON hIcon;
594 switch (uMsg)
595 {
596 case PSCB_INITIALIZED:
597 {
599 SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
600 break;
601 }
602 }
603 return 0;
604}
static HICON
Definition: imagelist.c:80
HICON hIcon
Definition: msconfig.c:44
#define PSCB_INITIALIZED
Definition: prsht.h:75
#define ICON_BIG
Definition: tnclass.cpp:51
LONG_PTR LPARAM
Definition: windef.h:208
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2127
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by INetCfgComponent_fnRaisePropertyUi().

Variable Documentation

◆ vt_EnumNetCfgComponent

const IEnumNetCfgComponentVtbl vt_EnumNetCfgComponent
static
Initial value:
=
{
}
HRESULT WINAPI IEnumNetCfgComponent_fnClone(IEnumNetCfgComponent *iface, IEnumNetCfgComponent **ppenum)
HRESULT WINAPI IEnumNetCfgComponent_fnQueryInterface(IEnumNetCfgComponent *iface, REFIID iid, LPVOID *ppvObj)
ULONG WINAPI IEnumNetCfgComponent_fnRelease(IEnumNetCfgComponent *iface)
HRESULT WINAPI IEnumNetCfgComponent_fnReset(IEnumNetCfgComponent *iface)
HRESULT WINAPI IEnumNetCfgComponent_fnNext(IEnumNetCfgComponent *iface, ULONG celt, INetCfgComponent **rgelt, ULONG *pceltFetched)
HRESULT WINAPI IEnumNetCfgComponent_fnSkip(IEnumNetCfgComponent *iface, ULONG celt)
ULONG WINAPI IEnumNetCfgComponent_fnAddRef(IEnumNetCfgComponent *iface)

Definition at line 830 of file inetcfgcomp_iface.c.

Referenced by IEnumNetCfgComponent_Constructor().

◆ vt_NetCfgComponent

const INetCfgComponentVtbl vt_NetCfgComponent
static
Initial value:
=
{
}
HRESULT WINAPI INetCfgComponent_fnGetDisplayName(INetCfgComponent *iface, LPWSTR *ppszwDisplayName)
HRESULT WINAPI INetCfgComponent_fnGetInstanceGuid(INetCfgComponent *iface, GUID *pGuid)
HRESULT WINAPI INetCfgComponent_fnGetDeviceStatus(INetCfgComponent *iface, ULONG *pStatus)
ULONG WINAPI INetCfgComponent_fnRelease(INetCfgComponent *iface)
HRESULT WINAPI INetCfgComponent_fnGetCharacteristics(INetCfgComponent *iface, DWORD *pdwCharacteristics)
HRESULT WINAPI INetCfgComponent_fnQueryInterface(INetCfgComponent *iface, REFIID iid, LPVOID *ppvObj)
HRESULT WINAPI INetCfgComponent_fnGetPnpDevNodeId(INetCfgComponent *iface, LPWSTR *ppszwDevNodeId)
HRESULT WINAPI INetCfgComponent_fnGetId(INetCfgComponent *iface, LPWSTR *ppszwId)
HRESULT WINAPI INetCfgComponent_fnGetBindName(INetCfgComponent *iface, LPWSTR *ppszwBindName)
ULONG WINAPI INetCfgComponent_fnAddRef(INetCfgComponent *iface)
HRESULT WINAPI INetCfgComponent_fnRaisePropertyUi(INetCfgComponent *iface, IN HWND hwndParent, IN DWORD dwFlags, IN IUnknown *pUnk)
HRESULT WINAPI INetCfgComponent_fnGetClassGuid(INetCfgComponent *iface, GUID *pGuid)
HRESULT WINAPI INetCfgComponent_fnSetDisplayName(INetCfgComponent *iface, LPCWSTR ppszwDisplayName)
HRESULT WINAPI INetCfgComponent_fnGetHelpText(INetCfgComponent *iface, LPWSTR *ppszwHelpText)
HRESULT WINAPI INetCfgComponent_fnOpenParamKey(INetCfgComponent *iface, HKEY *phkey)

Definition at line 662 of file inetcfgcomp_iface.c.

Referenced by INetCfgComponent_Constructor().

◆ vt_NetCfgComponentBindings

const INetCfgComponentBindingsVtbl vt_NetCfgComponentBindings
static
Initial value:
=
{
}
HRESULT WINAPI INetCfgComponentBindings_fnBindTo(INetCfgComponentBindings *iface, INetCfgComponent *pnccItem)
ULONG WINAPI INetCfgComponentBindings_fnRelease(INetCfgComponentBindings *iface)
HRESULT WINAPI INetCfgComponentBindings_fnIsBoundTo(INetCfgComponentBindings *iface, INetCfgComponent *pnccItem)
HRESULT WINAPI INetCfgComponentBindings_fnEnumBindingPaths(INetCfgComponentBindings *iface, DWORD dwFlags, IEnumNetCfgBindingPath **ppIEnum)
HRESULT WINAPI INetCfgComponentBindings_fnIsBindableTo(INetCfgComponentBindings *iface, INetCfgComponent *pnccItem)
HRESULT WINAPI INetCfgComponentBindings_fnQueryInterface(INetCfgComponentBindings *iface, REFIID iid, LPVOID *ppvObj)
HRESULT WINAPI INetCfgComponentBindings_fnMoveAfter(INetCfgComponentBindings *iface, DWORD dwFlags, INetCfgBindingPath *pncbItemSrc, INetCfgBindingPath *pncbItemDest)
HRESULT WINAPI INetCfgComponentBindings_fnSupportsBindingInterface(INetCfgComponentBindings *iface, DWORD dwFlags, LPCWSTR pszwInterfaceName)
ULONG WINAPI INetCfgComponentBindings_fnAddRef(INetCfgComponentBindings *iface)
HRESULT WINAPI INetCfgComponentBindings_fnMoveBefore(INetCfgComponentBindings *iface, DWORD dwFlags, INetCfgBindingPath *pncbItemSrc, INetCfgBindingPath *pncbItemDest)
HRESULT WINAPI INetCfgComponentBindings_fnUnbindFrom(INetCfgComponentBindings *iface, INetCfgComponent *pnccItem)

Definition at line 167 of file inetcfgcomp_iface.c.

Referenced by INetCfgComponent_Constructor().