s3:Makefile: net utility dependency cleanup
[ira/wip.git] / source3 / registry / reg_init_basic.c
index 9098bc4aec273cef19a71b7b66827aacba58832f..eab4ca7f9d62b3501401d9a46493f33e48f3ab77 100644 (file)
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_REGISTRY
 
-bool registry_init_basic(void)
+WERROR registry_init_common(void)
 {
        WERROR werr;
 
-       DEBUG(10, ("registry_init_basic called\n"));
-
        werr = regdb_init();
        if (!W_ERROR_IS_OK(werr)) {
-               DEBUG(1, ("Can't open the registry: %s\n", dos_errstr(werr)));
-               return false;
+               DEBUG(0, ("Failed to initialize the registry: %s\n",
+                         win_errstr(werr)));
+               goto done;
        }
-       regdb_close();
 
-       reghook_cache_init();
+       werr = reghook_cache_init();
+       if (!W_ERROR_IS_OK(werr)) {
+               DEBUG(0, ("Failed to initialize the reghook cache: %s\n",
+                         win_errstr(werr)));
+               goto done;
+       }
+
+       /* setup the necessary keys and values */
+
+       werr = init_registry_data();
+       if (!W_ERROR_IS_OK(werr)) {
+               DEBUG(0, ("Failed to initialize data in registry!\n"));
+       }
 
-       return true;
+done:
+       return werr;
+}
+
+WERROR registry_init_basic(void)
+{
+       WERROR werr;
+
+       DEBUG(10, ("registry_init_basic called\n"));
+
+       werr = registry_init_common();
+       regdb_close();
+       return werr;
 }