libsmb: Use clistr_smb2_extract_snapshot_token() in cli_smb2_create_fnum_send()
[Samba.git] / source3 / rpc_server / rpcd_winreg.c
blob4f92fd76617e22a7bbdda83f0bfeddbad47fd898
1 /*
2 * Unix SMB/CIFS implementation.
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.
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.
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/>.
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"
24 static size_t winreg_interfaces(
25 const struct ndr_interface_table ***pifaces,
26 void *private_data)
28 static const struct ndr_interface_table *ifaces[] = {
29 &ndr_table_winreg,
31 *pifaces = ifaces;
32 return ARRAY_SIZE(ifaces);
35 static size_t winreg_servers(
36 struct dcesrv_context *dce_ctx,
37 const struct dcesrv_endpoint_server ***_ep_servers,
38 void *private_data)
40 static const struct dcesrv_endpoint_server *ep_servers[1] = { NULL };
41 WERROR werr;
43 ep_servers[0] = winreg_get_ep_server();
45 werr = registry_init_full();
46 if (!W_ERROR_IS_OK(werr)) {
47 DBG_ERR("registry_init_full() failed: %s\n",
48 win_errstr(werr));
49 exit(1);
52 lp_load_with_shares(get_dyn_CONFIGFILE());
54 *_ep_servers = ep_servers;
55 return ARRAY_SIZE(ep_servers);
58 int main(int argc, const char *argv[])
60 return rpc_worker_main(
61 argc,
62 argv,
63 "rpcd_winreg",
65 60,
66 winreg_interfaces,
67 winreg_servers,
68 NULL);