#include "includes.h"
#include "registry.h"
+#include "param/param.h"
typedef struct registry_context reg;
typedef struct hive_key hive;
%import "../../lib/talloc/talloc.i"
%import "../../auth/credentials/credentials.i"
%import "../../libcli/util/errors.i"
+%import "../../param/param.i"
/* Utility functions */
free((char **) $1);
}
+%talloctype(reg);
+
typedef struct registry_context {
%extend {
- ~reg() { talloc_free($self); }
WERROR get_predefined_key_by_name(const char *name,
struct registry_key **key);
WERROR mount_hive(struct hive_key *hive_key, uint32_t hkey_id,
const char **elements=NULL);
- }
- %pythoncode {
- def mount(self, path, hkey_id, elements=[]):
- self.mount_hive(Hive(path), hkey_id, elements)
+ WERROR mount_hive(struct hive_key *hive_key, const char *predef_name)
+ {
+ int i;
+ for (i = 0; reg_predefined_keys[i].name; i++) {
+ if (!strcasecmp(reg_predefined_keys[i].name, predef_name))
+ return reg_mount_hive($self, hive_key,
+ reg_predefined_keys[i].handle, NULL);
+ }
+ return WERR_INVALID_NAME;
+ }
+
}
} reg;
WERROR reg_open_hive(TALLOC_CTX *parent_ctx, const char *location,
struct auth_session_info *session_info,
struct cli_credentials *credentials,
+ struct loadparm_context *lp_ctx,
struct hive_key **root);
+%talloctype(hive);
+
typedef struct hive_key {
- %extend {
- ~hive() { talloc_free($self); }
- }
} hive;
%rename(open_samba) reg_open_samba;
WERROR reg_open_samba(TALLOC_CTX *mem_ctx,
struct registry_context **ctx,
+ struct loadparm_context *lp_ctx,
struct auth_session_info *session_info,
struct cli_credentials *credentials);