summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-06-14 07:27:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:56:39 -0500
commit004a9979a974775b6c94eabf5c9e7674d31a150a (patch)
treeebdc587982f334c99c521924103b23b58bebf4e0
parentf0d43daac040c5d30a9735049817f292b8e35a4d (diff)
downloadsamba-004a9979a974775b6c94eabf5c9e7674d31a150a.tar.gz
samba-004a9979a974775b6c94eabf5c9e7674d31a150a.tar.bz2
samba-004a9979a974775b6c94eabf5c9e7674d31a150a.zip
r1133: - add ndr_pull_ptr() as a separate call instead of ndr_pull_uint32()
(useful for debugging IDL) - fixed a couple of places that auto-generate incorrect printf style arguments for ndr_pull_error() (This used to be commit ad3324a79ce030df4c5ed46408e662b46588f89f)
-rw-r--r--source4/build/pidl/parser.pm6
-rw-r--r--source4/librpc/ndr/ndr_basic.c10
2 files changed, 13 insertions, 3 deletions
diff --git a/source4/build/pidl/parser.pm b/source4/build/pidl/parser.pm
index 69b878e46e..120c964bbc 100644
--- a/source4/build/pidl/parser.pm
+++ b/source4/build/pidl/parser.pm
@@ -448,7 +448,7 @@ sub ParseElementPullSwitch($$$$)
} else {
pidl "\t\tif (_level != $switch_var) {\n";
}
- pidl "\t\t\treturn ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, \"Bad switch value %u in $e->{NAME}\");\t\t}\n";
+ pidl "\t\t\treturn ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, \"Bad switch value %u in $e->{NAME}\", _level);\t\t}\n";
if ($switch_var =~ /r->/) {
pidl "else { $switch_var = _level; }\n";
}
@@ -524,7 +524,7 @@ sub ParseElementPullScalar($$$)
} elsif (util::is_inline_array($e)) {
ParseArrayPull($e, "r->", "NDR_SCALARS");
} elsif (util::need_wire_pointer($e)) {
- pidl "\tNDR_CHECK(ndr_pull_uint32(ndr, &_ptr_$e->{NAME}));\n";
+ pidl "\tNDR_CHECK(ndr_pull_ptr(ndr, &_ptr_$e->{NAME}));\n";
pidl "\tif (_ptr_$e->{NAME}) {\n";
pidl "\t\tNDR_ALLOC(ndr, $var_prefix$e->{NAME});\n";
pidl "\t} else {\n";
@@ -1209,7 +1209,7 @@ sub ParseFunctionElementPull($$)
if (util::array_size($e)) {
if (util::need_wire_pointer($e)) {
- pidl "\tNDR_CHECK(ndr_pull_uint32(ndr, &_ptr_$e->{NAME}));\n";
+ pidl "\tNDR_CHECK(ndr_pull_ptr(ndr, &_ptr_$e->{NAME}));\n";
pidl "\tif (_ptr_$e->{NAME}) {\n";
} elsif ($inout eq "out" && util::has_property($e, "ref")) {
pidl "\tif (r->$inout.$e->{NAME}) {\n";
diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c
index ea58a77c47..5d4ade096f 100644
--- a/source4/librpc/ndr/ndr_basic.c
+++ b/source4/librpc/ndr/ndr_basic.c
@@ -66,6 +66,16 @@ NTSTATUS ndr_pull_uint32(struct ndr_pull *ndr, uint32_t *v)
}
/*
+ parse a pointer
+*/
+NTSTATUS ndr_pull_ptr(struct ndr_pull *ndr, uint32_t *v)
+{
+ NTSTATUS status;
+ status = ndr_pull_uint32(ndr, v);
+ return status;
+}
+
+/*
parse a uint64
*/
NTSTATUS ndr_pull_uint64(struct ndr_pull *ndr, uint64_t *v)