Added push/pull routines for uint8_buf IDL type used for spoolss buffers,
authorTim Potter <tpot@samba.org>
Sun, 16 Nov 2003 04:22:20 +0000 (04:22 +0000)
committerTim Potter <tpot@samba.org>
Sun, 16 Nov 2003 04:22:20 +0000 (04:22 +0000)
and possibly other places.

source/librpc/ndr/ndr_misc.c
source/librpc/ndr/ndr_misc.h

index cdd66520685244e906c095bb450560754b866cc7..08ec44c0b07b3deb8a8e819ededbf7dd5d50b452 100644 (file)
@@ -43,3 +43,27 @@ NTSTATUS ndr_push_policy_handle(struct ndr_push *ndr,
        NDR_CHECK(ndr_push_bytes(ndr, r->data, 20));
        return NT_STATUS_OK;
 }
+
+
+/*
+  push a buffer of bytes
+*/
+NTSTATUS ndr_push_uint8_buf(struct ndr_push *ndr, int ndr_flags,
+                           struct uint8_buf *buf)
+{
+       NDR_CHECK(ndr_push_uint32(ndr, buf->size));
+       NDR_CHECK(ndr_push_bytes(ndr, buf->data, buf->size));
+       return NT_STATUS_OK;
+}
+
+/*
+  pull a buffer of bytes
+*/
+NTSTATUS ndr_pull_uint8_buf(struct ndr_pull *ndr, int ndr_flags, 
+                           struct uint8_buf *buf)
+{
+       NDR_CHECK(ndr_pull_uint32(ndr, &buf->size));
+       NDR_ALLOC_SIZE(ndr, buf->data, buf->size);
+       NDR_CHECK(ndr_pull_bytes(ndr, buf->data, buf->size));
+       return NT_STATUS_OK;
+}
index cc3576b3e8c34f5c232299ec7c886996f196479c..1621bf6e05cdc1be1baf69acac7e0e34a859d3b6 100644 (file)
@@ -24,3 +24,9 @@
 struct policy_handle {
        char data[20];
 };
+
+/* A buffer of uint8s */
+struct uint8_buf {
+       uint32 size;
+       uint8 *data;
+};