1 --- a/source3/rpc_server/rpc_ep_setup.c
2 +++ b/source3/rpc_server/rpc_ep_setup.c
3 @@ -409,6 +409,7 @@ static bool epmapper_shutdown_cb(void *p
8 static bool winreg_init_cb(void *ptr)
10 struct dcesrv_ep_context *ep_ctx =
11 @@ -456,6 +457,7 @@ static bool winreg_init_cb(void *ptr)
17 static bool srvsvc_init_cb(void *ptr)
19 @@ -710,10 +712,12 @@ static bool svcctl_init_cb(void *ptr)
23 +#ifdef WINREG_SUPPORT
24 ok = svcctl_init_winreg(ep_ctx->msg_ctx);
30 /* initialize the control hooks */
31 init_service_op_table();
32 @@ -785,10 +789,12 @@ static bool eventlog_init_cb(void *ptr)
36 +#ifdef WINREG_SUPPORT
37 ok = eventlog_init_winreg(ep_ctx->msg_ctx);
43 if (StrCaseCmp(rpcsrv_type, "embedded") == 0 ||
44 StrCaseCmp(rpcsrv_type, "daemon") == 0) {
45 @@ -1077,12 +1083,14 @@ bool dcesrv_ep_setup(struct tevent_conte
49 +#ifdef WINREG_SUPPORT
50 winreg_cb.init = winreg_init_cb;
51 winreg_cb.shutdown = NULL;
52 winreg_cb.private_data = ep_ctx;
53 if (!NT_STATUS_IS_OK(rpc_winreg_init(&winreg_cb))) {
58 srvsvc_cb.init = srvsvc_init_cb;
59 srvsvc_cb.shutdown = NULL;
60 --- a/source3/smbd/server_exit.c
61 +++ b/source3/smbd/server_exit.c
62 @@ -151,7 +151,9 @@ static void exit_server_common(enum serv
65 rpc_srvsvc_shutdown();
66 +#ifdef WINREG_SUPPORT
67 rpc_winreg_shutdown();
70 rpc_netlogon_shutdown();
72 --- a/source3/librpc/rpc/rpc_common.c
73 +++ b/source3/librpc/rpc/rpc_common.c
74 @@ -112,9 +112,11 @@ static bool initialize_interfaces(void)
75 if (!smb_register_ndr_interface(&ndr_table_wkssvc)) {
78 +#ifdef WINREG_SUPPORT
79 if (!smb_register_ndr_interface(&ndr_table_winreg)) {
83 #ifdef PRINTER_SUPPORT
84 if (!smb_register_ndr_interface(&ndr_table_spoolss)) {
86 --- a/source3/rpc_server/svcctl/srv_svcctl_nt.c
87 +++ b/source3/rpc_server/svcctl/srv_svcctl_nt.c
88 @@ -95,9 +95,11 @@ bool init_service_op_table( void )
89 svcctl_ops[i].ops = &netlogon_svc_ops;
92 +#ifdef WINREG_SUPPORT
93 svcctl_ops[i].name = talloc_strdup( svcctl_ops, "RemoteRegistry" );
94 svcctl_ops[i].ops = &winreg_svc_ops;
98 svcctl_ops[i].name = talloc_strdup( svcctl_ops, "WINS" );
99 svcctl_ops[i].ops = &wins_svc_ops;
100 --- a/source3/services/svc_winreg_glue.c
101 +++ b/source3/services/svc_winreg_glue.c
102 @@ -88,6 +88,10 @@ struct security_descriptor *svcctl_get_s
104 WERROR result = WERR_OK;
106 +#ifndef WINREG_SUPPORT
110 key = talloc_asprintf(mem_ctx,
112 TOP_LEVEL_SERVICES_KEY, name);
113 @@ -161,6 +165,10 @@ bool svcctl_set_secdesc(struct messaging
115 WERROR result = WERR_OK;
117 +#ifndef WINREG_SUPPORT
121 tmp_ctx = talloc_stackframe();
122 if (tmp_ctx == NULL) {
124 @@ -272,6 +280,10 @@ const char *svcctl_get_string_value(TALL
126 WERROR result = WERR_OK;
128 +#ifndef WINREG_SUPPORT
132 tmp_ctx = talloc_stackframe();
133 if (tmp_ctx == NULL) {
135 --- a/source3/rpcclient/rpcclient.c
136 +++ b/source3/rpcclient/rpcclient.c
137 @@ -642,7 +642,9 @@ static struct cmd_set *rpcclient_command
141 +#ifdef WINREG_SUPPORT