From: Iain Patterson Date: Sun, 20 Mar 2016 09:20:40 +0000 (+0000) Subject: Don't ignore must_exist in open_registry(). X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=04056eb6ead840b893772711f5a8db10f8ba76c1;p=nssm.git Don't ignore must_exist in open_registry(). A typo meant that we were passing true to the overloaded open_registry() which also takes an HKEY as a parameter. As a result we would end up spamming ERROR_FILE_NOT_FOUND when updating a service via the GUI if there were no hooks to update, ironically in a section of code whose purpose was to check that it didn't need to do or report anything. Thanks Igor Zenkov and James Gleason. --- diff --git a/registry.cpp b/registry.cpp index 86eaaf5..b8aab78 100644 --- a/registry.cpp +++ b/registry.cpp @@ -524,7 +524,7 @@ long open_registry(const TCHAR *service_name, const TCHAR *sub, REGSAM sam, HKEY HKEY open_registry(const TCHAR *service_name, const TCHAR *sub, REGSAM sam, bool must_exist) { HKEY key; - long error = open_registry(service_name, sub, sam, &key, true); + long error = open_registry(service_name, sub, sam, &key, must_exist); return key; }