summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2020-01-02 10:43:12 +0100
committerDavid Lönnhager <david.l@mullvad.net>2020-01-02 10:43:12 +0100
commit8c649ed364fb1db71ee76ae4685fc2debb5c0861 (patch)
tree8535796067ab97d35c8d0a7fd3ae950a483948f0
parentec58b082eb71afc6cbf9a4b895c38496cbe8b17c (diff)
parentfa5443e9235016b462aadf258ccabe87fb58ffa0 (diff)
downloadmullvadvpn-8c649ed364fb1db71ee76ae4685fc2debb5c0861.tar.xz
mullvadvpn-8c649ed364fb1db71ee76ae4685fc2debb5c0861.zip
Merge branch 'libshared-update'
-rw-r--r--windows/nsis-plugins/src/driverlogic/context.cpp29
1 files changed, 21 insertions, 8 deletions
diff --git a/windows/nsis-plugins/src/driverlogic/context.cpp b/windows/nsis-plugins/src/driverlogic/context.cpp
index e65900582c..2fe33e22cd 100644
--- a/windows/nsis-plugins/src/driverlogic/context.cpp
+++ b/windows/nsis-plugins/src/driverlogic/context.cpp
@@ -274,15 +274,28 @@ std::set<Context::NetworkAdapter> GetTapAdapters()
// Construct NetworkAdapter
//
- const std::wstring guid = GetNetCfgInstanceId(devInfo, devInfoData);
- GUID guidObj = common::Guid::FromString(guid);
+ try
+ {
+ const std::wstring guid = GetNetCfgInstanceId(devInfo, devInfoData);
+ GUID guidObj = common::Guid::FromString(guid);
- adapters.emplace(Context::NetworkAdapter(
- guid,
- GetDeviceStringProperty(devInfo, &devInfoData, &DEVPKEY_Device_DriverDesc),
- nci.getConnectionName(guidObj),
- GetDeviceInstanceId(devInfo, &devInfoData)
- ));
+ adapters.emplace(Context::NetworkAdapter(
+ guid,
+ GetDeviceStringProperty(devInfo, &devInfoData, &DEVPKEY_Device_DriverDesc),
+ nci.getConnectionName(guidObj),
+ GetDeviceInstanceId(devInfo, &devInfoData)
+ ));
+ }
+ catch (const std::exception &e)
+ {
+ //
+ // Log exception and skip this adapter
+ //
+
+ std::string msg = "Skipping TAP adapter due to exception caught while iterating: ";
+ msg.append(e.what());
+ PluginLog(std::wstring(msg.begin(), msg.end()));
+ }
}
return adapters;