summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-05-21 01:25:16 +0200
committerGünther Deschner <gd@samba.org>2010-05-21 01:31:26 +0200
commit783cd32a75608b87952f062da7b83351bac69348 (patch)
tree4358594fabe9e79da6cc7e3a246be9c7666d83c0 /source4/torture
parente6047c163449c61de7f6883e3d5d40e1c2a30454 (diff)
downloadsamba-783cd32a75608b87952f062da7b83351bac69348.tar.gz
samba-783cd32a75608b87952f062da7b83351bac69348.tar.bz2
samba-783cd32a75608b87952f062da7b83351bac69348.zip
s4-smbtorture: add kernel_mode_registry_path().
Guenther
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/rpc/winreg.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c
index 98398b7f2f..ac9100cb1d 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,