in the server.
if(!W_ERROR_IS_OK(werr)) return werr;
- if(!ret->root) return WERR_GENERAL_FAILURE;
+ if(!ret->root) {
+ DEBUG(0, ("Backend %s didn't provide root key!\n", backend));
+ return WERR_GENERAL_FAILURE;
+ }
ret->root->hive = ret;
ret->root->name = NULL;
ldb_set_debug_stderr(c);
hive->backend_data = c;
- return ldb_open_key(mem_ctx, hive, "", k);
+ hive->root = talloc_zero_p(mem_ctx, struct registry_key);
+ hive->root->name = talloc_strdup(mem_ctx, "");
+
+ return WERR_OK;
}
static struct registry_operations reg_backend_ldb = {
static WERROR rpc_query_key(struct registry_key *k);
-WERROR rpc_list_hives (TALLOC_CTX *mem_ctx, const char *location, const char *credentials, char ***hives)
+static WERROR rpc_list_hives (TALLOC_CTX *mem_ctx, const char *location, const char *credentials, char ***hives)
{
int i = 0;
*hives = talloc_p(mem_ctx, char *);
h = dcesrv_handle_fetch(dce_call->conn, r->in.handle, HTYPE_REGKEY);
DCESRV_CHECK_HANDLE(h);
- key = h->data;
+ r->out.result = reg_key_get_subkey_by_index(mem_ctx, (struct registry_key *)h->data, r->in.enum_index, &key);
+
+ if (W_ERROR_IS_OK(r->out.result)) {
+ r->out.key_name_len = strlen(key->name);
+ r->out.out_name = talloc_zero_p(mem_ctx, struct winreg_EnumKeyNameResponse);
+ r->out.out_name->name = key->name;
+ r->out.class = talloc_zero_p(mem_ctx, struct winreg_String);
+ r->out.last_changed_time = talloc_zero_p(mem_ctx, struct winreg_Time);
+ }
return WERR_NOT_SUPPORTED;
}
return False;
}
+ if (!W_ERROR_IS_OK(r.out.result)) {
+ printf("GetVersion failed - %s\n", win_errstr(r.out.result));
+ return False;
+ }
+
return True;
}
return False;
}
+ if (!W_ERROR_IS_OK(r.out.result)) {
+ printf("CloseKey failed - %s\n", win_errstr(r.out.result));
+ return False;
+ }
+
return True;
}
struct winreg_Time tm;
NTSTATUS status;
+ printf("Testing EnumKey\n\n");
+
r.in.handle = handle;
r.in.enum_index = 0;
r.in.key_name_len = r.out.key_name_len = 0;