s4-pidl: add support for NDR64
authorAndrew Tridgell <tridge@samba.org>
Thu, 17 Sep 2009 16:10:21 +0000 (09:10 -0700)
committerAndrew Tridgell <tridge@samba.org>
Fri, 18 Sep 2009 04:52:25 +0000 (21:52 -0700)
Added support for NDR64 to the samba4 pidl generator

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

index a36f6380924977dd1285e0099e7ae16e988fc0c0..7aebed0fe2429fb150d7219005b1f9dbf72faef3 100644 (file)
@@ -363,7 +363,10 @@ sub find_largest_alignment($)
                my $a = 1;
 
                if ($e->{POINTERS}) {
                my $a = 1;
 
                if ($e->{POINTERS}) {
-                       $a = 4; 
+                       # this is a hack for NDR64
+                       # the NDR layer translates this into
+                       # an alignment of 4 for NDR and 8 for NDR64
+                       $a = 5;
                } elsif (has_property($e, "subcontext")) { 
                        $a = 1;
                } elsif (has_property($e, "transmit_as")) {
                } elsif (has_property($e, "subcontext")) { 
                        $a = 1;
                } elsif (has_property($e, "transmit_as")) {
index cc8085a54fdb577290c7c30cc4a3e49e35803bcb..27299c80257b265a5f4af7b78d50d44e8073e806 100644 (file)
@@ -204,12 +204,12 @@ sub ParseArrayPushHeader($$$$$$)
        }
 
        if ((!$l->{IS_SURROUNDING}) and $l->{IS_CONFORMANT}) {
        }
 
        if ((!$l->{IS_SURROUNDING}) and $l->{IS_CONFORMANT}) {
-               $self->pidl("NDR_CHECK(ndr_push_uint32($ndr, NDR_SCALARS, $size));");
+               $self->pidl("NDR_CHECK(ndr_push_uint3264($ndr, NDR_SCALARS, $size));");
        }
        
        if ($l->{IS_VARYING}) {
        }
        
        if ($l->{IS_VARYING}) {
-               $self->pidl("NDR_CHECK(ndr_push_uint32($ndr, NDR_SCALARS, 0));");  # array offset
-               $self->pidl("NDR_CHECK(ndr_push_uint32($ndr, NDR_SCALARS, $length));");
+               $self->pidl("NDR_CHECK(ndr_push_uint3264($ndr, NDR_SCALARS, 0));");  # array offset
+               $self->pidl("NDR_CHECK(ndr_push_uint3264($ndr, NDR_SCALARS, $length));");
        } 
 
        return $length;
        } 
 
        return $length;
@@ -1220,9 +1220,9 @@ sub ParseStructPushPrimitives($$$$$)
                                $size = ParseExpr($e->{LEVELS}[0]->{SIZE_IS}, $env, $e->{ORIGINAL});
                        }
 
                                $size = ParseExpr($e->{LEVELS}[0]->{SIZE_IS}, $env, $e->{ORIGINAL});
                        }
 
-                       $self->pidl("NDR_CHECK(ndr_push_uint32($ndr, NDR_SCALARS, $size));");
+                       $self->pidl("NDR_CHECK(ndr_push_uint3264($ndr, NDR_SCALARS, $size));");
                } else {
                } else {
-                       $self->pidl("NDR_CHECK(ndr_push_uint32($ndr, NDR_SCALARS, ndr_string_array_size($ndr, $varname->$e->{NAME})));");
+                       $self->pidl("NDR_CHECK(ndr_push_uint3264($ndr, NDR_SCALARS, ndr_string_array_size($ndr, $varname->$e->{NAME})));");
                }
        }
 
                }
        }