summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-11-16 04:22:20 +0000
committerTim Potter <tpot@samba.org>2003-11-16 04:22:20 +0000
commitfc55fd3e336576fea9a1029a8f2aedc2c4c21b06 (patch)
tree8b1e0ba316ff4087c114a08eea430469063973fa /source4/librpc/ndr
parent274667be32531da20f76b7ffc039c45f86e59282 (diff)
downloadsamba-fc55fd3e336576fea9a1029a8f2aedc2c4c21b06.tar.gz
samba-fc55fd3e336576fea9a1029a8f2aedc2c4c21b06.tar.bz2
samba-fc55fd3e336576fea9a1029a8f2aedc2c4c21b06.zip
Added push/pull routines for uint8_buf IDL type used for spoolss buffers,
and possibly other places. (This used to be commit 8fcac6742f7b34d85ca7456aa33ffad88281d397)
Diffstat (limited to 'source4/librpc/ndr')
-rw-r--r--source4/librpc/ndr/ndr_misc.c24
-rw-r--r--source4/librpc/ndr/ndr_misc.h6
2 files changed, 30 insertions, 0 deletions
diff --git a/source4/librpc/ndr/ndr_misc.c b/source4/librpc/ndr/ndr_misc.c
index cdd6652068..08ec44c0b0 100644
--- a/source4/librpc/ndr/ndr_misc.c
+++ b/source4/librpc/ndr/ndr_misc.c
@@ -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;
+}
diff --git a/source4/librpc/ndr/ndr_misc.h b/source4/librpc/ndr/ndr_misc.h
index cc3576b3e8..1621bf6e05 100644
--- a/source4/librpc/ndr/ndr_misc.h
+++ b/source4/librpc/ndr/ndr_misc.h
@@ -24,3 +24,9 @@
struct policy_handle {
char data[20];
};
+
+/* A buffer of uint8s */
+struct uint8_buf {
+ uint32 size;
+ uint8 *data;
+};