summaryrefslogtreecommitdiff
path: root/windows
diff options
context:
space:
mode:
authorRobert Socha <[email protected]>2020-04-18 18:56:28 +0200
committerRobert Socha <[email protected]>2020-04-18 18:56:28 +0200
commitbfe5c758ba38ab453e1f450738d09855c91e66d2 (patch)
tree223f65857ff3e9dde228a3fd609786a786ed109c /windows
parentb6b11dbf8242ff17c58f10f817d754da3f8c00eb (diff)
Add description for Windos service
Diffstat (limited to 'windows')
-rw-r--r--windows/ZeroTierOne/ServiceInstaller.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/windows/ZeroTierOne/ServiceInstaller.cpp b/windows/ZeroTierOne/ServiceInstaller.cpp
index d302d9f6..ef700747 100644
--- a/windows/ZeroTierOne/ServiceInstaller.cpp
+++ b/windows/ZeroTierOne/ServiceInstaller.cpp
@@ -53,6 +53,8 @@ std::string InstallService(PSTR pszServiceName,
char szPathTmp[MAX_PATH],szPath[MAX_PATH];
SC_HANDLE schSCManager = NULL;
SC_HANDLE schService = NULL;
+ SERVICE_DESCRIPTION sd;
+ LPTSTR szDesc = TEXT("Provides secure encrypted communications between hosts over an insecure networks.");
if (GetModuleFileName(NULL, szPathTmp, ARRAYSIZE(szPath)) == 0)
{
@@ -77,7 +79,7 @@ std::string InstallService(PSTR pszServiceName,
schSCManager, // SCManager database
pszServiceName, // Name of service
pszDisplayName, // Name to display
- SERVICE_QUERY_STATUS, // Desired access
+ SERVICE_ALL_ACCESS, // Desired access
SERVICE_WIN32_OWN_PROCESS, // Service type
dwStartType, // Service start type
SERVICE_ERROR_NORMAL, // Error control type
@@ -94,6 +96,11 @@ std::string InstallService(PSTR pszServiceName,
goto Cleanup;
}
+ // Setup service description
+ sd.lpDescription = szDesc;
+ if (!ChangeServiceConfig2(schService, SERVICE_CONFIG_DESCRIPTION, &sd)) {
+ ret = "CreateService failed (description)";
+ }
Cleanup:
// Centralized cleanup for all allocated resources.
if (schSCManager)