diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-09-29 17:47:54 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-09-29 18:08:22 +1000 |
commit | 64e08fef16001d62b43f6925a26ad739391cface (patch) | |
tree | fbe75bd3c38c149145f3a7aa1e3d8e6bf5cd75de /librpc | |
parent | 325baf37fffde738dcbb37a096d79f07b23586b2 (diff) | |
download | samba-64e08fef16001d62b43f6925a26ad739391cface.tar.gz samba-64e08fef16001d62b43f6925a26ad739391cface.tar.bz2 samba-64e08fef16001d62b43f6925a26ad739391cface.zip |
pidl: added union padding for NDR64
This fixes the problem with samr UserInfo16 when NDR64 is enabled
Diffstat (limited to 'librpc')
-rw-r--r-- | librpc/ndr/libndr.h | 2 | ||||
-rw-r--r-- | librpc/ndr/ndr_basic.c | 18 |
2 files changed, 20 insertions, 0 deletions
diff --git a/librpc/ndr/libndr.h b/librpc/ndr/libndr.h index 03b4362b37..f6f5170646 100644 --- a/librpc/ndr/libndr.h +++ b/librpc/ndr/libndr.h @@ -498,6 +498,8 @@ enum ndr_err_code ndr_pull_bytes(struct ndr_pull *ndr, uint8_t *data, uint32_t n enum ndr_err_code ndr_pull_array_uint8(struct ndr_pull *ndr, int ndr_flags, uint8_t *data, uint32_t n); enum ndr_err_code ndr_push_align(struct ndr_push *ndr, size_t size); enum ndr_err_code ndr_pull_align(struct ndr_pull *ndr, size_t size); +enum ndr_err_code ndr_push_union_align(struct ndr_push *ndr, size_t size); +enum ndr_err_code ndr_pull_union_align(struct ndr_pull *ndr, size_t size); enum ndr_err_code ndr_push_bytes(struct ndr_push *ndr, const uint8_t *data, uint32_t n); enum ndr_err_code ndr_push_zero(struct ndr_push *ndr, uint32_t n); enum ndr_err_code ndr_push_array_uint8(struct ndr_push *ndr, int ndr_flags, const uint8_t *data, uint32_t n); diff --git a/librpc/ndr/ndr_basic.c b/librpc/ndr/ndr_basic.c index 00e33ad9d0..f3b7e755c5 100644 --- a/librpc/ndr/ndr_basic.c +++ b/librpc/ndr/ndr_basic.c @@ -555,6 +555,24 @@ _PUBLIC_ enum ndr_err_code ndr_pull_align(struct ndr_pull *ndr, size_t size) return NDR_ERR_SUCCESS; } +_PUBLIC_ enum ndr_err_code ndr_push_union_align(struct ndr_push *ndr, size_t size) +{ + /* MS-RPCE section 2.2.5.3.4.4 */ + if (ndr->flags & LIBNDR_FLAG_NDR64) { + return ndr_push_align(ndr, size); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_union_align(struct ndr_pull *ndr, size_t size) +{ + /* MS-RPCE section 2.2.5.3.4.4 */ + if (ndr->flags & LIBNDR_FLAG_NDR64) { + return ndr_pull_align(ndr, size); + } + return NDR_ERR_SUCCESS; +} + /* push some bytes */ |