diff --git a/programs/reg/tests/add.c b/programs/reg/tests/add.c index 36fa634796d..469f354de39 100644 --- a/programs/reg/tests/add.c +++ b/programs/reg/tests/add.c @@ -154,7 +154,7 @@ void delete_key_(const char *file, unsigned line, HKEY root, const char *path, R } } -LONG delete_tree(HKEY root, const char *path, REGSAM sam) +LONG delete_tree_(const char *file, unsigned line, HKEY root, const char *path, REGSAM sam) { HKEY hkey; LONG ret; @@ -163,6 +163,7 @@ LONG delete_tree(HKEY root, const char *path, REGSAM sam) static const char empty[1]; ret = RegOpenKeyExA(root, path, 0, KEY_READ|sam, &hkey); + lok(!ret || ret == ERROR_FILE_NOT_FOUND, "RegOpenKeyExA failed, got error %d\n", ret); if (ret) return ret; ret = RegQueryInfoKeyA(hkey, NULL, NULL, NULL, NULL, &max_subkey_len, @@ -184,7 +185,7 @@ LONG delete_tree(HKEY root, const char *path, REGSAM sam) ret = RegEnumKeyExA(hkey, 0, subkey_name, &subkey_len, NULL, NULL, NULL, NULL); if (ret == ERROR_NO_MORE_ITEMS) break; if (ret) goto cleanup; - ret = delete_tree(hkey, subkey_name, sam); + ret = delete_tree_(file, line, hkey, subkey_name, sam); if (ret) goto cleanup; } @@ -193,6 +194,8 @@ LONG delete_tree(HKEY root, const char *path, REGSAM sam) else ret = RegDeleteKeyExA(hkey, empty, sam, 0); + lok(!ret, "Failed to delete registry key, got error %d\n", ret); + cleanup: HeapFree(GetProcessHeap(), 0, subkey_name); RegCloseKey(hkey); diff --git a/programs/reg/tests/reg_test.h b/programs/reg/tests/reg_test.h index a5d7169beb4..3f64e552a19 100644 --- a/programs/reg/tests/reg_test.h +++ b/programs/reg/tests/reg_test.h @@ -64,7 +64,8 @@ void add_key_(const char *file, unsigned line, const HKEY root, const char *path #define delete_key(r,p,s) delete_key_(__FILE__,__LINE__,r,p,s) void delete_key_(const char *file, unsigned line, HKEY root, const char *path, REGSAM sam); -LONG delete_tree(HKEY root, const char *path, REGSAM sam); +#define delete_tree(r,p,s) delete_tree_(__FILE__,__LINE__,r,p,s) +LONG delete_tree_(const char *file, unsigned line, HKEY root, const char *path, REGSAM sam); #define add_value(k,n,t,d,s) add_value_(__FILE__,__LINE__,k,n,t,d,s) void add_value_(const char *file, unsigned line, HKEY hkey, const char *name,