diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/librpc/idl/drsuapi.idl | 2 | ||||
-rw-r--r-- | source4/pidl/lib/Parse/Pidl/Samba/NDR/Parser.pm | 21 |
2 files changed, 22 insertions, 1 deletions
diff --git a/source4/librpc/idl/drsuapi.idl b/source4/librpc/idl/drsuapi.idl index 289f5110e2..66aa527039 100644 --- a/source4/librpc/idl/drsuapi.idl +++ b/source4/librpc/idl/drsuapi.idl @@ -444,7 +444,7 @@ interface drsuapi typedef struct { [range(0,10485760),value(ndr_size_drsuapi_DsReplicaObjectIdentifier3(object, ndr->flags))] uint32 __ndr_size; - [subcontext(4)] drsuapi_DsReplicaObjectIdentifier3 *object; + [subcontext(4),subcontext_size(__ndr_size)] drsuapi_DsReplicaObjectIdentifier3 *object; } drsuapi_DsAttributeValueDNString; typedef struct { diff --git a/source4/pidl/lib/Parse/Pidl/Samba/NDR/Parser.pm b/source4/pidl/lib/Parse/Pidl/Samba/NDR/Parser.pm index ef22ff9788..513fa0826d 100644 --- a/source4/pidl/lib/Parse/Pidl/Samba/NDR/Parser.pm +++ b/source4/pidl/lib/Parse/Pidl/Samba/NDR/Parser.pm @@ -235,6 +235,20 @@ sub GenerateStructEnv($) return \%env; } +sub EnvSubstituteValue($$) +{ + my ($env,$s) = @_; + + # Substitute the value() values in the env + foreach my $e (@{$s->{ELEMENTS}}) { + next unless (my $v = has_property($e, "value")); + + $env->{$e->{NAME}} = ParseExpr($v, $env); + } + + return $env; +} + sub GenerateFunctionInEnv($) { my $fn = shift; @@ -1095,6 +1109,8 @@ sub ParseStructPush($$) my $env = GenerateStructEnv($struct); + EnvSubstituteValue($env, $struct); + # save the old relative_base_offset pidl "uint32_t _save_relative_base_offset = ndr_push_get_relative_base_offset(ndr);" if defined($struct->{PROPERTIES}{relative_base}); @@ -1326,6 +1342,8 @@ sub ParseStructPrint($$) my $env = GenerateStructEnv($struct); + EnvSubstituteValue($env, $struct); + foreach my $e (@{$struct->{ELEMENTS}}) { DeclareArrayVariables($e); } @@ -1870,6 +1888,7 @@ sub ParseFunctionPrint($) pidl "ndr->depth++;"; my $env = GenerateFunctionInEnv($fn); + EnvSubstituteValue($env, $fn); foreach my $e (@{$fn->{ELEMENTS}}) { if (grep(/in/,@{$e->{DIRECTION}})) { @@ -1925,6 +1944,8 @@ sub ParseFunctionPush($) my $env = GenerateFunctionInEnv($fn); + EnvSubstituteValue($env, $fn); + foreach my $e (@{$fn->{ELEMENTS}}) { if (grep(/in/,@{$e->{DIRECTION}})) { ParseElementPush($e, "ndr", "r->in.", $env, 1, 1); |