pidl: fix generated s3-server in,out,ref qualifiers that are used for buffer allocation.
[kai/samba.git] / pidl / lib / Parse / Pidl / Samba3 / ServerNDR.pm
index c565d8a572968dee6ca62ade97e3f10d236f3d97..eb3cdf20cb060d2c18fb19abcae946c109bf38c4 100644 (file)
@@ -142,6 +142,13 @@ sub ParseFunction($$)
                my @dir = @{$_->{DIRECTION}};
                if (grep(/in/, @dir) and grep(/out/, @dir)) {
                        pidl "r->out.$_->{NAME} = r->in.$_->{NAME};";
+               }
+       }
+
+       foreach (@{$fn->{ELEMENTS}}) {
+               my @dir = @{$_->{DIRECTION}};
+               if (grep(/in/, @dir) and grep(/out/, @dir)) {
+                       # noop
                } elsif (grep(/out/, @dir) and not
                                 has_property($_, "represent_as")) {
                        AllocOutVar($_, "r", "r->out.$_->{NAME}", $env);
@@ -171,7 +178,7 @@ sub ParseFunction($$)
        pidl "\tNDR_PRINT_OUT_DEBUG($fn->{NAME}, r);";
        pidl "}";
        pidl "";
-       pidl "push = ndr_push_init_ctx(r);";
+       pidl "push = ndr_push_init_ctx(r, NULL);";
        pidl "if (push == NULL) {";
        pidl "\ttalloc_free(r);";
        pidl "\treturn false;";
@@ -205,7 +212,11 @@ sub ParseInterface($)
 
        pidl_hdr "#ifndef __SRV_$uif\__";
        pidl_hdr "#define __SRV_$uif\__";
-       ParseFunction($if, $_) foreach (@{$if->{FUNCTIONS}});
+
+       foreach (@{$if->{FUNCTIONS}}) {
+               next if ($_->{PROPERTIES}{noopnum});
+               ParseFunction($if, $_);
+       }
 
        pidl "";
        pidl "/* Tables */";
@@ -214,6 +225,7 @@ sub ParseInterface($)
        indent;
 
        foreach (@{$if->{FUNCTIONS}}) {
+               next if ($_->{PROPERTIES}{noopnum});
                pidl "{\"" . uc($_->{NAME}) . "\", NDR_" . uc($_->{NAME}) . ", api_$_->{NAME}},";
        }