s4-smbtorture: add kernel_mode_registry_path().
authorGünther Deschner <gd@samba.org>
Thu, 20 May 2010 23:25:16 +0000 (01:25 +0200)
committerGünther Deschner <gd@samba.org>
Thu, 20 May 2010 23:31:26 +0000 (01:31 +0200)
Guenther

source4/torture/rpc/winreg.c

index 98398b7f2f2817b94c3490e879d91be053e8d0b6..ac9100cb1d36e976925a5fd27c1776e8d2f6e717 100644 (file)
@@ -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,