Revert "Work around ndr_unpack failing on structures with relative pointers."
[ira/wip.git] / pidl / lib / Parse / Pidl / Samba4 / Python.pm
index c785619adb95c9965e7a40ed787fa31538085cd7..79c72d732fb707e809d4a5f7137b07af40f57cad 100644 (file)
@@ -275,24 +275,7 @@ sub PythonStruct($$$$$$)
                $self->pidl("if (!PyArg_ParseTuple(args, \"s#:__ndr_unpack__\", &blob.data, &blob.length))");
                $self->pidl("\treturn NULL;");
                $self->pidl("");
-
-               # This disgusting hack works around the fact that ndr_pull_struct_blob_all will always fail on structures with relative pointers.  
-                # So, map ndr_unpack to ndr_pull_struct_blob_all only if we don't have any relative pointers in this
-               my $got_relative = 0;
-               if ($#{$d->{ELEMENTS}} > -1) {
-                       foreach my $e (@{$d->{ELEMENTS}}) {
-                               my $l = $e->{LEVELS}[0];
-                               if ($l->{TYPE} eq "POINTER" and ($l->{POINTER_TYPE} eq "relative")) {
-                                       $got_relative = 1;
-                                       last;
-                               }
-                       }
-               }
-               if ($got_relative == 0) {
-                       $self->pidl("err = ndr_pull_struct_blob_all(&blob, py_talloc_get_mem_ctx(py_obj), NULL, object, (ndr_pull_flags_fn_t)ndr_pull_$name);");
-               } else {
-                       $self->pidl("err = ndr_pull_struct_blob(&blob, py_talloc_get_mem_ctx(py_obj), NULL, object, (ndr_pull_flags_fn_t)ndr_pull_$name);");
-               }
+               $self->pidl("err = ndr_pull_struct_blob_all(&blob, py_talloc_get_mem_ctx(py_obj), NULL, object, (ndr_pull_flags_fn_t)ndr_pull_$name);");
                $self->pidl("if (err != NDR_ERR_SUCCESS) {");
                $self->indent;
                $self->pidl("PyErr_SetNdrError(err);");