summaryrefslogtreecommitdiff
path: root/source4/build
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-03-12 08:29:54 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:11:01 -0500
commite90c904a5f9b3b10a2e304be3a532ceb83424cb5 (patch)
treec2cb689c85ec789036f9924f9773dacabbd378f1 /source4/build
parent4b83366b6cf81a29fab0f9dac5e6074784c639a8 (diff)
downloadsamba-e90c904a5f9b3b10a2e304be3a532ceb83424cb5.tar.gz
samba-e90c904a5f9b3b10a2e304be3a532ceb83424cb5.tar.bz2
samba-e90c904a5f9b3b10a2e304be3a532ceb83424cb5.zip
r5764: add support for embedded ref pointers
metze (This used to be commit 112043b1809a96b1a39ade71ea2885c0d792c79f)
Diffstat (limited to 'source4/build')
-rw-r--r--source4/build/pidl/ndr.pm14
-rw-r--r--source4/build/pidl/validator.pm4
2 files changed, 10 insertions, 8 deletions
diff --git a/source4/build/pidl/ndr.pm b/source4/build/pidl/ndr.pm
index fcd6f6d6dd..1e862f5c23 100644
--- a/source4/build/pidl/ndr.pm
+++ b/source4/build/pidl/ndr.pm
@@ -183,7 +183,7 @@ sub need_alloc($)
{
my $e = shift;
- return 0 if (util::has_property($e, "ref"));
+ return 0 if (util::has_property($e, "ref") && $e->{PARENT}->{TYPE} eq "FUNCTION");
return 1 if ($e->{POINTERS} || util::array_size($e));
return 0;
}
@@ -707,7 +707,9 @@ sub ParsePtrPush($$)
my $e = shift;
my $var_prefix = shift;
- if (util::has_property($e, "relative")) {
+ if (util::has_property($e, "ref")) {
+ pidl "NDR_CHECK(ndr_push_ref_ptr(ndr, $var_prefix$e->{NAME}));";
+ } elsif (util::has_property($e, "relative")) {
pidl "NDR_CHECK(ndr_push_relative_ptr1(ndr, $var_prefix$e->{NAME}));";
} else {
pidl "NDR_CHECK(ndr_push_unique_ptr(ndr, $var_prefix$e->{NAME}));";
@@ -855,7 +857,11 @@ sub ParsePtrPull($$)
my($e) = shift;
my($var_prefix) = shift;
- pidl "NDR_CHECK(ndr_pull_unique_ptr(ndr, &_ptr_$e->{NAME}));";
+ if (util::has_property($e, "ref")) {
+ pidl "NDR_CHECK(ndr_pull_ref_ptr(ndr, &_ptr_$e->{NAME}));";
+ } else {
+ pidl "NDR_CHECK(ndr_pull_unique_ptr(ndr, &_ptr_$e->{NAME}));";
+ }
pidl "if (_ptr_$e->{NAME}) {";
indent;
pidl "NDR_ALLOC(ndr, $var_prefix$e->{NAME});";
@@ -1777,7 +1783,7 @@ sub ParseFunctionElementPush($$)
if (util::array_size($e)) {
if (need_wire_pointer($e)) {
- pidl "NDR_CHECK(ndr_push_unique_ptr(ndr, r->$inout.$e->{NAME}));";
+ ParsePtrPush($e, "r->$inout.");
pidl "if (r->$inout.$e->{NAME}) {";
indent;
ParseArrayPush($e, "ndr", "r->$inout.", "NDR_SCALARS|NDR_BUFFERS");
diff --git a/source4/build/pidl/validator.pm b/source4/build/pidl/validator.pm
index bbef008ee5..e8a42c6031 100644
--- a/source4/build/pidl/validator.pm
+++ b/source4/build/pidl/validator.pm
@@ -88,10 +88,6 @@ sub ValidStruct($)
my($struct) = shift;
foreach my $e (@{$struct->{ELEMENTS}}) {
- if (util::has_property($e, "ref")) {
- fatal(el_name($e) . " : embedded ref pointers are not supported yet\n");
- }
-
$e->{PARENT} = $struct;
ValidElement($e);
}