From 783cd32a75608b87952f062da7b83351bac69348 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=BCnther=20Deschner?= Date: Fri, 21 May 2010 01:25:16 +0200 Subject: [PATCH] s4-smbtorture: add kernel_mode_registry_path(). Guenther --- source4/torture/rpc/winreg.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index 98398b7f2f2..ac9100cb1d3 100644 --- a/source4/torture/rpc/winreg.c +++ b/source4/torture/rpc/winreg.c @@ -2258,6 +2258,28 @@ static bool test_volatile_keys(struct torture_context *tctx, return true; } +static const char *kernel_mode_registry_path(struct torture_context *tctx, + int hkey, + const char *sid_string, + const char *path) +{ + switch (hkey) { + case HKEY_LOCAL_MACHINE: + return talloc_asprintf(tctx, "\\Registry\\MACHINE\\%s", path); + case HKEY_CURRENT_USER: + return talloc_asprintf(tctx, "\\Registry\\USER\\%s\\%s", sid_string, path); + case HKEY_USERS: + return talloc_asprintf(tctx, "\\Registry\\USER\\%s", path); + case HKEY_CLASSES_ROOT: + return talloc_asprintf(tctx, "\\Registry\\MACHINE\\Software\\Classes\\%s", path); + default: + torture_warning(tctx, "unsupported hkey: 0x%08x\n", hkey); + return NULL; + } + + return NULL; +} + static bool test_symlink_keys(struct torture_context *tctx, struct dcerpc_binding_handle *b, struct policy_handle *handle, -- 2.11.4.GIT