diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-09-26 12:10:32 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-09-26 19:11:09 +0000 |
commit | d720fe8f77fb7a5a1d1aed10f60f33284029d481 (patch) | |
tree | 52f9175fb2ededbcf43860e353fcd87ce0abd047 /tools/pidl | |
parent | df685fc94ea9f23143748eb2a1c179410fb658be (diff) |
Update to the latest version from the Samba Git repository.
Changes from the Samba Git log:
commit 2ba9453e9ff5d911a146e786ff8878ef67717366
Author: Stefan Metzmacher <metze@samba.org>
Date: Thu Sep 26 20:38:12 2013 +0200
pidl:NDR/Client: avoid useless memcpy()
If the src and dest pointer of memcpy would be the same
we should avoid it in order to avoid valgrind warnings.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
commit f50b561336c7b6c08300e6e477859d1f9fab62c2
Author: Stefan Metzmacher <metze@samba.org>
Date: Thu Sep 26 01:20:10 2013 +0200
pidl:NDR/Client: fix dcerpc_function() with [out,ref] pointers
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
commit 662fc2de8c2896503026a2a4052ed1ea8ce78af5
Author: Stefan Metzmacher <metze@samba.org>
Date: Fri Aug 30 08:54:10 2013 +0200
pidl:NDR/Client: simplify tevent_req_nterror() usage
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
commit 02c34fe4e51b5e62157eaf2de1d0aaf9fc6b8d72
Author: Stefan Metzmacher <metze@samba.org>
Date: Fri Aug 30 08:53:18 2013 +0200
pidl:NDR/Client: add missing TALLOC_FREE(subreq) after dcerpc_binding_handle_call_recv()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Change-Id: I19017fd216df8d8d202b995305f4eb7b7a8b9a35
Reviewed-on: https://code.wireshark.org/review/4314
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'tools/pidl')
-rw-r--r-- | tools/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/tools/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm b/tools/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm index c796b466ad..b4954ca624 100644 --- a/tools/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm +++ b/tools/pidl/lib/Parse/Pidl/Samba4/NDR/Client.pm @@ -158,9 +158,9 @@ sub ParseFunction_r_Done($$$$) $self->pidl(""); $self->pidl("status = dcerpc_binding_handle_call_recv(subreq);"); - $self->pidl("if (!NT_STATUS_IS_OK(status)) {"); + $self->pidl("TALLOC_FREE(subreq);"); + $self->pidl("if (tevent_req_nterror(req, status)) {"); $self->indent; - $self->pidl("tevent_req_nterror(req, status);"); $self->pidl("return;"); $self->deindent; $self->pidl("}"); @@ -400,11 +400,16 @@ sub ParseOutputArgument($$$$$$) $self->pidl("$copy_len_var = $out_length_is;"); } + my $dest_ptr = "$o$e->{NAME}"; + my $elem_size = "sizeof(*$dest_ptr)"; + $self->pidl("if ($dest_ptr != $out_var) {"); + $self->indent; if (has_property($e, "charset")) { - $self->pidl("memcpy(discard_const_p(uint8_t *, $o$e->{NAME}), $out_var, $copy_len_var * sizeof(*$o$e->{NAME}));"); - } else { - $self->pidl("memcpy($o$e->{NAME}, $out_var, $copy_len_var * sizeof(*$o$e->{NAME}));"); + $dest_ptr = "discard_const_p(uint8_t *, $dest_ptr)"; } + $self->pidl("memcpy($dest_ptr, $out_var, $copy_len_var * $elem_size);"); + $self->deindent; + $self->pidl("}"); $self->deindent; $self->pidl("}"); @@ -563,9 +568,8 @@ sub ParseFunction_Done($$$$) $self->pidl("status = dcerpc_$name\_r_recv(subreq, mem_ctx);"); $self->pidl("TALLOC_FREE(subreq);"); - $self->pidl("if (!NT_STATUS_IS_OK(status)) {"); + $self->pidl("if (tevent_req_nterror(req, status)) {"); $self->indent; - $self->pidl("tevent_req_nterror(req, status);"); $self->pidl("return;"); $self->deindent; $self->pidl("}"); @@ -693,6 +697,20 @@ sub ParseFunction_Sync($$$$) } $self->pidl(""); + $self->pidl("/* Out parameters */"); + foreach my $e (@{$fn->{ELEMENTS}}) { + next unless grep(/out/, @{$e->{DIRECTION}}); + + $self->ParseCopyArgument($fn, $e, "r.out.", "_"); + } + $self->pidl(""); + + if (defined($fn->{RETURN_TYPE})) { + $self->pidl("/* Result */"); + $self->pidl("ZERO_STRUCT(r.out.result);"); + $self->pidl(""); + } + $self->pidl("status = dcerpc_$name\_r(h, mem_ctx, &r);"); $self->pidl("if (!NT_STATUS_IS_OK(status)) {"); $self->indent; |