diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-11-11 06:22:58 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-11-11 06:22:58 +0000 |
commit | bde602b9e1192945d7c0139fd4226b431fc214f2 (patch) | |
tree | 0d6c322ae65423b4b28de81d1731a48564cc01da /source4/librpc/ndr/ndr_basic.c | |
parent | d720f3d2e40daee197a228924f2301c2c6ddd392 (diff) | |
download | samba-bde602b9e1192945d7c0139fd4226b431fc214f2.tar.gz samba-bde602b9e1192945d7c0139fd4226b431fc214f2.tar.bz2 samba-bde602b9e1192945d7c0139fd4226b431fc214f2.zip |
support lsa_AuditEventsInfo
(This used to be commit 7e7cb975936252083c5c02a64c00ee2667099c22)
Diffstat (limited to 'source4/librpc/ndr/ndr_basic.c')
-rw-r--r-- | source4/librpc/ndr/ndr_basic.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c index 2276b76e95..3cb9e38749 100644 --- a/source4/librpc/ndr/ndr_basic.c +++ b/source4/librpc/ndr/ndr_basic.c @@ -117,6 +117,39 @@ NTSTATUS ndr_pull_array_uint8(struct ndr_pull *ndr, char *data, uint32 n) /* + pull an array of uint16 +*/ +NTSTATUS ndr_pull_array_uint16(struct ndr_pull *ndr, uint16 *data, uint32 n) +{ + uint32 len, i; + NDR_CHECK(ndr_pull_uint32(ndr, &len)); + if (len != n) { + return NT_STATUS_INVALID_PARAMETER; + } + for (i=0;i<n;i++) { + NDR_CHECK(ndr_pull_uint16(ndr, &data[i])); + } + return NT_STATUS_OK; +} + +/* + pull an array of uint32 +*/ +NTSTATUS ndr_pull_array_uint32(struct ndr_pull *ndr, uint32 *data, uint32 n) +{ + uint32 len, i; + NDR_CHECK(ndr_pull_uint32(ndr, &len)); + if (len != n) { + return NT_STATUS_INVALID_PARAMETER; + } + for (i=0;i<n;i++) { + NDR_CHECK(ndr_pull_uint32(ndr, &data[i])); + } + return NT_STATUS_OK; +} + + +/* parse a GUID */ NTSTATUS ndr_pull_guid(struct ndr_pull *ndr, GUID *guid) @@ -428,3 +461,21 @@ void ndr_print_bad_level(struct ndr_print *ndr, const char *name, uint16 level) { ndr->print(ndr, "UNKNOWN LEVEL %u", level); } + +void ndr_print_array_uint32(struct ndr_print *ndr, const char *name, + uint32 *data, uint32 count) +{ + int i; + + ndr->print(ndr, "%s: ARRAY(%d)", name, count); + ndr->depth++; + for (i=0;i<count;i++) { + char *idx=NULL; + asprintf(&idx, "[%d]", i); + if (idx) { + ndr_print_uint32(ndr, idx, data[i]); + free(idx); + } + } + ndr->depth--; +} |