diff options
| author | Emīls Piņķis <emils@mullvad.net> | 2019-06-11 21:07:48 +0100 |
|---|---|---|
| committer | Emīls Piņķis <emils@mullvad.net> | 2019-06-11 21:07:48 +0100 |
| commit | d4a6e0b411b72f9e14eb6caee6c91dd31b612acf (patch) | |
| tree | 750fc0eca4e50b85df82491ee129dc59e0596c20 /windows/nsis-plugins/src/cleanup/cleanup.cpp | |
| parent | 63ebe7ac2f4602bcd1cf9439c6ba5fe177ef028e (diff) | |
| parent | 3f1a27e0581d54ec20ae40ee5ce9296626f6c578 (diff) | |
| download | mullvadvpn-d4a6e0b411b72f9e14eb6caee6c91dd31b612acf.tar.xz mullvadvpn-d4a6e0b411b72f9e14eb6caee6c91dd31b612acf.zip | |
Merge branch 'installer-remove-relay-list'
Diffstat (limited to 'windows/nsis-plugins/src/cleanup/cleanup.cpp')
| -rw-r--r-- | windows/nsis-plugins/src/cleanup/cleanup.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/windows/nsis-plugins/src/cleanup/cleanup.cpp b/windows/nsis-plugins/src/cleanup/cleanup.cpp index c7890d60b7..ea8d59ac79 100644 --- a/windows/nsis-plugins/src/cleanup/cleanup.cpp +++ b/windows/nsis-plugins/src/cleanup/cleanup.cpp @@ -1,5 +1,6 @@ #include <stdafx.h> #include "cleaningops.h" +#include <libcommon/string.h> #include <windows.h> #include <nsis/pluginapi.h> #include <functional> @@ -79,3 +80,40 @@ void __declspec(dllexport) NSISCALL RemoveSettings pushint(RemoveSettingsStatus::GENERAL_ERROR); } } + +enum class RemoveRelayCacheStatus +{ + GENERAL_ERROR = 0, + SUCCESS +}; + +void __declspec(dllexport) NSISCALL RemoveRelayCache +( + HWND hwndParent, + int string_size, + LPTSTR variables, + stack_t **stacktop, + extra_parameters *extra, + ... +) +{ + EXDLL_INIT(); + + try + { + cleaningops::RemoveRelayCacheServiceUser(); + + pushstring(L""); + pushint(RemoveRelayCacheStatus::SUCCESS); + } + catch (const std::exception &err) + { + pushstring(common::string::ToWide(err.what()).c_str()); + pushint(RemoveRelayCacheStatus::GENERAL_ERROR); + } + catch (...) + { + pushstring(L"Unspecified error"); + pushint(RemoveRelayCacheStatus::GENERAL_ERROR); + } +} |
