+ else {\r
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, registry, 0, sam, &key) != ERROR_SUCCESS) {\r
+ log_event(EVENTLOG_ERROR_TYPE, NSSM_EVENT_OPENKEY_FAILED, registry, error_string(GetLastError()), 0);\r
+ return 0;\r
+ }\r
+ }\r
+\r
+ return key;\r
+}\r
+\r
+HKEY open_registry(const TCHAR *service_name, REGSAM sam) {\r
+ return open_registry(service_name, 0, sam);\r
+}\r
+\r
+int get_parameters(nssm_service_t *service, STARTUPINFO *si) {\r
+ unsigned long ret;\r
+\r
+ /* Try to open the registry */\r
+ HKEY key = open_registry(service->name, KEY_READ);\r
+ if (! key) return 1;\r