Fix alignment issues in SPOOLSS "BUFFER" marshalling.
authorJeremy Allison <jra@samba.org>
Fri, 18 Feb 2011 17:01:46 +0000 (09:01 -0800)
committerJeremy Allison <jra@samba.org>
Fri, 18 Feb 2011 17:49:55 +0000 (18:49 +0100)
Guenther and Metze please check !

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Feb 18 18:49:55 CET 2011 on sn-devel-104

pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm

index 075ad85..eda583e 100644 (file)
@@ -1281,12 +1281,19 @@ sub ParseStructPushPrimitives($$$$$)
 sub ParseStructPushDeferred($$$$)
 {
        my ($self, $struct, $ndr, $varname, $env) = @_;
+
        if (defined($struct->{PROPERTIES}{relative_base})) {
+               $self->pidl("NDR_CHECK(ndr_push_align($ndr, $struct->{ALIGN}));");
+
                # retrieve the current offset as base for relative pointers
                # based on the toplevel struct/union
                $self->pidl("NDR_CHECK(ndr_push_setup_relative_base_offset2($ndr, $varname));");
        }
        $self->ParseElementPush($_, $ndr, $env, 0, 1) foreach (@{$struct->{ELEMENTS}});
+
+       if (defined($struct->{PROPERTIES}{relative_base})) {
+               $self->pidl("NDR_CHECK(ndr_push_trailer_align($ndr, $struct->{ALIGN}));");
+       }
 }
 
 #####################################################################