summaryrefslogtreecommitdiff
path: root/librpc/gen_ndr
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-03-17 02:38:56 +0100
committerGünther Deschner <gd@samba.org>2009-03-17 12:15:23 +0100
commit3255651b8375c12fc2ed668e5e1e433b00921455 (patch)
tree72fb3e565bebbf3d5ebc5fd4c1b1ef9e479e07a6 /librpc/gen_ndr
parent3a6b5fe6c11cf395686f672635f15503d418dfb1 (diff)
downloadsamba-3255651b8375c12fc2ed668e5e1e433b00921455.tar.gz
samba-3255651b8375c12fc2ed668e5e1e433b00921455.tar.bz2
samba-3255651b8375c12fc2ed668e5e1e433b00921455.zip
s3: re-run make samba3-idl.
Guenther
Diffstat (limited to 'librpc/gen_ndr')
-rw-r--r--librpc/gen_ndr/cli_spoolss.c8
-rw-r--r--librpc/gen_ndr/cli_spoolss.h4
-rw-r--r--librpc/gen_ndr/ndr_spoolss.c86
-rw-r--r--librpc/gen_ndr/spoolss.h4
-rw-r--r--librpc/gen_ndr/srv_spoolss.c4
5 files changed, 63 insertions, 43 deletions
diff --git a/librpc/gen_ndr/cli_spoolss.c b/librpc/gen_ndr/cli_spoolss.c
index 54346b5490..a774d21f17 100644
--- a/librpc/gen_ndr/cli_spoolss.c
+++ b/librpc/gen_ndr/cli_spoolss.c
@@ -3811,8 +3811,8 @@ NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
struct policy_handle *handle /* [in] [ref] */,
const char *key_name /* [in] [charset(UTF16)] */,
- uint16_t *key_buffer /* [out] [ref,size_is(key_buffer_size/2)] */,
- uint32_t key_buffer_size /* [in] */,
+ const char ** *key_buffer /* [out] [subcontext_size(offered),ref,subcontext(0),flag(LIBNDR_FLAG_STR_NULLTERM)] */,
+ uint32_t offered /* [in] */,
uint32_t *needed /* [out] [ref] */,
WERROR *werror)
{
@@ -3822,7 +3822,7 @@ NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli,
/* In parameters */
r.in.handle = handle;
r.in.key_name = key_name;
- r.in.key_buffer_size = key_buffer_size;
+ r.in.offered = offered;
if (DEBUGLEVEL >= 10) {
NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterKey, &r);
@@ -3847,7 +3847,7 @@ NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli,
}
/* Return variables */
- memcpy(key_buffer, r.out.key_buffer, r.in.key_buffer_size / 2 * sizeof(*key_buffer));
+ *key_buffer = *r.out.key_buffer;
*needed = *r.out.needed;
/* Return result */
diff --git a/librpc/gen_ndr/cli_spoolss.h b/librpc/gen_ndr/cli_spoolss.h
index a58aa3c816..a30b1b1faa 100644
--- a/librpc/gen_ndr/cli_spoolss.h
+++ b/librpc/gen_ndr/cli_spoolss.h
@@ -497,8 +497,8 @@ NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli,
TALLOC_CTX *mem_ctx,
struct policy_handle *handle /* [in] [ref] */,
const char *key_name /* [in] [charset(UTF16)] */,
- uint16_t *key_buffer /* [out] [ref,size_is(key_buffer_size/2)] */,
- uint32_t key_buffer_size /* [in] */,
+ const char ** *key_buffer /* [out] [subcontext_size(offered),ref,subcontext(0),flag(LIBNDR_FLAG_STR_NULLTERM)] */,
+ uint32_t offered /* [in] */,
uint32_t *needed /* [out] [ref] */,
WERROR *werror);
NTSTATUS rpccli_spoolss_DeletePrinterDataEx(struct rpc_pipe_client *cli,
diff --git a/librpc/gen_ndr/ndr_spoolss.c b/librpc/gen_ndr/ndr_spoolss.c
index a05a10ad99..b14a1da3e5 100644
--- a/librpc/gen_ndr/ndr_spoolss.c
+++ b/librpc/gen_ndr/ndr_spoolss.c
@@ -26261,7 +26261,6 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinterDataEx(struct ndr_print *ndr, const c
_PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterKey(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinterKey *r)
{
- uint32_t cntr_key_buffer_1;
if (flags & NDR_IN) {
if (r->in.handle == NULL) {
return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
@@ -26271,15 +26270,25 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterKey(struct ndr_push *ndr,
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.key_name, CH_UTF16)));
NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.key_name, ndr_charset_length(r->in.key_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.key_buffer_size));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered));
}
if (flags & NDR_OUT) {
- if (r->out.key_buffer == NULL) {
- return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
- }
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.key_buffer_size / 2));
- for (cntr_key_buffer_1 = 0; cntr_key_buffer_1 < r->in.key_buffer_size / 2; cntr_key_buffer_1++) {
- NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.key_buffer[cntr_key_buffer_1]));
+ {
+ uint32_t _flags_save_string_array = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
+ if (r->out.key_buffer == NULL) {
+ return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
+ }
+ NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.key_buffer));
+ if (*r->out.key_buffer) {
+ {
+ struct ndr_push *_ndr_key_buffer;
+ NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_key_buffer, 0, r->in.offered));
+ NDR_CHECK(ndr_push_string_array(_ndr_key_buffer, NDR_SCALARS, *r->out.key_buffer));
+ NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_key_buffer, 0, r->in.offered));
+ }
+ }
+ ndr->flags = _flags_save_string_array;
}
if (r->out.needed == NULL) {
return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer");
@@ -26292,8 +26301,9 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterKey(struct ndr_push *ndr,
_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterKey(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterKey *r)
{
- uint32_t cntr_key_buffer_1;
+ uint32_t _ptr_key_buffer;
TALLOC_CTX *_mem_save_handle_0;
+ TALLOC_CTX *_mem_save_key_buffer_0;
TALLOC_CTX *_mem_save_key_buffer_1;
TALLOC_CTX *_mem_save_needed_0;
if (flags & NDR_IN) {
@@ -26313,23 +26323,41 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterKey(struct ndr_pull *ndr,
}
NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.key_name), sizeof(uint16_t)));
NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.key_name, ndr_get_array_length(ndr, &r->in.key_name), sizeof(uint16_t), CH_UTF16));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.key_buffer_size));
- NDR_PULL_ALLOC_N(ndr, r->out.key_buffer, r->in.key_buffer_size / 2);
- memset(r->out.key_buffer, 0, (r->in.key_buffer_size / 2) * sizeof(*r->out.key_buffer));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered));
+ NDR_PULL_ALLOC(ndr, r->out.key_buffer);
+ ZERO_STRUCTP(r->out.key_buffer);
NDR_PULL_ALLOC(ndr, r->out.needed);
ZERO_STRUCTP(r->out.needed);
}
if (flags & NDR_OUT) {
- NDR_CHECK(ndr_pull_array_size(ndr, &r->out.key_buffer));
- if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
- NDR_PULL_ALLOC_N(ndr, r->out.key_buffer, ndr_get_array_size(ndr, &r->out.key_buffer));
- }
- _mem_save_key_buffer_1 = NDR_PULL_GET_MEM_CTX(ndr);
- NDR_PULL_SET_MEM_CTX(ndr, r->out.key_buffer, 0);
- for (cntr_key_buffer_1 = 0; cntr_key_buffer_1 < r->in.key_buffer_size / 2; cntr_key_buffer_1++) {
- NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.key_buffer[cntr_key_buffer_1]));
+ {
+ uint32_t _flags_save_string_array = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM);
+ if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
+ NDR_PULL_ALLOC(ndr, r->out.key_buffer);
+ }
+ _mem_save_key_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->out.key_buffer, LIBNDR_FLAG_REF_ALLOC);
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_key_buffer));
+ if (_ptr_key_buffer) {
+ NDR_PULL_ALLOC(ndr, *r->out.key_buffer);
+ } else {
+ *r->out.key_buffer = NULL;
+ }
+ if (*r->out.key_buffer) {
+ _mem_save_key_buffer_1 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, *r->out.key_buffer, 0);
+ {
+ struct ndr_pull *_ndr_key_buffer;
+ NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_key_buffer, 0, r->in.offered));
+ NDR_CHECK(ndr_pull_string_array(_ndr_key_buffer, NDR_SCALARS, r->out.key_buffer));
+ NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_key_buffer, 0, r->in.offered));
+ }
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_buffer_1, 0);
+ }
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_buffer_0, LIBNDR_FLAG_REF_ALLOC);
+ ndr->flags = _flags_save_string_array;
}
- NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_buffer_1, 0);
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
NDR_PULL_ALLOC(ndr, r->out.needed);
}
@@ -26338,16 +26366,12 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterKey(struct ndr_pull *ndr,
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC);
NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result));
- if (r->out.key_buffer) {
- NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.key_buffer, r->in.key_buffer_size / 2));
- }
}
return NDR_ERR_SUCCESS;
}
_PUBLIC_ void ndr_print_spoolss_EnumPrinterKey(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_EnumPrinterKey *r)
{
- uint32_t cntr_key_buffer_1;
ndr_print_struct(ndr, name, "spoolss_EnumPrinterKey");
ndr->depth++;
if (flags & NDR_SET_VALUES) {
@@ -26361,7 +26385,7 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinterKey(struct ndr_print *ndr, const char
ndr_print_policy_handle(ndr, "handle", r->in.handle);
ndr->depth--;
ndr_print_string(ndr, "key_name", r->in.key_name);
- ndr_print_uint32(ndr, "key_buffer_size", r->in.key_buffer_size);
+ ndr_print_uint32(ndr, "offered", r->in.offered);
ndr->depth--;
}
if (flags & NDR_OUT) {
@@ -26369,14 +26393,10 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinterKey(struct ndr_print *ndr, const char
ndr->depth++;
ndr_print_ptr(ndr, "key_buffer", r->out.key_buffer);
ndr->depth++;
- ndr->print(ndr, "%s: ARRAY(%d)", "key_buffer", (int)r->in.key_buffer_size / 2);
+ ndr_print_ptr(ndr, "key_buffer", *r->out.key_buffer);
ndr->depth++;
- for (cntr_key_buffer_1=0;cntr_key_buffer_1<r->in.key_buffer_size / 2;cntr_key_buffer_1++) {
- char *idx_1=NULL;
- if (asprintf(&idx_1, "[%d]", cntr_key_buffer_1) != -1) {
- ndr_print_uint16(ndr, "key_buffer", r->out.key_buffer[cntr_key_buffer_1]);
- free(idx_1);
- }
+ if (*r->out.key_buffer) {
+ ndr_print_string_array(ndr, "key_buffer", *r->out.key_buffer);
}
ndr->depth--;
ndr->depth--;
diff --git a/librpc/gen_ndr/spoolss.h b/librpc/gen_ndr/spoolss.h
index ce800edcf9..bcf04fb33d 100644
--- a/librpc/gen_ndr/spoolss.h
+++ b/librpc/gen_ndr/spoolss.h
@@ -2909,11 +2909,11 @@ struct spoolss_EnumPrinterKey {
struct {
struct policy_handle *handle;/* [ref] */
const char *key_name;/* [charset(UTF16)] */
- uint32_t key_buffer_size;
+ uint32_t offered;
} in;
struct {
- uint16_t *key_buffer;/* [ref,size_is(key_buffer_size/2)] */
+ const char ** *key_buffer;/* [subcontext_size(offered),ref,subcontext(0),flag(LIBNDR_FLAG_STR_NULLTERM)] */
uint32_t *needed;/* [ref] */
WERROR result;
} out;
diff --git a/librpc/gen_ndr/srv_spoolss.c b/librpc/gen_ndr/srv_spoolss.c
index 29b5d3198a..74ab6ba7dd 100644
--- a/librpc/gen_ndr/srv_spoolss.c
+++ b/librpc/gen_ndr/srv_spoolss.c
@@ -6296,7 +6296,7 @@ static bool api_spoolss_EnumPrinterKey(pipes_struct *p)
}
ZERO_STRUCT(r->out);
- r->out.key_buffer = talloc_zero_array(r, uint16_t, r->in.key_buffer_size / 2);
+ r->out.key_buffer = talloc_zero(r, const char **);
if (r->out.key_buffer == NULL) {
talloc_free(r);
return false;
@@ -8399,7 +8399,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
case NDR_SPOOLSS_ENUMPRINTERKEY: {
struct spoolss_EnumPrinterKey *r = (struct spoolss_EnumPrinterKey *)_r;
ZERO_STRUCT(r->out);
- r->out.key_buffer = talloc_zero_array(mem_ctx, uint16_t, r->in.key_buffer_size / 2);
+ r->out.key_buffer = talloc_zero(mem_ctx, const char **);
if (r->out.key_buffer == NULL) {
return NT_STATUS_NO_MEMORY;
}