summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOdd Stranne <odd@mullvad.net>2018-08-31 22:12:23 +0200
committerOdd Stranne <odd@mullvad.net>2018-09-04 13:06:33 +0200
commitb6d3f62ffcfdecea638f67efce67bbb738fa013a (patch)
tree638e9d8835ad4ef93f870902f5e5d06764dee715
parentd1bfd9cf3c52dea98261377f96e9b4864d861c06 (diff)
downloadmullvadvpn-b6d3f62ffcfdecea638f67efce67bbb738fa013a.tar.xz
mullvadvpn-b6d3f62ffcfdecea638f67efce67bbb738fa013a.zip
Extend module pinning in 'driverlogic' plugin
-rw-r--r--windows/nsis-plugins/src/driverlogic/driverlogic.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/windows/nsis-plugins/src/driverlogic/driverlogic.cpp b/windows/nsis-plugins/src/driverlogic/driverlogic.cpp
index 5604001645..4a8911572c 100644
--- a/windows/nsis-plugins/src/driverlogic/driverlogic.cpp
+++ b/windows/nsis-plugins/src/driverlogic/driverlogic.cpp
@@ -52,7 +52,15 @@ void PinDll()
throw std::runtime_error("Failed to pin plugin module");
}
- LoadLibraryW(self);
+ //
+ // NSIS sometimes frees a plugin module more times than it loads it.
+ // This hasn't been observed for this particular plugin but let's up the
+ // reference count a bit extra anyway.
+ //
+ for (int i = 0; i < 100; ++i)
+ {
+ LoadLibraryW(self);
+ }
}
} // anonymous namespace