summaryrefslogtreecommitdiff
path: root/source3/registry/reg_frontend.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/registry/reg_frontend.c')
-rw-r--r--source3/registry/reg_frontend.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/source3/registry/reg_frontend.c b/source3/registry/reg_frontend.c
index 3bb88eaf47..1f6b285653 100644
--- a/source3/registry/reg_frontend.c
+++ b/source3/registry/reg_frontend.c
@@ -93,15 +93,16 @@ BOOL init_registry( void )
int i;
- if ( !regdb_init() ) {
- DEBUG(0,("init_registry: failed to initialize the registry tdb!\n"));
- return False;
- }
-
/* build the cache tree of registry hooks */
reghook_cache_init();
+ if ( !regdb_init() ) {
+ DEBUG(0,("init_registry: failed to initialize the registry "
+ "tdb!\n"));
+ return False;
+ }
+
for ( i=0; reg_hooks[i].keyname; i++ ) {
if ( !reghook_cache_add(&reg_hooks[i]) )
return False;
@@ -642,3 +643,24 @@ WERROR reg_delete_path(const struct nt_user_token *token,
TALLOC_FREE(hive);
return err;
}
+
+WERROR reg_set_dword(struct registry_key *key, const char *valuename,
+ uint32 value)
+{
+ struct registry_value val;
+ ZERO_STRUCT(val);
+ val.type = REG_DWORD;
+ val.v.dword = value;
+ return reg_setvalue(key, valuename, &val);
+}
+
+WERROR reg_set_sz(struct registry_key *key, const char *valuename,
+ const char *value)
+{
+ struct registry_value val;
+ ZERO_STRUCT(val);
+ val.type = REG_SZ;
+ val.v.sz.str = CONST_DISCARD(char *, value);
+ val.v.sz.len = strlen(value)+1;
+ return reg_setvalue(key, valuename, &val);
+}