From 7e825911e286b91e9b715bb530ebd53d551a8a04 Mon Sep 17 00:00:00 2001 From: Piers Daniell Date: Thu, 5 Nov 2015 16:58:26 -0700 Subject: Reset the "access_flags" for each loop iteration Without out this fix the access_flags will have KEY_WOW64_32KEY set for all iterations except the first one. --- loader/loader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'loader/loader.c') diff --git a/loader/loader.c b/loader/loader.c index 459f0e10..4f910111 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -221,7 +221,7 @@ static char *loader_get_registry_files(const struct loader_instance *inst, char { LONG rtn_value; HKEY hive, key; - DWORD access_flags = KEY_QUERY_VALUE; + DWORD access_flags; char name[2048]; char *out = NULL; char *loc = location; @@ -236,6 +236,7 @@ static char *loader_get_registry_files(const struct loader_instance *inst, char { next = loader_get_next_path(loc); hive = DEFAULT_VK_REGISTRY_HIVE; + access_flags = KEY_QUERY_VALUE; rtn_value = RegOpenKeyEx(hive, loc, 0, access_flags, &key); if (rtn_value != ERROR_SUCCESS) { // We didn't find the key. Try the 32-bit hive (where we've seen the -- cgit v1.2.3