Alternative open_registry_key() signature.
[nssm.git] / service.cpp
index 6a3907e..d864fa2 100644 (file)
@@ -240,7 +240,7 @@ int affinity_string_to_mask(TCHAR *string, __int64 *mask) {
   return 0;\r
 }\r
 \r
-inline unsigned long priority_mask() {\r
+unsigned long priority_mask() {\r
  return REALTIME_PRIORITY_CLASS | HIGH_PRIORITY_CLASS | ABOVE_NORMAL_PRIORITY_CLASS | NORMAL_PRIORITY_CLASS | BELOW_NORMAL_PRIORITY_CLASS | IDLE_PRIORITY_CLASS;\r
 }\r
 \r
@@ -774,7 +774,7 @@ void cleanup_nssm_service(nssm_service_t *service) {
   if (service->throttle_section_initialised) DeleteCriticalSection(&service->throttle_section);\r
   if (service->throttle_timer) CloseHandle(service->throttle_timer);\r
   if (service->hook_section_initialised) DeleteCriticalSection(&service->hook_section);\r
-  if (service->initial_env) FreeEnvironmentStrings(service->initial_env);\r
+  if (service->initial_env) HeapFree(GetProcessHeap(), 0, service->initial_env);\r
   HeapFree(GetProcessHeap(), 0, service);\r
 }\r
 \r
@@ -1479,7 +1479,7 @@ void WINAPI service_main(unsigned long argc, TCHAR **argv) {
   service->hook_section_initialised = true;\r
 \r
   /* Remember our initial environment. */\r
-  service->initial_env = GetEnvironmentStrings();\r
+  service->initial_env = copy_environment();\r
 \r
   /* Remember our creation time. */\r
   if (get_process_creation_time(GetCurrentProcess(), &service->nssm_creation_time)) ZeroMemory(&service->nssm_creation_time, sizeof(service->nssm_creation_time));\r