diff options
Diffstat (limited to 'librpc')
-rw-r--r-- | librpc/gen_ndr/cli_spoolss.c | 8 | ||||
-rw-r--r-- | librpc/gen_ndr/cli_spoolss.h | 4 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_spoolss.c | 87 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_spoolss.h | 6 | ||||
-rw-r--r-- | librpc/gen_ndr/spoolss.h | 33 | ||||
-rw-r--r-- | librpc/gen_ndr/srv_spoolss.c | 24 |
6 files changed, 120 insertions, 42 deletions
diff --git a/librpc/gen_ndr/cli_spoolss.c b/librpc/gen_ndr/cli_spoolss.c index a774d21f17..1e94a2a63c 100644 --- a/librpc/gen_ndr/cli_spoolss.c +++ b/librpc/gen_ndr/cli_spoolss.c @@ -3758,10 +3758,10 @@ NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle /* [in] [ref] */, const char *key_name /* [in] [charset(UTF16)] */, - uint8_t *buffer /* [out] [ref,size_is(offered)] */, uint32_t offered /* [in] */, - uint32_t *needed /* [out] [ref] */, uint32_t *count /* [out] [ref] */, + struct spoolss_PrinterEnumValues **info /* [out] [ref,size_is(,*count)] */, + uint32_t *needed /* [out] [ref] */, WERROR *werror) { struct spoolss_EnumPrinterDataEx r; @@ -3795,9 +3795,9 @@ NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli, } /* Return variables */ - memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer)); - *needed = *r.out.needed; *count = *r.out.count; + *info = *r.out.info; + *needed = *r.out.needed; /* Return result */ if (werror) { diff --git a/librpc/gen_ndr/cli_spoolss.h b/librpc/gen_ndr/cli_spoolss.h index a30b1b1faa..eb86e8c6a0 100644 --- a/librpc/gen_ndr/cli_spoolss.h +++ b/librpc/gen_ndr/cli_spoolss.h @@ -488,10 +488,10 @@ NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle /* [in] [ref] */, const char *key_name /* [in] [charset(UTF16)] */, - uint8_t *buffer /* [out] [ref,size_is(offered)] */, uint32_t offered /* [in] */, - uint32_t *needed /* [out] [ref] */, uint32_t *count /* [out] [ref] */, + struct spoolss_PrinterEnumValues **info /* [out] [ref,size_is(,*count)] */, + uint32_t *needed /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, diff --git a/librpc/gen_ndr/ndr_spoolss.c b/librpc/gen_ndr/ndr_spoolss.c index f9781bc261..d340b811a1 100644 --- a/librpc/gen_ndr/ndr_spoolss.c +++ b/librpc/gen_ndr/ndr_spoolss.c @@ -26296,7 +26296,7 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinterDataEx(struct ndr_print *ndr, const ch ndr->depth--; } -_PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinterDataEx *r) +_PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct _spoolss_EnumPrinterDataEx *r) { if (flags & NDR_IN) { if (r->in.handle == NULL) { @@ -26310,11 +26310,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *n NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered)); } if (flags & NDR_OUT) { - if (r->out.buffer == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.offered)); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->out.info)); if (r->out.needed == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } @@ -26328,7 +26324,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *n return NDR_ERR_SUCCESS; } -_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterDataEx *r) +_PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct _spoolss_EnumPrinterDataEx *r) { TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_needed_0; @@ -26351,19 +26347,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *n 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.offered)); - NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.offered); - memset(r->out.buffer, 0, (r->in.offered) * sizeof(*r->out.buffer)); NDR_PULL_ALLOC(ndr, r->out.needed); ZERO_STRUCTP(r->out.needed); NDR_PULL_ALLOC(ndr, r->out.count); ZERO_STRUCTP(r->out.count); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)); - } - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer))); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->out.info)); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->out.needed); } @@ -26379,15 +26369,54 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *n NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.buffer) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, r->in.offered)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_push___spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct __spoolss_EnumPrinterDataEx *r) +{ + uint32_t cntr_info_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count)); + } + if (flags & NDR_OUT) { + for (cntr_info_0 = 0; cntr_info_0 < r->in.count; cntr_info_0++) { + NDR_CHECK(ndr_push_spoolss_PrinterEnumValues(ndr, NDR_SCALARS, &r->out.info[cntr_info_0])); + } + for (cntr_info_0 = 0; cntr_info_0 < r->in.count; cntr_info_0++) { + NDR_CHECK(ndr_push_spoolss_PrinterEnumValues(ndr, NDR_BUFFERS, &r->out.info[cntr_info_0])); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull___spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct __spoolss_EnumPrinterDataEx *r) +{ + uint32_t cntr_info_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.count)); + } + if (flags & NDR_OUT) { + NDR_PULL_ALLOC_N(ndr, r->out.info, r->in.count); + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0); + for (cntr_info_0 = 0; cntr_info_0 < r->in.count; cntr_info_0++) { + NDR_CHECK(ndr_pull_spoolss_PrinterEnumValues(ndr, NDR_SCALARS, &r->out.info[cntr_info_0])); + } + for (cntr_info_0 = 0; cntr_info_0 < r->in.count; cntr_info_0++) { + NDR_CHECK(ndr_pull_spoolss_PrinterEnumValues(ndr, NDR_BUFFERS, &r->out.info[cntr_info_0])); } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); } return NDR_ERR_SUCCESS; } _PUBLIC_ void ndr_print_spoolss_EnumPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_EnumPrinterDataEx *r) { + uint32_t cntr_info_2; ndr_print_struct(ndr, name, "spoolss_EnumPrinterDataEx"); ndr->depth++; if (flags & NDR_SET_VALUES) { @@ -26407,17 +26436,31 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinterDataEx(struct ndr_print *ndr, const c if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "spoolss_EnumPrinterDataEx"); ndr->depth++; - ndr_print_ptr(ndr, "buffer", r->out.buffer); + ndr_print_ptr(ndr, "count", r->out.count); ndr->depth++; - ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.offered); + ndr_print_uint32(ndr, "count", *r->out.count); ndr->depth--; - ndr_print_ptr(ndr, "needed", r->out.needed); + ndr_print_ptr(ndr, "info", r->out.info); ndr->depth++; - ndr_print_uint32(ndr, "needed", *r->out.needed); + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)*r->out.count); + ndr->depth++; + for (cntr_info_2=0;cntr_info_2<*r->out.count;cntr_info_2++) { + char *idx_2=NULL; + if (asprintf(&idx_2, "[%d]", cntr_info_2) != -1) { + ndr_print_spoolss_PrinterEnumValues(ndr, "info", &(*r->out.info)[cntr_info_2]); + free(idx_2); + } + } + ndr->depth--; + } ndr->depth--; - ndr_print_ptr(ndr, "count", r->out.count); + ndr->depth--; + ndr_print_ptr(ndr, "needed", r->out.needed); ndr->depth++; - ndr_print_uint32(ndr, "count", *r->out.count); + ndr_print_uint32(ndr, "needed", *r->out.needed); ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; diff --git a/librpc/gen_ndr/ndr_spoolss.h b/librpc/gen_ndr/ndr_spoolss.h index 77852e0a64..df0f20ff41 100644 --- a/librpc/gen_ndr/ndr_spoolss.h +++ b/librpc/gen_ndr/ndr_spoolss.h @@ -665,6 +665,12 @@ void ndr_print_spoolss_4b(struct ndr_print *ndr, const char *name, int flags, co void ndr_print_spoolss_4c(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_4c *r); void ndr_print_spoolss_SetPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_SetPrinterDataEx *r); void ndr_print_spoolss_GetPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_GetPrinterDataEx *r); +enum ndr_err_code ndr_push__spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct _spoolss_EnumPrinterDataEx *r); +enum ndr_err_code ndr_pull__spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct _spoolss_EnumPrinterDataEx *r); +void ndr_print__spoolss_EnumPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct _spoolss_EnumPrinterDataEx *r); +enum ndr_err_code ndr_push___spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct __spoolss_EnumPrinterDataEx *r); +enum ndr_err_code ndr_pull___spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct __spoolss_EnumPrinterDataEx *r); +void ndr_print___spoolss_EnumPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct __spoolss_EnumPrinterDataEx *r); enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinterDataEx *r); enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterDataEx *r); void ndr_print_spoolss_EnumPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_EnumPrinterDataEx *r); diff --git a/librpc/gen_ndr/spoolss.h b/librpc/gen_ndr/spoolss.h index c703c87f27..65655e9c70 100644 --- a/librpc/gen_ndr/spoolss.h +++ b/librpc/gen_ndr/spoolss.h @@ -2900,7 +2900,7 @@ struct spoolss_GetPrinterDataEx { }; -struct spoolss_EnumPrinterDataEx { +struct _spoolss_EnumPrinterDataEx { struct { struct policy_handle *handle;/* [ref] */ const char *key_name;/* [charset(UTF16)] */ @@ -2908,7 +2908,7 @@ struct spoolss_EnumPrinterDataEx { } in; struct { - uint8_t *buffer;/* [ref,size_is(offered)] */ + DATA_BLOB info; uint32_t *needed;/* [ref] */ uint32_t *count;/* [ref] */ WERROR result; @@ -2917,6 +2917,35 @@ struct spoolss_EnumPrinterDataEx { }; +struct __spoolss_EnumPrinterDataEx { + struct { + uint32_t count; + } in; + + struct { + struct spoolss_PrinterEnumValues *info; + } out; + +}; + + +struct spoolss_EnumPrinterDataEx { + struct { + struct policy_handle *handle;/* [ref] */ + const char *key_name;/* [charset(UTF16)] */ + uint32_t offered; + } in; + + struct { + uint32_t *count;/* [ref] */ + struct spoolss_PrinterEnumValues **info;/* [ref,size_is(,*count)] */ + uint32_t *needed;/* [ref] */ + WERROR result; + } out; + +}; + + struct spoolss_EnumPrinterKey { struct { struct policy_handle *handle;/* [ref] */ diff --git a/librpc/gen_ndr/srv_spoolss.c b/librpc/gen_ndr/srv_spoolss.c index 74ab6ba7dd..79efbb5970 100644 --- a/librpc/gen_ndr/srv_spoolss.c +++ b/librpc/gen_ndr/srv_spoolss.c @@ -6204,20 +6204,20 @@ static bool api_spoolss_EnumPrinterDataEx(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.buffer = talloc_zero_array(r, uint8_t, r->in.offered); - if (r->out.buffer == NULL) { + r->out.count = talloc_zero(r, uint32_t); + if (r->out.count == NULL) { talloc_free(r); return false; } - r->out.needed = talloc_zero(r, uint32_t); - if (r->out.needed == NULL) { + r->out.info = talloc_zero(r, struct spoolss_PrinterEnumValues *); + if (r->out.info == NULL) { talloc_free(r); return false; } - r->out.count = talloc_zero(r, uint32_t); - if (r->out.count == NULL) { + r->out.needed = talloc_zero(r, uint32_t); + if (r->out.needed == NULL) { talloc_free(r); return false; } @@ -8377,18 +8377,18 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, case NDR_SPOOLSS_ENUMPRINTERDATAEX: { struct spoolss_EnumPrinterDataEx *r = (struct spoolss_EnumPrinterDataEx *)_r; ZERO_STRUCT(r->out); - r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.offered); - if (r->out.buffer == NULL) { + r->out.count = talloc_zero(mem_ctx, uint32_t); + if (r->out.count == NULL) { return NT_STATUS_NO_MEMORY; } - r->out.needed = talloc_zero(mem_ctx, uint32_t); - if (r->out.needed == NULL) { + r->out.info = talloc_zero(mem_ctx, struct spoolss_PrinterEnumValues *); + if (r->out.info == NULL) { return NT_STATUS_NO_MEMORY; } - r->out.count = talloc_zero(mem_ctx, uint32_t); - if (r->out.count == NULL) { + r->out.needed = talloc_zero(mem_ctx, uint32_t); + if (r->out.needed == NULL) { return NT_STATUS_NO_MEMORY; } |