65 LPWSTR *ppszwClientDescription)
72 if (
This->bInitialized)
78 if (ppszwClientDescription)
82 dwResult =
sizeof(szValue);
85 szValue[(
sizeof(szValue)/
sizeof(
WCHAR))-1] =
L'\0';
87 if (*ppszwClientDescription)
88 wcscpy(*ppszwClientDescription, szValue);
115 if (
This->bInitialized)
129 LPWSTR *ppszwClientDescription)
143 szValue[(
sizeof(szValue)/
sizeof(
WCHAR))-1] =
L'\0';
145 if (*ppszwClientDescription)
146 wcscpy(*ppszwClientDescription, szValue);
175 INetCfgPnpReconfigCallback * iface,
186 INetCfgPnpReconfigCallback * iface)
196 INetCfgPnpReconfigCallback * iface)
205 INetCfgPnpReconfigCallback * iface,
240 wcscpy(szBuffer,
L"SYSTEM\\CurrentControlSet\\Services\\");
242 wcscat(szBuffer,
L"\\Linkage");
272 HKEY hSubKey, hNDIKey;
303 pCurrent->dwCharacteristics = 0;
311 szText[(
sizeof(szText)/
sizeof(
WCHAR))-1] =
L'\0';
314 wcscpy(pCurrent->szId, szText);
324 szText[(
sizeof(szText)/
sizeof(
WCHAR))-1] =
L'\0';
326 if (pCurrent->szDisplayName)
327 wcscpy(pCurrent->szDisplayName, szText);
339 szText[(
sizeof(szText)/
sizeof(
WCHAR))-1] =
L'\0';
341 if (pCurrent->szHelpText)
342 wcscpy(pCurrent->szHelpText, szText);
352 szText[(
sizeof(szText)/
sizeof(
WCHAR))-1] =
L'\0';
354 if (pCurrent->szBindName)
355 wcscpy(pCurrent->szBindName, szText);
367 pLast->
pNext = pCurrent;
393 swprintf(
szName,
L"SYSTEM\\CurrentControlSet\\Control\\Network\\%s", pszGuid);
413 WCHAR szDetail[200] =
L"SYSTEM\\CurrentControlSet\\Control\\Class\\";
414 WCHAR szName[130] =
L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\";
427 DevInfo.
cbSize =
sizeof(DevInfo);
442 dwSize =
sizeof(szNetCfg);
455 CopyMemory(&pCurrent->ClassGUID, &GUID_DEVCLASS_NET,
sizeof(
GUID));
460 if (pCurrent->szBindName)
461 wcscpy(pCurrent->szBindName, szNetCfg);
464 dwSize =
sizeof(szAdapterNetCfg);
469 wcscpy(pCurrent->szId, szAdapterNetCfg);
472 dwSize =
sizeof(szAdapterNetCfg);
476 if (pCurrent->szDisplayName)
477 wcscpy(pCurrent->szDisplayName, szAdapterNetCfg);
488 dwSize =
sizeof(szAdapterNetCfg);
492 if (pCurrent->szNodeId)
493 wcscpy(pCurrent->szNodeId, szAdapterNetCfg);
500 szNetCfg[(
sizeof(szNetCfg)/
sizeof(
WCHAR))-1] =
L'\0';
502 if (pCurrent->szDisplayName)
503 wcscpy(pCurrent->szDisplayName, szNetCfg);
507 pLast->
pNext = pCurrent;
524 INetCfgComponent **pComponent,
533 pHead = pHead->
pNext;
559 if (
This->bInitialized)
570 if (
This->bInitialized)
573 *ppvObj = (
LPVOID)&
This->lpVtblPnpReconfigCallback;
616 if (
This->bInitialized)
644 const CLSID * lpClassGUID,
661 swprintf(
szName,
L"SYSTEM\\CurrentControlSet\\Control\\Network\\%s", pszGuid);
672 else if (pHead->
pNCCC)
687 pHead = pHead->
pNext;
711 if (!
This->bInitialized)
717 pItem =
This->pService;
725 pItem =
This->pClient;
733 pItem =
This->pProtocol;
759 if (!
This->bInitialized)
777 if (!
This->bInitialized)
791 const GUID *pguidClass,
792 IEnumNetCfgComponent **ppenumComponent)
796 if (!
This->bInitialized)
801 else if (
IsEqualGUID(&GUID_DEVCLASS_NETCLIENT, pguidClass))
803 else if (
IsEqualGUID(&GUID_DEVCLASS_NETSERVICE, pguidClass))
805 else if (
IsEqualGUID(&GUID_DEVCLASS_NETTRANS, pguidClass))
817 INetCfgComponent **pComponent)
822 if (!
This->bInitialized)
844 const GUID *pguidClass,
#define InterlockedIncrement
#define InterlockedDecrement
#define RegCloseKey(hKey)
#define MAX_DEVICE_ID_LEN
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
BOOL WINAPI SetupDiEnumDeviceInfo(HDEVINFO devinfo, DWORD index, PSP_DEVINFO_DATA info)
BOOL WINAPI SetupDiGetDeviceRegistryPropertyW(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DWORD Property, PDWORD PropertyRegDataType, PBYTE PropertyBuffer, DWORD PropertyBufferSize, PDWORD RequiredSize)
BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
VOID WINAPI CoTaskMemFree(LPVOID ptr)
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
HRESULT WINAPI INetCfgComponent_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv, NetCfgComponentItem *pItem, INetCfg *pNCfg)
HRESULT WINAPI IEnumNetCfgComponent_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv, NetCfgComponentItem *pItem, INetCfg *pNCfg)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
ULONG WINAPI INetCfgLock_fnAddRef(INetCfgLock *iface)
static __inline LPINetCfgImpl impl_from_INetCfgLock(INetCfgLock *iface)
HRESULT WINAPI INetCfgPnpReconfigCallback_fnSendPnpReconfig(INetCfgPnpReconfigCallback *iface, NCPNP_RECONFIG_LAYER Layer, LPCWSTR pszwUpper, LPCWSTR pszwLower, PVOID pvData, DWORD dwSizeOfData)
HRESULT WINAPI INetCfg_fnApply(INetCfg *iface)
HRESULT EnumerateNetworkAdapter(NetCfgComponentItem **pHead)
static const INetCfgPnpReconfigCallbackVtbl vt_NetCfgPnpReconfigCallback
HRESULT FindNetworkComponent(NetCfgComponentItem *pHead, LPCWSTR pszwComponentId, INetCfgComponent **pComponent, INetCfg *iface)
ULONG WINAPI INetCfgPnpReconfigCallback_fnAddRef(INetCfgPnpReconfigCallback *iface)
HRESULT WINAPI INetCfg_fnCancel(INetCfg *iface)
HRESULT WINAPI INetCfg_fnEnumComponents(INetCfg *iface, const GUID *pguidClass, IEnumNetCfgComponent **ppenumComponent)
HRESULT WINAPI INetCfg_fnInitialize(INetCfg *iface, PVOID pReserved)
VOID ApplyOrCancelChanges(NetCfgComponentItem *pHead, const CLSID *lpClassGUID, BOOL bApply)
HRESULT WINAPI INetCfgLock_fnAcquireWriteLock(INetCfgLock *iface, DWORD cmsTimeout, LPCWSTR pszwClientDescription, LPWSTR *ppszwClientDescription)
struct INetCfgImpl * LPINetCfgImpl
static const INetCfgLockVtbl vt_NetCfgLock
HRESULT WINAPI INetCfgPnpReconfigCallback_fnQueryInterface(INetCfgPnpReconfigCallback *iface, REFIID iid, LPVOID *ppvObj)
HRESULT WINAPI INetCfg_fnUninitialize(INetCfg *iface)
HRESULT WINAPI INetCfgLock_fnReleaseWriteLock(INetCfgLock *iface)
ULONG WINAPI INetCfgLock_fnRelease(INetCfgLock *iface)
HRESULT EnumClientServiceProtocol(HKEY hKey, const GUID *pGuid, NetCfgComponentItem **pHead)
ULONG WINAPI INetCfgPnpReconfigCallback_fnRelease(INetCfgPnpReconfigCallback *iface)
HRESULT WINAPI INetCfgLock_fnIsWriteLocked(INetCfgLock *iface, LPWSTR *ppszwClientDescription)
HRESULT WINAPI INetCfg_fnQueryNetCfgClass(INetCfg *iface, const GUID *pguidClass, REFIID riid, void **ppvObject)
HRESULT WINAPI INetCfg_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
HRESULT EnumerateNetworkComponent(const GUID *pGuid, NetCfgComponentItem **pHead)
HRESULT WINAPI INetCfg_fnQueryInterface(INetCfg *iface, REFIID iid, LPVOID *ppvObj)
HRESULT ReadBindingString(NetCfgComponentItem *Item)
HRESULT WINAPI INetCfgLock_fnQueryInterface(INetCfgLock *iface, REFIID iid, LPVOID *ppvObj)
ULONG WINAPI INetCfg_fnRelease(INetCfg *iface)
static __inline LPINetCfgImpl impl_from_INetCfgPnpReconfigCallback(INetCfgPnpReconfigCallback *iface)
HRESULT WINAPI INetCfg_fnFindComponent(INetCfg *iface, LPCWSTR pszwComponentId, INetCfgComponent **pComponent)
static const INetCfgVtbl vt_NetCfg
VOID FreeComponentItem(NetCfgComponentItem *pItem)
ULONG WINAPI INetCfg_fnAddRef(INetCfg *iface)
#define INetCfgComponentControl_ApplyRegistryChanges(p)
#define INetCfgComponentControl_CancelChanges(p)
EXTERN_C const IID IID_INetCfgPnpReconfigCallback
#define INetCfgPnpReconfigCallback_AddRef(p)
#define INetCfg_Release(p)
#define INetCfg_QueryInterface(p, a, b)
EXTERN_C const IID IID_INetCfgLock
EXTERN_C const IID IID_INetCfgComponent
#define INetCfgLock_AddRef(p)
#define INetCfg_AddRef(p)
#define NETCFG_E_NOT_INITIALIZED
EXTERN_C const IID IID_IEnumNetCfgComponent
EXTERN_C const IID IID_INetCfg
#define NETCFG_E_ALREADY_INITIALIZED
static const WCHAR szName[]
#define IsEqualGUID(rguid1, rguid2)
#define IsEqualIID(riid1, riid2)
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_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)
#define SetupDiGetClassDevs
NetCfgComponentItem * pClient
const INetCfgLock * lpVtblLock
const INetCfgPnpReconfigCallback * lpVtblPnpReconfigCallback
NetCfgComponentItem * pService
NetCfgComponentItem * pProtocol
NetCfgComponentItem * pNet
INetCfgComponentControl * pNCCC
struct tagNetCfgComponentItem * pNext
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCWSTR lpName OPTIONAL)
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
#define FIELD_OFFSET(t, f)
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
_In_ ULONG _In_opt_ PVOID pvData
#define HKEY_LOCAL_MACHINE