r1766: we do not have smb_read_error in samba4
[samba.git] / source4 / build / pidl / packet-dcerpc-eparser.c
index c1b6e4378c8dd910692d05d230ee6564fd93c057..bf2b6e798169af810bbc00de9dccd19ab7c327c1 100644 (file)
@@ -57,11 +57,18 @@ void ndr_pull_level(struct e_ndr_pull *ndr, proto_tree *tree, int hf,
                tree, ndr->drep, hf, data);
 }
 
-void ndr_pull_NTSTATUS(struct e_ndr_pull *ndr, proto_tree *tree, int hf)
+void ndr_pull_NTSTATUS(struct e_ndr_pull *ndr, proto_tree *tree, int hf, gNTSTATUS *data)
 {
        ndr->offset = dissect_ntstatus(
                ndr->tvb, ndr->offset, ndr->pinfo,
-               tree, ndr->drep, hf, NULL);
+               tree, ndr->drep, hf, data);
+}
+
+void ndr_pull_WERROR(struct e_ndr_pull *ndr, proto_tree *tree, int hf, gWERROR *data)
+{
+       ndr->offset = dissect_werror(
+               ndr->tvb, ndr->offset, ndr->pinfo,
+               tree, ndr->drep, hf, data);
 }
 
 void ndr_pull_uint8(struct e_ndr_pull *ndr, proto_tree *tree, int hf, 
@@ -104,6 +111,37 @@ void ndr_pull_uint64(struct e_ndr_pull *ndr, proto_tree *tree, int hf,
                tree, ndr->drep, hf, data);     
 }
 
+void ndr_pull_DATA_BLOB(struct e_ndr_pull *ndr, proto_tree *tree, int hf, gDATA_BLOB *h)
+{
+       guint32 length;
+
+       if (!(ndr_flags & NDR_SCALARS)) {
+               return;
+       }
+
+       if (ndr->flags & LIBNDR_ALIGN_FLAGS) {
+               if (ndr->flags & LIBNDR_FLAG_ALIGN2) {
+                       length = NDR_ALIGN(ndr, 2);
+               } else if (ndr->flags & LIBNDR_FLAG_ALIGN4) {
+                       length = NDR_ALIGN(ndr, 4);
+               } else if (ndr->flags & LIBNDR_FLAG_ALIGN8) {
+                       length = NDR_ALIGN(ndr, 8);
+               }
+               if (ndr->data_size - ndr->offset < length) {
+                       length = ndr->data_size - ndr->offset;
+               }
+       } else if (ndr->flags & LIBNDR_FLAG_REMAINING) {
+               length = ndr->data_size - ndr->offset;
+       } else {
+               ndr_pull_uint32(ndr, &length);
+       }
+
+       h->data = g_malloc(length);
+       proto_tree_add_bytes(tree, hf_bytes_data, ndr->tvb, ndr->offset, length, h->data);
+       
+    ndr->offset += length;
+}
+
 void ndr_pull_string(struct e_ndr_pull *ndr, proto_tree *tree, int ndr_flags)
 {
        guint32 len1, ofs, len2;
@@ -511,6 +549,18 @@ void ndr_pull_array_uint8(struct e_ndr_pull *ndr, proto_tree *tree, int hf,
        }       
 }
 
+void ndr_pull_array_uint16(struct e_ndr_pull *ndr, proto_tree *tree, int hf, 
+                         int ndr_flags, guint32 n)
+{
+       guint32 i;
+       if (!(ndr_flags & NDR_SCALARS)) {
+               return;
+       }
+       for (i=0;i<n;i++) {
+               ndr_pull_uint16(ndr, tree, hf, NULL);
+       }       
+}
+
 void ndr_pull_array_uint32(struct e_ndr_pull *ndr, proto_tree *tree, int hf, 
                           int ndr_flags, guint32 n)
 {