LCOV - code coverage report
Current view: top level - source3/registry - reg_init_basic.c (source / functions) Hit Total Coverage
Test: coverage report for vadcx-master-patch-75612 fe003de8 Lines: 15 21 71.4 %
Date: 2024-02-29 22:57:05 Functions: 2 2 100.0 %

          Line data    Source code
       1             : /*
       2             :  * Unix SMB/CIFS implementation.
       3             :  * Registry helper routines
       4             :  * Copyright (C) Michael Adam 2008
       5             :  *
       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.
      10             :  *
      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.
      15             :  *
      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/>.
      18             :  */
      19             : 
      20             : #include "includes.h"
      21             : #include "registry.h"
      22             : #include "reg_init_basic.h"
      23             : #include "reg_cachehook.h"
      24             : #include "reg_backend_db.h"
      25             : 
      26             : #undef DBGC_CLASS
      27             : #define DBGC_CLASS DBGC_REGISTRY
      28             : 
      29        1375 : WERROR registry_init_common(void)
      30             : {
      31          12 :         WERROR werr;
      32             : 
      33        1375 :         werr = regdb_init();
      34        1375 :         if (!W_ERROR_IS_OK(werr)) {
      35           0 :                 DEBUG(0, ("Failed to initialize the registry: %s\n",
      36             :                           win_errstr(werr)));
      37           0 :                 goto done;
      38             :         }
      39             : 
      40        1375 :         werr = reghook_cache_init();
      41        1375 :         if (!W_ERROR_IS_OK(werr)) {
      42           0 :                 DEBUG(0, ("Failed to initialize the reghook cache: %s\n",
      43             :                           win_errstr(werr)));
      44           0 :                 goto done;
      45             :         }
      46             : 
      47             :         /* setup the necessary keys and values */
      48             : 
      49        1375 :         werr = init_registry_data();
      50        1375 :         if (!W_ERROR_IS_OK(werr)) {
      51           0 :                 DEBUG(0, ("Failed to initialize data in registry!\n"));
      52             :         }
      53             : 
      54        1375 : done:
      55        1375 :         return werr;
      56             : }
      57             : 
      58         130 : WERROR registry_init_basic(void)
      59             : {
      60           0 :         WERROR werr;
      61             : 
      62         130 :         DEBUG(10, ("registry_init_basic called\n"));
      63             : 
      64         130 :         werr = registry_init_common();
      65         130 :         regdb_close();
      66         130 :         return werr;
      67             : }

Generated by: LCOV version 1.14