summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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.c42
-rw-r--r--librpc/gen_ndr/spoolss.h4
4 files changed, 44 insertions, 14 deletions
diff --git a/librpc/gen_ndr/cli_spoolss.c b/librpc/gen_ndr/cli_spoolss.c
index fbbbfd44f8..4906d239de 100644
--- a/librpc/gen_ndr/cli_spoolss.c
+++ b/librpc/gen_ndr/cli_spoolss.c
@@ -2743,8 +2743,8 @@ NTSTATUS rpccli_spoolss_ReplyOpenPrinter(struct rpc_pipe_client *cli,
const char *server_name /* [in] [charset(UTF16)] */,
uint32_t printer_local /* [in] */,
enum winreg_Type type /* [in] */,
- uint32_t unknown1 /* [in] */,
- uint32_t unknown2 /* [in] */,
+ uint32_t bufsize /* [in] [range(0,512)] */,
+ uint8_t *buffer /* [in] [unique,size_is(bufsize)] */,
struct policy_handle *handle /* [out] [ref] */,
WERROR *werror)
{
@@ -2755,8 +2755,8 @@ NTSTATUS rpccli_spoolss_ReplyOpenPrinter(struct rpc_pipe_client *cli,
r.in.server_name = server_name;
r.in.printer_local = printer_local;
r.in.type = type;
- r.in.unknown1 = unknown1;
- r.in.unknown2 = unknown2;
+ r.in.bufsize = bufsize;
+ r.in.buffer = buffer;
if (DEBUGLEVEL >= 10) {
NDR_PRINT_IN_DEBUG(spoolss_ReplyOpenPrinter, &r);
diff --git a/librpc/gen_ndr/cli_spoolss.h b/librpc/gen_ndr/cli_spoolss.h
index 852f53d79f..9eb43d61a5 100644
--- a/librpc/gen_ndr/cli_spoolss.h
+++ b/librpc/gen_ndr/cli_spoolss.h
@@ -343,8 +343,8 @@ NTSTATUS rpccli_spoolss_ReplyOpenPrinter(struct rpc_pipe_client *cli,
const char *server_name /* [in] [charset(UTF16)] */,
uint32_t printer_local /* [in] */,
enum winreg_Type type /* [in] */,
- uint32_t unknown1 /* [in] */,
- uint32_t unknown2 /* [in] */,
+ uint32_t bufsize /* [in] [range(0,512)] */,
+ uint8_t *buffer /* [in] [unique,size_is(bufsize)] */,
struct policy_handle *handle /* [out] [ref] */,
WERROR *werror);
NTSTATUS rpccli_spoolss_RouterReplyPrinter(struct rpc_pipe_client *cli,
diff --git a/librpc/gen_ndr/ndr_spoolss.c b/librpc/gen_ndr/ndr_spoolss.c
index 8cc99574c9..c696e53539 100644
--- a/librpc/gen_ndr/ndr_spoolss.c
+++ b/librpc/gen_ndr/ndr_spoolss.c
@@ -14289,8 +14289,12 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_ReplyOpenPrinter(struct ndr_push *nd
NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.server_name, ndr_charset_length(r->in.server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16));
NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.printer_local));
NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, r->in.type));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown1));
- NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.unknown2));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.bufsize));
+ NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.buffer));
+ if (r->in.buffer) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.bufsize));
+ NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->in.buffer, r->in.bufsize));
+ }
}
if (flags & NDR_OUT) {
if (r->out.handle == NULL) {
@@ -14304,6 +14308,8 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_ReplyOpenPrinter(struct ndr_push *nd
_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_ReplyOpenPrinter(struct ndr_pull *ndr, int flags, struct spoolss_ReplyOpenPrinter *r)
{
+ uint32_t _ptr_buffer;
+ TALLOC_CTX *_mem_save_buffer_0;
TALLOC_CTX *_mem_save_handle_0;
if (flags & NDR_IN) {
ZERO_STRUCT(r->out);
@@ -14317,10 +14323,29 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_ReplyOpenPrinter(struct ndr_pull *nd
NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.server_name, ndr_get_array_length(ndr, &r->in.server_name), sizeof(uint16_t), CH_UTF16));
NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.printer_local));
NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, &r->in.type));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown1));
- NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.unknown2));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.bufsize));
+ if (r->in.bufsize > 512) {
+ return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range");
+ }
+ NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_buffer));
+ if (_ptr_buffer) {
+ NDR_PULL_ALLOC(ndr, r->in.buffer);
+ } else {
+ r->in.buffer = NULL;
+ }
+ if (r->in.buffer) {
+ _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->in.buffer, 0);
+ NDR_CHECK(ndr_pull_array_size(ndr, &r->in.buffer));
+ NDR_PULL_ALLOC_N(ndr, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer));
+ NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer)));
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0);
+ }
NDR_PULL_ALLOC(ndr, r->out.handle);
ZERO_STRUCTP(r->out.handle);
+ if (r->in.buffer) {
+ NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->in.buffer, r->in.bufsize));
+ }
}
if (flags & NDR_OUT) {
if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {
@@ -14348,8 +14373,13 @@ _PUBLIC_ void ndr_print_spoolss_ReplyOpenPrinter(struct ndr_print *ndr, const ch
ndr_print_string(ndr, "server_name", r->in.server_name);
ndr_print_uint32(ndr, "printer_local", r->in.printer_local);
ndr_print_winreg_Type(ndr, "type", r->in.type);
- ndr_print_uint32(ndr, "unknown1", r->in.unknown1);
- ndr_print_uint32(ndr, "unknown2", r->in.unknown2);
+ ndr_print_uint32(ndr, "bufsize", r->in.bufsize);
+ ndr_print_ptr(ndr, "buffer", r->in.buffer);
+ ndr->depth++;
+ if (r->in.buffer) {
+ ndr_print_array_uint8(ndr, "buffer", r->in.buffer, r->in.bufsize);
+ }
+ ndr->depth--;
ndr->depth--;
}
if (flags & NDR_OUT) {
diff --git a/librpc/gen_ndr/spoolss.h b/librpc/gen_ndr/spoolss.h
index 5934cfa033..b503f665c9 100644
--- a/librpc/gen_ndr/spoolss.h
+++ b/librpc/gen_ndr/spoolss.h
@@ -1802,8 +1802,8 @@ struct spoolss_ReplyOpenPrinter {
const char *server_name;/* [charset(UTF16)] */
uint32_t printer_local;
enum winreg_Type type;
- uint32_t unknown1;
- uint32_t unknown2;
+ uint32_t bufsize;/* [range(0,512)] */
+ uint8_t *buffer;/* [unique,size_is(bufsize)] */
} in;
struct {