diff options
Diffstat (limited to 'source4/script/build_smb_interfaces.pl')
-rwxr-xr-x | source4/script/build_smb_interfaces.pl | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source4/script/build_smb_interfaces.pl b/source4/script/build_smb_interfaces.pl index 7c9bd3d365..3aacc6df55 100755 --- a/source4/script/build_smb_interfaces.pl +++ b/source4/script/build_smb_interfaces.pl @@ -77,7 +77,7 @@ sub print_field($$) { my $f = shift; my $suffix = shift; - my $type = "UNKNOWN"; + my $type = $f->{TYPE}; if ($f->{TYPE} eq "char" and $f->{POINTERS} == 1) { $type = "string"; @@ -88,8 +88,16 @@ sub print_field($$) { $type =~ s/_t$//; } + my $deref = "&"; + if ($f->{POINTERS} == 1 && $type ne "string") { + $deref = ""; + } + foreach my $x (@{$f->{NAME}}) { - print FILE "\tNDR_CHECK(ejs_pull_$type(ejs, v, \"$x\", &r->$suffix.$x));\n"; + if ($f->{POINTERS} > 0) { + print FILE "\t// alloc $x?\n"; + } + print FILE "\tNDR_CHECK(ejs_pull_$type(ejs, v, \"$x\", ${deref}r->$suffix.$x));\n"; } } |