diff options
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Samba3')
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm b/source4/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm index c939feb1b9..6cfab753e9 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba3/ClientNDR.pm @@ -10,7 +10,7 @@ use strict; use Parse::Pidl::Typelist qw(hasType getType mapType scalar_is_reference); use Parse::Pidl::Util qw(has_property ParseExpr is_constant); use Parse::Pidl::NDR qw(GetPrevLevel GetNextLevel ContainsDeferred); -use Parse::Pidl::Samba4 qw(DeclLong); +use Parse::Pidl::Samba4 qw(DeclLong_cli IsUniqueOut); use vars qw($VERSION); $VERSION = '0.01'; @@ -36,7 +36,7 @@ sub ParseFunction($$) my $ufn = "DCERPC_".uc($fn->{NAME}); foreach (@{$fn->{ELEMENTS}}) { - $defargs .= ", " . DeclLong($_); + $defargs .= ", " . DeclLong_cli($_); } fn_declare "NTSTATUS rpccli_$fn->{NAME}(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx$defargs)"; pidl "{"; @@ -48,7 +48,12 @@ sub ParseFunction($$) foreach (@{$fn->{ELEMENTS}}) { if (grep(/in/, @{$_->{DIRECTION}})) { + if ( IsUniqueOut($_) ) { + pidl "r.in.$_->{NAME} = *$_->{NAME};"; + } + else { pidl "r.in.$_->{NAME} = $_->{NAME};"; + } } } @@ -79,12 +84,8 @@ sub ParseFunction($$) fatal($e, "[out] argument is not a pointer or array") if ($e->{LEVELS}[0]->{TYPE} ne "POINTER" and $e->{LEVELS}[0]->{TYPE} ne "ARRAY"); - if ( ($e->{LEVELS}[0]->{TYPE} eq "POINTER") && ($e->{LEVELS}[0]->{POINTER_TYPE} eq "unique") ) { - pidl "if ( $e->{NAME} ) {"; - indent; - pidl "*$e->{NAME} = *r.out.$e->{NAME};"; - deindent; - pidl "}"; + if ( IsUniqueOut($e) ) { + pidl "*$e->{NAME} = r.out.$e->{NAME};"; } else { pidl "*$e->{NAME} = *r.out.$e->{NAME};"; } |