diff options
Diffstat (limited to 'source4/build/pidl')
-rwxr-xr-x | source4/build/pidl/pidl.pl | 27 | ||||
-rw-r--r-- | source4/build/pidl/stub.pm | 12 |
2 files changed, 28 insertions, 11 deletions
diff --git a/source4/build/pidl/pidl.pl b/source4/build/pidl/pidl.pl index 8388bcfd4c..c430c75236 100755 --- a/source4/build/pidl/pidl.pl +++ b/source4/build/pidl/pidl.pl @@ -168,18 +168,35 @@ sub process_file($) } if ($opt_server) { - my($server) = util::ChangeExtension($output, "_s.c"); - my $res = ""; + my $h_filename = util::ChangeExtension($output, ".h"); + my $plain = ""; + my $dcom = ""; + foreach my $x (@{$pidl}) { next if ($x->{TYPE} ne "INTERFACE"); if (util::has_property($x, "object")) { - $res .= IdlStub::ParseInterface($x); + $dcom .= IdlStub::ParseInterface($x); } else { - $res .= IdlServer::ParseInterface($x); + $plain .= IdlServer::ParseInterface($x); } } - util::FileSave($server, $res); + + if ($plain ne "") { + util::FileSave(util::ChangeExtension($output, "_s.c"), $plain); + } + + if ($dcom ne "") { + $dcom = " +#include \"includes.h\" +#include \"$h_filename\" +#include \"rpc_server/dcerpc_server.h\" +#include \"rpc_server/common/common.h\" + +$dcom +"; + util::FileSave(util::ChangeExtension($output, "_d.c"), $dcom); + } } if ($opt_parser) { diff --git a/source4/build/pidl/stub.pm b/source4/build/pidl/stub.pm index 1cfb3cb11e..2bcece8416 100644 --- a/source4/build/pidl/stub.pm +++ b/source4/build/pidl/stub.pm @@ -27,12 +27,13 @@ sub gen_dispatch_switch($) next if ($d->{TYPE} ne "FUNCTION"); pidl "\tcase $count: {\n"; + pidl "\t\tNTSTATUS result;\n"; pidl "\t\tstruct $d->{NAME} *r2 = r;\n"; pidl "\t\tif (DEBUGLEVEL > 10) {\n"; pidl "\t\t\tNDR_PRINT_FUNCTION_DEBUG($d->{NAME}, NDR_IN, r2);\n"; pidl "\t\t}\n"; if ($d->{RETURN_TYPE} && $d->{RETURN_TYPE} ne "void") { - pidl "\t\tr2->out.result = vtable->$d->{NAME}(iface, mem_ctx, r2);\n"; + pidl "\t\tresult = vtable->$d->{NAME}(iface, mem_ctx, r2);\n"; } else { pidl "\t\tvtable->$d->{NAME}(iface, mem_ctx, r2);\n"; } @@ -89,8 +90,8 @@ static NTSTATUS $name\__op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_C { uint16 opnum = dce_call->pkt.u.request.opnum; struct GUID ipid = dce_call->pkt.u.request.object.object; - struct dcom_interface_p *iface = dcoms_get_ifacep(&ipid); - struct dcom_$name\_vtable *vtable = if->vtable; + struct dcom_interface_p *iface = dcom_get_iface_p(&ipid); + const struct dcom_$name\_vtable *vtable = iface->vtable; dce_call->fault_code = 0; @@ -193,7 +194,7 @@ NTSTATUS dcerpc_server_$name\_init(void) ep_server.interface_by_name = $name\__op_interface_by_name; /* register ourselves with the DCERPC subsystem. */ - ret = register_backend(\"dcerpc\", &ep_server); + ret = dcerpc_register_ep_server(&ep_server); if (!NT_STATUS_IS_OK(ret)) { DEBUG(0,(\"Failed to register \'$name\' endpoint server!\\n\")); @@ -209,7 +210,7 @@ NTSTATUS dcerpc_server_$name\_init(void) sub ParseInterface($) { my($interface) = shift; - $res = "/* dcerpc server boilerplate generated by pidl */\n\n"; + $res = "/* dcom interface stub generated by pidl */\n\n"; Boilerplate_Iface($interface); Boilerplate_Ep_Server($interface); @@ -218,4 +219,3 @@ sub ParseInterface($) } 1; - |