Don't ignore must_exist in open_registry().
authorIain Patterson <me@iain.cx>
Sun, 20 Mar 2016 09:20:40 +0000 (09:20 +0000)
committerIain Patterson <me@iain.cx>
Sun, 20 Mar 2016 09:20:40 +0000 (09:20 +0000)
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.

registry.cpp

index 86eaaf5..b8aab78 100644 (file)
@@ -524,7 +524,7 @@ long open_registry(const TCHAR *service_name, const TCHAR *sub, REGSAM sam, HKEY
 \r
 HKEY open_registry(const TCHAR *service_name, const TCHAR *sub, REGSAM sam, bool must_exist) {\r
   HKEY key;\r
-  long error = open_registry(service_name, sub, sam, &key, true);\r
+  long error = open_registry(service_name, sub, sam, &key, must_exist);\r
   return key;\r
 }\r
 \r