LCOV - code coverage report
Current view: top level - source3/rpc_server - rpcd_winreg.c (source / functions) Hit Total Coverage
Test: coverage report for master 98b443d9 Lines: 13 15 86.7 %
Date: 2024-05-31 13:13:24 Functions: 3 3 100.0 %

          Line data    Source code
       1             : /*
       2             :  *  Unix SMB/CIFS implementation.
       3             :  *
       4             :  *  This program is free software; you can redistribute it and/or modify
       5             :  *  it under the terms of the GNU General Public License as published by
       6             :  *  the Free Software Foundation; either version 3 of the License, or
       7             :  *  (at your option) any later version.
       8             :  *
       9             :  *  This program is distributed in the hope that it will be useful,
      10             :  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
      11             :  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      12             :  *  GNU General Public License for more details.
      13             :  *
      14             :  *  You should have received a copy of the GNU General Public License
      15             :  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
      16             :  */
      17             : 
      18             : #include "includes.h"
      19             : #include "rpc_worker.h"
      20             : #include "librpc/gen_ndr/ndr_winreg.h"
      21             : #include "librpc/gen_ndr/ndr_winreg_scompat.h"
      22             : #include "source3/registry/reg_init_full.h"
      23             : 
      24         103 : static size_t winreg_interfaces(
      25             :         const struct ndr_interface_table ***pifaces,
      26             :         void *private_data)
      27             : {
      28             :         static const struct ndr_interface_table *ifaces[] = {
      29             :                 &ndr_table_winreg,
      30             :         };
      31         103 :         *pifaces = ifaces;
      32         103 :         return ARRAY_SIZE(ifaces);
      33             : }
      34             : 
      35         181 : static NTSTATUS winreg_servers(
      36             :         struct dcesrv_context *dce_ctx,
      37             :         const struct dcesrv_endpoint_server ***_ep_servers,
      38             :         size_t *_num_ep_servers,
      39             :         void *private_data)
      40             : {
      41             :         static const struct dcesrv_endpoint_server *ep_servers[1] = { NULL };
      42             :         WERROR werr;
      43             : 
      44         181 :         ep_servers[0] = winreg_get_ep_server();
      45             : 
      46         181 :         werr = registry_init_full();
      47         181 :         if (!W_ERROR_IS_OK(werr)) {
      48           0 :                 DBG_ERR("registry_init_full() failed: %s\n",
      49             :                         win_errstr(werr));
      50           0 :                 return werror_to_ntstatus(werr);
      51             :         }
      52             : 
      53         181 :         lp_load_with_shares(get_dyn_CONFIGFILE());
      54             : 
      55         181 :         *_ep_servers = ep_servers;
      56         181 :         *_num_ep_servers = ARRAY_SIZE(ep_servers);
      57         181 :         return NT_STATUS_OK;
      58             : }
      59             : 
      60         284 : int main(int argc, const char *argv[])
      61             : {
      62         284 :         return rpc_worker_main(
      63             :                 argc,
      64             :                 argv,
      65             :                 "rpcd_winreg",
      66             :                 5,
      67             :                 60,
      68             :                 winreg_interfaces,
      69             :                 winreg_servers,
      70             :                 NULL);
      71             : }

Generated by: LCOV version 1.14