浏览代码

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.
Iain Patterson 8 年之前
父节点
当前提交
04056eb6ea
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      registry.cpp

+ 1 - 1
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 open_registry(const TCHAR *service_name, const TCHAR *sub, REGSAM sam, bool must_exist) {
   HKEY key;
   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;
   return key;
 }
 }