Fix up the "reg_common_open_remote" call
[ira/wip.git] / source4 / lib / registry / tools / common.c
index 6d766fd25c41e41210f0b5d6f92f2431ec5ace35..f770f6a3cafd06a2244b5e91a910a246cc2778bb 100644 (file)
 #include "lib/registry/tools/common.h"
 
 struct registry_context *reg_common_open_remote(const char *remote,
+                                               struct event_context *ev_ctx,
+                                               struct loadparm_context *lp_ctx,
                                                struct cli_credentials *creds)
 {
-       struct registry_context *h;
+       struct registry_context *h = NULL;
        WERROR error;
 
-       error = reg_open_remote(&h, NULL, creds, remote, NULL);
+       error = reg_open_remote(&h, NULL, creds, lp_ctx, remote, ev_ctx);
 
        if (!W_ERROR_IS_OK(error)) {
                fprintf(stderr, "Unable to open remote registry at %s:%s \n",
@@ -41,13 +43,15 @@ struct registry_context *reg_common_open_remote(const char *remote,
 }
 
 struct registry_key *reg_common_open_file(const char *path,
+                                         struct event_context *ev_ctx,
+                                         struct loadparm_context *lp_ctx,
                                          struct cli_credentials *creds)
 {
        struct hive_key *hive_root;
-       struct registry_context *h;
+       struct registry_context *h = NULL;
        WERROR error;
 
-       error = reg_open_hive(NULL, path, NULL, creds, &hive_root);
+       error = reg_open_hive(NULL, path, NULL, creds, ev_ctx, lp_ctx, &hive_root);
 
        if(!W_ERROR_IS_OK(error)) {
                fprintf(stderr, "Unable to open '%s': %s \n",
@@ -55,7 +59,7 @@ struct registry_key *reg_common_open_file(const char *path,
                return NULL;
        }
 
-       error = reg_open_local(NULL, &h, NULL, creds);
+       error = reg_open_local(NULL, &h);
        if (!W_ERROR_IS_OK(error)) {
                fprintf(stderr, "Unable to initialize local registry: %s\n",
                        win_errstr(error));
@@ -65,12 +69,14 @@ struct registry_key *reg_common_open_file(const char *path,
        return reg_import_hive_key(h, hive_root, -1, NULL);
 }
 
-struct registry_context *reg_common_open_local(struct cli_credentials *creds, struct loadparm_context *lp_ctx)
+struct registry_context *reg_common_open_local(struct cli_credentials *creds, 
+                                              struct event_context *ev_ctx, 
+                                              struct loadparm_context *lp_ctx)
 {
        WERROR error;
-       struct registry_context *h;
+       struct registry_context *h = NULL;
 
-       error = reg_open_samba(NULL, &h, lp_ctx, NULL, creds);
+       error = reg_open_samba(NULL, &h, ev_ctx, lp_ctx, NULL, creds);
 
        if(!W_ERROR_IS_OK(error)) {
                fprintf(stderr, "Unable to open local registry:%s \n",