s3-rpc_client: move protos to cli_lsarpc.h
[Samba/ekacnet.git] / source3 / registry / reg_init_basic.c
blob4958df22a059e32d2d0a2aab2c1a3ac5645f5278
1 /*
2 * Unix SMB/CIFS implementation.
3 * Registry helper routines
4 * Copyright (C) Michael Adam 2008
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 3 of the License, or (at your option)
9 * any later version.
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
16 * You should have received a copy of the GNU General Public License along with
17 * this program; if not, see <http://www.gnu.org/licenses/>.
20 #include "includes.h"
21 #include "registry.h"
23 #undef DBGC_CLASS
24 #define DBGC_CLASS DBGC_REGISTRY
26 WERROR registry_init_common(void)
28 WERROR werr;
30 werr = regdb_init();
31 if (!W_ERROR_IS_OK(werr)) {
32 DEBUG(0, ("Failed to initialize the registry: %s\n",
33 win_errstr(werr)));
34 goto done;
37 werr = reghook_cache_init();
38 if (!W_ERROR_IS_OK(werr)) {
39 DEBUG(0, ("Failed to initialize the reghook cache: %s\n",
40 win_errstr(werr)));
41 goto done;
44 /* setup the necessary keys and values */
46 werr = init_registry_data();
47 if (!W_ERROR_IS_OK(werr)) {
48 DEBUG(0, ("Failed to initialize data in registry!\n"));
51 done:
52 return werr;
55 WERROR registry_init_basic(void)
57 WERROR werr;
59 DEBUG(10, ("registry_init_basic called\n"));
61 werr = registry_init_common();
62 regdb_close();
63 return werr;