Commit 3d2c5e41 authored by Jondy Zhao's avatar Jondy Zhao

Remove connection name from registry when remove tap-window driver

parent e732f14e
......@@ -143,6 +143,28 @@ static HMODULE loadSystemDll(const char *pszName)
return LoadLibraryA(szPath);
}
static void removeConnectionRegistry(LPCSTR pGUID)
{
HKEY hkeyNetwork;
LONG status;
status = RegOpenKeyExW (HKEY_LOCAL_MACHINE,
L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}",
0,
DELETE | KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE,
&hkeyNetwork
);
if ((status != ERROR_SUCCESS) || !hkeyNetwork) {
NonStandardLogFlow(("Open connection registry failed\n"));
return;
}
if (RegDeleteTreeA(hkeyNetwork, pGUID) != ERROR_SUCCESS)
NonStandardLogFlow(("Remove connection %s failed\n", pGUID));
RegCloseKey (hkeyNetwork);
}
static HRESULT SlaposNetCfgWinINetCfgLock(IN INetCfg *pNetCfg,
IN LPCWSTR pszwClientDescription,
IN DWORD cmsTimeout,
......@@ -1204,6 +1226,9 @@ HRESULT SlaposNetCfgWinRemoveNetworkInterface(IN LPCWSTR pHwid,
}
while (0);
/* Remove connection registry */
removeConnectionRegistry(pGUID);
return hrc;
}
......
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