From 6cf13f4d72beee3df0432d0898c5981ce8bced43 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 11 Dec 2004 17:12:16 +0000 Subject: r4154: Add definitions for HKEY_PERFORMANCE_TEXT and HKEY_PERFORMANCE_NLSTEXT Hives and predefined keys (HKEY_*) are not necessarily the same thing. (This used to be commit 217e4e5841cfedb2b18dce3f89dd88ea4a36fe8f) --- source4/gtk/tools/gregedit.c | 2 +- source4/include/registry.h | 8 ++++---- source4/lib/registry/common/reg_interface.c | 20 ++++++++++---------- source4/lib/registry/tools/regdiff.c | 2 +- source4/lib/registry/tools/regtree.c | 2 +- source4/rpc_server/winreg/rpc_winreg.c | 4 ++-- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/source4/gtk/tools/gregedit.c b/source4/gtk/tools/gregedit.c index 6301910a48..7aed4101e5 100644 --- a/source4/gtk/tools/gregedit.c +++ b/source4/gtk/tools/gregedit.c @@ -313,7 +313,7 @@ static void registry_load_root(void) gtk_tree_store_clear(store_keys); - for(i = HKEY_CLASSES_ROOT; i <= HKEY_PN; i++) + for(i = HKEY_CLASSES_ROOT; i <= HKEY_PERFORMANCE_NLSTEXT; i++) { if (!W_ERROR_IS_OK(reg_get_hive(registry, i, &root))) { continue; } diff --git a/source4/include/registry.h b/source4/include/registry.h index b399869091..e3b7eeb902 100644 --- a/source4/include/registry.h +++ b/source4/include/registry.h @@ -22,8 +22,8 @@ #ifndef _REGISTRY_H /* _REGISTRY_H */ #define _REGISTRY_H - -enum hkeys { +/* Handles for the predefined keys */ +enum reg_predefined_key { HKEY_CLASSES_ROOT = 0x80000000, HKEY_CURRENT_USER = 0x80000001, HKEY_LOCAL_MACHINE = 0x80000002, @@ -31,8 +31,8 @@ enum hkeys { HKEY_PERFORMANCE_DATA = 0x80000004, HKEY_CURRENT_CONFIG = 0x80000005, HKEY_DYN_DATA = 0x80000006, - HKEY_PT = 0x80000007, /* Don't know if this is correct! */ - HKEY_PN = 0x80000008 /* Don't know if this is correct! */ + HKEY_PERFORMANCE_TEXT = 0x80000050, + HKEY_PERFORMANCE_NLSTEXT= 0x80000060 }; /* Registry data types */ diff --git a/source4/lib/registry/common/reg_interface.c b/source4/lib/registry/common/reg_interface.c index b7211d92a4..ba65e570c4 100644 --- a/source4/lib/registry/common/reg_interface.c +++ b/source4/lib/registry/common/reg_interface.c @@ -74,7 +74,7 @@ BOOL reg_has_backend(const char *backend) } static struct { - uint32 hkey; + enum reg_predefined_key handle; const char *name; } hkey_names[] = { @@ -85,30 +85,30 @@ static struct { {HKEY_USERS, "HKEY_USERS" }, {HKEY_CURRENT_CONFIG, "HKEY_CURRENT_CONFIG" }, {HKEY_DYN_DATA, "HKEY_DYN_DATA" }, - {HKEY_PT, "HKEY_PT" }, - {HKEY_PN, "HKEY_PN" }, + {HKEY_PERFORMANCE_TEXT, "HKEY_PERFORMANCE_TEXT" }, + {HKEY_PERFORMANCE_NLSTEXT, "HKEY_PERFORMANCE_NLSTEXT" }, { 0, NULL } }; -int reg_list_hives(TALLOC_CTX *mem_ctx, char ***hives, uint32_t **hkeys) +int reg_list_predefs(TALLOC_CTX *mem_ctx, char ***hives, enum reg_predefined_key **hkeys) { int i; *hives = talloc_array_p(mem_ctx, char *, ARRAY_SIZE(hkey_names)); - *hkeys = talloc_array_p(mem_ctx, uint32_t, ARRAY_SIZE(hkey_names)); + *hkeys = talloc_array_p(mem_ctx, enum reg_predefined_key, ARRAY_SIZE(hkey_names)); for (i = 0; hkey_names[i].name; i++) { (*hives)[i] = talloc_strdup(mem_ctx, hkey_names[i].name); - (*hkeys)[i] = hkey_names[i].hkey; + (*hkeys)[i] = hkey_names[i].handle; } return i; } -const char *reg_get_hkey_name(uint32_t hkey) +const char *reg_get_hkey_name(enum reg_predefined_key hkey) { int i; for (i = 0; hkey_names[i].name; i++) { - if (hkey_names[i].hkey == hkey) return hkey_names[i].name; + if (hkey_names[i].handle == hkey) return hkey_names[i].name; } return NULL; @@ -119,7 +119,7 @@ WERROR reg_get_hive_by_name(struct registry_context *ctx, const char *name, stru int i; for (i = 0; hkey_names[i].name; i++) { - if (!strcmp(hkey_names[i].name, name)) return reg_get_hive(ctx, hkey_names[i].hkey, key); + if (!strcmp(hkey_names[i].name, name)) return reg_get_hive(ctx, hkey_names[i].handle, key); } DEBUG(1, ("No hive with name '%s'\n", name)); @@ -134,7 +134,7 @@ WERROR reg_close (struct registry_context *ctx) return WERR_OK; } -WERROR reg_get_hive(struct registry_context *ctx, uint32_t hkey, struct registry_key **key) +WERROR reg_get_hive(struct registry_context *ctx, enum reg_predefined_key hkey, struct registry_key **key) { WERROR ret = ctx->get_hive(ctx, hkey, key); diff --git a/source4/lib/registry/tools/regdiff.c b/source4/lib/registry/tools/regdiff.c index fc2954b6af..dfa85d636f 100644 --- a/source4/lib/registry/tools/regdiff.c +++ b/source4/lib/registry/tools/regdiff.c @@ -173,7 +173,7 @@ static void writediff(struct registry_key *oldkey, struct registry_key *newkey, error2 = error = WERR_OK; - for(i = HKEY_CLASSES_ROOT; i <= HKEY_PN; i++) { + for(i = HKEY_CLASSES_ROOT; i <= HKEY_PERFORMANCE_NLSTEXT; i++) { struct registry_key *r1, *r2; error = reg_get_hive(h1, i, &r1); if (!W_ERROR_IS_OK(error)) { diff --git a/source4/lib/registry/tools/regtree.c b/source4/lib/registry/tools/regtree.c index 8ff68229eb..7adeeea731 100644 --- a/source4/lib/registry/tools/regtree.c +++ b/source4/lib/registry/tools/regtree.c @@ -123,7 +123,7 @@ static void print_tree(int l, struct registry_key *p, int fullpath, int novals) if (!h) { print_tree(0, root, fullpath, no_values); } else { - for(i = HKEY_CLASSES_ROOT; i < HKEY_PN; i++) { + for(i = HKEY_CLASSES_ROOT; i < HKEY_PERFORMANCE_NLSTEXT; i++) { error = reg_get_hive(h, i, &root); if (!W_ERROR_IS_OK(error)) { fprintf(stderr, "Skipping %s\n", reg_get_hkey_name(i)); diff --git a/source4/rpc_server/winreg/rpc_winreg.c b/source4/rpc_server/winreg/rpc_winreg.c index dfe3be5d8a..a5c6effa2f 100644 --- a/source4/rpc_server/winreg/rpc_winreg.c +++ b/source4/rpc_server/winreg/rpc_winreg.c @@ -70,8 +70,8 @@ func_winreg_OpenHive(HKPD,HKEY_PERFORMANCE_DATA) func_winreg_OpenHive(HKU,HKEY_USERS) func_winreg_OpenHive(HKCC,HKEY_CURRENT_CONFIG) func_winreg_OpenHive(HKDD,HKEY_DYN_DATA) -func_winreg_OpenHive(HKPT,HKEY_PT) -func_winreg_OpenHive(HKPN,HKEY_PN) +func_winreg_OpenHive(HKPT,HKEY_PERFORMANCE_TEXT) +func_winreg_OpenHive(HKPN,HKEY_PERFORMANCE_NLSTEXT) /* winreg_CloseKey -- cgit