pidl:Samba4/NDR/Parser: fix NDR64 union alignment
[kai/samba.git] / pidl / lib / Parse / Pidl / Samba4 / NDR / Parser.pm
index 27e7a30ca699d11e1189a8204122a997c041ae6b..09518f7ceec94d45b790e137583f3c0bd974adb9 100644 (file)
@@ -1688,6 +1688,10 @@ sub ParseUnionPushPrimitives($$$$)
 
        $self->pidl("uint32_t level = ndr_push_get_switch_value($ndr, $varname);");
 
+       if (defined($e->{ALIGN})) {
+               $self->pidl("NDR_CHECK(ndr_push_union_align($ndr, $e->{ALIGN}));");
+       }
+
        if (defined($e->{SWITCH_TYPE})) {
                $self->pidl("NDR_CHECK(ndr_push_$e->{SWITCH_TYPE}($ndr, NDR_SCALARS, level));");
        }
@@ -1833,6 +1837,10 @@ sub ParseUnionPullPrimitives($$$$$)
        my ($self,$e,$ndr,$varname,$switch_type) = @_;
        my $have_default = 0;
 
+       if (defined($e->{ALIGN})) {
+               $self->pidl("NDR_CHECK(ndr_pull_union_align($ndr, $e->{ALIGN}));");
+       }
+
        if (defined($switch_type)) {
                $self->pidl("NDR_CHECK(ndr_pull_$switch_type($ndr, NDR_SCALARS, &_level));");
                $self->pidl("if (_level != level) {");