diff options
Diffstat (limited to 'source4/librpc/ndr/ndr_basic.c')
-rw-r--r-- | source4/librpc/ndr/ndr_basic.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c index 6ada49997f..b8c0cffd6d 100644 --- a/source4/librpc/ndr/ndr_basic.c +++ b/source4/librpc/ndr/ndr_basic.c @@ -103,6 +103,20 @@ NTSTATUS ndr_pull_bytes(struct ndr_pull *ndr, char *data, uint32 n) } /* + pull an array of uint8 +*/ +NTSTATUS ndr_pull_array_uint8(struct ndr_pull *ndr, char *data, uint32 n) +{ + uint32 len; + NDR_CHECK(ndr_pull_uint32(ndr, &len)); + if (len != n) { + return NT_STATUS_INVALID_PARAMETER; + } + return ndr_pull_bytes(ndr, data, len); +} + + +/* parse a GUID */ NTSTATUS ndr_pull_guid(struct ndr_pull *ndr, GUID *guid) @@ -180,6 +194,15 @@ NTSTATUS ndr_push_bytes(struct ndr_push *ndr, const char *data, uint32 n) } /* + push an array of uint8 +*/ +NTSTATUS ndr_push_array_uint8(struct ndr_push *ndr, const char *data, uint32 n) +{ + NDR_CHECK(ndr_push_uint32(ndr, n)); + return ndr_push_bytes(ndr, data, n); +} + +/* save the current position */ void ndr_push_save(struct ndr_push *ndr, struct ndr_push_save *save) |