Commit 4ff7dc9f authored by Jondy Zhao's avatar Jondy Zhao

Fix add openvpn driver failed in the international environments:

  Add ipwin functioin to install a tap-window driver and rename connection name
parent d8d4fed0
......@@ -8,6 +8,12 @@
<surname>Zhao</surname>
</author>
<revhistory>
<revision>
<revnumber>0.2</revnumber>
<date>2013-07-05</date>
<authorinitials>Jondy Zhao - jondy.zhao@nexedi.com</authorinitials>
<revremark>Add Cron Service and Know Issues section, fix some problems in the chapter Generating windows installer from sources.</revremark>
</revision>
<revision>
<revnumber>0.1</revnumber>
<date>2013-06-20</date>
......

Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C++ Express 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ipwin", "ipwin\ipwin.vcproj", "{01FF89A6-D888-410B-A6EF-02AF59BCF503}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{01FF89A6-D888-410B-A6EF-02AF59BCF503}.Debug|Win32.ActiveCfg = Debug|Win32
{01FF89A6-D888-410B-A6EF-02AF59BCF503}.Debug|Win32.Build.0 = Debug|Win32
{01FF89A6-D888-410B-A6EF-02AF59BCF503}.Release|Win32.ActiveCfg = Release|Win32
{01FF89A6-D888-410B-A6EF-02AF59BCF503}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
/*
* Syntax:
*
* ipwin command options
*
* Get guid of interface:
*
* ipwin guid *MSLOOP re6stnet-lo
*
* Install network adapter and rename connection
*
* ipwin install "OemWin2k.inf" tap0901 re6stnet-tcp
*
* ipwin install "netloop.inf" *MSLOOP re6stnet-lo
*
* Remove network adapter
*
* ipwin remove tap0901 re6stnet-tcp
*
* Run all of testcases:
*
* ipwin test
*
*/
#include <Windows.h>
#include <tchar.h>
#include <stdio.h>
HRESULT SlaposNetCfgWinCreateNetworkInterface(IN LPCWSTR pInfPath,
IN bool bIsInfPathFile,
IN LPCWSTR pHwid,
IN LPCWSTR pConnectionName,
OUT GUID *pGuid,
OUT BSTR *pErrMsg
);
HRESULT SlaposNetCfgWinRemoveNetworkInterface(IN LPCWSTR pHwid,
IN LPCSTR pGUID,
OUT BSTR *pErrMsg
);
HRESULT SlaposNetCfgGetNetworkInterfaceGuid(IN LPCWSTR pHwid,
IN LPCWSTR pConnectionName,
OUT BSTR *pGUID,
OUT BSTR *pErrMsg
);
void usage()
{
printf("Usage: ipwin [command] [options] \n\n\
Get guid of interface:\n\
ipwin guid HWID CONNECTION-NAME\n\n\
For example,\n\
ipwin guid *MSLOOP re6stnet-lo\n\
\n\
Install network adapter and rename connection:\n\
ipwin install INF-FILE HWID CONNECTION-NAME\n\n\
For example,\n\
ipwin install \"OemWin2k.inf\" tap0901 re6stnet-tcp\n\
\n\
ipwin install \"netloop.inf\" *MSLOOP re6stnet-lo\n\
\n\
Remove network adapter:\n\
ipwin remove HWID CONNECTIION-NAME\n\n\
For example,\n\
ipwin remove tap0901 re6stnet-tcp\n\
\n\n\
Exit status:\n\
0 if OK,\n\
other value if problems\n\
\n");
}
int _tmain(int argc, TCHAR * argv[])
{
GUID guid;
BSTR pErrMsg[1024] = {0};
BSTR pGUID[512] = {0};
HRESULT hr = CoInitialize(NULL);
if (argc == 1) {
usage();
}
else if (wcscmp(argv[1], L"install") == 0) {
if (argc != 5) {
usage();
hr = E_FAIL;
}
else
hr = SlaposNetCfgWinCreateNetworkInterface(argv[2], TRUE, argv[3], argv[4], &guid, pErrMsg);
}
else if (wcscmp(argv[1], L"remove") == 0) {
if (argc != 4) {
usage();
hr = E_FAIL;
}
else {
hr = SlaposNetCfgGetNetworkInterfaceGuid(argv[2], argv[3], pGUID, pErrMsg);
if (hr == S_OK) {
hr = SlaposNetCfgWinRemoveNetworkInterface(argv[2], (LPCSTR)pGUID, pErrMsg);
}
}
}
else if (wcscmp(argv[1], L"guid") == 0) {
if (argc != 4) {
usage();
hr = E_FAIL;
}
else {
hr = SlaposNetCfgGetNetworkInterfaceGuid(argv[2], argv[3], pGUID, pErrMsg);
printf("%s\n", hr == S_OK ? pGUID : pErrMsg);
}
}
else if (wcscmp(argv[1], L"test") == 0) {
}
else {
usage();
}
CoUninitialize();
return hr;
}
<?xml version="1.0" encoding="gb2312"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="ipwin"
ProjectGUID="{01FF89A6-D888-410B-A6EF-02AF59BCF503}"
RootNamespace="ipwin"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="setupapi.lib iphlpapi.lib"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="setupapi.lib iphlpapi.lib"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Դļ"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\ipwin.cpp"
>
</File>
<File
RelativePath=".\netcfg.cpp"
>
</File>
</Filter>
<Filter
Name="ͷļ"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\netcfgn.h"
>
</File>
<File
RelativePath=".\netcfgx.h"
>
</File>
</Filter>
<Filter
Name="Դļ"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0600
#endif
#ifndef _UNICODE
#define _UNICODE 1
#endif
#define _WIN32_DCOM
#include <winsock2.h>
#include <Windows.h>
#include <Setupapi.h>
#include <iphlpapi.h>
#include <devguid.h>
#include <stdio.h>
#include <regstr.h>
#include <shlobj.h>
#include <cfgmgr32.h>
#include <tchar.h>
#include <objbase.h>
#include <crtdbg.h>
#include <stdlib.h>
#include <string.h>
#include <Wbemidl.h>
#include <comdef.h>
#include "netcfgn.h"
#define MALLOC(x) HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,x)
#define FREE(p) if(NULL != p) {HeapFree(GetProcessHeap(),0,p); p = NULL;}
#define DRIVERHWID L"tap0901"
#define SLAPOS_CONNECTION_NAME L"SlapOS Re6stnet Network"
#define RT_ELEMENTS(aArray) ( sizeof(aArray) / sizeof((aArray)[0]) )
typedef VOID (*LOG_ROUTINE)(LPCSTR szString);
static LOG_ROUTINE g_Logger = NULL;
static VOID DoLogging(LPCSTR szString, ...);
#define NonStandardLog DoLogging
#define NonStandardLogFlow(x) DoLogging x
static VOID DoLogging(LPCSTR szString, ...)
{
LOG_ROUTINE pfnRoutine = (LOG_ROUTINE)(*((void * volatile *)&g_Logger));
if (pfnRoutine)
{
char szBuffer[4096] = {0};
va_list va;
va_start(va, szString);
_vsnprintf(szBuffer, RT_ELEMENTS(szBuffer), szString, va);
va_end(va);
pfnRoutine(szBuffer);
}
}
#define SetErrBreak(strAndArgs) \
if (1) { \
hrc = E_FAIL; \
NonStandardLog strAndArgs; \
break; \
} else do {} while (0)
#ifndef Assert /** @todo r=bird: where would this be defined? */
//# ifdef DEBUG
//# define Assert(_expr) assert(_expr)
//# else
//# define Assert(_expr) do{ }while (0)
//# endif
# define Assert _ASSERT
# define AssertMsg(expr, msg) do{}while (0)
#endif
/**
* Use the IShellFolder API to rename the connection.
*/
static HRESULT rename_shellfolder (PCWSTR wGuid, PCWSTR wNewName)
{
/* This is the GUID for the network connections folder. It is constant.
* {7007ACC7-3202-11D1-AAD2-00805FC1270E} */
const GUID CLSID_NetworkConnections = {
0x7007ACC7, 0x3202, 0x11D1, {
0xAA, 0xD2, 0x00, 0x80, 0x5F, 0xC1, 0x27, 0x0E
}
};
LPITEMIDLIST pidl = NULL;
IShellFolder *pShellFolder = NULL;
HRESULT hr;
/* Build the display name in the form "::{GUID}". */
if (wcslen(wGuid) >= MAX_PATH)
return E_INVALIDARG;
WCHAR szAdapterGuid[MAX_PATH + 2] = {0};
swprintf(szAdapterGuid, L"::%ls", wGuid);
/* Create an instance of the network connections folder. */
hr = CoCreateInstance(CLSID_NetworkConnections, NULL,
CLSCTX_INPROC_SERVER, IID_IShellFolder,
reinterpret_cast<LPVOID *>(&pShellFolder));
/* Parse the display name. */
if (SUCCEEDED (hr))
{
hr = pShellFolder->ParseDisplayName (NULL, NULL, szAdapterGuid, NULL,
&pidl, NULL);
}
if (SUCCEEDED (hr))
{
hr = pShellFolder->SetNameOf (NULL, pidl, wNewName, SHGDN_NORMAL,
&pidl);
}
CoTaskMemFree (pidl);
if (pShellFolder)
pShellFolder->Release();
return hr;
}
/**
* Loads a system DLL.
*
* @returns Module handle or NULL
* @param pszName The DLL name.
*/
static HMODULE loadSystemDll(const char *pszName)
{
char szPath[MAX_PATH];
UINT cchPath = GetSystemDirectoryA(szPath, sizeof(szPath));
size_t cbName = strlen(pszName) + 1;
if (cchPath + 1 + cbName > sizeof(szPath))
return NULL;
szPath[cchPath] = '\\';
memcpy(&szPath[cchPath + 1], pszName, cbName);
return LoadLibraryA(szPath);
}
static HRESULT SlaposNetCfgWinINetCfgLock(IN INetCfg *pNetCfg,
IN LPCWSTR pszwClientDescription,
IN DWORD cmsTimeout,
OUT LPWSTR *ppszwClientDescription)
{
INetCfgLock *pLock;
HRESULT hr = pNetCfg->QueryInterface(IID_INetCfgLock, (PVOID*)&pLock);
if (FAILED(hr))
{
NonStandardLogFlow(("QueryInterface failed, hr (0x%x)\n", hr));
return hr;
}
hr = pLock->AcquireWriteLock(cmsTimeout, pszwClientDescription, ppszwClientDescription);
if (hr == S_FALSE)
{
NonStandardLogFlow(("Write lock busy\n"));
}
else if (FAILED(hr))
{
NonStandardLogFlow(("AcquireWriteLock failed, hr (0x%x)\n", hr));
}
pLock->Release();
return hr;
}
static HRESULT SlaposNetCfgWinINetCfgUnlock(IN INetCfg *pNetCfg)
{
INetCfgLock *pLock;
HRESULT hr = pNetCfg->QueryInterface(IID_INetCfgLock, (PVOID*)&pLock);
if (FAILED(hr))
{
NonStandardLogFlow(("QueryInterface failed, hr (0x%x)\n", hr));
return hr;
}
hr = pLock->ReleaseWriteLock();
if (FAILED(hr))
NonStandardLogFlow(("ReleaseWriteLock failed, hr (0x%x)\n", hr));
pLock->Release();
return hr;
}
HRESULT SlaposNetCfgWinQueryINetCfg(OUT INetCfg **ppNetCfg,
IN BOOL fGetWriteLock,
IN LPCWSTR pszwClientDescription,
IN DWORD cmsTimeout,
OUT LPWSTR *ppszwClientDescription)
{
INetCfg *pNetCfg;
HRESULT hr = CoCreateInstance(CLSID_CNetCfg, NULL, CLSCTX_INPROC_SERVER, IID_INetCfg, (PVOID*)&pNetCfg);
if (FAILED(hr))
{
NonStandardLogFlow(("CoCreateInstance failed, hr (0x%x)\n", hr));
return hr;
}
if (fGetWriteLock)
{
hr = SlaposNetCfgWinINetCfgLock(pNetCfg, pszwClientDescription, cmsTimeout, ppszwClientDescription);
if (hr == S_FALSE)
{
NonStandardLogFlow(("Write lock is busy\n", hr));
hr = NETCFG_E_NO_WRITE_LOCK;
}
}
if (SUCCEEDED(hr))
{
hr = pNetCfg->Initialize(NULL);
if (SUCCEEDED(hr))
{
*ppNetCfg = pNetCfg;
return S_OK;
}
else
NonStandardLogFlow(("Initialize failed, hr (0x%x)\n", hr));
}
pNetCfg->Release();
return hr;
}
HRESULT SlaposNetCfgWinReleaseINetCfg(IN INetCfg *pNetCfg, IN BOOL fHasWriteLock)
{
HRESULT hr = pNetCfg->Uninitialize();
if (FAILED(hr))
{
NonStandardLogFlow(("Uninitialize failed, hr (0x%x)\n", hr));
return hr;
}
if (fHasWriteLock)
{
hr = SlaposNetCfgWinINetCfgUnlock(pNetCfg);
if (FAILED(hr))
NonStandardLogFlow(("SlaposNetCfgWinINetCfgUnlock failed, hr (0x%x)\n", hr));
}
pNetCfg->Release();
return hr;
}
static HRESULT SlaposNetCfgWinGetComponentByGuidEnum(IEnumNetCfgComponent *pEnumNcc,
IN const GUID *pGuid,
OUT INetCfgComponent **ppNcc)
{
HRESULT hr = pEnumNcc->Reset();
if (FAILED(hr))
{
NonStandardLogFlow(("Reset failed, hr (0x%x)\n", hr));
return hr;
}
INetCfgComponent *pNcc;
while ((hr = pEnumNcc->Next(1, &pNcc, NULL)) == S_OK)
{
ULONG uComponentStatus;
hr = pNcc->GetDeviceStatus(&uComponentStatus);
if (SUCCEEDED(hr))
{
if (uComponentStatus == 0)
{
GUID NccGuid;
hr = pNcc->GetInstanceGuid(&NccGuid);
if (SUCCEEDED(hr))
{
if (NccGuid == *pGuid)
{
/* found the needed device */
*ppNcc = pNcc;
break;
}
}
else
NonStandardLogFlow(("GetInstanceGuid failed, hr (0x%x)\n", hr));
}
}
pNcc->Release();
}
return hr;
}
HRESULT SlaposNetCfgWinGetComponentByGuid(IN INetCfg *pNc,
IN const GUID *pguidClass,
IN const GUID * pComponentGuid,
OUT INetCfgComponent **ppncc)
{
IEnumNetCfgComponent *pEnumNcc;
HRESULT hr = pNc->EnumComponents(pguidClass, &pEnumNcc);
if (SUCCEEDED(hr))
{
hr = SlaposNetCfgWinGetComponentByGuidEnum(pEnumNcc, pComponentGuid, ppncc);
if (hr == S_FALSE)
{
NonStandardLogFlow(("Component not found\n"));
}
else if (FAILED(hr))
{
NonStandardLogFlow(("SlaposNetCfgWinGetComponentByGuidEnum failed, hr (0x%x)\n", hr));
}
pEnumNcc->Release();
}
else
NonStandardLogFlow(("EnumComponents failed, hr (0x%x)\n", hr));
return hr;
}
static BOOL SlaposNetCfgWinAdjustNetworkInterfacePriority(IN INetCfg *pNc, IN INetCfgComponent *pNcc, PVOID pContext)
{
INetCfgComponentBindings *pNetCfgBindings;
GUID *pGuid = (GUID*)pContext;
/* Get component's binding. */
HRESULT hr = pNcc->QueryInterface(IID_INetCfgComponentBindings, (PVOID*)&pNetCfgBindings);
if (SUCCEEDED(hr))
{
/* Get binding path enumerator reference. */
IEnumNetCfgBindingPath *pEnumNetCfgBindPath;
hr = pNetCfgBindings->EnumBindingPaths(EBP_BELOW, &pEnumNetCfgBindPath);
if (SUCCEEDED(hr))
{
bool bFoundIface = false;
hr = pEnumNetCfgBindPath->Reset();
do
{
INetCfgBindingPath *pNetCfgBindPath;
hr = pEnumNetCfgBindPath->Next(1, &pNetCfgBindPath, NULL);
if (hr == S_OK)
{
IEnumNetCfgBindingInterface *pEnumNetCfgBindIface;
hr = pNetCfgBindPath->EnumBindingInterfaces(&pEnumNetCfgBindIface);
if (hr == S_OK)
{
pEnumNetCfgBindIface->Reset();
do
{
INetCfgBindingInterface *pNetCfgBindIfce;
hr = pEnumNetCfgBindIface->Next(1, &pNetCfgBindIfce, NULL);
if (hr == S_OK)
{
INetCfgComponent *pNetCfgCompo;
hr = pNetCfgBindIfce->GetLowerComponent(&pNetCfgCompo);
if (hr == S_OK)
{
ULONG uComponentStatus;
hr = pNetCfgCompo->GetDeviceStatus(&uComponentStatus);
if (hr == S_OK)
{
GUID guid;
hr = pNetCfgCompo->GetInstanceGuid(&guid);
if ( hr == S_OK
&& guid == *pGuid)
{
hr = pNetCfgBindings->MoveAfter(pNetCfgBindPath, NULL);
if (FAILED(hr))
NonStandardLogFlow(("Unable to move interface, hr (0x%x)\n", hr));
bFoundIface = true;
}
}
pNetCfgCompo->Release();
}
else
NonStandardLogFlow(("GetLowerComponent failed, hr (0x%x)\n", hr));
pNetCfgBindIfce->Release();
}
else
{
if (hr == S_FALSE) /* No more binding interfaces? */
hr = S_OK;
else
NonStandardLogFlow(("Next binding interface failed, hr (0x%x)\n", hr));
break;
}
} while (!bFoundIface);
pEnumNetCfgBindIface->Release();
}
else
NonStandardLogFlow(("EnumBindingInterfaces failed, hr (0x%x)\n", hr));
pNetCfgBindPath->Release();
}
else
{
if (hr = S_FALSE) /* No more binding paths? */
hr = S_OK;
else
NonStandardLogFlow(("Next bind path failed, hr (0x%x)\n", hr));
break;
}
} while (!bFoundIface);
pEnumNetCfgBindPath->Release();
}
else
NonStandardLogFlow(("EnumBindingPaths failed, hr (0x%x)\n", hr));
pNetCfgBindings->Release();
}
else
NonStandardLogFlow(("QueryInterface for IID_INetCfgComponentBindings failed, hr (0x%x)\n", hr));
return TRUE;
}
static UINT WINAPI SlaposNetCfgWinPspFileCallback(PVOID Context,
UINT Notification,
UINT_PTR Param1,
UINT_PTR Param2
)
{
switch (Notification)
{
case SPFILENOTIFY_TARGETNEWER:
case SPFILENOTIFY_TARGETEXISTS:
return TRUE;
}
return SetupDefaultQueueCallback(Context, Notification, Param1, Param2);
}
HRESULT SlaposNetCfgWinRenameConnection (LPWSTR pGuid, PCWSTR NewName)
{
typedef HRESULT (WINAPI *lpHrRenameConnection) (const GUID *, PCWSTR);
lpHrRenameConnection RenameConnectionFunc = NULL;
HRESULT status;
/* First try the IShellFolder interface, which was unimplemented
* for the network connections folder before XP. */
status = rename_shellfolder (pGuid, NewName);
if (status == E_NOTIMPL)
{
/** @todo that code doesn't seem to work! */
/* The IShellFolder interface is not implemented on this platform.
* Try the (undocumented) HrRenameConnection API in the netshell
* library. */
CLSID clsid;
HINSTANCE hNetShell;
status = CLSIDFromString ((LPOLESTR) pGuid, &clsid);
if (FAILED(status))
return E_FAIL;
hNetShell = loadSystemDll("netshell.dll");
if (hNetShell == NULL)
return E_FAIL;
RenameConnectionFunc =
(lpHrRenameConnection) GetProcAddress (hNetShell,
"HrRenameConnection");
if (RenameConnectionFunc == NULL)
{
FreeLibrary (hNetShell);
return E_FAIL;
}
status = RenameConnectionFunc (&clsid, NewName);
FreeLibrary (hNetShell);
}
if (FAILED (status))
return status;
return S_OK;
}
typedef BOOL (*SLAPOSNETCFGWIN_NETCFGENUM_CALLBACK) (IN INetCfg *pNetCfg, IN INetCfgComponent *pNetCfgComponent, PVOID pContext);
static HRESULT SlaposNetCfgWinEnumNetCfgComponents(IN INetCfg *pNetCfg,
IN const GUID *pguidClass,
SLAPOSNETCFGWIN_NETCFGENUM_CALLBACK callback,
PVOID pContext)
{
IEnumNetCfgComponent *pEnumComponent;
HRESULT hr = pNetCfg->EnumComponents(pguidClass, &pEnumComponent);
if (SUCCEEDED(hr))
{
INetCfgComponent *pNetCfgComponent;
hr = pEnumComponent->Reset();
do
{
hr = pEnumComponent->Next(1, &pNetCfgComponent, NULL);
if (hr == S_OK)
{
// ULONG uComponentStatus;
// hr = pNcc->GetDeviceStatus(&uComponentStatus);
// if (SUCCEEDED(hr))
BOOL fResult = FALSE;
if (pNetCfgComponent)
{
if (pContext)
fResult = callback(pNetCfg, pNetCfgComponent, pContext);
pNetCfgComponent->Release();
}
if (!fResult)
break;
}
else
{
if (hr == S_FALSE)
{
hr = S_OK;
}
else
NonStandardLogFlow(("Next failed, hr (0x%x)\n", hr));
break;
}
} while (true);
pEnumComponent->Release();
}
return hr;
}
HRESULT SlaposNetCfgWinGenConnectionName(PCWSTR DevName, WCHAR *pBuf, PULONG pcbBuf)
{
const WCHAR * pSuffix = wcsrchr( DevName, L'#' );
ULONG cbSize = sizeof(SLAPOS_CONNECTION_NAME);
ULONG cbSufSize = 0;
if (pSuffix)
{
cbSize += (ULONG)wcslen(pSuffix) * 2;
cbSize += 2; /* for space */
}
if (*pcbBuf < cbSize)
{
*pcbBuf = cbSize;
return E_FAIL;
}
wcscpy(pBuf, SLAPOS_CONNECTION_NAME);
if (pSuffix)
{
wcscat(pBuf, L" ");
wcscat(pBuf, pSuffix);
}
return S_OK;
}
HRESULT SlaposNetCfgWinCreateNetworkInterface(IN LPCWSTR pInfPath,
IN bool bIsInfPathFile,
IN LPCWSTR pHwid,
IN LPCWSTR pConnectionName,
OUT GUID *pGuid,
OUT BSTR *pErrMsg
)
{
HRESULT hrc = S_OK;
HDEVINFO hDeviceInfo = INVALID_HANDLE_VALUE;
SP_DEVINFO_DATA DeviceInfoData;
PVOID pQueueCallbackContext = NULL;
DWORD ret = 0;
BOOL found = FALSE;
BOOL registered = FALSE;
BOOL destroyList = FALSE;
WCHAR pWCfgGuidString [50];
WCHAR DevName[256];
do
{
GUID netGuid;
SP_DRVINFO_DATA DriverInfoData;
SP_DEVINSTALL_PARAMS DeviceInstallParams;
TCHAR className [MAX_PATH];
DWORD index = 0;
PSP_DRVINFO_DETAIL_DATA pDriverInfoDetail;
/* for our purposes, 2k buffer is more
* than enough to obtain the hardware ID
* of the SlaposNetAdp driver. */
DWORD detailBuf [2048];
HKEY hkey = NULL;
DWORD cbSize;
DWORD dwValueType;
/* initialize the structure size */
DeviceInfoData.cbSize = sizeof (SP_DEVINFO_DATA);
DriverInfoData.cbSize = sizeof (SP_DRVINFO_DATA);
/* copy the net class GUID */
memcpy(&netGuid, &GUID_DEVCLASS_NET, sizeof(GUID_DEVCLASS_NET));
/* create an empty device info set associated with the net class GUID */
hDeviceInfo = SetupDiCreateDeviceInfoList(&netGuid, NULL);
if (hDeviceInfo == INVALID_HANDLE_VALUE)
SetErrBreak (("SetupDiCreateDeviceInfoList failed (0x%08X)",
GetLastError()));
/* get the class name from GUID */
BOOL fResult = SetupDiClassNameFromGuid (&netGuid, className, MAX_PATH, NULL);
if (!fResult)
SetErrBreak (("SetupDiClassNameFromGuid failed (0x%08X)",
GetLastError()));
/* create a device info element and add the new device instance
* key to registry */
fResult = SetupDiCreateDeviceInfo (hDeviceInfo, className, &netGuid, NULL, NULL,
DICD_GENERATE_ID, &DeviceInfoData);
if (!fResult)
SetErrBreak (("SetupDiCreateDeviceInfo failed (0x%08X)",
GetLastError()));
/* select the newly created device info to be the currently
selected member */
fResult = SetupDiSetSelectedDevice (hDeviceInfo, &DeviceInfoData);
if (!fResult)
SetErrBreak (("SetupDiSetSelectedDevice failed (0x%08X)",
GetLastError()));
if (pInfPath)
{
/* get the device install parameters and disable filecopy */
DeviceInstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS);
fResult = SetupDiGetDeviceInstallParams (hDeviceInfo, &DeviceInfoData,
&DeviceInstallParams);
if (fResult)
{
memset(DeviceInstallParams.DriverPath, 0, sizeof(DeviceInstallParams.DriverPath));
size_t pathLenght = wcslen(pInfPath) + 1/* null terminator */;
if (pathLenght < sizeof(DeviceInstallParams.DriverPath)/sizeof(DeviceInstallParams.DriverPath[0]))
{
memcpy(DeviceInstallParams.DriverPath, pInfPath, pathLenght*sizeof(DeviceInstallParams.DriverPath[0]));
if (bIsInfPathFile)
{
DeviceInstallParams.Flags |= DI_ENUMSINGLEINF;
}
fResult = SetupDiSetDeviceInstallParams(hDeviceInfo, &DeviceInfoData,
&DeviceInstallParams);
if (!fResult)
{
DWORD winEr = GetLastError();
NonStandardLogFlow(("SetupDiSetDeviceInstallParams failed, winEr (%d)\n", winEr));
break;
}
}
else
{
NonStandardLogFlow(("SetupDiSetDeviceInstallParams faileed: INF path is too long\n"));
break;
}
}
else
{
DWORD winEr = GetLastError();
NonStandardLogFlow(("SetupDiGetDeviceInstallParams failed, winEr (%d)\n", winEr));
}
}
/* build a list of class drivers */
fResult = SetupDiBuildDriverInfoList (hDeviceInfo, &DeviceInfoData,
SPDIT_CLASSDRIVER);
if (!fResult)
SetErrBreak (("SetupDiBuildDriverInfoList failed (0x%08X)",
GetLastError()));
destroyList = TRUE;
/* enumerate the driver info list */
while (TRUE)
{
BOOL ret;
ret = SetupDiEnumDriverInfo (hDeviceInfo, &DeviceInfoData,
SPDIT_CLASSDRIVER, index, &DriverInfoData);
/* if the function failed and GetLastError() returned
* ERROR_NO_MORE_ITEMS, then we have reached the end of the
* list. Otherwise there was something wrong with this
* particular driver. */
if (!ret)
{
if (GetLastError() == ERROR_NO_MORE_ITEMS)
break;
else
{
index++;
continue;
}
}
pDriverInfoDetail = (PSP_DRVINFO_DETAIL_DATA) detailBuf;
pDriverInfoDetail->cbSize = sizeof(SP_DRVINFO_DETAIL_DATA);
/* if we successfully find the hardware ID and it turns out to
* be the one for the loopback driver, then we are done. */
if (SetupDiGetDriverInfoDetail (hDeviceInfo,
&DeviceInfoData,
&DriverInfoData,
pDriverInfoDetail,
sizeof (detailBuf),
NULL))
{
TCHAR * t;
/* pDriverInfoDetail->HardwareID is a MULTISZ string. Go through the
* whole list and see if there is a match somewhere. */
t = pDriverInfoDetail->HardwareID;
while (t && *t && t < (TCHAR *) &detailBuf [RT_ELEMENTS(detailBuf)])
{
if (!_tcsicmp(t, pHwid ? pHwid : DRIVERHWID))
break;
t += _tcslen(t) + 1;
}
if (t && *t && t < (TCHAR *) &detailBuf [RT_ELEMENTS(detailBuf)])
{
found = TRUE;
break;
}
}
index ++;
}
if (!found)
SetErrBreak(("Could not find Host Interface Networking driver! Please reinstall"));
/* set the loopback driver to be the currently selected */
fResult = SetupDiSetSelectedDriver (hDeviceInfo, &DeviceInfoData,
&DriverInfoData);
if (!fResult)
SetErrBreak(("SetupDiSetSelectedDriver failed (0x%08X)",
GetLastError()));
/* register the phantom device to prepare for install */
fResult = SetupDiCallClassInstaller (DIF_REGISTERDEVICE, hDeviceInfo,
&DeviceInfoData);
if (!fResult)
{
DWORD err = GetLastError();
SetErrBreak (("SetupDiCallClassInstaller failed (0x%08X)",
err));
}
/* registered, but remove if errors occur in the following code */
registered = TRUE;
/* ask the installer if we can install the device */
fResult = SetupDiCallClassInstaller (DIF_ALLOW_INSTALL, hDeviceInfo,
&DeviceInfoData);
if (!fResult)
{
if (GetLastError() != ERROR_DI_DO_DEFAULT)
SetErrBreak (("SetupDiCallClassInstaller (DIF_ALLOW_INSTALL) failed (0x%08X)",
GetLastError()));
/* that's fine */
}
/* get the device install parameters and disable filecopy */
DeviceInstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS);
fResult = SetupDiGetDeviceInstallParams (hDeviceInfo, &DeviceInfoData,
&DeviceInstallParams);
if (fResult)
{
pQueueCallbackContext = SetupInitDefaultQueueCallback(NULL);
if (pQueueCallbackContext)
{
DeviceInstallParams.InstallMsgHandlerContext = pQueueCallbackContext;
DeviceInstallParams.InstallMsgHandler = (PSP_FILE_CALLBACK)SlaposNetCfgWinPspFileCallback;
fResult = SetupDiSetDeviceInstallParams (hDeviceInfo, &DeviceInfoData,
&DeviceInstallParams);
if (!fResult)
{
DWORD winEr = GetLastError();
NonStandardLogFlow(("SetupDiSetDeviceInstallParams failed, winEr (%d)\n", winEr));
}
Assert(fResult);
}
else
{
DWORD winEr = GetLastError();
NonStandardLogFlow(("SetupInitDefaultQueueCallback failed, winEr (%d)\n", winEr));
}
}
else
{
DWORD winEr = GetLastError();
NonStandardLogFlow(("SetupDiGetDeviceInstallParams failed, winEr (%d)\n", winEr));
}
/* install the files first */
fResult = SetupDiCallClassInstaller (DIF_INSTALLDEVICEFILES, hDeviceInfo,
&DeviceInfoData);
if (!fResult)
SetErrBreak (("SetupDiCallClassInstaller (DIF_INSTALLDEVICEFILES) failed (0x%08X)",
GetLastError()));
/* get the device install parameters and disable filecopy */
DeviceInstallParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS);
fResult = SetupDiGetDeviceInstallParams (hDeviceInfo, &DeviceInfoData,
&DeviceInstallParams);
if (fResult)
{
DeviceInstallParams.Flags |= DI_NOFILECOPY;
fResult = SetupDiSetDeviceInstallParams(hDeviceInfo, &DeviceInfoData,
&DeviceInstallParams);
if (!fResult)
SetErrBreak (("SetupDiSetDeviceInstallParams failed (0x%08X)",
GetLastError()));
}
/*
* Register any device-specific co-installers for this device,
*/
fResult = SetupDiCallClassInstaller(DIF_REGISTER_COINSTALLERS,
hDeviceInfo,
&DeviceInfoData);
if (!fResult)
SetErrBreak (("SetupDiCallClassInstaller (DIF_REGISTER_COINSTALLERS) failed (0x%08X)",
GetLastError()));
/*
* install any installer-specified interfaces.
* and then do the real install
*/
fResult = SetupDiCallClassInstaller(DIF_INSTALLINTERFACES,
hDeviceInfo,
&DeviceInfoData);
if (!fResult)
SetErrBreak (("SetupDiCallClassInstaller (DIF_INSTALLINTERFACES) failed (0x%08X)",
GetLastError()));
fResult = SetupDiCallClassInstaller(DIF_INSTALLDEVICE,
hDeviceInfo,
&DeviceInfoData);
if (!fResult)
SetErrBreak (("SetupDiCallClassInstaller (DIF_INSTALLDEVICE) failed (0x%08X)",
GetLastError()));
/* Figure out NetCfgInstanceId */
hkey = SetupDiOpenDevRegKey(hDeviceInfo,
&DeviceInfoData,
DICS_FLAG_GLOBAL,
0,
DIREG_DRV,
KEY_READ);
if (hkey == INVALID_HANDLE_VALUE)
SetErrBreak(("SetupDiOpenDevRegKey failed (0x%08X)", GetLastError()));
cbSize = sizeof(pWCfgGuidString);
DWORD ret;
ret = RegQueryValueExW (hkey, L"NetCfgInstanceId", NULL,
&dwValueType, (LPBYTE) pWCfgGuidString, &cbSize);
RegCloseKey (hkey);
if (!SetupDiGetDeviceRegistryPropertyW(hDeviceInfo, &DeviceInfoData,
SPDRP_FRIENDLYNAME , /* IN DWORD Property,*/
NULL, /*OUT PDWORD PropertyRegDataType, OPTIONAL*/
(PBYTE)DevName, /*OUT PBYTE PropertyBuffer,*/
sizeof(DevName), /* IN DWORD PropertyBufferSize,*/
NULL /*OUT PDWORD RequiredSize OPTIONAL*/))
{
int err = GetLastError();
if (err != ERROR_INVALID_DATA)
{
SetErrBreak (("SetupDiGetDeviceRegistryProperty failed (0x%08X)",
err));
}
if (!SetupDiGetDeviceRegistryPropertyW(hDeviceInfo, &DeviceInfoData,
SPDRP_DEVICEDESC, /* IN DWORD Property,*/
NULL, /*OUT PDWORD PropertyRegDataType, OPTIONAL*/
(PBYTE)DevName, /*OUT PBYTE PropertyBuffer,*/
sizeof(DevName), /* IN DWORD PropertyBufferSize,*/
NULL /*OUT PDWORD RequiredSize OPTIONAL*/
))
{
err = GetLastError();
SetErrBreak (("SetupDiGetDeviceRegistryProperty failed (0x%08X)",
err));
}
}
}
while (0);
/*
* cleanup
*/
if (pQueueCallbackContext)
SetupTermDefaultQueueCallback(pQueueCallbackContext);
if (hDeviceInfo != INVALID_HANDLE_VALUE)
{
/* an error has occurred, but the device is registered, we must remove it */
if (ret != 0 && registered)
SetupDiCallClassInstaller(DIF_REMOVE, hDeviceInfo, &DeviceInfoData);
found = SetupDiDeleteDeviceInfo(hDeviceInfo, &DeviceInfoData);
/* destroy the driver info list */
if (destroyList)
SetupDiDestroyDriverInfoList(hDeviceInfo, &DeviceInfoData,
SPDIT_CLASSDRIVER);
/* clean up the device info set */
SetupDiDestroyDeviceInfoList (hDeviceInfo);
}
/* return the network connection GUID on success */
if (SUCCEEDED(hrc))
{
HRESULT hr;
if (pConnectionName) {
hr = SlaposNetCfgWinRenameConnection(pWCfgGuidString, pConnectionName);
}
else {
WCHAR ConnectoinName[128];
ULONG cbName = sizeof(ConnectoinName);
hr = SlaposNetCfgWinGenConnectionName(DevName, ConnectoinName, &cbName);
if (SUCCEEDED(hr))
hr = SlaposNetCfgWinRenameConnection(pWCfgGuidString, ConnectoinName);
}
// if (lppszName)
// {
// *lppszName = SysAllocString((const OLECHAR *) DevName);
// if (!*lppszName)
// {
// NonStandardLogFlow(("SysAllocString failed\n"));
// hrc = HRESULT_FROM_WIN32(ERROR_NOT_ENOUGH_MEMORY);
// }
// }
if (pGuid)
{
hrc = CLSIDFromString(pWCfgGuidString, (LPCLSID)pGuid);
if (FAILED(hrc))
NonStandardLogFlow(("CLSIDFromString failed, hrc (0x%x)\n", hrc));
}
INetCfg *pNetCfg = NULL;
LPWSTR lpszApp = NULL;
hr = SlaposNetCfgWinQueryINetCfg(&pNetCfg, TRUE, L"VirtualBox Host-Only Creation",
30 * 1000,
&lpszApp);
if (hr == S_OK)
{
hr = SlaposNetCfgWinEnumNetCfgComponents(pNetCfg,
&GUID_DEVCLASS_NETSERVICE,
SlaposNetCfgWinAdjustNetworkInterfacePriority,
pGuid);
if (SUCCEEDED(hr))
{
hr = SlaposNetCfgWinEnumNetCfgComponents(pNetCfg,
&GUID_DEVCLASS_NETTRANS,
SlaposNetCfgWinAdjustNetworkInterfacePriority,
pGuid);
if (SUCCEEDED(hr))
hr = SlaposNetCfgWinEnumNetCfgComponents(pNetCfg,
&GUID_DEVCLASS_NETCLIENT,
SlaposNetCfgWinAdjustNetworkInterfacePriority,
pGuid);
}
if (SUCCEEDED(hr))
{
hr = pNetCfg->Apply();
}
else
NonStandardLogFlow(("Enumeration failed, hr 0x%x\n", hr));
SlaposNetCfgWinReleaseINetCfg(pNetCfg, TRUE);
}
else if (hr == NETCFG_E_NO_WRITE_LOCK && lpszApp)
{
NonStandardLogFlow(("Application %ws is holding the lock, failed\n", lpszApp));
CoTaskMemFree(lpszApp);
}
else
NonStandardLogFlow(("SlaposNetCfgWinQueryINetCfg failed, hr 0x%x\n", hr));
}
return hrc;
}
HRESULT SlaposNetCfgWinRemoveNetworkInterface(IN LPCWSTR pHwid,
IN LPCSTR pGUID,
OUT BSTR *pErrMsg
)
{
HRESULT hrc = S_OK;
do
{
TCHAR lszPnPInstanceId [512] = {0};
/* We have to find the device instance ID through a registry search */
HKEY hkeyNetwork = 0;
HKEY hkeyConnection = 0;
do
{
WCHAR strRegLocation [256];
WCHAR wszGuid[50];
size_t size;
size = MultiByteToWideChar(CP_ACP,
0,
pGUID,
-1,
NULL,
0
);
if (size > 50 * sizeof(WCHAR))
return E_FAIL;
if (MultiByteToWideChar(CP_ACP,
0,
pGUID,
-1,
wszGuid,
size
) == 0)
return E_FAIL;
// int length = StringFromGUID2(*pGUID, wszGuid, RT_ELEMENTS(wszGuid));
// if (!length)
// SetErrBreak(("Failed to create a Guid string"));
swprintf (strRegLocation,
L"SYSTEM\\CurrentControlSet\\Control\\Network\\"
L"{4D36E972-E325-11CE-BFC1-08002BE10318}\\%s",
wszGuid);
LONG status;
status = RegOpenKeyExW (HKEY_LOCAL_MACHINE, strRegLocation, 0,
KEY_READ, &hkeyNetwork);
if ((status != ERROR_SUCCESS) || !hkeyNetwork)
SetErrBreak (("Host interface network is not found in registry (%S) [1]",
strRegLocation));
status = RegOpenKeyExW (hkeyNetwork, L"Connection", 0,
KEY_READ, &hkeyConnection);
if ((status != ERROR_SUCCESS) || !hkeyConnection)
SetErrBreak (("Host interface network is not found in registry (%S) [2]",
strRegLocation));
DWORD len = sizeof (lszPnPInstanceId);
DWORD dwKeyType;
status = RegQueryValueExW (hkeyConnection, L"PnPInstanceID", NULL,
&dwKeyType, (LPBYTE) lszPnPInstanceId, &len);
if ((status != ERROR_SUCCESS) || (dwKeyType != REG_SZ))
SetErrBreak (("Host interface network is not found in registry (%S) [3]",
strRegLocation));
}
while (0);
if (hkeyConnection)
RegCloseKey (hkeyConnection);
if (hkeyNetwork)
RegCloseKey (hkeyNetwork);
if (FAILED (hrc))
break;
/*
* Now we are going to enumerate all network devices and
* wait until we encounter the right device instance ID
*/
HDEVINFO hDeviceInfo = INVALID_HANDLE_VALUE;
do
{
BOOL ok;
DWORD ret = 0;
GUID netGuid;
SP_DEVINFO_DATA DeviceInfoData;
DWORD index = 0;
BOOL found = FALSE;
DWORD size = 0;
/* initialize the structure size */
DeviceInfoData.cbSize = sizeof (SP_DEVINFO_DATA);
/* copy the net class GUID */
memcpy (&netGuid, &GUID_DEVCLASS_NET, sizeof (GUID_DEVCLASS_NET));
/* return a device info set contains all installed devices of the Net class */
hDeviceInfo = SetupDiGetClassDevs (&netGuid, NULL, NULL, DIGCF_PRESENT);
if (hDeviceInfo == INVALID_HANDLE_VALUE)
SetErrBreak (("SetupDiGetClassDevs failed (0x%08X)", GetLastError()));
/* enumerate the driver info list */
while (TRUE)
{
TCHAR *deviceHwid;
ok = SetupDiEnumDeviceInfo (hDeviceInfo, index, &DeviceInfoData);
if (!ok)
{
if (GetLastError() == ERROR_NO_MORE_ITEMS)
break;
else
{
index++;
continue;
}
}
/* try to get the hardware ID registry property */
ok = SetupDiGetDeviceRegistryProperty (hDeviceInfo,
&DeviceInfoData,
SPDRP_HARDWAREID,
NULL,
NULL,
0,
&size);
if (!ok)
{
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
{
index++;
continue;
}
deviceHwid = (TCHAR *) malloc (size);
ok = SetupDiGetDeviceRegistryProperty (hDeviceInfo,
&DeviceInfoData,
SPDRP_HARDWAREID,
NULL,
(PBYTE)deviceHwid,
size,
NULL);
if (!ok)
{
free (deviceHwid);
deviceHwid = NULL;
index++;
continue;
}
}
else
{
/* something is wrong. This shouldn't have worked with a NULL buffer */
index++;
continue;
}
for (TCHAR *t = deviceHwid;
t && *t && t < &deviceHwid[size / sizeof(TCHAR)];
t += _tcslen (t) + 1)
{
if (!_tcsicmp (pHwid ? pHwid : DRIVERHWID, t))
{
/* get the device instance ID */
TCHAR devID [MAX_DEVICE_ID_LEN];
if (CM_Get_Device_ID(DeviceInfoData.DevInst,
devID, MAX_DEVICE_ID_LEN, 0) == CR_SUCCESS)
{
/* compare to what we determined before */
if (wcscmp(devID, lszPnPInstanceId) == 0)
{
found = TRUE;
break;
}
}
}
}
if (deviceHwid)
{
free (deviceHwid);
deviceHwid = NULL;
}
if (found)
break;
index++;
}
if (found == FALSE)
SetErrBreak (("Host Interface Network driver not found (0x%08X)",
GetLastError()));
ok = SetupDiSetSelectedDevice (hDeviceInfo, &DeviceInfoData);
if (!ok)
SetErrBreak (("SetupDiSetSelectedDevice failed (0x%08X)",
GetLastError()));
ok = SetupDiCallClassInstaller (DIF_REMOVE, hDeviceInfo, &DeviceInfoData);
if (!ok)
SetErrBreak (("SetupDiCallClassInstaller (DIF_REMOVE) failed (0x%08X)",
GetLastError()));
}
while (0);
/* clean up the device info set */
if (hDeviceInfo != INVALID_HANDLE_VALUE)
SetupDiDestroyDeviceInfoList (hDeviceInfo);
if (FAILED (hrc))
break;
}
while (0);
return hrc;
}
HRESULT SlaposNetCfgGetNetworkInterfaceGuid(IN LPCWSTR pHwid,
IN LPCWSTR pConnectionName,
OUT BSTR *pGUID,
OUT BSTR *pErrMsg
)
{
HRESULT hrc = S_OK;
IP_ADAPTER_ADDRESSES *pAdaptAddr = NULL;
IP_ADAPTER_ADDRESSES *pTmpAdaptAddr = NULL;
DWORD dwRet = 0;
DWORD dwSize = 0x10000;
dwRet = GetAdaptersAddresses(AF_UNSPEC,
GAA_FLAG_SKIP_UNICAST \
| GAA_FLAG_SKIP_ANYCAST \
| GAA_FLAG_SKIP_MULTICAST \
| GAA_FLAG_SKIP_DNS_SERVER,
NULL,
pAdaptAddr,
&dwSize
);
if (ERROR_BUFFER_OVERFLOW == dwRet) {
FREE(pAdaptAddr);
if (NULL == (pAdaptAddr = (IP_ADAPTER_ADDRESSES*)MALLOC(dwSize)))
return E_FAIL;
dwRet = GetAdaptersAddresses(AF_UNSPEC,
GAA_FLAG_SKIP_UNICAST \
| GAA_FLAG_SKIP_ANYCAST \
| GAA_FLAG_SKIP_MULTICAST \
| GAA_FLAG_SKIP_DNS_SERVER,
NULL,
pAdaptAddr,
&dwSize
);
}
if (NO_ERROR == dwRet) {
pTmpAdaptAddr = pAdaptAddr;
while (pTmpAdaptAddr) {
if (wcscmp(pConnectionName, pTmpAdaptAddr -> FriendlyName) == 0) {
memcpy(pGUID, pTmpAdaptAddr -> AdapterName, strlen(pTmpAdaptAddr -> AdapterName));
// memcpy(pGUID, &(pTmpAdaptAddr -> NetworkGuid), sizeof(pTmpAdaptAddr -> NetworkGuid));
break;
}
pTmpAdaptAddr = pTmpAdaptAddr->Next;
}
}
FREE(pAdaptAddr);
return hrc;
}
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 7.00.0555 */
/* Compiler settings for netcfgn.idl:
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
/* @@MIDL_FILE_HEADING( ) */
#pragma warning( disable: 4049 ) /* more than 64k source lines */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 500
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCSAL_H_VERSION__
#define __REQUIRED_RPCSAL_H_VERSION__ 100
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __netcfgn_h__
#define __netcfgn_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifndef __INetCfgPnpReconfigCallback_FWD_DEFINED__
#define __INetCfgPnpReconfigCallback_FWD_DEFINED__
typedef interface INetCfgPnpReconfigCallback INetCfgPnpReconfigCallback;
#endif /* __INetCfgPnpReconfigCallback_FWD_DEFINED__ */
#ifndef __INetCfgComponentControl_FWD_DEFINED__
#define __INetCfgComponentControl_FWD_DEFINED__
typedef interface INetCfgComponentControl INetCfgComponentControl;
#endif /* __INetCfgComponentControl_FWD_DEFINED__ */
#ifndef __INetCfgComponentSetup_FWD_DEFINED__
#define __INetCfgComponentSetup_FWD_DEFINED__
typedef interface INetCfgComponentSetup INetCfgComponentSetup;
#endif /* __INetCfgComponentSetup_FWD_DEFINED__ */
#ifndef __INetCfgComponentPropertyUi_FWD_DEFINED__
#define __INetCfgComponentPropertyUi_FWD_DEFINED__
typedef interface INetCfgComponentPropertyUi INetCfgComponentPropertyUi;
#endif /* __INetCfgComponentPropertyUi_FWD_DEFINED__ */
#ifndef __INetCfgComponentNotifyBinding_FWD_DEFINED__
#define __INetCfgComponentNotifyBinding_FWD_DEFINED__
typedef interface INetCfgComponentNotifyBinding INetCfgComponentNotifyBinding;
#endif /* __INetCfgComponentNotifyBinding_FWD_DEFINED__ */
#ifndef __INetCfgComponentNotifyGlobal_FWD_DEFINED__
#define __INetCfgComponentNotifyGlobal_FWD_DEFINED__
typedef interface INetCfgComponentNotifyGlobal INetCfgComponentNotifyGlobal;
#endif /* __INetCfgComponentNotifyGlobal_FWD_DEFINED__ */
#ifndef __INetCfgComponentUpperEdge_FWD_DEFINED__
#define __INetCfgComponentUpperEdge_FWD_DEFINED__
typedef interface INetCfgComponentUpperEdge INetCfgComponentUpperEdge;
#endif /* __INetCfgComponentUpperEdge_FWD_DEFINED__ */
#ifndef __INetLanConnectionUiInfo_FWD_DEFINED__
#define __INetLanConnectionUiInfo_FWD_DEFINED__
typedef interface INetLanConnectionUiInfo INetLanConnectionUiInfo;
#endif /* __INetLanConnectionUiInfo_FWD_DEFINED__ */
#ifndef __INetRasConnectionIpUiInfo_FWD_DEFINED__
#define __INetRasConnectionIpUiInfo_FWD_DEFINED__
typedef interface INetRasConnectionIpUiInfo INetRasConnectionIpUiInfo;
#endif /* __INetRasConnectionIpUiInfo_FWD_DEFINED__ */
#ifndef __INetCfgComponentSysPrep_FWD_DEFINED__
#define __INetCfgComponentSysPrep_FWD_DEFINED__
typedef interface INetCfgComponentSysPrep INetCfgComponentSysPrep;
#endif /* __INetCfgComponentSysPrep_FWD_DEFINED__ */
/* header files for imported files */
#include "unknwn.h"
#include "netcfgx.h"
#ifdef __cplusplus
extern "C"{
#endif
/* interface __MIDL_itf_netcfgn_0000_0000 */
/* [local] */
//+-------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//--------------------------------------------------------------------------
#if ( _MSC_VER >= 800 )
#pragma warning(disable:4201)
#endif
extern RPC_IF_HANDLE __MIDL_itf_netcfgn_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_netcfgn_0000_0000_v0_0_s_ifspec;
#ifndef __INetCfgPnpReconfigCallback_INTERFACE_DEFINED__
#define __INetCfgPnpReconfigCallback_INTERFACE_DEFINED__
/* interface INetCfgPnpReconfigCallback */
/* [unique][uuid][object][local] */
typedef /* [v1_enum] */
enum tagNCPNP_RECONFIG_LAYER
{ NCRL_NDIS = 1,
NCRL_TDI = 2
} NCPNP_RECONFIG_LAYER;
EXTERN_C const IID IID_INetCfgPnpReconfigCallback;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("8d84bd35-e227-11d2-b700-00a0c98a6a85")
INetCfgPnpReconfigCallback : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE SendPnpReconfig(
/* [annotation][in] */
__in NCPNP_RECONFIG_LAYER Layer,
/* [annotation][in] */
__in LPCWSTR pszwUpper,
/* [annotation][in] */
__in LPCWSTR pszwLower,
/* [annotation][in] */
__in_bcount(dwSizeOfData) PVOID pvData,
/* [annotation][in] */
__in DWORD dwSizeOfData) = 0;
};
#else /* C style interface */
typedef struct INetCfgPnpReconfigCallbackVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
INetCfgPnpReconfigCallback * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
INetCfgPnpReconfigCallback * This);
ULONG ( STDMETHODCALLTYPE *Release )(
INetCfgPnpReconfigCallback * This);
HRESULT ( STDMETHODCALLTYPE *SendPnpReconfig )(
INetCfgPnpReconfigCallback * This,
/* [annotation][in] */
__in NCPNP_RECONFIG_LAYER Layer,
/* [annotation][in] */
__in LPCWSTR pszwUpper,
/* [annotation][in] */
__in LPCWSTR pszwLower,
/* [annotation][in] */
__in_bcount(dwSizeOfData) PVOID pvData,
/* [annotation][in] */
__in DWORD dwSizeOfData);
END_INTERFACE
} INetCfgPnpReconfigCallbackVtbl;
interface INetCfgPnpReconfigCallback
{
CONST_VTBL struct INetCfgPnpReconfigCallbackVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define INetCfgPnpReconfigCallback_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define INetCfgPnpReconfigCallback_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define INetCfgPnpReconfigCallback_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define INetCfgPnpReconfigCallback_SendPnpReconfig(This,Layer,pszwUpper,pszwLower,pvData,dwSizeOfData) \
( (This)->lpVtbl -> SendPnpReconfig(This,Layer,pszwUpper,pszwLower,pvData,dwSizeOfData) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __INetCfgPnpReconfigCallback_INTERFACE_DEFINED__ */
#ifndef __INetCfgComponentControl_INTERFACE_DEFINED__
#define __INetCfgComponentControl_INTERFACE_DEFINED__
/* interface INetCfgComponentControl */
/* [unique][uuid][object][local] */
EXTERN_C const IID IID_INetCfgComponentControl;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("932238df-bea1-11d0-9298-00c04fc99dcf")
INetCfgComponentControl : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Initialize(
/* [annotation][in] */
__in INetCfgComponent *pIComp,
/* [annotation][in] */
__in INetCfg *pINetCfg,
/* [annotation][in] */
__in BOOL fInstalling) = 0;
virtual HRESULT STDMETHODCALLTYPE ApplyRegistryChanges( void) = 0;
virtual HRESULT STDMETHODCALLTYPE ApplyPnpChanges(
/* [annotation][in] */
__in INetCfgPnpReconfigCallback *pICallback) = 0;
virtual HRESULT STDMETHODCALLTYPE CancelChanges( void) = 0;
};
#else /* C style interface */
typedef struct INetCfgComponentControlVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
INetCfgComponentControl * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
INetCfgComponentControl * This);
ULONG ( STDMETHODCALLTYPE *Release )(
INetCfgComponentControl * This);
HRESULT ( STDMETHODCALLTYPE *Initialize )(
INetCfgComponentControl * This,
/* [annotation][in] */
__in INetCfgComponent *pIComp,
/* [annotation][in] */
__in INetCfg *pINetCfg,
/* [annotation][in] */
__in BOOL fInstalling);
HRESULT ( STDMETHODCALLTYPE *ApplyRegistryChanges )(
INetCfgComponentControl * This);
HRESULT ( STDMETHODCALLTYPE *ApplyPnpChanges )(
INetCfgComponentControl * This,
/* [annotation][in] */
__in INetCfgPnpReconfigCallback *pICallback);
HRESULT ( STDMETHODCALLTYPE *CancelChanges )(
INetCfgComponentControl * This);
END_INTERFACE
} INetCfgComponentControlVtbl;
interface INetCfgComponentControl
{
CONST_VTBL struct INetCfgComponentControlVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define INetCfgComponentControl_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define INetCfgComponentControl_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define INetCfgComponentControl_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define INetCfgComponentControl_Initialize(This,pIComp,pINetCfg,fInstalling) \
( (This)->lpVtbl -> Initialize(This,pIComp,pINetCfg,fInstalling) )
#define INetCfgComponentControl_ApplyRegistryChanges(This) \
( (This)->lpVtbl -> ApplyRegistryChanges(This) )
#define INetCfgComponentControl_ApplyPnpChanges(This,pICallback) \
( (This)->lpVtbl -> ApplyPnpChanges(This,pICallback) )
#define INetCfgComponentControl_CancelChanges(This) \
( (This)->lpVtbl -> CancelChanges(This) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __INetCfgComponentControl_INTERFACE_DEFINED__ */
#ifndef __INetCfgComponentSetup_INTERFACE_DEFINED__
#define __INetCfgComponentSetup_INTERFACE_DEFINED__
/* interface INetCfgComponentSetup */
/* [unique][uuid][object][local] */
typedef /* [v1_enum] */
enum tagNETWORK_INSTALL_TIME
{ NSF_PRIMARYINSTALL = 0x1,
NSF_POSTSYSINSTALL = 0x2
} NETWORK_INSTALL_TIME;
typedef /* [v1_enum] */
enum tagNETWORK_UPGRADE_TYPE
{ NSF_WIN16_UPGRADE = 0x10,
NSF_WIN95_UPGRADE = 0x20,
NSF_WINNT_WKS_UPGRADE = 0x40,
NSF_WINNT_SVR_UPGRADE = 0x80,
NSF_WINNT_SBS_UPGRADE = 0x100,
NSF_COMPONENT_UPDATE = 0x200
} NETWORK_UPGRADE_TYPE;
EXTERN_C const IID IID_INetCfgComponentSetup;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("932238e3-bea1-11d0-9298-00c04fc99dcf")
INetCfgComponentSetup : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Install(
/* [annotation][in] */
__in DWORD dwSetupFlags) = 0;
virtual HRESULT STDMETHODCALLTYPE Upgrade(
/* [annotation][in] */
__in DWORD dwSetupFlags,
/* [annotation][in] */
__in DWORD dwUpgradeFomBuildNo) = 0;
virtual HRESULT STDMETHODCALLTYPE ReadAnswerFile(
/* [annotation][in] */
__in LPCWSTR pszwAnswerFile,
/* [annotation][in] */
__in LPCWSTR pszwAnswerSections) = 0;
virtual HRESULT STDMETHODCALLTYPE Removing( void) = 0;
};
#else /* C style interface */
typedef struct INetCfgComponentSetupVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
INetCfgComponentSetup * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
INetCfgComponentSetup * This);
ULONG ( STDMETHODCALLTYPE *Release )(
INetCfgComponentSetup * This);
HRESULT ( STDMETHODCALLTYPE *Install )(
INetCfgComponentSetup * This,
/* [annotation][in] */
__in DWORD dwSetupFlags);
HRESULT ( STDMETHODCALLTYPE *Upgrade )(
INetCfgComponentSetup * This,
/* [annotation][in] */
__in DWORD dwSetupFlags,
/* [annotation][in] */
__in DWORD dwUpgradeFomBuildNo);
HRESULT ( STDMETHODCALLTYPE *ReadAnswerFile )(
INetCfgComponentSetup * This,
/* [annotation][in] */
__in LPCWSTR pszwAnswerFile,
/* [annotation][in] */
__in LPCWSTR pszwAnswerSections);
HRESULT ( STDMETHODCALLTYPE *Removing )(
INetCfgComponentSetup * This);
END_INTERFACE
} INetCfgComponentSetupVtbl;
interface INetCfgComponentSetup
{
CONST_VTBL struct INetCfgComponentSetupVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define INetCfgComponentSetup_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define INetCfgComponentSetup_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define INetCfgComponentSetup_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define INetCfgComponentSetup_Install(This,dwSetupFlags) \
( (This)->lpVtbl -> Install(This,dwSetupFlags) )
#define INetCfgComponentSetup_Upgrade(This,dwSetupFlags,dwUpgradeFomBuildNo) \
( (This)->lpVtbl -> Upgrade(This,dwSetupFlags,dwUpgradeFomBuildNo) )
#define INetCfgComponentSetup_ReadAnswerFile(This,pszwAnswerFile,pszwAnswerSections) \
( (This)->lpVtbl -> ReadAnswerFile(This,pszwAnswerFile,pszwAnswerSections) )
#define INetCfgComponentSetup_Removing(This) \
( (This)->lpVtbl -> Removing(This) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __INetCfgComponentSetup_INTERFACE_DEFINED__ */
#ifndef __INetCfgComponentPropertyUi_INTERFACE_DEFINED__
#define __INetCfgComponentPropertyUi_INTERFACE_DEFINED__
/* interface INetCfgComponentPropertyUi */
/* [unique][uuid][object][local] */
typedef /* [v1_enum] */
enum tagDEFAULT_PAGES
{ DPP_ADVANCED = 1
} DEFAULT_PAGES;
EXTERN_C const IID IID_INetCfgComponentPropertyUi;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("932238e0-bea1-11d0-9298-00c04fc99dcf")
INetCfgComponentPropertyUi : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE QueryPropertyUi(
/* [annotation][in] */
__in IUnknown *pUnkReserved) = 0;
virtual HRESULT STDMETHODCALLTYPE SetContext(
/* [annotation][in] */
__in IUnknown *pUnkReserved) = 0;
virtual HRESULT STDMETHODCALLTYPE MergePropPages(
/* [annotation][out][in] */
__inout DWORD *pdwDefPages,
/* [annotation][out] */
__out BYTE **pahpspPrivate,
/* [annotation][out] */
__out UINT *pcPages,
/* [annotation][in] */
__in HWND hwndParent,
/* [annotation][in] */
__in_opt LPCWSTR *pszStartPage) = 0;
virtual HRESULT STDMETHODCALLTYPE ValidateProperties(
/* [annotation][in] */
__in HWND hwndSheet) = 0;
virtual HRESULT STDMETHODCALLTYPE ApplyProperties( void) = 0;
virtual HRESULT STDMETHODCALLTYPE CancelProperties( void) = 0;
};
#else /* C style interface */
typedef struct INetCfgComponentPropertyUiVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
INetCfgComponentPropertyUi * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
INetCfgComponentPropertyUi * This);
ULONG ( STDMETHODCALLTYPE *Release )(
INetCfgComponentPropertyUi * This);
HRESULT ( STDMETHODCALLTYPE *QueryPropertyUi )(
INetCfgComponentPropertyUi * This,
/* [annotation][in] */
__in IUnknown *pUnkReserved);
HRESULT ( STDMETHODCALLTYPE *SetContext )(
INetCfgComponentPropertyUi * This,
/* [annotation][in] */
__in IUnknown *pUnkReserved);
HRESULT ( STDMETHODCALLTYPE *MergePropPages )(
INetCfgComponentPropertyUi * This,
/* [annotation][out][in] */
__inout DWORD *pdwDefPages,
/* [annotation][out] */
__out BYTE **pahpspPrivate,
/* [annotation][out] */
__out UINT *pcPages,
/* [annotation][in] */
__in HWND hwndParent,
/* [annotation][in] */
__in_opt LPCWSTR *pszStartPage);
HRESULT ( STDMETHODCALLTYPE *ValidateProperties )(
INetCfgComponentPropertyUi * This,
/* [annotation][in] */
__in HWND hwndSheet);
HRESULT ( STDMETHODCALLTYPE *ApplyProperties )(
INetCfgComponentPropertyUi * This);
HRESULT ( STDMETHODCALLTYPE *CancelProperties )(
INetCfgComponentPropertyUi * This);
END_INTERFACE
} INetCfgComponentPropertyUiVtbl;
interface INetCfgComponentPropertyUi
{
CONST_VTBL struct INetCfgComponentPropertyUiVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define INetCfgComponentPropertyUi_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define INetCfgComponentPropertyUi_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define INetCfgComponentPropertyUi_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define INetCfgComponentPropertyUi_QueryPropertyUi(This,pUnkReserved) \
( (This)->lpVtbl -> QueryPropertyUi(This,pUnkReserved) )
#define INetCfgComponentPropertyUi_SetContext(This,pUnkReserved) \
( (This)->lpVtbl -> SetContext(This,pUnkReserved) )
#define INetCfgComponentPropertyUi_MergePropPages(This,pdwDefPages,pahpspPrivate,pcPages,hwndParent,pszStartPage) \
( (This)->lpVtbl -> MergePropPages(This,pdwDefPages,pahpspPrivate,pcPages,hwndParent,pszStartPage) )
#define INetCfgComponentPropertyUi_ValidateProperties(This,hwndSheet) \
( (This)->lpVtbl -> ValidateProperties(This,hwndSheet) )
#define INetCfgComponentPropertyUi_ApplyProperties(This) \
( (This)->lpVtbl -> ApplyProperties(This) )
#define INetCfgComponentPropertyUi_CancelProperties(This) \
( (This)->lpVtbl -> CancelProperties(This) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __INetCfgComponentPropertyUi_INTERFACE_DEFINED__ */
#ifndef __INetCfgComponentNotifyBinding_INTERFACE_DEFINED__
#define __INetCfgComponentNotifyBinding_INTERFACE_DEFINED__
/* interface INetCfgComponentNotifyBinding */
/* [unique][uuid][object][local] */
typedef /* [v1_enum] */
enum tagBIND_FLAGS1
{ NCN_ADD = 0x1,
NCN_REMOVE = 0x2,
NCN_UPDATE = 0x4,
NCN_ENABLE = 0x10,
NCN_DISABLE = 0x20,
NCN_BINDING_PATH = 0x100,
NCN_PROPERTYCHANGE = 0x200,
NCN_NET = 0x10000,
NCN_NETTRANS = 0x20000,
NCN_NETCLIENT = 0x40000,
NCN_NETSERVICE = 0x80000
} BIND_FLAGS1;
EXTERN_C const IID IID_INetCfgComponentNotifyBinding;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("932238e1-bea1-11d0-9298-00c04fc99dcf")
INetCfgComponentNotifyBinding : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE QueryBindingPath(
/* [annotation][in] */
__in DWORD dwChangeFlag,
/* [annotation][in] */
__in INetCfgBindingPath *pIPath) = 0;
virtual HRESULT STDMETHODCALLTYPE NotifyBindingPath(
/* [annotation][in] */
__in DWORD dwChangeFlag,
/* [annotation][in] */
__in INetCfgBindingPath *pIPath) = 0;
};
#else /* C style interface */
typedef struct INetCfgComponentNotifyBindingVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
INetCfgComponentNotifyBinding * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
INetCfgComponentNotifyBinding * This);
ULONG ( STDMETHODCALLTYPE *Release )(
INetCfgComponentNotifyBinding * This);
HRESULT ( STDMETHODCALLTYPE *QueryBindingPath )(
INetCfgComponentNotifyBinding * This,
/* [annotation][in] */
__in DWORD dwChangeFlag,
/* [annotation][in] */
__in INetCfgBindingPath *pIPath);
HRESULT ( STDMETHODCALLTYPE *NotifyBindingPath )(
INetCfgComponentNotifyBinding * This,
/* [annotation][in] */
__in DWORD dwChangeFlag,
/* [annotation][in] */
__in INetCfgBindingPath *pIPath);
END_INTERFACE
} INetCfgComponentNotifyBindingVtbl;
interface INetCfgComponentNotifyBinding
{
CONST_VTBL struct INetCfgComponentNotifyBindingVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define INetCfgComponentNotifyBinding_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define INetCfgComponentNotifyBinding_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define INetCfgComponentNotifyBinding_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define INetCfgComponentNotifyBinding_QueryBindingPath(This,dwChangeFlag,pIPath) \
( (This)->lpVtbl -> QueryBindingPath(This,dwChangeFlag,pIPath) )
#define INetCfgComponentNotifyBinding_NotifyBindingPath(This,dwChangeFlag,pIPath) \
( (This)->lpVtbl -> NotifyBindingPath(This,dwChangeFlag,pIPath) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __INetCfgComponentNotifyBinding_INTERFACE_DEFINED__ */
#ifndef __INetCfgComponentNotifyGlobal_INTERFACE_DEFINED__
#define __INetCfgComponentNotifyGlobal_INTERFACE_DEFINED__
/* interface INetCfgComponentNotifyGlobal */
/* [unique][uuid][object][local] */
EXTERN_C const IID IID_INetCfgComponentNotifyGlobal;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("932238e2-bea1-11d0-9298-00c04fc99dcf")
INetCfgComponentNotifyGlobal : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetSupportedNotifications(
/* [annotation][out] */
__out DWORD *dwNotifications) = 0;
virtual HRESULT STDMETHODCALLTYPE SysQueryBindingPath(
/* [annotation][in] */
__in DWORD dwChangeFlag,
/* [annotation][in] */
__in INetCfgBindingPath *pIPath) = 0;
virtual HRESULT STDMETHODCALLTYPE SysNotifyBindingPath(
/* [annotation][in] */
__in DWORD dwChangeFlag,
/* [annotation][in] */
__in INetCfgBindingPath *pIPath) = 0;
virtual HRESULT STDMETHODCALLTYPE SysNotifyComponent(
/* [annotation][in] */
__in DWORD dwChangeFlag,
/* [annotation][in] */
__in INetCfgComponent *pIComp) = 0;
};
#else /* C style interface */
typedef struct INetCfgComponentNotifyGlobalVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
INetCfgComponentNotifyGlobal * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
INetCfgComponentNotifyGlobal * This);
ULONG ( STDMETHODCALLTYPE *Release )(
INetCfgComponentNotifyGlobal * This);
HRESULT ( STDMETHODCALLTYPE *GetSupportedNotifications )(
INetCfgComponentNotifyGlobal * This,
/* [annotation][out] */
__out DWORD *dwNotifications);
HRESULT ( STDMETHODCALLTYPE *SysQueryBindingPath )(
INetCfgComponentNotifyGlobal * This,
/* [annotation][in] */
__in DWORD dwChangeFlag,
/* [annotation][in] */
__in INetCfgBindingPath *pIPath);
HRESULT ( STDMETHODCALLTYPE *SysNotifyBindingPath )(
INetCfgComponentNotifyGlobal * This,
/* [annotation][in] */
__in DWORD dwChangeFlag,
/* [annotation][in] */
__in INetCfgBindingPath *pIPath);
HRESULT ( STDMETHODCALLTYPE *SysNotifyComponent )(
INetCfgComponentNotifyGlobal * This,
/* [annotation][in] */
__in DWORD dwChangeFlag,
/* [annotation][in] */
__in INetCfgComponent *pIComp);
END_INTERFACE
} INetCfgComponentNotifyGlobalVtbl;
interface INetCfgComponentNotifyGlobal
{
CONST_VTBL struct INetCfgComponentNotifyGlobalVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define INetCfgComponentNotifyGlobal_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define INetCfgComponentNotifyGlobal_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define INetCfgComponentNotifyGlobal_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define INetCfgComponentNotifyGlobal_GetSupportedNotifications(This,dwNotifications) \
( (This)->lpVtbl -> GetSupportedNotifications(This,dwNotifications) )
#define INetCfgComponentNotifyGlobal_SysQueryBindingPath(This,dwChangeFlag,pIPath) \
( (This)->lpVtbl -> SysQueryBindingPath(This,dwChangeFlag,pIPath) )
#define INetCfgComponentNotifyGlobal_SysNotifyBindingPath(This,dwChangeFlag,pIPath) \
( (This)->lpVtbl -> SysNotifyBindingPath(This,dwChangeFlag,pIPath) )
#define INetCfgComponentNotifyGlobal_SysNotifyComponent(This,dwChangeFlag,pIComp) \
( (This)->lpVtbl -> SysNotifyComponent(This,dwChangeFlag,pIComp) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __INetCfgComponentNotifyGlobal_INTERFACE_DEFINED__ */
#ifndef __INetCfgComponentUpperEdge_INTERFACE_DEFINED__
#define __INetCfgComponentUpperEdge_INTERFACE_DEFINED__
/* interface INetCfgComponentUpperEdge */
/* [unique][uuid][object][local] */
EXTERN_C const IID IID_INetCfgComponentUpperEdge;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("932238e4-bea1-11d0-9298-00c04fc99dcf")
INetCfgComponentUpperEdge : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetInterfaceIdsForAdapter(
/* [annotation][in] */
__in INetCfgComponent *pAdapter,
/* [annotation][out] */
__out DWORD *pdwNumInterfaces,
/* [annotation][out] */
__deref_out_opt GUID **ppguidInterfaceIds) = 0;
virtual HRESULT STDMETHODCALLTYPE AddInterfacesToAdapter(
/* [annotation][in] */
__in INetCfgComponent *pAdapter,
/* [annotation][in] */
__in DWORD dwNumInterfaces) = 0;
virtual HRESULT STDMETHODCALLTYPE RemoveInterfacesFromAdapter(
/* [annotation][in] */
__in INetCfgComponent *pAdapter,
/* [annotation][in] */
__in DWORD dwNumInterfaces,
/* [annotation][in] */
__in const GUID *pguidInterfaceIds) = 0;
};
#else /* C style interface */
typedef struct INetCfgComponentUpperEdgeVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
INetCfgComponentUpperEdge * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
INetCfgComponentUpperEdge * This);
ULONG ( STDMETHODCALLTYPE *Release )(
INetCfgComponentUpperEdge * This);
HRESULT ( STDMETHODCALLTYPE *GetInterfaceIdsForAdapter )(
INetCfgComponentUpperEdge * This,
/* [annotation][in] */
__in INetCfgComponent *pAdapter,
/* [annotation][out] */
__out DWORD *pdwNumInterfaces,
/* [annotation][out] */
__deref_out_opt GUID **ppguidInterfaceIds);
HRESULT ( STDMETHODCALLTYPE *AddInterfacesToAdapter )(
INetCfgComponentUpperEdge * This,
/* [annotation][in] */
__in INetCfgComponent *pAdapter,
/* [annotation][in] */
__in DWORD dwNumInterfaces);
HRESULT ( STDMETHODCALLTYPE *RemoveInterfacesFromAdapter )(
INetCfgComponentUpperEdge * This,
/* [annotation][in] */
__in INetCfgComponent *pAdapter,
/* [annotation][in] */
__in DWORD dwNumInterfaces,
/* [annotation][in] */
__in const GUID *pguidInterfaceIds);
END_INTERFACE
} INetCfgComponentUpperEdgeVtbl;
interface INetCfgComponentUpperEdge
{
CONST_VTBL struct INetCfgComponentUpperEdgeVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define INetCfgComponentUpperEdge_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define INetCfgComponentUpperEdge_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define INetCfgComponentUpperEdge_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define INetCfgComponentUpperEdge_GetInterfaceIdsForAdapter(This,pAdapter,pdwNumInterfaces,ppguidInterfaceIds) \
( (This)->lpVtbl -> GetInterfaceIdsForAdapter(This,pAdapter,pdwNumInterfaces,ppguidInterfaceIds) )
#define INetCfgComponentUpperEdge_AddInterfacesToAdapter(This,pAdapter,dwNumInterfaces) \
( (This)->lpVtbl -> AddInterfacesToAdapter(This,pAdapter,dwNumInterfaces) )
#define INetCfgComponentUpperEdge_RemoveInterfacesFromAdapter(This,pAdapter,dwNumInterfaces,pguidInterfaceIds) \
( (This)->lpVtbl -> RemoveInterfacesFromAdapter(This,pAdapter,dwNumInterfaces,pguidInterfaceIds) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __INetCfgComponentUpperEdge_INTERFACE_DEFINED__ */
#ifndef __INetLanConnectionUiInfo_INTERFACE_DEFINED__
#define __INetLanConnectionUiInfo_INTERFACE_DEFINED__
/* interface INetLanConnectionUiInfo */
/* [unique][uuid][object] */
EXTERN_C const IID IID_INetLanConnectionUiInfo;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("C08956A6-1CD3-11D1-B1C5-00805FC1270E")
INetLanConnectionUiInfo : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetDeviceGuid(
/* [out] */ __RPC__out GUID *pguid) = 0;
};
#else /* C style interface */
typedef struct INetLanConnectionUiInfoVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in INetLanConnectionUiInfo * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in INetLanConnectionUiInfo * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in INetLanConnectionUiInfo * This);
HRESULT ( STDMETHODCALLTYPE *GetDeviceGuid )(
__RPC__in INetLanConnectionUiInfo * This,
/* [out] */ __RPC__out GUID *pguid);
END_INTERFACE
} INetLanConnectionUiInfoVtbl;
interface INetLanConnectionUiInfo
{
CONST_VTBL struct INetLanConnectionUiInfoVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define INetLanConnectionUiInfo_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define INetLanConnectionUiInfo_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define INetLanConnectionUiInfo_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define INetLanConnectionUiInfo_GetDeviceGuid(This,pguid) \
( (This)->lpVtbl -> GetDeviceGuid(This,pguid) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __INetLanConnectionUiInfo_INTERFACE_DEFINED__ */
#ifndef __INetRasConnectionIpUiInfo_INTERFACE_DEFINED__
#define __INetRasConnectionIpUiInfo_INTERFACE_DEFINED__
/* interface INetRasConnectionIpUiInfo */
/* [unique][uuid][object] */
typedef
enum tagRASCON_IPUI_FLAGS
{ RCUIF_VPN = 0x1,
RCUIF_DEMAND_DIAL = 0x2,
RCUIF_NOT_ADMIN = 0x4,
RCUIF_USE_IPv4_STATICADDRESS = 0x8,
RCUIF_USE_IPv4_NAME_SERVERS = 0x10,
RCUIF_USE_IPv4_REMOTE_GATEWAY = 0x20,
RCUIF_USE_IPv4_EXPLICIT_METRIC = 0x40,
RCUIF_USE_HEADER_COMPRESSION = 0x80,
RCUIF_USE_DISABLE_REGISTER_DNS = 0x100,
RCUIF_USE_PRIVATE_DNS_SUFFIX = 0x200,
RCUIF_ENABLE_NBT = 0x400,
RCUIF_USE_IPv6_STATICADDRESS = 0x800,
RCUIF_USE_IPv6_NAME_SERVERS = 0x1000,
RCUIF_USE_IPv6_REMOTE_GATEWAY = 0x2000,
RCUIF_USE_IPv6_EXPLICIT_METRIC = 0x4000,
RCUIF_DISABLE_CLASS_BASED_ROUTE = 0x8000
} RASCON_UIINFO_FLAGS;
typedef struct tagRASCON_IPUI
{
GUID guidConnection;
BOOL fIPv6Cfg;
DWORD dwFlags;
WCHAR pszwIpAddr[ 16 ];
WCHAR pszwDnsAddr[ 16 ];
WCHAR pszwDns2Addr[ 16 ];
WCHAR pszwWinsAddr[ 16 ];
WCHAR pszwWins2Addr[ 16 ];
WCHAR pszwDnsSuffix[ 256 ];
WCHAR pszwIpv6Addr[ 65 ];
DWORD dwIpv6PrefixLength;
WCHAR pszwIpv6DnsAddr[ 65 ];
WCHAR pszwIpv6Dns2Addr[ 65 ];
DWORD dwIPv4InfMetric;
DWORD dwIPv6InfMetric;
} RASCON_IPUI;
EXTERN_C const IID IID_INetRasConnectionIpUiInfo;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("FAEDCF58-31FE-11D1-AAD2-00805FC1270E")
INetRasConnectionIpUiInfo : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetUiInfo(
/* [out] */ __RPC__out RASCON_IPUI *pInfo) = 0;
};
#else /* C style interface */
typedef struct INetRasConnectionIpUiInfoVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
__RPC__in INetRasConnectionIpUiInfo * This,
/* [in] */ __RPC__in REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
__RPC__in INetRasConnectionIpUiInfo * This);
ULONG ( STDMETHODCALLTYPE *Release )(
__RPC__in INetRasConnectionIpUiInfo * This);
HRESULT ( STDMETHODCALLTYPE *GetUiInfo )(
__RPC__in INetRasConnectionIpUiInfo * This,
/* [out] */ __RPC__out RASCON_IPUI *pInfo);
END_INTERFACE
} INetRasConnectionIpUiInfoVtbl;
interface INetRasConnectionIpUiInfo
{
CONST_VTBL struct INetRasConnectionIpUiInfoVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define INetRasConnectionIpUiInfo_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define INetRasConnectionIpUiInfo_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define INetRasConnectionIpUiInfo_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define INetRasConnectionIpUiInfo_GetUiInfo(This,pInfo) \
( (This)->lpVtbl -> GetUiInfo(This,pInfo) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __INetRasConnectionIpUiInfo_INTERFACE_DEFINED__ */
#ifndef __INetCfgComponentSysPrep_INTERFACE_DEFINED__
#define __INetCfgComponentSysPrep_INTERFACE_DEFINED__
/* interface INetCfgComponentSysPrep */
/* [unique][uuid][object][local] */
EXTERN_C const IID IID_INetCfgComponentSysPrep;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("C0E8AE9A-306E-11D1-AACF-00805FC1270E")
INetCfgComponentSysPrep : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE SaveAdapterParameters(
/* [annotation][in] */
__in INetCfgSysPrep *pncsp,
/* [annotation][in] */
__in LPCWSTR pszwAnswerSections,
/* [annotation][in] */
__in GUID *pAdapterInstanceGuid) = 0;
virtual HRESULT STDMETHODCALLTYPE RestoreAdapterParameters(
/* [annotation][in] */
__in LPCWSTR pszwAnswerFile,
/* [annotation][in] */
__in LPCWSTR pszwAnswerSection,
/* [annotation][in] */
__in GUID *pAdapterInstanceGuid) = 0;
};
#else /* C style interface */
typedef struct INetCfgComponentSysPrepVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
INetCfgComponentSysPrep * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
INetCfgComponentSysPrep * This);
ULONG ( STDMETHODCALLTYPE *Release )(
INetCfgComponentSysPrep * This);
HRESULT ( STDMETHODCALLTYPE *SaveAdapterParameters )(
INetCfgComponentSysPrep * This,
/* [annotation][in] */
__in INetCfgSysPrep *pncsp,
/* [annotation][in] */
__in LPCWSTR pszwAnswerSections,
/* [annotation][in] */
__in GUID *pAdapterInstanceGuid);
HRESULT ( STDMETHODCALLTYPE *RestoreAdapterParameters )(
INetCfgComponentSysPrep * This,
/* [annotation][in] */
__in LPCWSTR pszwAnswerFile,
/* [annotation][in] */
__in LPCWSTR pszwAnswerSection,
/* [annotation][in] */
__in GUID *pAdapterInstanceGuid);
END_INTERFACE
} INetCfgComponentSysPrepVtbl;
interface INetCfgComponentSysPrep
{
CONST_VTBL struct INetCfgComponentSysPrepVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define INetCfgComponentSysPrep_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define INetCfgComponentSysPrep_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define INetCfgComponentSysPrep_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define INetCfgComponentSysPrep_SaveAdapterParameters(This,pncsp,pszwAnswerSections,pAdapterInstanceGuid) \
( (This)->lpVtbl -> SaveAdapterParameters(This,pncsp,pszwAnswerSections,pAdapterInstanceGuid) )
#define INetCfgComponentSysPrep_RestoreAdapterParameters(This,pszwAnswerFile,pszwAnswerSection,pAdapterInstanceGuid) \
( (This)->lpVtbl -> RestoreAdapterParameters(This,pszwAnswerFile,pszwAnswerSection,pAdapterInstanceGuid) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __INetCfgComponentSysPrep_INTERFACE_DEFINED__ */
/* Additional Prototypes for ALL interfaces */
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 7.00.0555 */
/* Compiler settings for netcfgx.idl:
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
/* @@MIDL_FILE_HEADING( ) */
#pragma warning( disable: 4049 ) /* more than 64k source lines */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 500
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCSAL_H_VERSION__
#define __REQUIRED_RPCSAL_H_VERSION__ 100
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif // __RPCNDR_H_VERSION__
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __netcfgx_h__
#define __netcfgx_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifndef __IEnumNetCfgBindingInterface_FWD_DEFINED__
#define __IEnumNetCfgBindingInterface_FWD_DEFINED__
typedef interface IEnumNetCfgBindingInterface IEnumNetCfgBindingInterface;
#endif /* __IEnumNetCfgBindingInterface_FWD_DEFINED__ */
#ifndef __IEnumNetCfgBindingPath_FWD_DEFINED__
#define __IEnumNetCfgBindingPath_FWD_DEFINED__
typedef interface IEnumNetCfgBindingPath IEnumNetCfgBindingPath;
#endif /* __IEnumNetCfgBindingPath_FWD_DEFINED__ */
#ifndef __IEnumNetCfgComponent_FWD_DEFINED__
#define __IEnumNetCfgComponent_FWD_DEFINED__
typedef interface IEnumNetCfgComponent IEnumNetCfgComponent;
#endif /* __IEnumNetCfgComponent_FWD_DEFINED__ */
#ifndef __INetCfg_FWD_DEFINED__
#define __INetCfg_FWD_DEFINED__
typedef interface INetCfg INetCfg;
#endif /* __INetCfg_FWD_DEFINED__ */
#ifndef __INetCfgLock_FWD_DEFINED__
#define __INetCfgLock_FWD_DEFINED__
typedef interface INetCfgLock INetCfgLock;
#endif /* __INetCfgLock_FWD_DEFINED__ */
#ifndef __INetCfgBindingInterface_FWD_DEFINED__
#define __INetCfgBindingInterface_FWD_DEFINED__
typedef interface INetCfgBindingInterface INetCfgBindingInterface;
#endif /* __INetCfgBindingInterface_FWD_DEFINED__ */
#ifndef __INetCfgBindingPath_FWD_DEFINED__
#define __INetCfgBindingPath_FWD_DEFINED__
typedef interface INetCfgBindingPath INetCfgBindingPath;
#endif /* __INetCfgBindingPath_FWD_DEFINED__ */
#ifndef __INetCfgClass_FWD_DEFINED__
#define __INetCfgClass_FWD_DEFINED__
typedef interface INetCfgClass INetCfgClass;
#endif /* __INetCfgClass_FWD_DEFINED__ */
#ifndef __INetCfgClassSetup_FWD_DEFINED__
#define __INetCfgClassSetup_FWD_DEFINED__
typedef interface INetCfgClassSetup INetCfgClassSetup;
#endif /* __INetCfgClassSetup_FWD_DEFINED__ */
#ifndef __INetCfgComponent_FWD_DEFINED__
#define __INetCfgComponent_FWD_DEFINED__
typedef interface INetCfgComponent INetCfgComponent;
#endif /* __INetCfgComponent_FWD_DEFINED__ */
#ifndef __INetCfgComponentBindings_FWD_DEFINED__
#define __INetCfgComponentBindings_FWD_DEFINED__
typedef interface INetCfgComponentBindings INetCfgComponentBindings;
#endif /* __INetCfgComponentBindings_FWD_DEFINED__ */
#ifndef __INetCfgSysPrep_FWD_DEFINED__
#define __INetCfgSysPrep_FWD_DEFINED__
typedef interface INetCfgSysPrep INetCfgSysPrep;
#endif /* __INetCfgSysPrep_FWD_DEFINED__ */
/* header files for imported files */
#include "unknwn.h"
#include "prsht.h"
#ifdef __cplusplus
extern "C"{
#endif
/* interface __MIDL_itf_netcfgx_0000_0000 */
/* [local] */
//+-------------------------------------------------------------------------
//
// Microsoft Windows
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//--------------------------------------------------------------------------
#if ( _MSC_VER >= 800 )
#pragma warning(disable:4201)
#endif
EXTERN_C const CLSID CLSID_CNetCfg;
#define NETCFG_E_ALREADY_INITIALIZED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA020)
#define NETCFG_E_NOT_INITIALIZED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA021)
#define NETCFG_E_IN_USE MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA022)
#define NETCFG_E_NO_WRITE_LOCK MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA024)
#define NETCFG_E_NEED_REBOOT MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA025)
#define NETCFG_E_ACTIVE_RAS_CONNECTIONS MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA026)
#define NETCFG_E_ADAPTER_NOT_FOUND MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA027)
#define NETCFG_E_COMPONENT_REMOVED_PENDING_REBOOT MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA028)
#define NETCFG_E_MAX_FILTER_LIMIT MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA029)
#define NETCFG_S_REBOOT MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0xA020)
#define NETCFG_S_DISABLE_QUERY MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0xA022)
#define NETCFG_S_STILL_REFERENCED MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0xA023)
#define NETCFG_S_CAUSED_SETUP_CHANGE MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0xA024)
#define NETCFG_S_COMMIT_NOW MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0xA025)
#define NETCFG_CLIENT_CID_MS_MSClient TEXT("ms_msclient")
#define NETCFG_SERVICE_CID_MS_SERVER TEXT("ms_server")
#define NETCFG_SERVICE_CID_MS_NETBIOS TEXT("ms_netbios")
#define NETCFG_SERVICE_CID_MS_PSCHED TEXT("ms_pschedpc")
#define NETCFG_SERVICE_CID_MS_WLBS TEXT("ms_wlbs")
#define NETCFG_TRANS_CID_MS_APPLETALK TEXT("ms_appletalk")
#define NETCFG_TRANS_CID_MS_NETBEUI TEXT("ms_netbeui")
#define NETCFG_TRANS_CID_MS_NETMON TEXT("ms_netmon")
#define NETCFG_TRANS_CID_MS_NWIPX TEXT("ms_nwipx")
#define NETCFG_TRANS_CID_MS_NWSPX TEXT("ms_nwspx")
#define NETCFG_TRANS_CID_MS_TCPIP TEXT("ms_tcpip")
extern RPC_IF_HANDLE __MIDL_itf_netcfgx_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_netcfgx_0000_0000_v0_0_s_ifspec;
#ifndef __IEnumNetCfgBindingInterface_INTERFACE_DEFINED__
#define __IEnumNetCfgBindingInterface_INTERFACE_DEFINED__
/* interface IEnumNetCfgBindingInterface */
/* [unique][uuid][object][local] */
EXTERN_C const IID IID_IEnumNetCfgBindingInterface;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("C0E8AE90-306E-11D1-AACF-00805FC1270E")
IEnumNetCfgBindingInterface : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Next(
/* [annotation][in] */
__in ULONG celt,
/* [annotation][length_is][size_is][out] */
__out_ecount(celt) INetCfgBindingInterface **rgelt,
/* [annotation][out] */
__out_opt ULONG *pceltFetched) = 0;
virtual HRESULT STDMETHODCALLTYPE Skip(
/* [annotation][in] */
__in ULONG celt) = 0;
virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0;
virtual HRESULT STDMETHODCALLTYPE Clone(
/* [annotation][out] */
__out IEnumNetCfgBindingInterface **ppenum) = 0;
};
#else /* C style interface */
typedef struct IEnumNetCfgBindingInterfaceVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IEnumNetCfgBindingInterface * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IEnumNetCfgBindingInterface * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IEnumNetCfgBindingInterface * This);
HRESULT ( STDMETHODCALLTYPE *Next )(
IEnumNetCfgBindingInterface * This,
/* [annotation][in] */
__in ULONG celt,
/* [annotation][length_is][size_is][out] */
__out_ecount(celt) INetCfgBindingInterface **rgelt,
/* [annotation][out] */
__out_opt ULONG *pceltFetched);
HRESULT ( STDMETHODCALLTYPE *Skip )(
IEnumNetCfgBindingInterface * This,
/* [annotation][in] */
__in ULONG celt);
HRESULT ( STDMETHODCALLTYPE *Reset )(
IEnumNetCfgBindingInterface * This);
HRESULT ( STDMETHODCALLTYPE *Clone )(
IEnumNetCfgBindingInterface * This,
/* [annotation][out] */
__out IEnumNetCfgBindingInterface **ppenum);
END_INTERFACE
} IEnumNetCfgBindingInterfaceVtbl;
interface IEnumNetCfgBindingInterface
{
CONST_VTBL struct IEnumNetCfgBindingInterfaceVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IEnumNetCfgBindingInterface_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IEnumNetCfgBindingInterface_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IEnumNetCfgBindingInterface_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IEnumNetCfgBindingInterface_Next(This,celt,rgelt,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) )
#define IEnumNetCfgBindingInterface_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
#define IEnumNetCfgBindingInterface_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
#define IEnumNetCfgBindingInterface_Clone(This,ppenum) \
( (This)->lpVtbl -> Clone(This,ppenum) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IEnumNetCfgBindingInterface_INTERFACE_DEFINED__ */
#ifndef __IEnumNetCfgBindingPath_INTERFACE_DEFINED__
#define __IEnumNetCfgBindingPath_INTERFACE_DEFINED__
/* interface IEnumNetCfgBindingPath */
/* [unique][uuid][object][local] */
EXTERN_C const IID IID_IEnumNetCfgBindingPath;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("C0E8AE91-306E-11D1-AACF-00805FC1270E")
IEnumNetCfgBindingPath : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Next(
/* [annotation][in] */
__in ULONG celt,
/* [annotation][length_is][size_is][out] */
__out_ecount(celt) INetCfgBindingPath **rgelt,
/* [annotation][out] */
__out ULONG *pceltFetched) = 0;
virtual HRESULT STDMETHODCALLTYPE Skip(
/* [annotation][in] */
__in ULONG celt) = 0;
virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0;
virtual HRESULT STDMETHODCALLTYPE Clone(
/* [annotation][out] */
__out IEnumNetCfgBindingPath **ppenum) = 0;
};
#else /* C style interface */
typedef struct IEnumNetCfgBindingPathVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IEnumNetCfgBindingPath * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IEnumNetCfgBindingPath * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IEnumNetCfgBindingPath * This);
HRESULT ( STDMETHODCALLTYPE *Next )(
IEnumNetCfgBindingPath * This,
/* [annotation][in] */
__in ULONG celt,
/* [annotation][length_is][size_is][out] */
__out_ecount(celt) INetCfgBindingPath **rgelt,
/* [annotation][out] */
__out ULONG *pceltFetched);
HRESULT ( STDMETHODCALLTYPE *Skip )(
IEnumNetCfgBindingPath * This,
/* [annotation][in] */
__in ULONG celt);
HRESULT ( STDMETHODCALLTYPE *Reset )(
IEnumNetCfgBindingPath * This);
HRESULT ( STDMETHODCALLTYPE *Clone )(
IEnumNetCfgBindingPath * This,
/* [annotation][out] */
__out IEnumNetCfgBindingPath **ppenum);
END_INTERFACE
} IEnumNetCfgBindingPathVtbl;
interface IEnumNetCfgBindingPath
{
CONST_VTBL struct IEnumNetCfgBindingPathVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IEnumNetCfgBindingPath_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IEnumNetCfgBindingPath_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IEnumNetCfgBindingPath_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IEnumNetCfgBindingPath_Next(This,celt,rgelt,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) )
#define IEnumNetCfgBindingPath_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
#define IEnumNetCfgBindingPath_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
#define IEnumNetCfgBindingPath_Clone(This,ppenum) \
( (This)->lpVtbl -> Clone(This,ppenum) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IEnumNetCfgBindingPath_INTERFACE_DEFINED__ */
#ifndef __IEnumNetCfgComponent_INTERFACE_DEFINED__
#define __IEnumNetCfgComponent_INTERFACE_DEFINED__
/* interface IEnumNetCfgComponent */
/* [unique][uuid][object][local] */
EXTERN_C const IID IID_IEnumNetCfgComponent;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("C0E8AE92-306E-11D1-AACF-00805FC1270E")
IEnumNetCfgComponent : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Next(
/* [annotation][in] */
__in ULONG celt,
/* [annotation][length_is][size_is][out] */
__out_ecount(celt) INetCfgComponent **rgelt,
/* [annotation][out] */
__out ULONG *pceltFetched) = 0;
virtual HRESULT STDMETHODCALLTYPE Skip(
/* [annotation][in] */
__in ULONG celt) = 0;
virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0;
virtual HRESULT STDMETHODCALLTYPE Clone(
/* [annotation][out] */
__out IEnumNetCfgComponent **ppenum) = 0;
};
#else /* C style interface */
typedef struct IEnumNetCfgComponentVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IEnumNetCfgComponent * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IEnumNetCfgComponent * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IEnumNetCfgComponent * This);
HRESULT ( STDMETHODCALLTYPE *Next )(
IEnumNetCfgComponent * This,
/* [annotation][in] */
__in ULONG celt,
/* [annotation][length_is][size_is][out] */
__out_ecount(celt) INetCfgComponent **rgelt,
/* [annotation][out] */
__out ULONG *pceltFetched);
HRESULT ( STDMETHODCALLTYPE *Skip )(
IEnumNetCfgComponent * This,
/* [annotation][in] */
__in ULONG celt);
HRESULT ( STDMETHODCALLTYPE *Reset )(
IEnumNetCfgComponent * This);
HRESULT ( STDMETHODCALLTYPE *Clone )(
IEnumNetCfgComponent * This,
/* [annotation][out] */
__out IEnumNetCfgComponent **ppenum);
END_INTERFACE
} IEnumNetCfgComponentVtbl;
interface IEnumNetCfgComponent
{
CONST_VTBL struct IEnumNetCfgComponentVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IEnumNetCfgComponent_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IEnumNetCfgComponent_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IEnumNetCfgComponent_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IEnumNetCfgComponent_Next(This,celt,rgelt,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) )
#define IEnumNetCfgComponent_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
#define IEnumNetCfgComponent_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
#define IEnumNetCfgComponent_Clone(This,ppenum) \
( (This)->lpVtbl -> Clone(This,ppenum) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IEnumNetCfgComponent_INTERFACE_DEFINED__ */
#ifndef __INetCfg_INTERFACE_DEFINED__
#define __INetCfg_INTERFACE_DEFINED__
/* interface INetCfg */
/* [unique][uuid][object][local] */
EXTERN_C const IID IID_INetCfg;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("C0E8AE93-306E-11D1-AACF-00805FC1270E")
INetCfg : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Initialize(
/* [annotation][in] */
__in PVOID pvReserved) = 0;
virtual HRESULT STDMETHODCALLTYPE Uninitialize( void) = 0;
virtual HRESULT STDMETHODCALLTYPE Apply( void) = 0;
virtual HRESULT STDMETHODCALLTYPE Cancel( void) = 0;
virtual HRESULT STDMETHODCALLTYPE EnumComponents(
/* [annotation][in] */
__in const GUID *pguidClass,
/* [annotation][out] */
__deref_out_opt IEnumNetCfgComponent **ppenumComponent) = 0;
virtual HRESULT STDMETHODCALLTYPE FindComponent(
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pszwInfId,
/* [annotation][out] */
__deref_out_opt INetCfgComponent **pComponent) = 0;
virtual HRESULT STDMETHODCALLTYPE QueryNetCfgClass(
/* [annotation][in] */
__in const GUID *pguidClass,
/* [annotation][in] */
__in REFIID riid,
/* [annotation][iid_is][out] */
__deref_out_opt void **ppvObject) = 0;
};
#else /* C style interface */
typedef struct INetCfgVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
INetCfg * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
INetCfg * This);
ULONG ( STDMETHODCALLTYPE *Release )(
INetCfg * This);
HRESULT ( STDMETHODCALLTYPE *Initialize )(
INetCfg * This,
/* [annotation][in] */
__in PVOID pvReserved);
HRESULT ( STDMETHODCALLTYPE *Uninitialize )(
INetCfg * This);
HRESULT ( STDMETHODCALLTYPE *Apply )(
INetCfg * This);
HRESULT ( STDMETHODCALLTYPE *Cancel )(
INetCfg * This);
HRESULT ( STDMETHODCALLTYPE *EnumComponents )(
INetCfg * This,
/* [annotation][in] */
__in const GUID *pguidClass,
/* [annotation][out] */
__deref_out_opt IEnumNetCfgComponent **ppenumComponent);
HRESULT ( STDMETHODCALLTYPE *FindComponent )(
INetCfg * This,
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pszwInfId,
/* [annotation][out] */
__deref_out_opt INetCfgComponent **pComponent);
HRESULT ( STDMETHODCALLTYPE *QueryNetCfgClass )(
INetCfg * This,
/* [annotation][in] */
__in const GUID *pguidClass,
/* [annotation][in] */
__in REFIID riid,
/* [annotation][iid_is][out] */
__deref_out_opt void **ppvObject);
END_INTERFACE
} INetCfgVtbl;
interface INetCfg
{
CONST_VTBL struct INetCfgVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define INetCfg_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define INetCfg_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define INetCfg_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define INetCfg_Initialize(This,pvReserved) \
( (This)->lpVtbl -> Initialize(This,pvReserved) )
#define INetCfg_Uninitialize(This) \
( (This)->lpVtbl -> Uninitialize(This) )
#define INetCfg_Apply(This) \
( (This)->lpVtbl -> Apply(This) )
#define INetCfg_Cancel(This) \
( (This)->lpVtbl -> Cancel(This) )
#define INetCfg_EnumComponents(This,pguidClass,ppenumComponent) \
( (This)->lpVtbl -> EnumComponents(This,pguidClass,ppenumComponent) )
#define INetCfg_FindComponent(This,pszwInfId,pComponent) \
( (This)->lpVtbl -> FindComponent(This,pszwInfId,pComponent) )
#define INetCfg_QueryNetCfgClass(This,pguidClass,riid,ppvObject) \
( (This)->lpVtbl -> QueryNetCfgClass(This,pguidClass,riid,ppvObject) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __INetCfg_INTERFACE_DEFINED__ */
#ifndef __INetCfgLock_INTERFACE_DEFINED__
#define __INetCfgLock_INTERFACE_DEFINED__
/* interface INetCfgLock */
/* [unique][uuid][object][local] */
EXTERN_C const IID IID_INetCfgLock;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("C0E8AE9F-306E-11D1-AACF-00805FC1270E")
INetCfgLock : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE AcquireWriteLock(
/* [annotation][in] */
__in DWORD cmsTimeout,
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pszwClientDescription,
/* [annotation][string][out] */
__deref_out_opt LPWSTR *ppszwClientDescription) = 0;
virtual HRESULT STDMETHODCALLTYPE ReleaseWriteLock( void) = 0;
virtual HRESULT STDMETHODCALLTYPE IsWriteLocked(
/* [annotation][string][out] */
__deref_out __nullterminated LPWSTR *ppszwClientDescription) = 0;
};
#else /* C style interface */
typedef struct INetCfgLockVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
INetCfgLock * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
INetCfgLock * This);
ULONG ( STDMETHODCALLTYPE *Release )(
INetCfgLock * This);
HRESULT ( STDMETHODCALLTYPE *AcquireWriteLock )(
INetCfgLock * This,
/* [annotation][in] */
__in DWORD cmsTimeout,
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pszwClientDescription,
/* [annotation][string][out] */
__deref_out_opt LPWSTR *ppszwClientDescription);
HRESULT ( STDMETHODCALLTYPE *ReleaseWriteLock )(
INetCfgLock * This);
HRESULT ( STDMETHODCALLTYPE *IsWriteLocked )(
INetCfgLock * This,
/* [annotation][string][out] */
__deref_out __nullterminated LPWSTR *ppszwClientDescription);
END_INTERFACE
} INetCfgLockVtbl;
interface INetCfgLock
{
CONST_VTBL struct INetCfgLockVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define INetCfgLock_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define INetCfgLock_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define INetCfgLock_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define INetCfgLock_AcquireWriteLock(This,cmsTimeout,pszwClientDescription,ppszwClientDescription) \
( (This)->lpVtbl -> AcquireWriteLock(This,cmsTimeout,pszwClientDescription,ppszwClientDescription) )
#define INetCfgLock_ReleaseWriteLock(This) \
( (This)->lpVtbl -> ReleaseWriteLock(This) )
#define INetCfgLock_IsWriteLocked(This,ppszwClientDescription) \
( (This)->lpVtbl -> IsWriteLocked(This,ppszwClientDescription) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __INetCfgLock_INTERFACE_DEFINED__ */
#ifndef __INetCfgBindingInterface_INTERFACE_DEFINED__
#define __INetCfgBindingInterface_INTERFACE_DEFINED__
/* interface INetCfgBindingInterface */
/* [unique][uuid][object][local] */
EXTERN_C const IID IID_INetCfgBindingInterface;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("C0E8AE94-306E-11D1-AACF-00805FC1270E")
INetCfgBindingInterface : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetName(
/* [annotation][string][out] */
__deref_out LPWSTR *ppszwInterfaceName) = 0;
virtual HRESULT STDMETHODCALLTYPE GetUpperComponent(
/* [annotation][out] */
__deref_out_opt INetCfgComponent **ppnccItem) = 0;
virtual HRESULT STDMETHODCALLTYPE GetLowerComponent(
/* [annotation][out] */
__deref_out_opt INetCfgComponent **ppnccItem) = 0;
};
#else /* C style interface */
typedef struct INetCfgBindingInterfaceVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
INetCfgBindingInterface * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
INetCfgBindingInterface * This);
ULONG ( STDMETHODCALLTYPE *Release )(
INetCfgBindingInterface * This);
HRESULT ( STDMETHODCALLTYPE *GetName )(
INetCfgBindingInterface * This,
/* [annotation][string][out] */
__deref_out LPWSTR *ppszwInterfaceName);
HRESULT ( STDMETHODCALLTYPE *GetUpperComponent )(
INetCfgBindingInterface * This,
/* [annotation][out] */
__deref_out_opt INetCfgComponent **ppnccItem);
HRESULT ( STDMETHODCALLTYPE *GetLowerComponent )(
INetCfgBindingInterface * This,
/* [annotation][out] */
__deref_out_opt INetCfgComponent **ppnccItem);
END_INTERFACE
} INetCfgBindingInterfaceVtbl;
interface INetCfgBindingInterface
{
CONST_VTBL struct INetCfgBindingInterfaceVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define INetCfgBindingInterface_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define INetCfgBindingInterface_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define INetCfgBindingInterface_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define INetCfgBindingInterface_GetName(This,ppszwInterfaceName) \
( (This)->lpVtbl -> GetName(This,ppszwInterfaceName) )
#define INetCfgBindingInterface_GetUpperComponent(This,ppnccItem) \
( (This)->lpVtbl -> GetUpperComponent(This,ppnccItem) )
#define INetCfgBindingInterface_GetLowerComponent(This,ppnccItem) \
( (This)->lpVtbl -> GetLowerComponent(This,ppnccItem) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __INetCfgBindingInterface_INTERFACE_DEFINED__ */
#ifndef __INetCfgBindingPath_INTERFACE_DEFINED__
#define __INetCfgBindingPath_INTERFACE_DEFINED__
/* interface INetCfgBindingPath */
/* [unique][uuid][object][local] */
EXTERN_C const IID IID_INetCfgBindingPath;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("C0E8AE96-306E-11D1-AACF-00805FC1270E")
INetCfgBindingPath : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE IsSamePathAs(
/* [annotation][in] */
__in INetCfgBindingPath *pPath) = 0;
virtual HRESULT STDMETHODCALLTYPE IsSubPathOf(
/* [annotation][in] */
__in INetCfgBindingPath *pPath) = 0;
virtual HRESULT STDMETHODCALLTYPE IsEnabled( void) = 0;
virtual HRESULT STDMETHODCALLTYPE Enable(
/* [annotation][in] */
__in BOOL fEnable) = 0;
virtual HRESULT STDMETHODCALLTYPE GetPathToken(
/* [annotation][string][out] */
__deref_out __nullterminated LPWSTR *ppszwPathToken) = 0;
virtual HRESULT STDMETHODCALLTYPE GetOwner(
/* [annotation][out] */
__deref_out_opt INetCfgComponent **ppComponent) = 0;
virtual HRESULT STDMETHODCALLTYPE GetDepth(
/* [annotation][out] */
__out ULONG *pcInterfaces) = 0;
virtual HRESULT STDMETHODCALLTYPE EnumBindingInterfaces(
/* [annotation][out] */
__deref_out_opt IEnumNetCfgBindingInterface **ppenumInterface) = 0;
};
#else /* C style interface */
typedef struct INetCfgBindingPathVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
INetCfgBindingPath * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
INetCfgBindingPath * This);
ULONG ( STDMETHODCALLTYPE *Release )(
INetCfgBindingPath * This);
HRESULT ( STDMETHODCALLTYPE *IsSamePathAs )(
INetCfgBindingPath * This,
/* [annotation][in] */
__in INetCfgBindingPath *pPath);
HRESULT ( STDMETHODCALLTYPE *IsSubPathOf )(
INetCfgBindingPath * This,
/* [annotation][in] */
__in INetCfgBindingPath *pPath);
HRESULT ( STDMETHODCALLTYPE *IsEnabled )(
INetCfgBindingPath * This);
HRESULT ( STDMETHODCALLTYPE *Enable )(
INetCfgBindingPath * This,
/* [annotation][in] */
__in BOOL fEnable);
HRESULT ( STDMETHODCALLTYPE *GetPathToken )(
INetCfgBindingPath * This,
/* [annotation][string][out] */
__deref_out __nullterminated LPWSTR *ppszwPathToken);
HRESULT ( STDMETHODCALLTYPE *GetOwner )(
INetCfgBindingPath * This,
/* [annotation][out] */
__deref_out_opt INetCfgComponent **ppComponent);
HRESULT ( STDMETHODCALLTYPE *GetDepth )(
INetCfgBindingPath * This,
/* [annotation][out] */
__out ULONG *pcInterfaces);
HRESULT ( STDMETHODCALLTYPE *EnumBindingInterfaces )(
INetCfgBindingPath * This,
/* [annotation][out] */
__deref_out_opt IEnumNetCfgBindingInterface **ppenumInterface);
END_INTERFACE
} INetCfgBindingPathVtbl;
interface INetCfgBindingPath
{
CONST_VTBL struct INetCfgBindingPathVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define INetCfgBindingPath_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define INetCfgBindingPath_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define INetCfgBindingPath_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define INetCfgBindingPath_IsSamePathAs(This,pPath) \
( (This)->lpVtbl -> IsSamePathAs(This,pPath) )
#define INetCfgBindingPath_IsSubPathOf(This,pPath) \
( (This)->lpVtbl -> IsSubPathOf(This,pPath) )
#define INetCfgBindingPath_IsEnabled(This) \
( (This)->lpVtbl -> IsEnabled(This) )
#define INetCfgBindingPath_Enable(This,fEnable) \
( (This)->lpVtbl -> Enable(This,fEnable) )
#define INetCfgBindingPath_GetPathToken(This,ppszwPathToken) \
( (This)->lpVtbl -> GetPathToken(This,ppszwPathToken) )
#define INetCfgBindingPath_GetOwner(This,ppComponent) \
( (This)->lpVtbl -> GetOwner(This,ppComponent) )
#define INetCfgBindingPath_GetDepth(This,pcInterfaces) \
( (This)->lpVtbl -> GetDepth(This,pcInterfaces) )
#define INetCfgBindingPath_EnumBindingInterfaces(This,ppenumInterface) \
( (This)->lpVtbl -> EnumBindingInterfaces(This,ppenumInterface) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __INetCfgBindingPath_INTERFACE_DEFINED__ */
#ifndef __INetCfgClass_INTERFACE_DEFINED__
#define __INetCfgClass_INTERFACE_DEFINED__
/* interface INetCfgClass */
/* [unique][uuid][object][local] */
EXTERN_C const IID IID_INetCfgClass;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("C0E8AE97-306E-11D1-AACF-00805FC1270E")
INetCfgClass : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE FindComponent(
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pszwInfId,
/* [annotation][out] */
__deref_out_opt INetCfgComponent **ppnccItem) = 0;
virtual HRESULT STDMETHODCALLTYPE EnumComponents(
/* [annotation][out] */
__deref_out_opt IEnumNetCfgComponent **ppenumComponent) = 0;
};
#else /* C style interface */
typedef struct INetCfgClassVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
INetCfgClass * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
INetCfgClass * This);
ULONG ( STDMETHODCALLTYPE *Release )(
INetCfgClass * This);
HRESULT ( STDMETHODCALLTYPE *FindComponent )(
INetCfgClass * This,
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pszwInfId,
/* [annotation][out] */
__deref_out_opt INetCfgComponent **ppnccItem);
HRESULT ( STDMETHODCALLTYPE *EnumComponents )(
INetCfgClass * This,
/* [annotation][out] */
__deref_out_opt IEnumNetCfgComponent **ppenumComponent);
END_INTERFACE
} INetCfgClassVtbl;
interface INetCfgClass
{
CONST_VTBL struct INetCfgClassVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define INetCfgClass_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define INetCfgClass_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define INetCfgClass_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define INetCfgClass_FindComponent(This,pszwInfId,ppnccItem) \
( (This)->lpVtbl -> FindComponent(This,pszwInfId,ppnccItem) )
#define INetCfgClass_EnumComponents(This,ppenumComponent) \
( (This)->lpVtbl -> EnumComponents(This,ppenumComponent) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __INetCfgClass_INTERFACE_DEFINED__ */
#ifndef __INetCfgClassSetup_INTERFACE_DEFINED__
#define __INetCfgClassSetup_INTERFACE_DEFINED__
/* interface INetCfgClassSetup */
/* [unique][uuid][object][local] */
typedef
enum tagOBO_TOKEN_TYPE
{ OBO_USER = 1,
OBO_COMPONENT = 2,
OBO_SOFTWARE = 3
} OBO_TOKEN_TYPE;
typedef struct tagOBO_TOKEN
{
OBO_TOKEN_TYPE Type;
INetCfgComponent *pncc;
LPCWSTR pszwManufacturer;
LPCWSTR pszwProduct;
LPCWSTR pszwDisplayName;
BOOL fRegistered;
} OBO_TOKEN;
EXTERN_C const IID IID_INetCfgClassSetup;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("C0E8AE9D-306E-11D1-AACF-00805FC1270E")
INetCfgClassSetup : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE SelectAndInstall(
/* [annotation][in] */
__in HWND hwndParent,
/* [annotation][in] */
__in_opt OBO_TOKEN *pOboToken,
/* [annotation][out] */
__deref_out_opt INetCfgComponent **ppnccItem) = 0;
virtual HRESULT STDMETHODCALLTYPE Install(
/* [annotation][string][in] */
__in LPCWSTR pszwInfId,
/* [annotation][in] */
__in_opt OBO_TOKEN *pOboToken,
/* [annotation][in] */
__in_opt DWORD dwSetupFlags,
/* [annotation][in] */
__in_opt DWORD dwUpgradeFromBuildNo,
/* [annotation][string][in] */
__in_opt LPCWSTR pszwAnswerFile,
/* [annotation][string][in] */
__in_opt LPCWSTR pszwAnswerSections,
/* [annotation][out] */
__deref_out_opt INetCfgComponent **ppnccItem) = 0;
virtual HRESULT STDMETHODCALLTYPE DeInstall(
/* [annotation][in] */
__in INetCfgComponent *pComponent,
/* [annotation][in] */
__in_opt OBO_TOKEN *pOboToken,
/* [annotation][out] */
__deref_out_opt LPWSTR *pmszwRefs) = 0;
};
#else /* C style interface */
typedef struct INetCfgClassSetupVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
INetCfgClassSetup * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
INetCfgClassSetup * This);
ULONG ( STDMETHODCALLTYPE *Release )(
INetCfgClassSetup * This);
HRESULT ( STDMETHODCALLTYPE *SelectAndInstall )(
INetCfgClassSetup * This,
/* [annotation][in] */
__in HWND hwndParent,
/* [annotation][in] */
__in_opt OBO_TOKEN *pOboToken,
/* [annotation][out] */
__deref_out_opt INetCfgComponent **ppnccItem);
HRESULT ( STDMETHODCALLTYPE *Install )(
INetCfgClassSetup * This,
/* [annotation][string][in] */
__in LPCWSTR pszwInfId,
/* [annotation][in] */
__in_opt OBO_TOKEN *pOboToken,
/* [annotation][in] */
__in_opt DWORD dwSetupFlags,
/* [annotation][in] */
__in_opt DWORD dwUpgradeFromBuildNo,
/* [annotation][string][in] */
__in_opt LPCWSTR pszwAnswerFile,
/* [annotation][string][in] */
__in_opt LPCWSTR pszwAnswerSections,
/* [annotation][out] */
__deref_out_opt INetCfgComponent **ppnccItem);
HRESULT ( STDMETHODCALLTYPE *DeInstall )(
INetCfgClassSetup * This,
/* [annotation][in] */
__in INetCfgComponent *pComponent,
/* [annotation][in] */
__in_opt OBO_TOKEN *pOboToken,
/* [annotation][out] */
__deref_out_opt LPWSTR *pmszwRefs);
END_INTERFACE
} INetCfgClassSetupVtbl;
interface INetCfgClassSetup
{
CONST_VTBL struct INetCfgClassSetupVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define INetCfgClassSetup_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define INetCfgClassSetup_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define INetCfgClassSetup_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define INetCfgClassSetup_SelectAndInstall(This,hwndParent,pOboToken,ppnccItem) \
( (This)->lpVtbl -> SelectAndInstall(This,hwndParent,pOboToken,ppnccItem) )
#define INetCfgClassSetup_Install(This,pszwInfId,pOboToken,dwSetupFlags,dwUpgradeFromBuildNo,pszwAnswerFile,pszwAnswerSections,ppnccItem) \
( (This)->lpVtbl -> Install(This,pszwInfId,pOboToken,dwSetupFlags,dwUpgradeFromBuildNo,pszwAnswerFile,pszwAnswerSections,ppnccItem) )
#define INetCfgClassSetup_DeInstall(This,pComponent,pOboToken,pmszwRefs) \
( (This)->lpVtbl -> DeInstall(This,pComponent,pOboToken,pmszwRefs) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __INetCfgClassSetup_INTERFACE_DEFINED__ */
#ifndef __INetCfgComponent_INTERFACE_DEFINED__
#define __INetCfgComponent_INTERFACE_DEFINED__
/* interface INetCfgComponent */
/* [unique][uuid][object][local] */
typedef
enum tagCOMPONENT_CHARACTERISTICS
{ NCF_VIRTUAL = 0x1,
NCF_SOFTWARE_ENUMERATED = 0x2,
NCF_PHYSICAL = 0x4,
NCF_HIDDEN = 0x8,
NCF_NO_SERVICE = 0x10,
NCF_NOT_USER_REMOVABLE = 0x20,
NCF_MULTIPORT_INSTANCED_ADAPTER = 0x40,
NCF_HAS_UI = 0x80,
NCF_SINGLE_INSTANCE = 0x100,
NCF_FILTER = 0x400,
NCF_DONTEXPOSELOWER = 0x1000,
NCF_HIDE_BINDING = 0x2000,
NCF_NDIS_PROTOCOL = 0x4000,
NCF_FIXED_BINDING = 0x20000,
NCF_LW_FILTER = 0x40000
} COMPONENT_CHARACTERISTICS;
typedef
enum tagNCRP_FLAGS
{ NCRP_QUERY_PROPERTY_UI = 0x1,
NCRP_SHOW_PROPERTY_UI = 0x2
} NCRP_FLAGS;
EXTERN_C const IID IID_INetCfgComponent;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("C0E8AE99-306E-11D1-AACF-00805FC1270E")
INetCfgComponent : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetDisplayName(
/* [annotation][string][out] */
__deref_out_opt LPWSTR *ppszwDisplayName) = 0;
virtual HRESULT STDMETHODCALLTYPE SetDisplayName(
/* [annotation][string][in] */
__in LPCWSTR pszwDisplayName) = 0;
virtual HRESULT STDMETHODCALLTYPE GetHelpText(
/* [annotation][string][out] */
__deref_out_opt LPWSTR *pszwHelpText) = 0;
virtual HRESULT STDMETHODCALLTYPE GetId(
/* [annotation][string][out] */
__deref_out_opt LPWSTR *ppszwId) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCharacteristics(
/* [annotation][out] */
__out LPDWORD pdwCharacteristics) = 0;
virtual HRESULT STDMETHODCALLTYPE GetInstanceGuid(
/* [annotation][out] */
__out_opt GUID *pGuid) = 0;
virtual HRESULT STDMETHODCALLTYPE GetPnpDevNodeId(
/* [annotation][string][out] */
__deref_out_opt LPWSTR *ppszwDevNodeId) = 0;
virtual HRESULT STDMETHODCALLTYPE GetClassGuid(
/* [annotation][out] */
__out_opt GUID *pGuid) = 0;
virtual HRESULT STDMETHODCALLTYPE GetBindName(
/* [annotation][string][out] */
__deref_out_opt LPWSTR *ppszwBindName) = 0;
virtual HRESULT STDMETHODCALLTYPE GetDeviceStatus(
/* [annotation][out] */
__out ULONG *pulStatus) = 0;
virtual HRESULT STDMETHODCALLTYPE OpenParamKey(
/* [annotation][out] */
__deref_out_opt HKEY *phkey) = 0;
virtual HRESULT STDMETHODCALLTYPE RaisePropertyUi(
/* [annotation][in] */
__in_opt HWND hwndParent,
/* [annotation][in] */
__in DWORD dwFlags,
/* [annotation][in] */
__in_opt IUnknown *punkContext) = 0;
};
#else /* C style interface */
typedef struct INetCfgComponentVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
INetCfgComponent * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
INetCfgComponent * This);
ULONG ( STDMETHODCALLTYPE *Release )(
INetCfgComponent * This);
HRESULT ( STDMETHODCALLTYPE *GetDisplayName )(
INetCfgComponent * This,
/* [annotation][string][out] */
__deref_out_opt LPWSTR *ppszwDisplayName);
HRESULT ( STDMETHODCALLTYPE *SetDisplayName )(
INetCfgComponent * This,
/* [annotation][string][in] */
__in LPCWSTR pszwDisplayName);
HRESULT ( STDMETHODCALLTYPE *GetHelpText )(
INetCfgComponent * This,
/* [annotation][string][out] */
__deref_out_opt LPWSTR *pszwHelpText);
HRESULT ( STDMETHODCALLTYPE *GetId )(
INetCfgComponent * This,
/* [annotation][string][out] */
__deref_out_opt LPWSTR *ppszwId);
HRESULT ( STDMETHODCALLTYPE *GetCharacteristics )(
INetCfgComponent * This,
/* [annotation][out] */
__out LPDWORD pdwCharacteristics);
HRESULT ( STDMETHODCALLTYPE *GetInstanceGuid )(
INetCfgComponent * This,
/* [annotation][out] */
__out_opt GUID *pGuid);
HRESULT ( STDMETHODCALLTYPE *GetPnpDevNodeId )(
INetCfgComponent * This,
/* [annotation][string][out] */
__deref_out_opt LPWSTR *ppszwDevNodeId);
HRESULT ( STDMETHODCALLTYPE *GetClassGuid )(
INetCfgComponent * This,
/* [annotation][out] */
__out_opt GUID *pGuid);
HRESULT ( STDMETHODCALLTYPE *GetBindName )(
INetCfgComponent * This,
/* [annotation][string][out] */
__deref_out_opt LPWSTR *ppszwBindName);
HRESULT ( STDMETHODCALLTYPE *GetDeviceStatus )(
INetCfgComponent * This,
/* [annotation][out] */
__out ULONG *pulStatus);
HRESULT ( STDMETHODCALLTYPE *OpenParamKey )(
INetCfgComponent * This,
/* [annotation][out] */
__deref_out_opt HKEY *phkey);
HRESULT ( STDMETHODCALLTYPE *RaisePropertyUi )(
INetCfgComponent * This,
/* [annotation][in] */
__in_opt HWND hwndParent,
/* [annotation][in] */
__in DWORD dwFlags,
/* [annotation][in] */
__in_opt IUnknown *punkContext);
END_INTERFACE
} INetCfgComponentVtbl;
interface INetCfgComponent
{
CONST_VTBL struct INetCfgComponentVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define INetCfgComponent_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define INetCfgComponent_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define INetCfgComponent_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define INetCfgComponent_GetDisplayName(This,ppszwDisplayName) \
( (This)->lpVtbl -> GetDisplayName(This,ppszwDisplayName) )
#define INetCfgComponent_SetDisplayName(This,pszwDisplayName) \
( (This)->lpVtbl -> SetDisplayName(This,pszwDisplayName) )
#define INetCfgComponent_GetHelpText(This,pszwHelpText) \
( (This)->lpVtbl -> GetHelpText(This,pszwHelpText) )
#define INetCfgComponent_GetId(This,ppszwId) \
( (This)->lpVtbl -> GetId(This,ppszwId) )
#define INetCfgComponent_GetCharacteristics(This,pdwCharacteristics) \
( (This)->lpVtbl -> GetCharacteristics(This,pdwCharacteristics) )
#define INetCfgComponent_GetInstanceGuid(This,pGuid) \
( (This)->lpVtbl -> GetInstanceGuid(This,pGuid) )
#define INetCfgComponent_GetPnpDevNodeId(This,ppszwDevNodeId) \
( (This)->lpVtbl -> GetPnpDevNodeId(This,ppszwDevNodeId) )
#define INetCfgComponent_GetClassGuid(This,pGuid) \
( (This)->lpVtbl -> GetClassGuid(This,pGuid) )
#define INetCfgComponent_GetBindName(This,ppszwBindName) \
( (This)->lpVtbl -> GetBindName(This,ppszwBindName) )
#define INetCfgComponent_GetDeviceStatus(This,pulStatus) \
( (This)->lpVtbl -> GetDeviceStatus(This,pulStatus) )
#define INetCfgComponent_OpenParamKey(This,phkey) \
( (This)->lpVtbl -> OpenParamKey(This,phkey) )
#define INetCfgComponent_RaisePropertyUi(This,hwndParent,dwFlags,punkContext) \
( (This)->lpVtbl -> RaisePropertyUi(This,hwndParent,dwFlags,punkContext) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __INetCfgComponent_INTERFACE_DEFINED__ */
#ifndef __INetCfgComponentBindings_INTERFACE_DEFINED__
#define __INetCfgComponentBindings_INTERFACE_DEFINED__
/* interface INetCfgComponentBindings */
/* [unique][uuid][object][local] */
typedef
enum tagSUPPORTS_BINDING_INTERFACE_FLAGS
{ NCF_LOWER = 0x1,
NCF_UPPER = 0x2
} SUPPORTS_BINDING_INTERFACE_FLAGS;
typedef
enum tagENUM_BINDING_PATHS_FLAGS
{ EBP_ABOVE = 0x1,
EBP_BELOW = 0x2
} ENUM_BINDING_PATHS_FLAGS;
EXTERN_C const IID IID_INetCfgComponentBindings;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("C0E8AE9E-306E-11D1-AACF-00805FC1270E")
INetCfgComponentBindings : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE BindTo(
/* [annotation][in] */
__in INetCfgComponent *pnccItem) = 0;
virtual HRESULT STDMETHODCALLTYPE UnbindFrom(
/* [annotation][in] */
__in INetCfgComponent *pnccItem) = 0;
virtual HRESULT STDMETHODCALLTYPE SupportsBindingInterface(
/* [annotation][in] */
__in DWORD dwFlags,
/* [annotation][in] */
__in __nullterminated LPCWSTR pszwInterfaceName) = 0;
virtual HRESULT STDMETHODCALLTYPE IsBoundTo(
/* [annotation][in] */
__in INetCfgComponent *pnccItem) = 0;
virtual HRESULT STDMETHODCALLTYPE IsBindableTo(
/* [annotation][in] */
__in INetCfgComponent *pnccItem) = 0;
virtual HRESULT STDMETHODCALLTYPE EnumBindingPaths(
/* [annotation][in] */
__in DWORD dwFlags,
/* [annotation][out] */
__deref_out_opt IEnumNetCfgBindingPath **ppIEnum) = 0;
virtual HRESULT STDMETHODCALLTYPE MoveBefore(
/* [annotation][in] */
__in INetCfgBindingPath *pncbItemSrc,
/* [annotation][in] */
__in INetCfgBindingPath *pncbItemDest) = 0;
virtual HRESULT STDMETHODCALLTYPE MoveAfter(
/* [annotation][in] */
__in INetCfgBindingPath *pncbItemSrc,
/* [annotation][in] */
__in INetCfgBindingPath *pncbItemDest) = 0;
};
#else /* C style interface */
typedef struct INetCfgComponentBindingsVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
INetCfgComponentBindings * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
INetCfgComponentBindings * This);
ULONG ( STDMETHODCALLTYPE *Release )(
INetCfgComponentBindings * This);
HRESULT ( STDMETHODCALLTYPE *BindTo )(
INetCfgComponentBindings * This,
/* [annotation][in] */
__in INetCfgComponent *pnccItem);
HRESULT ( STDMETHODCALLTYPE *UnbindFrom )(
INetCfgComponentBindings * This,
/* [annotation][in] */
__in INetCfgComponent *pnccItem);
HRESULT ( STDMETHODCALLTYPE *SupportsBindingInterface )(
INetCfgComponentBindings * This,
/* [annotation][in] */
__in DWORD dwFlags,
/* [annotation][in] */
__in __nullterminated LPCWSTR pszwInterfaceName);
HRESULT ( STDMETHODCALLTYPE *IsBoundTo )(
INetCfgComponentBindings * This,
/* [annotation][in] */
__in INetCfgComponent *pnccItem);
HRESULT ( STDMETHODCALLTYPE *IsBindableTo )(
INetCfgComponentBindings * This,
/* [annotation][in] */
__in INetCfgComponent *pnccItem);
HRESULT ( STDMETHODCALLTYPE *EnumBindingPaths )(
INetCfgComponentBindings * This,
/* [annotation][in] */
__in DWORD dwFlags,
/* [annotation][out] */
__deref_out_opt IEnumNetCfgBindingPath **ppIEnum);
HRESULT ( STDMETHODCALLTYPE *MoveBefore )(
INetCfgComponentBindings * This,
/* [annotation][in] */
__in INetCfgBindingPath *pncbItemSrc,
/* [annotation][in] */
__in INetCfgBindingPath *pncbItemDest);
HRESULT ( STDMETHODCALLTYPE *MoveAfter )(
INetCfgComponentBindings * This,
/* [annotation][in] */
__in INetCfgBindingPath *pncbItemSrc,
/* [annotation][in] */
__in INetCfgBindingPath *pncbItemDest);
END_INTERFACE
} INetCfgComponentBindingsVtbl;
interface INetCfgComponentBindings
{
CONST_VTBL struct INetCfgComponentBindingsVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define INetCfgComponentBindings_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define INetCfgComponentBindings_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define INetCfgComponentBindings_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define INetCfgComponentBindings_BindTo(This,pnccItem) \
( (This)->lpVtbl -> BindTo(This,pnccItem) )
#define INetCfgComponentBindings_UnbindFrom(This,pnccItem) \
( (This)->lpVtbl -> UnbindFrom(This,pnccItem) )
#define INetCfgComponentBindings_SupportsBindingInterface(This,dwFlags,pszwInterfaceName) \
( (This)->lpVtbl -> SupportsBindingInterface(This,dwFlags,pszwInterfaceName) )
#define INetCfgComponentBindings_IsBoundTo(This,pnccItem) \
( (This)->lpVtbl -> IsBoundTo(This,pnccItem) )
#define INetCfgComponentBindings_IsBindableTo(This,pnccItem) \
( (This)->lpVtbl -> IsBindableTo(This,pnccItem) )
#define INetCfgComponentBindings_EnumBindingPaths(This,dwFlags,ppIEnum) \
( (This)->lpVtbl -> EnumBindingPaths(This,dwFlags,ppIEnum) )
#define INetCfgComponentBindings_MoveBefore(This,pncbItemSrc,pncbItemDest) \
( (This)->lpVtbl -> MoveBefore(This,pncbItemSrc,pncbItemDest) )
#define INetCfgComponentBindings_MoveAfter(This,pncbItemSrc,pncbItemDest) \
( (This)->lpVtbl -> MoveAfter(This,pncbItemSrc,pncbItemDest) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __INetCfgComponentBindings_INTERFACE_DEFINED__ */
#ifndef __INetCfgSysPrep_INTERFACE_DEFINED__
#define __INetCfgSysPrep_INTERFACE_DEFINED__
/* interface INetCfgSysPrep */
/* [unique][uuid][object][local] */
EXTERN_C const IID IID_INetCfgSysPrep;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("C0E8AE98-306E-11D1-AACF-00805FC1270E")
INetCfgSysPrep : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE HrSetupSetFirstDword(
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pwszSection,
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pwszKey,
/* [in] */ DWORD dwValue) = 0;
virtual HRESULT STDMETHODCALLTYPE HrSetupSetFirstString(
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pwszSection,
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pwszKey,
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pwszValue) = 0;
virtual HRESULT STDMETHODCALLTYPE HrSetupSetFirstStringAsBool(
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pwszSection,
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pwszKey,
/* [in] */ BOOL fValue) = 0;
virtual HRESULT STDMETHODCALLTYPE HrSetupSetFirstMultiSzField(
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pwszSection,
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pwszKey,
/* [annotation][in] */
__in __nullterminated LPCWSTR pmszValue) = 0;
};
#else /* C style interface */
typedef struct INetCfgSysPrepVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
INetCfgSysPrep * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
__RPC__deref_out void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
INetCfgSysPrep * This);
ULONG ( STDMETHODCALLTYPE *Release )(
INetCfgSysPrep * This);
HRESULT ( STDMETHODCALLTYPE *HrSetupSetFirstDword )(
INetCfgSysPrep * This,
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pwszSection,
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pwszKey,
/* [in] */ DWORD dwValue);
HRESULT ( STDMETHODCALLTYPE *HrSetupSetFirstString )(
INetCfgSysPrep * This,
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pwszSection,
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pwszKey,
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pwszValue);
HRESULT ( STDMETHODCALLTYPE *HrSetupSetFirstStringAsBool )(
INetCfgSysPrep * This,
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pwszSection,
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pwszKey,
/* [in] */ BOOL fValue);
HRESULT ( STDMETHODCALLTYPE *HrSetupSetFirstMultiSzField )(
INetCfgSysPrep * This,
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pwszSection,
/* [annotation][string][in] */
__in __nullterminated LPCWSTR pwszKey,
/* [annotation][in] */
__in __nullterminated LPCWSTR pmszValue);
END_INTERFACE
} INetCfgSysPrepVtbl;
interface INetCfgSysPrep
{
CONST_VTBL struct INetCfgSysPrepVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define INetCfgSysPrep_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define INetCfgSysPrep_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define INetCfgSysPrep_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define INetCfgSysPrep_HrSetupSetFirstDword(This,pwszSection,pwszKey,dwValue) \
( (This)->lpVtbl -> HrSetupSetFirstDword(This,pwszSection,pwszKey,dwValue) )
#define INetCfgSysPrep_HrSetupSetFirstString(This,pwszSection,pwszKey,pwszValue) \
( (This)->lpVtbl -> HrSetupSetFirstString(This,pwszSection,pwszKey,pwszValue) )
#define INetCfgSysPrep_HrSetupSetFirstStringAsBool(This,pwszSection,pwszKey,fValue) \
( (This)->lpVtbl -> HrSetupSetFirstStringAsBool(This,pwszSection,pwszKey,fValue) )
#define INetCfgSysPrep_HrSetupSetFirstMultiSzField(This,pwszSection,pwszKey,pmszValue) \
( (This)->lpVtbl -> HrSetupSetFirstMultiSzField(This,pwszSection,pwszKey,pmszValue) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __INetCfgSysPrep_INTERFACE_DEFINED__ */
/* Additional Prototypes for ALL interfaces */
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif
......@@ -295,6 +295,46 @@ echo
echo Configure section config OK.
echo
# -----------------------------------------------------------
# taps: Install openvpn tap-windows drivers used by re6stnet
# -----------------------------------------------------------
#
# Adding tap-windows driver will break others, so we add all drivers
# here. Get re6stnet client count, then remove extra drivers and add
# required drivers.
if check_re6stnet_needed ; then
echo
echo Starting configure section taps ...
echo
original_connections=$(echo $(get_all_connections))
client_count=$(sed -n -e "s/^client-count *//p" $re6stnet_configure_file)
[[ -z "$client_count" ]] && client_count=10
echo " Client count: $client_count"
re6stnet_name_list="re6stnet-tcp re6stnet-udp"
for (( i=1; i<=client_count; i=i+1 )) ; do
re6stnet_name_list="$re6stnet_name_list re6stnet$i"
done
for name in $re6stnet_name_list ; do
echo "Checking interface $name ..."
if [[ ! " $original_connections " == *[\ ]$name[\ ]* ]] ; then
echo "Installing interface $name ..."
ip vpntap add dev $name || \
show_error_exit "Failed to install OpenVPN Tap-Windows Driver."
echo "Interface $name installed."
else
echo "$name has been installed."
fi
done
#
# Remove OpenVPN Tap-Windows Driver
#
# ip vpntap del dev re6stnet-x
#
echo
echo Configure section taps OK.
echo
fi
# -----------------------------------------------------------
# re6stnet: Install required packages and register to nexedi
# -----------------------------------------------------------
......@@ -394,44 +434,6 @@ echo
echo Configure section re6stnet OK.
echo
# -----------------------------------------------------------
# taps: Install openvpn tap-windows drivers used by re6stnet
# -----------------------------------------------------------
#
# Adding tap-windows driver will break others, so we add all drivers
# here. Get re6stnet client count, then remove extra drivers and add
# required drivers.
echo
echo Starting configure section taps ...
echo
original_connections=$(echo $(get_all_connections))
client_count=$(sed -n -e "s/^client-count *//p" $re6stnet_configure_file)
[[ -z "$client_count" ]] && client_count=10
echo " Client count: $client_count"
re6stnet_name_list="re6stnet-tcp re6stnet-udp"
for (( i=1; i<=client_count; i=i+1 )) ; do
re6stnet_name_list="$re6stnet_name_list re6stnet$i"
done
for name in $re6stnet_name_list ; do
echo "Checking interface $name ..."
if [[ ! " $original_connections " == *[\ ]$name[\ ]* ]] ; then
echo "Installing interface $name ..."
ip vpntap add dev $name || \
show_error_exit "Failed to install OpenVPN Tap-Windows Driver."
echo "Interface $name installed."
else
echo "$name has been installed."
fi
done
#
# Remove OpenVPN Tap-Windows Driver
#
# ip vpntap del dev re6stnet-x
#
echo
echo Configure section taps OK.
echo
# -----------------------------------------------------------
# runner: Create instance of slap web runner
# -----------------------------------------------------------
......
......@@ -233,6 +233,25 @@ function connection2guid()
| grep "^Transport Name:" | sed -e "s/^.*Tcpip_//g"
} # === connection2guid() === #
# ======================================================================
# Routine: rename_connection_name
# Rename connection name by guid by changing registry
# $1 guid
# $2 new name
# ======================================================================
function rename_connection_name()
{
local guid=$1
local name=$2
local key='\HKLMHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}\$guid\Connection'
if regtool check $key ; then
regtool set $key\\Name $name
else
echo Missing key name in the registry.
return 1
fi
} # === rename_connection_name() === #
# ======================================================================
# Routine: show_error_exit
# Show error message and wait for user to press any key to exit
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment