summaryrefslogtreecommitdiff
path: root/source4/pidl/lib/Parse/Pidl/Samba4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-01-05 21:36:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:37:04 -0500
commit40b71722e184e82de6c030d56af6943854599e19 (patch)
treed65e625a1ace17ee9e6f17ae155e9f193681bfc7 /source4/pidl/lib/Parse/Pidl/Samba4
parent46908530bc39e0ba3742650639b35a6d0c32852b (diff)
downloadsamba-40b71722e184e82de6c030d56af6943854599e19.tar.gz
samba-40b71722e184e82de6c030d56af6943854599e19.tar.bz2
samba-40b71722e184e82de6c030d56af6943854599e19.zip
r20573: fix handling of pointers handling to elements with the charset property
metze (This used to be commit 895416c2202cac561e3bda80fe5c05a782dde0b0)
Diffstat (limited to 'source4/pidl/lib/Parse/Pidl/Samba4')
-rw-r--r--source4/pidl/lib/Parse/Pidl/Samba4/EJS.pm20
1 files changed, 14 insertions, 6 deletions
diff --git a/source4/pidl/lib/Parse/Pidl/Samba4/EJS.pm b/source4/pidl/lib/Parse/Pidl/Samba4/EJS.pm
index c851fafd4b..1ce22d5180 100644
--- a/source4/pidl/lib/Parse/Pidl/Samba4/EJS.pm
+++ b/source4/pidl/lib/Parse/Pidl/Samba4/EJS.pm
@@ -187,7 +187,11 @@ sub EjsPullPointer($$$$$)
sub EjsPullString($$$$$)
{
my ($e, $l, $var, $name, $env) = @_;
+ my $pl = Parse::Pidl::NDR::GetPrevLevel($e, $l);
$var = get_pointer_to($var);
+ if (defined($pl) and $pl->{TYPE} eq "POINTER") {
+ $var = get_pointer_to($var);
+ }
pidl "NDR_CHECK(ejs_pull_string(ejs, v, $name, $var));";
}
@@ -248,14 +252,14 @@ sub EjsPullSwitch($$$$$)
sub EjsPullElement($$$$$)
{
my ($e, $l, $var, $name, $env) = @_;
- if (has_property($e, "charset")) {
+ if (($l->{TYPE} eq "POINTER")) {
+ EjsPullPointer($e, $l, $var, $name, $env);
+ } elsif (has_property($e, "charset")) {
EjsPullString($e, $l, $var, $name, $env);
} elsif ($l->{TYPE} eq "ARRAY") {
EjsPullArray($e, $l, $var, $name, $env);
} elsif ($l->{TYPE} eq "DATA") {
EjsPullScalar($e, $l, $var, $name, $env);
- } elsif (($l->{TYPE} eq "POINTER")) {
- EjsPullPointer($e, $l, $var, $name, $env);
} elsif (($l->{TYPE} eq "SWITCH")) {
EjsPullSwitch($e, $l, $var, $name, $env);
} else {
@@ -459,6 +463,10 @@ sub EjsPushScalar($$$$$)
sub EjsPushString($$$$$)
{
my ($e, $l, $var, $name, $env) = @_;
+ my $pl = Parse::Pidl::NDR::GetPrevLevel($e, $l);
+ if (defined($pl) and $pl->{TYPE} eq "POINTER") {
+ $var = get_pointer_to($var);
+ }
pidl "NDR_CHECK(ejs_push_string(ejs, v, $name, $var));";
}
@@ -531,14 +539,14 @@ sub EjsPushArray($$$$$)
sub EjsPushElement($$$$$)
{
my ($e, $l, $var, $name, $env) = @_;
- if (has_property($e, "charset")) {
+ if (($l->{TYPE} eq "POINTER")) {
+ EjsPushPointer($e, $l, $var, $name, $env);
+ } elsif (has_property($e, "charset")) {
EjsPushString($e, $l, $var, $name, $env);
} elsif ($l->{TYPE} eq "ARRAY") {
EjsPushArray($e, $l, $var, $name, $env);
} elsif ($l->{TYPE} eq "DATA") {
EjsPushScalar($e, $l, $var, $name, $env);
- } elsif (($l->{TYPE} eq "POINTER")) {
- EjsPushPointer($e, $l, $var, $name, $env);
} elsif (($l->{TYPE} eq "SWITCH")) {
EjsPushSwitch($e, $l, $var, $name, $env);
} else {