summaryrefslogtreecommitdiffhomepage
path: root/windows/nsis-plugins/src/cleanup/cleanup.cpp
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2019-12-11 13:29:50 +0100
committerDavid Lönnhager <david.l@mullvad.net>2019-12-16 15:16:19 +0100
commit11ab41a02e34c0f3907faa5891f64da366bbc8c2 (patch)
treecdef956018d9dd61e654f2157b879dced9b52ce6 /windows/nsis-plugins/src/cleanup/cleanup.cpp
parent99eb972eb7c995216ce0b337b14c94cd89254ab4 (diff)
downloadmullvadvpn-11ab41a02e34c0f3907faa5891f64da366bbc8c2.tar.xz
mullvadvpn-11ab41a02e34c0f3907faa5891f64da366bbc8c2.zip
Get rid of duplicate nsis constants
Diffstat (limited to 'windows/nsis-plugins/src/cleanup/cleanup.cpp')
-rw-r--r--windows/nsis-plugins/src/cleanup/cleanup.cpp31
1 files changed, 7 insertions, 24 deletions
diff --git a/windows/nsis-plugins/src/cleanup/cleanup.cpp b/windows/nsis-plugins/src/cleanup/cleanup.cpp
index ea8d59ac79..faef07c2f0 100644
--- a/windows/nsis-plugins/src/cleanup/cleanup.cpp
+++ b/windows/nsis-plugins/src/cleanup/cleanup.cpp
@@ -1,4 +1,5 @@
#include <stdafx.h>
+#include "../error.h"
#include "cleaningops.h"
#include <libcommon/string.h>
#include <windows.h>
@@ -6,12 +7,6 @@
#include <functional>
#include <vector>
-enum class RemoveLogsAndCacheStatus
-{
- GENERAL_ERROR = 0,
- SUCCESS
-};
-
void __declspec(dllexport) NSISCALL RemoveLogsAndCache
(
HWND hwndParent,
@@ -49,15 +44,9 @@ void __declspec(dllexport) NSISCALL RemoveLogsAndCache
}
}
- pushint(success ? RemoveLogsAndCacheStatus::SUCCESS : RemoveLogsAndCacheStatus::GENERAL_ERROR);
+ pushint(success ? NsisStatus::SUCCESS : NsisStatus::GENERAL_ERROR);
}
-enum class RemoveSettingsStatus
-{
- GENERAL_ERROR = 0,
- SUCCESS
-};
-
void __declspec(dllexport) NSISCALL RemoveSettings
(
HWND hwndParent,
@@ -73,20 +62,14 @@ void __declspec(dllexport) NSISCALL RemoveSettings
try
{
cleaningops::RemoveSettingsServiceUser();
- pushint(RemoveSettingsStatus::SUCCESS);
+ pushint(NsisStatus::SUCCESS);
}
catch (...)
{
- pushint(RemoveSettingsStatus::GENERAL_ERROR);
+ pushint(NsisStatus::GENERAL_ERROR);
}
}
-enum class RemoveRelayCacheStatus
-{
- GENERAL_ERROR = 0,
- SUCCESS
-};
-
void __declspec(dllexport) NSISCALL RemoveRelayCache
(
HWND hwndParent,
@@ -104,16 +87,16 @@ void __declspec(dllexport) NSISCALL RemoveRelayCache
cleaningops::RemoveRelayCacheServiceUser();
pushstring(L"");
- pushint(RemoveRelayCacheStatus::SUCCESS);
+ pushint(NsisStatus::SUCCESS);
}
catch (const std::exception &err)
{
pushstring(common::string::ToWide(err.what()).c_str());
- pushint(RemoveRelayCacheStatus::GENERAL_ERROR);
+ pushint(NsisStatus::GENERAL_ERROR);
}
catch (...)
{
pushstring(L"Unspecified error");
- pushint(RemoveRelayCacheStatus::GENERAL_ERROR);
+ pushint(NsisStatus::GENERAL_ERROR);
}
}