diff options
author | Andreas Schneider <asn@samba.org> | 2010-07-16 14:52:42 +0200 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2010-07-19 12:59:18 +0200 |
commit | 5cefbfef26bf2d5f470f1d8c52d75e9756c0f738 (patch) | |
tree | e68e42882b0dd51a29240ff936097ff0e6a54981 /pidl | |
parent | b91e5cf17d09e4e8bf73e78b96f69831a7cb0d0b (diff) | |
download | samba-5cefbfef26bf2d5f470f1d8c52d75e9756c0f738.tar.gz samba-5cefbfef26bf2d5f470f1d8c52d75e9756c0f738.tar.bz2 samba-5cefbfef26bf2d5f470f1d8c52d75e9756c0f738.zip |
s3-rpc_server: Added callbacks for init and shutdown of a rpc service.
This adds two callback function for each rpc service. One is for
initialisation and the other for shutdown. rpc_<service>_unregister()
needs to be called to execute the shutdown function.
Diffstat (limited to 'pidl')
-rw-r--r-- | pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm b/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm index 0ea43e48ad..04475d26c9 100644 --- a/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm +++ b/pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm @@ -257,10 +257,19 @@ sub ParseInterface($) pidl ""; if (not has_property($if, "no_srv_register")) { - pidl_hdr "NTSTATUS rpc_$if->{NAME}_init(void);"; - pidl "NTSTATUS rpc_$if->{NAME}_init(void)"; + pidl_hdr "struct rpc_srv_callbacks;"; + pidl_hdr "NTSTATUS rpc_$if->{NAME}_init(const struct rpc_srv_callbacks *rpc_srv_cb);"; + pidl "NTSTATUS rpc_$if->{NAME}_init(const struct rpc_srv_callbacks *rpc_srv_cb)"; pidl "{"; - pidl "\treturn rpc_srv_register(SMB_RPC_INTERFACE_VERSION, \"$if->{NAME}\", \"$if->{NAME}\", \&ndr_table_$if->{NAME}, api_$if->{NAME}_cmds, sizeof(api_$if->{NAME}_cmds) / sizeof(struct api_struct));"; + pidl "\treturn rpc_srv_register(SMB_RPC_INTERFACE_VERSION, \"$if->{NAME}\", \"$if->{NAME}\", \&ndr_table_$if->{NAME}, api_$if->{NAME}_cmds, sizeof(api_$if->{NAME}_cmds) / sizeof(struct api_struct), rpc_srv_cb);"; + pidl "}"; + + pidl ""; + + pidl_hdr "NTSTATUS rpc_$if->{NAME}_shutdown(void);"; + pidl "NTSTATUS rpc_$if->{NAME}_shutdown(void)"; + pidl "{"; + pidl "\treturn rpc_srv_unregister(\&ndr_table_$if->{NAME});"; pidl "}"; } pidl_hdr "#endif /* __SRV_$uif\__ */"; |