From 3d5dd91f598b8661d090ae147ae7c3a8fcea29e0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 7 Sep 2011 15:34:43 +1000 Subject: pidl: added checking of NDR flags in generated code Pair-Programmed-With: Andrew Bartlett --- pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'pidl') diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm index 3d31366abf..19c3cc8024 100644 --- a/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm +++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm @@ -1332,6 +1332,7 @@ sub ParseStructPush($$$$) $self->start_flags($struct, $ndr); + $self->pidl("NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);"); $self->pidl("if (ndr_flags & NDR_SCALARS) {"); $self->indent; $self->ParseStructPushPrimitives($struct, $ndr, $varname, $env); @@ -1645,6 +1646,7 @@ sub ParseStructPull($$$$) my $env = GenerateStructEnv($struct, $varname); + $self->pidl("NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);"); $self->pidl("if (ndr_flags & NDR_SCALARS) {"); $self->indent; $self->ParseStructPullPrimitives($struct,$ndr,$varname,$env); @@ -1808,6 +1810,7 @@ sub ParseUnionPush($$$$) $self->start_flags($e, $ndr); + $self->pidl("NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);"); $self->pidl("if (ndr_flags & NDR_SCALARS) {"); $self->indent; $self->ParseUnionPushPrimitives($e, $ndr, $varname); @@ -1985,6 +1988,7 @@ sub ParseUnionPull($$$$) $self->pidl("level = ndr_pull_get_switch_value($ndr, $varname);"); + $self->pidl("NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);"); $self->pidl("if (ndr_flags & NDR_SCALARS) {"); $self->indent; $self->ParseUnionPullPrimitives($e,$ndr,$varname,$switch_type); @@ -2267,6 +2271,8 @@ sub ParseFunctionPush($$) $self->DeclareArrayVariables($e); } + $self->pidl("NDR_PUSH_CHECK_FN_FLAGS(ndr, flags);"); + $self->pidl("if (flags & NDR_IN) {"); $self->indent; @@ -2354,6 +2360,8 @@ sub ParseFunctionPull($$) $double_cases{"$e->{NAME}"} = 1; } + $self->pidl("NDR_PULL_CHECK_FN_FLAGS(ndr, flags);"); + $self->pidl("if (flags & NDR_IN) {"); $self->indent; -- cgit