summaryrefslogtreecommitdiff
path: root/source3/registry/reg_frontend.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-12-03 17:16:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:16:21 -0500
commit61bd0c8e450b3638c38bc60eb31fc6a4488f3121 (patch)
tree1134e4c540231a0d497be3008cb788b7716450b2 /source3/registry/reg_frontend.c
parentb0a6049391d4aebcaa6e0370deb20651a07dcbe8 (diff)
downloadsamba-61bd0c8e450b3638c38bc60eb31fc6a4488f3121.tar.gz
samba-61bd0c8e450b3638c38bc60eb31fc6a4488f3121.tar.bz2
samba-61bd0c8e450b3638c38bc60eb31fc6a4488f3121.zip
r20019: Replace one set of tricky code by calls to another set of tricky code:
Initializing the reg_db now uses reg_createkey and reg_setvalue. Volker (This used to be commit cab5ccbbe484795f13531726d68b978073262e33)
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);
+}