diff options
author | Andrew Tridgell <tridge@samba.org> | 2003-11-19 22:10:20 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2003-11-19 22:10:20 +0000 |
commit | 10ee36bede1337d73feec575cc840957090b30b2 (patch) | |
tree | 8d292361ad5e6bb1291fc3dbca191d1c44bd453b /source4/librpc/ndr/ndr_lsa.c | |
parent | 5a51af068533357fbf0ae4ddfd169fb752ddd2b5 (diff) | |
download | samba-10ee36bede1337d73feec575cc840957090b30b2.tar.gz samba-10ee36bede1337d73feec575cc840957090b30b2.tar.bz2 samba-10ee36bede1337d73feec575cc840957090b30b2.zip |
switched to a new way of handling unions, so that we can handle
alignment correctly for unions that have non-uint16 discriminants
fixed the union handling in srvsvc.idl. (metze, please take a look at
the changes, your IDL did match what was one the wire in most cases,
but isn't the way IDL is usually coded)
(This used to be commit 7b5d0287298e8505e0ec7b22d75d9f9a8a610031)
Diffstat (limited to 'source4/librpc/ndr/ndr_lsa.c')
-rw-r--r-- | source4/librpc/ndr/ndr_lsa.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/source4/librpc/ndr/ndr_lsa.c b/source4/librpc/ndr/ndr_lsa.c index 3b540b3614..2ed6b89e7b 100644 --- a/source4/librpc/ndr/ndr_lsa.c +++ b/source4/librpc/ndr/ndr_lsa.c @@ -878,12 +878,11 @@ done: return NT_STATUS_OK; } -NTSTATUS ndr_pull_lsa_PolicyInformation(struct ndr_pull *ndr, int ndr_flags, uint16 *level, union lsa_PolicyInformation *r) +NTSTATUS ndr_pull_lsa_PolicyInformation(struct ndr_pull *ndr, int ndr_flags, uint16 level, union lsa_PolicyInformation *r) { if (!(ndr_flags & NDR_SCALARS)) goto buffers; NDR_CHECK(ndr_pull_struct_start(ndr)); - NDR_CHECK(ndr_pull_uint16(ndr, level)); - switch (*level) { + switch (level) { case 1: { NDR_CHECK(ndr_pull_lsa_AuditLogInfo(ndr, NDR_SCALARS, &r->audit_log)); break; } @@ -933,12 +932,12 @@ NTSTATUS ndr_pull_lsa_PolicyInformation(struct ndr_pull *ndr, int ndr_flags, uin break; } default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", *level); + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); } ndr_pull_struct_end(ndr); buffers: if (!(ndr_flags & NDR_BUFFERS)) goto done; - switch (*level) { + switch (level) { case 1: NDR_CHECK(ndr_pull_lsa_AuditLogInfo(ndr, NDR_BUFFERS, &r->audit_log)); break; @@ -988,7 +987,7 @@ buffers: break; default: - return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", *level); + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); } done: return NT_STATUS_OK; @@ -1004,10 +1003,12 @@ NTSTATUS ndr_pull_lsa_QueryInfoPolicy(struct ndr_pull *ndr, struct lsa_QueryInfo r->out.info = NULL; } if (r->out.info) { - { uint16 _level = r->in.level; - NDR_CHECK(ndr_pull_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, &_level, r->out.info)); - if (((NDR_SCALARS|NDR_BUFFERS) & NDR_SCALARS) && (_level != r->in.level)) return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u in info"); + if ((NDR_SCALARS|NDR_BUFFERS) & NDR_SCALARS) { + uint16 _level; + NDR_CHECK(ndr_pull_uint16(ndr, &_level)); + if (_level != r->in.level) return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u in info"); } + NDR_CHECK(ndr_pull_lsa_PolicyInformation(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.level, r->out.info)); } NDR_CHECK(ndr_pull_NTSTATUS(ndr, &r->out.result)); |