summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/build/pidl/client.pm37
-rw-r--r--source4/build/pidl/parser.pm3
2 files changed, 22 insertions, 18 deletions
diff --git a/source4/build/pidl/client.pm b/source4/build/pidl/client.pm
index 6944b26747..7eb3b397b3 100644
--- a/source4/build/pidl/client.pm
+++ b/source4/build/pidl/client.pm
@@ -17,35 +17,36 @@ sub ParseFunction($)
my $name = $fn->{NAME};
my $uname = uc $name;
- if ($fn->{RETURN_TYPE} ne "NTSTATUS") {
- $res .= "
-NTSTATUS dcerpc_$name(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r)
-{
- return dcerpc_ndr_request(p, DCERPC_$uname, mem_ctx,
- (ndr_push_fn_t) ndr_push_$name,
- (ndr_pull_fn_t) ndr_pull_$name,
- r);
-}
-";
- } else {
- $res .= "
+ $res .=
+"
NTSTATUS dcerpc_$name(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct $name *r)
{
NTSTATUS status;
+
+ if (p->flags & DCERPC_DEBUG_PRINT_IN) {
+ NDR_PRINT_IN_DEBUG($name, r);
+ }
+
status = dcerpc_ndr_request(p, DCERPC_$uname, mem_ctx,
(ndr_push_fn_t) ndr_push_$name,
(ndr_pull_fn_t) ndr_pull_$name,
r);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
+
+ if (NT_STATUS_IS_OK(status) && (p->flags & DCERPC_DEBUG_PRINT_OUT)) {
+ NDR_PRINT_OUT_DEBUG($name, r);
}
-
- return r->out.result;
-}
";
+ if ($fn->{RETURN_TYPE} eq "NTSTATUS") {
+ $res .= "\tif (NT_STATUS_IS_OK(status)) status = r->out.result;\n";
+ }
+ $res .=
+"
+ return status;
}
+";
}
+
#####################################################################
# parse the interface definitions
sub ParseInterface($)
@@ -64,7 +65,7 @@ sub ParseInterface($)
sub Parse($)
{
my($idl) = shift;
- $res = "/* dcerpc client calls auto-generated by pidl */\n\n";
+ $res = "/* dcerpc client calls generated by pidl */\n\n";
$res .= "#include \"includes.h\"\n\n";
foreach my $x (@{$idl}) {
($x->{TYPE} eq "INTERFACE") &&
diff --git a/source4/build/pidl/parser.pm b/source4/build/pidl/parser.pm
index 050ebdda02..1d3e772298 100644
--- a/source4/build/pidl/parser.pm
+++ b/source4/build/pidl/parser.pm
@@ -825,6 +825,9 @@ sub ParseFunctionPrint($)
ParseElementPrintScalar($e, "r->out.");
}
}
+ if ($fn->{RETURN_TYPE} && $fn->{RETURN_TYPE} ne "void") {
+ $res .= "\tndr_print_$fn->{RETURN_TYPE}(ndr, \"result\", &r->out.result);\n";
+ }
$res .= "\tndr->depth--;\n";
$res .= "\t}\n";