From 2cb372f7a457d16bef791eb9670f61555510fe87 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 31 Dec 2005 00:02:41 +0000 Subject: r12623: Another round of fixes for the prototypes of tables.c (This used to be commit fb5b22e3dc9ad0892817ae72a73e1e80f3db75c5) --- source4/build/smb_build/TODO | 6 +----- source4/librpc/config.mk | 8 ++++++-- source4/librpc/rpc/table.c | 13 +++++++++++++ source4/librpc/tables.pl | 10 ++++------ 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/source4/build/smb_build/TODO b/source4/build/smb_build/TODO index 6c45e6e6b2..487556b513 100644 --- a/source4/build/smb_build/TODO +++ b/source4/build/smb_build/TODO @@ -4,11 +4,7 @@ - install Samba-specific headers in $INCLUDEDIR/samba-4.0. talloc.h, tdb.h and ldb.h belong in $INCLUDEDIR - add register function to smbtorture -- init functions per shared library / binary - - gensec, com - - rpc/ndr ?? - - list not automatically generated - - utility function for 'init mutex' - install shared modules - improve (un)install scripts (rewrite in perl?) - proper #include dependencies +- determine dependencies from #include lines ? diff --git a/source4/librpc/config.mk b/source4/librpc/config.mk index dc40b69271..d87ac86ce5 100644 --- a/source4/librpc/config.mk +++ b/source4/librpc/config.mk @@ -302,10 +302,14 @@ librpc/gen_ndr/tables.c: librpc/gen_ndr/ndr_*.h @$(PERL) librpc/tables.pl --output=librpc/gen_ndr/tables.c \ librpc/gen_ndr/ndr_*.h +[SUBSYSTEM::NDR_IFACE_TABLE] +OBJ_FILES = gen_ndr/tables.o +NOPROTO = YES + [SUBSYSTEM::NDR_ALL] -OBJ_FILES = rpc/table.o gen_ndr/tables.o +OBJ_FILES = rpc/table.o PRIVATE_PROTO_HEADER = rpc/dcerpc_table.h -REQUIRED_SUBSYSTEMS = NDR_AUDIOSRV NDR_ECHO NDR_DCERPC NDR_EXCHANGE \ +REQUIRED_SUBSYSTEMS = NDR_IFACE_TABLE NDR_AUDIOSRV NDR_ECHO NDR_DCERPC NDR_EXCHANGE \ NDR_DSBACKUP NDR_EFS NDR_MISC NDR_LSA NDR_DFS NDR_DRSUAPI \ NDR_POLICYAGENT NDR_UNIXINFO NDR_SAMR NDR_SPOOLSS NDR_WKSSVC NDR_SRVSVC NDR_ATSVC \ NDR_EVENTLOG NDR_EPMAPPER NDR_DBGIDL NDR_DSSETUP NDR_MSGSVC NDR_WINS \ diff --git a/source4/librpc/rpc/table.c b/source4/librpc/rpc/table.c index 14600a779f..8dfecd858e 100644 --- a/source4/librpc/rpc/table.c +++ b/source4/librpc/rpc/table.c @@ -119,3 +119,16 @@ const struct dcerpc_interface_list *librpc_dcerpc_pipes(void) } +NTSTATUS dcerpc_register_builtin_interfaces(); + +NTSTATUS dcerpc_table_init(void) +{ + static BOOL initialized = False; + + if (initialized) return NT_STATUS_OK; + initialized = True; + + dcerpc_register_builtin_interfaces(); + + return NT_STATUS_OK; +} diff --git a/source4/librpc/tables.pl b/source4/librpc/tables.pl index 462ef19e08..9f30674de8 100644 --- a/source4/librpc/tables.pl +++ b/source4/librpc/tables.pl @@ -55,7 +55,8 @@ sub process_file($) while (my $line = ) { if ($line =~ /extern const struct dcerpc_interface_table (\w+);/) { $found = 1; - $init_fns.="\tlibrpc_register_interface(&$1);\n"; + $init_fns.="\tstatus = librpc_register_interface(&$1);\n"; + $init_fns.="\tif (NT_STATUS_IS_ERR(status)) return status;\n\n"; } } @@ -81,12 +82,9 @@ process_file($_) foreach (@ARGV); print TABLEC <