diff options
author | Gerald Carter <jerry@samba.org> | 2006-09-21 18:09:20 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:00:58 -0500 |
commit | 8e0217da6f19a75250c27c5abaa000ee4d328267 (patch) | |
tree | 532e9bc639d4b16d111a635c47c2cd2934dfb2fb /source3/librpc/gen_ndr/ndr_winreg.c | |
parent | eab57a0a0fe90be464f5061691f57ca1da150885 (diff) | |
download | samba-8e0217da6f19a75250c27c5abaa000ee4d328267.tar.gz samba-8e0217da6f19a75250c27c5abaa000ee4d328267.tar.bz2 samba-8e0217da6f19a75250c27c5abaa000ee4d328267.zip |
r18790: Correct the IDL (still a bug in pidl) for QueryValue()
(This used to be commit 44851d7afa3112278faea41b470cc5d3cad97cb5)
Diffstat (limited to 'source3/librpc/gen_ndr/ndr_winreg.c')
-rw-r--r-- | source3/librpc/gen_ndr/ndr_winreg.c | 71 |
1 files changed, 6 insertions, 65 deletions
diff --git a/source3/librpc/gen_ndr/ndr_winreg.c b/source3/librpc/gen_ndr/ndr_winreg.c index 5dd8fc49be..ca007bb449 100644 --- a/source3/librpc/gen_ndr/ndr_winreg.c +++ b/source3/librpc/gen_ndr/ndr_winreg.c @@ -2272,7 +2272,6 @@ _PUBLIC_ void ndr_print_winreg_QueryInfoKey(struct ndr_print *ndr, const char *n NTSTATUS ndr_push_winreg_QueryValue(struct ndr_push *ndr, int flags, const struct winreg_QueryValue *r) { - uint32_t cntr_data_1; if (flags & NDR_IN) { if (r->in.handle == NULL) return NT_STATUS_INVALID_PARAMETER_MIX; NDR_CHECK(ndr_push_policy_handle(ndr, NDR_SCALARS|NDR_BUFFERS, r->in.handle)); @@ -2286,9 +2285,7 @@ NTSTATUS ndr_push_winreg_QueryValue(struct ndr_push *ndr, int flags, const struc NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.size)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->in.length)); - for (cntr_data_1 = 0; cntr_data_1 < *r->in.length; cntr_data_1++) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.data[cntr_data_1])); - } + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.data, *r->in.length)); } NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.size)); if (r->in.size) { @@ -2309,9 +2306,7 @@ NTSTATUS ndr_push_winreg_QueryValue(struct ndr_push *ndr, int flags, const struc NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.size)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.length)); - for (cntr_data_1 = 0; cntr_data_1 < *r->out.length; cntr_data_1++) { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.data[cntr_data_1])); - } + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.data, *r->out.length)); } NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.size)); if (r->out.size) { @@ -2330,14 +2325,11 @@ NTSTATUS ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int flags, struct winr { uint32_t _ptr_type; uint32_t _ptr_data; - uint32_t cntr_data_1; uint32_t _ptr_size; uint32_t _ptr_length; TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_type_0; TALLOC_CTX *_mem_save_data_0; - TALLOC_CTX *_mem_save_data_1; - TALLOC_CTX *_mem_save_data_2; TALLOC_CTX *_mem_save_size_0; TALLOC_CTX *_mem_save_length_0; if (flags & NDR_IN) { @@ -2378,17 +2370,7 @@ NTSTATUS ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int flags, struct winr return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.data), ndr_get_array_length(ndr, &r->in.data)); } NDR_PULL_ALLOC_N(ndr, r->in.data, ndr_get_array_size(ndr, &r->in.data)); - _mem_save_data_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->in.data, 0); - for (cntr_data_1 = 0; cntr_data_1 < *r->in.length; cntr_data_1++) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); - if (_ptr_data) { - NDR_PULL_ALLOC(ndr, r->in.data[cntr_data_1]); - } else { - r->in.data[cntr_data_1] = NULL; - } - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_1, 0); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.data, ndr_get_array_length(ndr, &r->in.data))); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); } NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_size)); @@ -2452,17 +2434,7 @@ NTSTATUS ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int flags, struct winr return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->out.data), ndr_get_array_length(ndr, &r->out.data)); } NDR_PULL_ALLOC_N(ndr, r->out.data, ndr_get_array_size(ndr, &r->out.data)); - _mem_save_data_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.data, 0); - for (cntr_data_1 = 0; cntr_data_1 < *r->out.length; cntr_data_1++) { - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); - if (_ptr_data) { - NDR_PULL_ALLOC(ndr, r->out.data[cntr_data_1]); - } else { - r->out.data[cntr_data_1] = NULL; - } - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_1, 0); + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.data, ndr_get_array_length(ndr, &r->out.data))); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); } NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_size)); @@ -2504,7 +2476,6 @@ NTSTATUS ndr_pull_winreg_QueryValue(struct ndr_pull *ndr, int flags, struct winr _PUBLIC_ void ndr_print_winreg_QueryValue(struct ndr_print *ndr, const char *name, int flags, const struct winreg_QueryValue *r) { - uint32_t cntr_data_1; ndr_print_struct(ndr, name, "winreg_QueryValue"); ndr->depth++; if (flags & NDR_SET_VALUES) { @@ -2527,22 +2498,7 @@ _PUBLIC_ void ndr_print_winreg_QueryValue(struct ndr_print *ndr, const char *nam ndr_print_ptr(ndr, "data", r->in.data); ndr->depth++; if (r->in.data) { - ndr->print(ndr, "%s: ARRAY(%d)", "data", *r->in.length); - ndr->depth++; - for (cntr_data_1=0;cntr_data_1<*r->in.length;cntr_data_1++) { - char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_data_1); - if (idx_1) { - ndr_print_ptr(ndr, "data", r->in.data[cntr_data_1]); - ndr->depth++; - if (r->in.data[cntr_data_1]) { - ndr_print_uint8(ndr, "data", *r->in.data[cntr_data_1]); - } - ndr->depth--; - free(idx_1); - } - } - ndr->depth--; + ndr_print_array_uint8(ndr, "data", r->in.data, *r->in.length); } ndr->depth--; ndr_print_ptr(ndr, "size", r->in.size); @@ -2571,22 +2527,7 @@ _PUBLIC_ void ndr_print_winreg_QueryValue(struct ndr_print *ndr, const char *nam ndr_print_ptr(ndr, "data", r->out.data); ndr->depth++; if (r->out.data) { - ndr->print(ndr, "%s: ARRAY(%d)", "data", *r->out.length); - ndr->depth++; - for (cntr_data_1=0;cntr_data_1<*r->out.length;cntr_data_1++) { - char *idx_1=NULL; - asprintf(&idx_1, "[%d]", cntr_data_1); - if (idx_1) { - ndr_print_ptr(ndr, "data", r->out.data[cntr_data_1]); - ndr->depth++; - if (r->out.data[cntr_data_1]) { - ndr_print_uint8(ndr, "data", *r->out.data[cntr_data_1]); - } - ndr->depth--; - free(idx_1); - } - } - ndr->depth--; + ndr_print_array_uint8(ndr, "data", r->out.data, *r->out.length); } ndr->depth--; ndr_print_ptr(ndr, "size", r->out.size); |