s3-registry: only include registry headers when really needed.
[amitay/samba.git] / source3 / registry / reg_init_basic.c
index 72ab9d1e655f7c32e85105ef15c57dcd5193bc84..4958df22a059e32d2d0a2aab2c1a3ac5645f5278 100644 (file)
  */
 
 #include "includes.h"
+#include "registry.h"
 
 #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, ("Failed to initialize 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();
 
        werr = reghook_cache_init();
        if (!W_ERROR_IS_OK(werr)) {
-               DEBUG(1, ("Failed to initialize the reghook cache: %s\n",
-                         dos_errstr(werr)));
-               return false;
+               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;
 }