diff options
Diffstat (limited to 'librpc')
39 files changed, 5059 insertions, 446 deletions
diff --git a/librpc/gen_ndr/cli_eventlog.c b/librpc/gen_ndr/cli_eventlog.c index 6b084d2217..b9cf39dea0 100644 --- a/librpc/gen_ndr/cli_eventlog.c +++ b/librpc/gen_ndr/cli_eventlog.c @@ -902,7 +902,7 @@ NTSTATUS rpccli_eventlog_WriteClusterEvents(struct rpc_pipe_client *cli, return r.out.result; } -NTSTATUS rpccli_eventlog_GetLogIntormation(struct rpc_pipe_client *cli, +NTSTATUS rpccli_eventlog_GetLogInformation(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle /* [in] [ref] */, uint32_t level /* [in] */, @@ -910,7 +910,7 @@ NTSTATUS rpccli_eventlog_GetLogIntormation(struct rpc_pipe_client *cli, uint32_t buf_size /* [in] [range(0,1024)] */, uint32_t *bytes_needed /* [out] [ref] */) { - struct eventlog_GetLogIntormation r; + struct eventlog_GetLogInformation r; NTSTATUS status; /* In parameters */ @@ -919,13 +919,13 @@ NTSTATUS rpccli_eventlog_GetLogIntormation(struct rpc_pipe_client *cli, r.in.buf_size = buf_size; if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_GetLogIntormation, &r); + NDR_PRINT_IN_DEBUG(eventlog_GetLogInformation, &r); } status = cli->dispatch(cli, mem_ctx, &ndr_table_eventlog, - NDR_EVENTLOG_GETLOGINTORMATION, + NDR_EVENTLOG_GETLOGINFORMATION, &r); if (!NT_STATUS_IS_OK(status)) { @@ -933,7 +933,7 @@ NTSTATUS rpccli_eventlog_GetLogIntormation(struct rpc_pipe_client *cli, } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_GetLogIntormation, &r); + NDR_PRINT_OUT_DEBUG(eventlog_GetLogInformation, &r); } if (NT_STATUS_IS_ERR(status)) { diff --git a/librpc/gen_ndr/cli_eventlog.h b/librpc/gen_ndr/cli_eventlog.h index ae5544daf3..d905676041 100644 --- a/librpc/gen_ndr/cli_eventlog.h +++ b/librpc/gen_ndr/cli_eventlog.h @@ -93,7 +93,7 @@ NTSTATUS rpccli_eventlog_DeregisterClusterSvc(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx); NTSTATUS rpccli_eventlog_WriteClusterEvents(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx); -NTSTATUS rpccli_eventlog_GetLogIntormation(struct rpc_pipe_client *cli, +NTSTATUS rpccli_eventlog_GetLogInformation(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle /* [in] [ref] */, uint32_t level /* [in] */, diff --git a/librpc/gen_ndr/cli_spoolss.c b/librpc/gen_ndr/cli_spoolss.c index 02a05b94ff..2aa42b93bf 100644 --- a/librpc/gen_ndr/cli_spoolss.c +++ b/librpc/gen_ndr/cli_spoolss.c @@ -2540,7 +2540,7 @@ NTSTATUS rpccli_spoolss_GetPrinterDriver2(struct rpc_pipe_client *cli, uint32_t offered /* [in] */, uint32_t client_major_version /* [in] */, uint32_t client_minor_version /* [in] */, - DATA_BLOB *info /* [out] [unique] */, + union spoolss_DriverInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */, uint32_t *needed /* [out] [ref] */, uint32_t *server_major_version /* [out] [ref] */, uint32_t *server_minor_version /* [out] [ref] */, diff --git a/librpc/gen_ndr/cli_spoolss.h b/librpc/gen_ndr/cli_spoolss.h index bb38d59cfb..83b2e28729 100644 --- a/librpc/gen_ndr/cli_spoolss.h +++ b/librpc/gen_ndr/cli_spoolss.h @@ -331,7 +331,7 @@ NTSTATUS rpccli_spoolss_GetPrinterDriver2(struct rpc_pipe_client *cli, uint32_t offered /* [in] */, uint32_t client_major_version /* [in] */, uint32_t client_minor_version /* [in] */, - DATA_BLOB *info /* [out] [unique] */, + union spoolss_DriverInfo *info /* [out] [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */, uint32_t *needed /* [out] [ref] */, uint32_t *server_major_version /* [out] [ref] */, uint32_t *server_minor_version /* [out] [ref] */, diff --git a/librpc/gen_ndr/dfs.h b/librpc/gen_ndr/dfs.h index 07548c3742..41be3bd28d 100644 --- a/librpc/gen_ndr/dfs.h +++ b/librpc/gen_ndr/dfs.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #include "librpc/gen_ndr/misc.h" #ifndef _HEADER_netdfs #define _HEADER_netdfs diff --git a/librpc/gen_ndr/drsblobs.h b/librpc/gen_ndr/drsblobs.h index bb33464c76..190e012cb5 100644 --- a/librpc/gen_ndr/drsblobs.h +++ b/librpc/gen_ndr/drsblobs.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #include "librpc/gen_ndr/drsuapi.h" #include "librpc/gen_ndr/misc.h" #include "librpc/gen_ndr/samr.h" diff --git a/librpc/gen_ndr/drsuapi.h b/librpc/gen_ndr/drsuapi.h index e3d480365e..8f9b165631 100644 --- a/librpc/gen_ndr/drsuapi.h +++ b/librpc/gen_ndr/drsuapi.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #include "librpc/gen_ndr/security.h" #include "librpc/gen_ndr/misc.h" #include "librpc/gen_ndr/samr.h" diff --git a/librpc/gen_ndr/dssetup.h b/librpc/gen_ndr/dssetup.h index d284a63375..5d254fe92e 100644 --- a/librpc/gen_ndr/dssetup.h +++ b/librpc/gen_ndr/dssetup.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #include "librpc/gen_ndr/misc.h" #ifndef _HEADER_dssetup #define _HEADER_dssetup diff --git a/librpc/gen_ndr/echo.h b/librpc/gen_ndr/echo.h index 79d4220714..9c783046f3 100644 --- a/librpc/gen_ndr/echo.h +++ b/librpc/gen_ndr/echo.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #ifndef _HEADER_rpcecho #define _HEADER_rpcecho diff --git a/librpc/gen_ndr/epmapper.h b/librpc/gen_ndr/epmapper.h index e5155a8cad..ff80fbb4fd 100644 --- a/librpc/gen_ndr/epmapper.h +++ b/librpc/gen_ndr/epmapper.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #include "librpc/gen_ndr/misc.h" #ifndef _HEADER_epmapper #define _HEADER_epmapper diff --git a/librpc/gen_ndr/eventlog.h b/librpc/gen_ndr/eventlog.h index 94da688f5c..b6e792fdd3 100644 --- a/librpc/gen_ndr/eventlog.h +++ b/librpc/gen_ndr/eventlog.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #include "librpc/gen_ndr/lsa.h" #include "librpc/gen_ndr/security.h" #ifndef _HEADER_eventlog @@ -39,32 +41,6 @@ struct eventlog_OpenUnknown0 { uint16_t unknown1; }; -struct eventlog_Record { - uint32_t size; - const char *reserved;/* [value("eLfL"),charset(DOS)] */ - uint32_t record_number; - time_t time_generated; - time_t time_written; - uint32_t event_id; - enum eventlogEventTypes event_type; - uint16_t num_of_strings;/* [range(0,256)] */ - uint16_t event_category; - uint16_t reserved_flags; - uint32_t closing_record_number; - uint32_t stringoffset; - uint32_t sid_size;/* [value(ndr_size_dom_sid0(&sid,ndr->flags))] */ - uint32_t sid_offset; - uint32_t data_length; - uint32_t data_offset; - const char * source_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - const char * computer_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - struct dom_sid0 sid;/* [subcontext_size(sid_size),subcontext(0)] */ - const char * *strings;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ - const char * raw_data;/* [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ - DATA_BLOB _padding;/* [flag(LIBNDR_FLAG_ALIGN4)] */ - uint32_t size2;/* [value(size)] */ -}/* [public,flag(LIBNDR_FLAG_NOALIGN)] */; - struct eventlog_Record_tdb { uint32_t size; const char *reserved;/* [value("eLfL"),charset(DOS)] */ @@ -437,7 +413,7 @@ struct eventlog_WriteClusterEvents { }; -struct eventlog_GetLogIntormation { +struct eventlog_GetLogInformation { struct { struct policy_handle *handle;/* [ref] */ uint32_t level; diff --git a/librpc/gen_ndr/initshutdown.h b/librpc/gen_ndr/initshutdown.h index 014e2fe689..913eb8f740 100644 --- a/librpc/gen_ndr/initshutdown.h +++ b/librpc/gen_ndr/initshutdown.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #include "librpc/gen_ndr/lsa.h" #ifndef _HEADER_initshutdown #define _HEADER_initshutdown diff --git a/librpc/gen_ndr/krb5pac.h b/librpc/gen_ndr/krb5pac.h index 73bd0d95bb..03b23bdaae 100644 --- a/librpc/gen_ndr/krb5pac.h +++ b/librpc/gen_ndr/krb5pac.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #include "librpc/gen_ndr/security.h" #include "librpc/gen_ndr/netlogon.h" #include "librpc/gen_ndr/samr.h" diff --git a/librpc/gen_ndr/lsa.h b/librpc/gen_ndr/lsa.h index 03a0464d5b..a6da7a6cef 100644 --- a/librpc/gen_ndr/lsa.h +++ b/librpc/gen_ndr/lsa.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #include "librpc/gen_ndr/misc.h" #include "librpc/gen_ndr/security.h" #ifndef _HEADER_lsarpc diff --git a/librpc/gen_ndr/misc.h b/librpc/gen_ndr/misc.h index e000cb0624..824483d292 100644 --- a/librpc/gen_ndr/misc.h +++ b/librpc/gen_ndr/misc.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #ifndef _HEADER_misc #define _HEADER_misc diff --git a/librpc/gen_ndr/named_pipe_auth.h b/librpc/gen_ndr/named_pipe_auth.h index 7ca7444c92..e35c221118 100644 --- a/librpc/gen_ndr/named_pipe_auth.h +++ b/librpc/gen_ndr/named_pipe_auth.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #include "librpc/gen_ndr/netlogon.h" #ifndef _HEADER_named_pipe_auth #define _HEADER_named_pipe_auth diff --git a/librpc/gen_ndr/nbt.h b/librpc/gen_ndr/nbt.h index 1f3ad37d9b..affbeffa08 100644 --- a/librpc/gen_ndr/nbt.h +++ b/librpc/gen_ndr/nbt.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #include "librpc/gen_ndr/misc.h" #include "librpc/gen_ndr/security.h" #include "librpc/gen_ndr/svcctl.h" diff --git a/librpc/gen_ndr/ndr_eventlog.c b/librpc/gen_ndr/ndr_eventlog.c index 0d5654c640..3f19902690 100644 --- a/librpc/gen_ndr/ndr_eventlog.c +++ b/librpc/gen_ndr/ndr_eventlog.c @@ -92,201 +92,6 @@ _PUBLIC_ void ndr_print_eventlog_OpenUnknown0(struct ndr_print *ndr, const char ndr->depth--; } -_PUBLIC_ enum ndr_err_code ndr_push_eventlog_Record(struct ndr_push *ndr, int ndr_flags, const struct eventlog_Record *r) -{ - uint32_t cntr_strings_0; - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); - NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, "eLfL", 4, sizeof(uint8_t), CH_DOS)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->record_number)); - NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->time_generated)); - NDR_CHECK(ndr_push_time_t(ndr, NDR_SCALARS, r->time_written)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->event_id)); - NDR_CHECK(ndr_push_eventlogEventTypes(ndr, NDR_SCALARS, r->event_type)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->num_of_strings)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->event_category)); - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->reserved_flags)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->closing_record_number)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->stringoffset)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_dom_sid0(&r->sid, ndr->flags))); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sid_offset)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->data_length)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->data_offset)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->source_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->computer_name)); - ndr->flags = _flags_save_string; - } - { - struct ndr_push *_ndr_sid; - NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_sid, 0, ndr_size_dom_sid0(&r->sid, ndr->flags))); - NDR_CHECK(ndr_push_dom_sid0(_ndr_sid, NDR_SCALARS|NDR_BUFFERS, &r->sid)); - NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_sid, 0, ndr_size_dom_sid0(&r->sid, ndr->flags))); - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - for (cntr_strings_0 = 0; cntr_strings_0 < r->num_of_strings; cntr_strings_0++) { - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->strings[cntr_strings_0])); - } - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->raw_data)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->_padding)); - ndr->flags = _flags_save_DATA_BLOB; - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ enum ndr_err_code ndr_pull_eventlog_Record(struct ndr_pull *ndr, int ndr_flags, struct eventlog_Record *r) -{ - uint32_t cntr_strings_0; - TALLOC_CTX *_mem_save_strings_0; - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - if (ndr_flags & NDR_SCALARS) { - NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); - NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->reserved, 4, sizeof(uint8_t), CH_DOS)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->record_number)); - NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->time_generated)); - NDR_CHECK(ndr_pull_time_t(ndr, NDR_SCALARS, &r->time_written)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->event_id)); - NDR_CHECK(ndr_pull_eventlogEventTypes(ndr, NDR_SCALARS, &r->event_type)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->num_of_strings)); - if (r->num_of_strings > 256) { - return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); - } - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->event_category)); - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->reserved_flags)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->closing_record_number)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->stringoffset)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_size)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sid_offset)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->data_length)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->data_offset)); - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->source_name)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->computer_name)); - ndr->flags = _flags_save_string; - } - { - struct ndr_pull *_ndr_sid; - NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_sid, 0, r->sid_size)); - NDR_CHECK(ndr_pull_dom_sid0(_ndr_sid, NDR_SCALARS|NDR_BUFFERS, &r->sid)); - NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_sid, 0, r->sid_size)); - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); - NDR_PULL_ALLOC_N(ndr, r->strings, r->num_of_strings); - _mem_save_strings_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->strings, 0); - for (cntr_strings_0 = 0; cntr_strings_0 < r->num_of_strings; cntr_strings_0++) { - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->strings[cntr_strings_0])); - } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_strings_0, 0); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_string = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); - NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->raw_data)); - ndr->flags = _flags_save_string; - } - { - uint32_t _flags_save_DATA_BLOB = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_ALIGN4); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->_padding)); - ndr->flags = _flags_save_DATA_BLOB; - } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size2)); - } - if (ndr_flags & NDR_BUFFERS) { - } - ndr->flags = _flags_save_STRUCT; - } - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_eventlog_Record(struct ndr_print *ndr, const char *name, const struct eventlog_Record *r) -{ - uint32_t cntr_strings_0; - ndr_print_struct(ndr, name, "eventlog_Record"); - { - uint32_t _flags_save_STRUCT = ndr->flags; - ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN); - ndr->depth++; - ndr_print_uint32(ndr, "size", r->size); - ndr_print_string(ndr, "reserved", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?"eLfL":r->reserved); - ndr_print_uint32(ndr, "record_number", r->record_number); - ndr_print_time_t(ndr, "time_generated", r->time_generated); - ndr_print_time_t(ndr, "time_written", r->time_written); - ndr_print_uint32(ndr, "event_id", r->event_id); - ndr_print_eventlogEventTypes(ndr, "event_type", r->event_type); - ndr_print_uint16(ndr, "num_of_strings", r->num_of_strings); - ndr_print_uint16(ndr, "event_category", r->event_category); - ndr_print_uint16(ndr, "reserved_flags", r->reserved_flags); - ndr_print_uint32(ndr, "closing_record_number", r->closing_record_number); - ndr_print_uint32(ndr, "stringoffset", r->stringoffset); - ndr_print_uint32(ndr, "sid_size", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_dom_sid0(&r->sid, ndr->flags):r->sid_size); - ndr_print_uint32(ndr, "sid_offset", r->sid_offset); - ndr_print_uint32(ndr, "data_length", r->data_length); - ndr_print_uint32(ndr, "data_offset", r->data_offset); - ndr_print_string(ndr, "source_name", r->source_name); - ndr_print_string(ndr, "computer_name", r->computer_name); - ndr_print_dom_sid0(ndr, "sid", &r->sid); - ndr->print(ndr, "%s: ARRAY(%d)", "strings", (int)r->num_of_strings); - ndr->depth++; - for (cntr_strings_0=0;cntr_strings_0<r->num_of_strings;cntr_strings_0++) { - char *idx_0=NULL; - if (asprintf(&idx_0, "[%d]", cntr_strings_0) != -1) { - ndr_print_string(ndr, "strings", r->strings[cntr_strings_0]); - free(idx_0); - } - } - ndr->depth--; - ndr_print_string(ndr, "raw_data", r->raw_data); - ndr_print_DATA_BLOB(ndr, "_padding", r->_padding); - ndr_print_uint32(ndr, "size2", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?r->size:r->size2); - ndr->depth--; - ndr->flags = _flags_save_STRUCT; - } -} - _PUBLIC_ enum ndr_err_code ndr_push_eventlog_Record_tdb(struct ndr_push *ndr, int ndr_flags, const struct eventlog_Record_tdb *r) { uint32_t cntr_strings_0; @@ -2589,7 +2394,7 @@ _PUBLIC_ void ndr_print_eventlog_WriteClusterEvents(struct ndr_print *ndr, const ndr->depth--; } -static enum ndr_err_code ndr_push_eventlog_GetLogIntormation(struct ndr_push *ndr, int flags, const struct eventlog_GetLogIntormation *r) +static enum ndr_err_code ndr_push_eventlog_GetLogInformation(struct ndr_push *ndr, int flags, const struct eventlog_GetLogInformation *r) { if (flags & NDR_IN) { if (r->in.handle == NULL) { @@ -2614,7 +2419,7 @@ static enum ndr_err_code ndr_push_eventlog_GetLogIntormation(struct ndr_push *nd return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_eventlog_GetLogIntormation(struct ndr_pull *ndr, int flags, struct eventlog_GetLogIntormation *r) +static enum ndr_err_code ndr_pull_eventlog_GetLogInformation(struct ndr_pull *ndr, int flags, struct eventlog_GetLogInformation *r) { TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_bytes_needed_0; @@ -2659,15 +2464,15 @@ static enum ndr_err_code ndr_pull_eventlog_GetLogIntormation(struct ndr_pull *nd return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_eventlog_GetLogIntormation(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_GetLogIntormation *r) +_PUBLIC_ void ndr_print_eventlog_GetLogInformation(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_GetLogInformation *r) { - ndr_print_struct(ndr, name, "eventlog_GetLogIntormation"); + ndr_print_struct(ndr, name, "eventlog_GetLogInformation"); ndr->depth++; if (flags & NDR_SET_VALUES) { ndr->flags |= LIBNDR_PRINT_SET_VALUES; } if (flags & NDR_IN) { - ndr_print_struct(ndr, "in", "eventlog_GetLogIntormation"); + ndr_print_struct(ndr, "in", "eventlog_GetLogInformation"); ndr->depth++; ndr_print_ptr(ndr, "handle", r->in.handle); ndr->depth++; @@ -2678,7 +2483,7 @@ _PUBLIC_ void ndr_print_eventlog_GetLogIntormation(struct ndr_print *ndr, const ndr->depth--; } if (flags & NDR_OUT) { - ndr_print_struct(ndr, "out", "eventlog_GetLogIntormation"); + ndr_print_struct(ndr, "out", "eventlog_GetLogInformation"); ndr->depth++; ndr_print_ptr(ndr, "buffer", r->out.buffer); ndr->depth++; @@ -3267,11 +3072,11 @@ static const struct ndr_interface_call eventlog_calls[] = { false, }, { - "eventlog_GetLogIntormation", - sizeof(struct eventlog_GetLogIntormation), - (ndr_push_flags_fn_t) ndr_push_eventlog_GetLogIntormation, - (ndr_pull_flags_fn_t) ndr_pull_eventlog_GetLogIntormation, - (ndr_print_function_t) ndr_print_eventlog_GetLogIntormation, + "eventlog_GetLogInformation", + sizeof(struct eventlog_GetLogInformation), + (ndr_push_flags_fn_t) ndr_push_eventlog_GetLogInformation, + (ndr_pull_flags_fn_t) ndr_pull_eventlog_GetLogInformation, + (ndr_print_function_t) ndr_print_eventlog_GetLogInformation, false, }, { diff --git a/librpc/gen_ndr/ndr_eventlog.h b/librpc/gen_ndr/ndr_eventlog.h index 34e6e09637..39f5f1bbc8 100644 --- a/librpc/gen_ndr/ndr_eventlog.h +++ b/librpc/gen_ndr/ndr_eventlog.h @@ -55,7 +55,7 @@ extern const struct ndr_interface_table ndr_table_eventlog; #define NDR_EVENTLOG_WRITECLUSTEREVENTS (0x15) -#define NDR_EVENTLOG_GETLOGINTORMATION (0x16) +#define NDR_EVENTLOG_GETLOGINFORMATION (0x16) #define NDR_EVENTLOG_FLUSHEVENTLOG (0x17) @@ -67,9 +67,6 @@ enum ndr_err_code ndr_push_eventlogEventTypes(struct ndr_push *ndr, int ndr_flag enum ndr_err_code ndr_pull_eventlogEventTypes(struct ndr_pull *ndr, int ndr_flags, enum eventlogEventTypes *r); void ndr_print_eventlogEventTypes(struct ndr_print *ndr, const char *name, enum eventlogEventTypes r); void ndr_print_eventlog_OpenUnknown0(struct ndr_print *ndr, const char *name, const struct eventlog_OpenUnknown0 *r); -enum ndr_err_code ndr_push_eventlog_Record(struct ndr_push *ndr, int ndr_flags, const struct eventlog_Record *r); -enum ndr_err_code ndr_pull_eventlog_Record(struct ndr_pull *ndr, int ndr_flags, struct eventlog_Record *r); -void ndr_print_eventlog_Record(struct ndr_print *ndr, const char *name, const struct eventlog_Record *r); enum ndr_err_code ndr_push_eventlog_Record_tdb(struct ndr_push *ndr, int ndr_flags, const struct eventlog_Record_tdb *r); enum ndr_err_code ndr_pull_eventlog_Record_tdb(struct ndr_pull *ndr, int ndr_flags, struct eventlog_Record_tdb *r); void ndr_print_eventlog_Record_tdb(struct ndr_print *ndr, const char *name, const struct eventlog_Record_tdb *r); @@ -109,7 +106,7 @@ void ndr_print_eventlog_ReportEventA(struct ndr_print *ndr, const char *name, in void ndr_print_eventlog_RegisterClusterSvc(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_RegisterClusterSvc *r); void ndr_print_eventlog_DeregisterClusterSvc(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_DeregisterClusterSvc *r); void ndr_print_eventlog_WriteClusterEvents(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_WriteClusterEvents *r); -void ndr_print_eventlog_GetLogIntormation(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_GetLogIntormation *r); +void ndr_print_eventlog_GetLogInformation(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_GetLogInformation *r); void ndr_print_eventlog_FlushEventLog(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_FlushEventLog *r); void ndr_print_eventlog_ReportEventAndSourceW(struct ndr_print *ndr, const char *name, int flags, const struct eventlog_ReportEventAndSourceW *r); #endif /* _HEADER_NDR_eventlog */ diff --git a/librpc/gen_ndr/ndr_spoolss.c b/librpc/gen_ndr/ndr_spoolss.c index 9ec3f35930..31220edc62 100644 --- a/librpc/gen_ndr/ndr_spoolss.c +++ b/librpc/gen_ndr/ndr_spoolss.c @@ -2520,6 +2520,40 @@ _PUBLIC_ void ndr_print_spoolss_DevmodeContainer(struct ndr_print *ndr, const ch ndr->depth--; } +static enum ndr_err_code ndr_push_spoolss_JobStatus(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_spoolss_JobStatus(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_JobStatus(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_PAUSED", JOB_STATUS_PAUSED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_ERROR", JOB_STATUS_ERROR, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_DELETING", JOB_STATUS_DELETING, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_SPOOLING", JOB_STATUS_SPOOLING, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_PRINTING", JOB_STATUS_PRINTING, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_OFFLINE", JOB_STATUS_OFFLINE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_PAPEROUT", JOB_STATUS_PAPEROUT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_PRINTED", JOB_STATUS_PRINTED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_DELETED", JOB_STATUS_DELETED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_BLOCKED_DEVQ", JOB_STATUS_BLOCKED_DEVQ, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_USER_INTERVENTION", JOB_STATUS_USER_INTERVENTION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_RESTART", JOB_STATUS_RESTART, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_COMPLETE", JOB_STATUS_COMPLETE, r); + ndr->depth--; +} + static enum ndr_err_code ndr_push_spoolss_JobInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_JobInfo1 *r) { if (ndr_flags & NDR_SCALARS) { @@ -2561,12 +2595,12 @@ static enum ndr_err_code ndr_push_spoolss_JobInfo1(struct ndr_push *ndr, int ndr NDR_CHECK(ndr_push_relative_ptr1(ndr, r->text_status)); ndr->flags = _flags_save_string; } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->status)); + NDR_CHECK(ndr_push_spoolss_JobStatus(ndr, NDR_SCALARS, r->status)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->position)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->total_pages)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pages_printed)); - NDR_CHECK(ndr_push_spoolss_Time(ndr, NDR_SCALARS, &r->time)); + NDR_CHECK(ndr_push_spoolss_Time(ndr, NDR_SCALARS, &r->submitted)); } if (ndr_flags & NDR_BUFFERS) { { @@ -2716,12 +2750,12 @@ static enum ndr_err_code ndr_pull_spoolss_JobInfo1(struct ndr_pull *ndr, int ndr } ndr->flags = _flags_save_string; } - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->status)); + NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->status)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->position)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->total_pages)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pages_printed)); - NDR_CHECK(ndr_pull_spoolss_Time(ndr, NDR_SCALARS, &r->time)); + NDR_CHECK(ndr_pull_spoolss_Time(ndr, NDR_SCALARS, &r->submitted)); } if (ndr_flags & NDR_BUFFERS) { { @@ -2859,12 +2893,1291 @@ _PUBLIC_ void ndr_print_spoolss_JobInfo1(struct ndr_print *ndr, const char *name ndr_print_string(ndr, "text_status", r->text_status); } ndr->depth--; - ndr_print_uint32(ndr, "status", r->status); + ndr_print_spoolss_JobStatus(ndr, "status", r->status); ndr_print_uint32(ndr, "priority", r->priority); ndr_print_uint32(ndr, "position", r->position); ndr_print_uint32(ndr, "total_pages", r->total_pages); ndr_print_uint32(ndr, "pages_printed", r->pages_printed); - ndr_print_spoolss_Time(ndr, "time", &r->time); + ndr_print_spoolss_Time(ndr, "submitted", &r->submitted); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_spoolss_JobInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_JobInfo2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->job_id)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->printer_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->server_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->user_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->document_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->notify_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->data_type)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->print_processor)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->parameters)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->driver_name)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->devmode)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->text_status)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->secdesc)); + NDR_CHECK(ndr_push_spoolss_JobStatus(ndr, NDR_SCALARS, r->status)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->position)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->start_time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->until_time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->total_pages)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_spoolss_Time(ndr, NDR_SCALARS, &r->submitted)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pages_printed)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->printer_name) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->printer_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->printer_name)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->server_name) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->server_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->server_name)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->user_name) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->user_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->document_name) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->document_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->document_name)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->notify_name) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->notify_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->notify_name)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->data_type) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->data_type)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->data_type)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->print_processor) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->print_processor)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->print_processor)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->parameters) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->parameters)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->parameters)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->driver_name) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->driver_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->driver_name)); + } + ndr->flags = _flags_save_string; + } + if (r->devmode) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->devmode)); + NDR_CHECK(ndr_push_spoolss_DeviceMode(ndr, NDR_SCALARS, r->devmode)); + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->text_status) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->text_status)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->text_status)); + } + ndr->flags = _flags_save_string; + } + if (r->secdesc) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->secdesc)); + NDR_CHECK(ndr_push_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_spoolss_JobInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_JobInfo2 *r) +{ + uint32_t _ptr_printer_name; + TALLOC_CTX *_mem_save_printer_name_0; + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + uint32_t _ptr_user_name; + TALLOC_CTX *_mem_save_user_name_0; + uint32_t _ptr_document_name; + TALLOC_CTX *_mem_save_document_name_0; + uint32_t _ptr_notify_name; + TALLOC_CTX *_mem_save_notify_name_0; + uint32_t _ptr_data_type; + TALLOC_CTX *_mem_save_data_type_0; + uint32_t _ptr_print_processor; + TALLOC_CTX *_mem_save_print_processor_0; + uint32_t _ptr_parameters; + TALLOC_CTX *_mem_save_parameters_0; + uint32_t _ptr_driver_name; + TALLOC_CTX *_mem_save_driver_name_0; + uint32_t _ptr_devmode; + TALLOC_CTX *_mem_save_devmode_0; + uint32_t _ptr_text_status; + TALLOC_CTX *_mem_save_text_status_0; + uint32_t _ptr_secdesc; + TALLOC_CTX *_mem_save_secdesc_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->job_id)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printer_name)); + if (_ptr_printer_name) { + NDR_PULL_ALLOC(ndr, r->printer_name); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->printer_name, _ptr_printer_name)); + } else { + r->printer_name = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->server_name); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->server_name, _ptr_server_name)); + } else { + r->server_name = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user_name)); + if (_ptr_user_name) { + NDR_PULL_ALLOC(ndr, r->user_name); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->user_name, _ptr_user_name)); + } else { + r->user_name = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_document_name)); + if (_ptr_document_name) { + NDR_PULL_ALLOC(ndr, r->document_name); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->document_name, _ptr_document_name)); + } else { + r->document_name = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_notify_name)); + if (_ptr_notify_name) { + NDR_PULL_ALLOC(ndr, r->notify_name); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->notify_name, _ptr_notify_name)); + } else { + r->notify_name = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_type)); + if (_ptr_data_type) { + NDR_PULL_ALLOC(ndr, r->data_type); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->data_type, _ptr_data_type)); + } else { + r->data_type = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_print_processor)); + if (_ptr_print_processor) { + NDR_PULL_ALLOC(ndr, r->print_processor); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->print_processor, _ptr_print_processor)); + } else { + r->print_processor = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parameters)); + if (_ptr_parameters) { + NDR_PULL_ALLOC(ndr, r->parameters); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->parameters, _ptr_parameters)); + } else { + r->parameters = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name)); + if (_ptr_driver_name) { + NDR_PULL_ALLOC(ndr, r->driver_name); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->driver_name, _ptr_driver_name)); + } else { + r->driver_name = NULL; + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devmode)); + if (_ptr_devmode) { + NDR_PULL_ALLOC(ndr, r->devmode); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->devmode, _ptr_devmode)); + } else { + r->devmode = NULL; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_text_status)); + if (_ptr_text_status) { + NDR_PULL_ALLOC(ndr, r->text_status); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->text_status, _ptr_text_status)); + } else { + r->text_status = NULL; + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdesc)); + if (_ptr_secdesc) { + NDR_PULL_ALLOC(ndr, r->secdesc); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->secdesc, _ptr_secdesc)); + } else { + r->secdesc = NULL; + } + NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->status)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->position)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->start_time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->until_time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->total_pages)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_spoolss_Time(ndr, NDR_SCALARS, &r->submitted)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pages_printed)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->printer_name) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->printer_name)); + _mem_save_printer_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->printer_name, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->printer_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printer_name_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->server_name) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->server_name)); + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->server_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->user_name) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->user_name)); + _mem_save_user_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user_name, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_name_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->document_name) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->document_name)); + _mem_save_document_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->document_name, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->document_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_document_name_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->notify_name) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->notify_name)); + _mem_save_notify_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->notify_name, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->notify_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_notify_name_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->data_type) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->data_type)); + _mem_save_data_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data_type, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->data_type)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_type_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->print_processor) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->print_processor)); + _mem_save_print_processor_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->print_processor, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->print_processor)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_print_processor_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->parameters) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->parameters)); + _mem_save_parameters_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->parameters, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->parameters)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parameters_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->driver_name) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->driver_name)); + _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->driver_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + if (r->devmode) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->devmode)); + _mem_save_devmode_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->devmode, 0); + NDR_CHECK(ndr_pull_spoolss_DeviceMode(ndr, NDR_SCALARS, r->devmode)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devmode_0, 0); + ndr->offset = _relative_save_offset; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->text_status) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->text_status)); + _mem_save_text_status_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->text_status, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->text_status)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_text_status_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + if (r->secdesc) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->secdesc)); + _mem_save_secdesc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->secdesc, 0); + NDR_CHECK(ndr_pull_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0); + ndr->offset = _relative_save_offset; + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_JobInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_JobInfo2 *r) +{ + ndr_print_struct(ndr, name, "spoolss_JobInfo2"); + ndr->depth++; + ndr_print_uint32(ndr, "job_id", r->job_id); + ndr_print_ptr(ndr, "printer_name", r->printer_name); + ndr->depth++; + if (r->printer_name) { + ndr_print_string(ndr, "printer_name", r->printer_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "server_name", r->server_name); + ndr->depth++; + if (r->server_name) { + ndr_print_string(ndr, "server_name", r->server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "user_name", r->user_name); + ndr->depth++; + if (r->user_name) { + ndr_print_string(ndr, "user_name", r->user_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "document_name", r->document_name); + ndr->depth++; + if (r->document_name) { + ndr_print_string(ndr, "document_name", r->document_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "notify_name", r->notify_name); + ndr->depth++; + if (r->notify_name) { + ndr_print_string(ndr, "notify_name", r->notify_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "data_type", r->data_type); + ndr->depth++; + if (r->data_type) { + ndr_print_string(ndr, "data_type", r->data_type); + } + ndr->depth--; + ndr_print_ptr(ndr, "print_processor", r->print_processor); + ndr->depth++; + if (r->print_processor) { + ndr_print_string(ndr, "print_processor", r->print_processor); + } + ndr->depth--; + ndr_print_ptr(ndr, "parameters", r->parameters); + ndr->depth++; + if (r->parameters) { + ndr_print_string(ndr, "parameters", r->parameters); + } + ndr->depth--; + ndr_print_ptr(ndr, "driver_name", r->driver_name); + ndr->depth++; + if (r->driver_name) { + ndr_print_string(ndr, "driver_name", r->driver_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "devmode", r->devmode); + ndr->depth++; + if (r->devmode) { + ndr_print_spoolss_DeviceMode(ndr, "devmode", r->devmode); + } + ndr->depth--; + ndr_print_ptr(ndr, "text_status", r->text_status); + ndr->depth++; + if (r->text_status) { + ndr_print_string(ndr, "text_status", r->text_status); + } + ndr->depth--; + ndr_print_ptr(ndr, "secdesc", r->secdesc); + ndr->depth++; + if (r->secdesc) { + ndr_print_security_descriptor(ndr, "secdesc", r->secdesc); + } + ndr->depth--; + ndr_print_spoolss_JobStatus(ndr, "status", r->status); + ndr_print_uint32(ndr, "priority", r->priority); + ndr_print_uint32(ndr, "position", r->position); + ndr_print_uint32(ndr, "start_time", r->start_time); + ndr_print_uint32(ndr, "until_time", r->until_time); + ndr_print_uint32(ndr, "total_pages", r->total_pages); + ndr_print_uint32(ndr, "size", r->size); + ndr_print_spoolss_Time(ndr, "submitted", &r->submitted); + ndr_print_uint32(ndr, "time", r->time); + ndr_print_uint32(ndr, "pages_printed", r->pages_printed); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_spoolss_JobInfo3(struct ndr_push *ndr, int ndr_flags, const struct spoolss_JobInfo3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->job_id)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->next_job_id)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->reserved)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_spoolss_JobInfo3(struct ndr_pull *ndr, int ndr_flags, struct spoolss_JobInfo3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->job_id)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->next_job_id)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->reserved)); + } + if (ndr_flags & NDR_BUFFERS) { + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_JobInfo3(struct ndr_print *ndr, const char *name, const struct spoolss_JobInfo3 *r) +{ + ndr_print_struct(ndr, name, "spoolss_JobInfo3"); + ndr->depth++; + ndr_print_uint32(ndr, "job_id", r->job_id); + ndr_print_uint32(ndr, "next_job_id", r->next_job_id); + ndr_print_uint32(ndr, "reserved", r->reserved); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_spoolss_JobInfo4(struct ndr_push *ndr, int ndr_flags, const struct spoolss_JobInfo4 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->job_id)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->printer_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->server_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->user_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->document_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->notify_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->data_type)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->print_processor)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->parameters)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->driver_name)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->devmode)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->text_status)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->secdesc)); + NDR_CHECK(ndr_push_spoolss_JobStatus(ndr, NDR_SCALARS, r->status)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->position)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->start_time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->until_time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->total_pages)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_spoolss_Time(ndr, NDR_SCALARS, &r->submitted)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pages_printed)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size_high)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->printer_name) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->printer_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->printer_name)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->server_name) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->server_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->server_name)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->user_name) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->user_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->user_name)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->document_name) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->document_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->document_name)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->notify_name) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->notify_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->notify_name)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->data_type) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->data_type)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->data_type)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->print_processor) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->print_processor)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->print_processor)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->parameters) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->parameters)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->parameters)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->driver_name) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->driver_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->driver_name)); + } + ndr->flags = _flags_save_string; + } + if (r->devmode) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->devmode)); + NDR_CHECK(ndr_push_spoolss_DeviceMode(ndr, NDR_SCALARS, r->devmode)); + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->text_status) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->text_status)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->text_status)); + } + ndr->flags = _flags_save_string; + } + if (r->secdesc) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->secdesc)); + NDR_CHECK(ndr_push_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_spoolss_JobInfo4(struct ndr_pull *ndr, int ndr_flags, struct spoolss_JobInfo4 *r) +{ + uint32_t _ptr_printer_name; + TALLOC_CTX *_mem_save_printer_name_0; + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + uint32_t _ptr_user_name; + TALLOC_CTX *_mem_save_user_name_0; + uint32_t _ptr_document_name; + TALLOC_CTX *_mem_save_document_name_0; + uint32_t _ptr_notify_name; + TALLOC_CTX *_mem_save_notify_name_0; + uint32_t _ptr_data_type; + TALLOC_CTX *_mem_save_data_type_0; + uint32_t _ptr_print_processor; + TALLOC_CTX *_mem_save_print_processor_0; + uint32_t _ptr_parameters; + TALLOC_CTX *_mem_save_parameters_0; + uint32_t _ptr_driver_name; + TALLOC_CTX *_mem_save_driver_name_0; + uint32_t _ptr_devmode; + TALLOC_CTX *_mem_save_devmode_0; + uint32_t _ptr_text_status; + TALLOC_CTX *_mem_save_text_status_0; + uint32_t _ptr_secdesc; + TALLOC_CTX *_mem_save_secdesc_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->job_id)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printer_name)); + if (_ptr_printer_name) { + NDR_PULL_ALLOC(ndr, r->printer_name); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->printer_name, _ptr_printer_name)); + } else { + r->printer_name = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->server_name); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->server_name, _ptr_server_name)); + } else { + r->server_name = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user_name)); + if (_ptr_user_name) { + NDR_PULL_ALLOC(ndr, r->user_name); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->user_name, _ptr_user_name)); + } else { + r->user_name = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_document_name)); + if (_ptr_document_name) { + NDR_PULL_ALLOC(ndr, r->document_name); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->document_name, _ptr_document_name)); + } else { + r->document_name = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_notify_name)); + if (_ptr_notify_name) { + NDR_PULL_ALLOC(ndr, r->notify_name); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->notify_name, _ptr_notify_name)); + } else { + r->notify_name = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_type)); + if (_ptr_data_type) { + NDR_PULL_ALLOC(ndr, r->data_type); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->data_type, _ptr_data_type)); + } else { + r->data_type = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_print_processor)); + if (_ptr_print_processor) { + NDR_PULL_ALLOC(ndr, r->print_processor); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->print_processor, _ptr_print_processor)); + } else { + r->print_processor = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parameters)); + if (_ptr_parameters) { + NDR_PULL_ALLOC(ndr, r->parameters); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->parameters, _ptr_parameters)); + } else { + r->parameters = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name)); + if (_ptr_driver_name) { + NDR_PULL_ALLOC(ndr, r->driver_name); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->driver_name, _ptr_driver_name)); + } else { + r->driver_name = NULL; + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devmode)); + if (_ptr_devmode) { + NDR_PULL_ALLOC(ndr, r->devmode); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->devmode, _ptr_devmode)); + } else { + r->devmode = NULL; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_text_status)); + if (_ptr_text_status) { + NDR_PULL_ALLOC(ndr, r->text_status); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->text_status, _ptr_text_status)); + } else { + r->text_status = NULL; + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdesc)); + if (_ptr_secdesc) { + NDR_PULL_ALLOC(ndr, r->secdesc); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->secdesc, _ptr_secdesc)); + } else { + r->secdesc = NULL; + } + NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->status)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->position)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->start_time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->until_time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->total_pages)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_spoolss_Time(ndr, NDR_SCALARS, &r->submitted)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pages_printed)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size_high)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->printer_name) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->printer_name)); + _mem_save_printer_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->printer_name, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->printer_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printer_name_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->server_name) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->server_name)); + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->server_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->user_name) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->user_name)); + _mem_save_user_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user_name, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->user_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_name_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->document_name) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->document_name)); + _mem_save_document_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->document_name, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->document_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_document_name_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->notify_name) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->notify_name)); + _mem_save_notify_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->notify_name, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->notify_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_notify_name_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->data_type) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->data_type)); + _mem_save_data_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data_type, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->data_type)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_type_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->print_processor) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->print_processor)); + _mem_save_print_processor_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->print_processor, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->print_processor)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_print_processor_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->parameters) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->parameters)); + _mem_save_parameters_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->parameters, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->parameters)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parameters_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->driver_name) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->driver_name)); + _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->driver_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + if (r->devmode) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->devmode)); + _mem_save_devmode_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->devmode, 0); + NDR_CHECK(ndr_pull_spoolss_DeviceMode(ndr, NDR_SCALARS, r->devmode)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devmode_0, 0); + ndr->offset = _relative_save_offset; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->text_status) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->text_status)); + _mem_save_text_status_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->text_status, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->text_status)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_text_status_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + if (r->secdesc) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->secdesc)); + _mem_save_secdesc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->secdesc, 0); + NDR_CHECK(ndr_pull_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0); + ndr->offset = _relative_save_offset; + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_JobInfo4(struct ndr_print *ndr, const char *name, const struct spoolss_JobInfo4 *r) +{ + ndr_print_struct(ndr, name, "spoolss_JobInfo4"); + ndr->depth++; + ndr_print_uint32(ndr, "job_id", r->job_id); + ndr_print_ptr(ndr, "printer_name", r->printer_name); + ndr->depth++; + if (r->printer_name) { + ndr_print_string(ndr, "printer_name", r->printer_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "server_name", r->server_name); + ndr->depth++; + if (r->server_name) { + ndr_print_string(ndr, "server_name", r->server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "user_name", r->user_name); + ndr->depth++; + if (r->user_name) { + ndr_print_string(ndr, "user_name", r->user_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "document_name", r->document_name); + ndr->depth++; + if (r->document_name) { + ndr_print_string(ndr, "document_name", r->document_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "notify_name", r->notify_name); + ndr->depth++; + if (r->notify_name) { + ndr_print_string(ndr, "notify_name", r->notify_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "data_type", r->data_type); + ndr->depth++; + if (r->data_type) { + ndr_print_string(ndr, "data_type", r->data_type); + } + ndr->depth--; + ndr_print_ptr(ndr, "print_processor", r->print_processor); + ndr->depth++; + if (r->print_processor) { + ndr_print_string(ndr, "print_processor", r->print_processor); + } + ndr->depth--; + ndr_print_ptr(ndr, "parameters", r->parameters); + ndr->depth++; + if (r->parameters) { + ndr_print_string(ndr, "parameters", r->parameters); + } + ndr->depth--; + ndr_print_ptr(ndr, "driver_name", r->driver_name); + ndr->depth++; + if (r->driver_name) { + ndr_print_string(ndr, "driver_name", r->driver_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "devmode", r->devmode); + ndr->depth++; + if (r->devmode) { + ndr_print_spoolss_DeviceMode(ndr, "devmode", r->devmode); + } + ndr->depth--; + ndr_print_ptr(ndr, "text_status", r->text_status); + ndr->depth++; + if (r->text_status) { + ndr_print_string(ndr, "text_status", r->text_status); + } + ndr->depth--; + ndr_print_ptr(ndr, "secdesc", r->secdesc); + ndr->depth++; + if (r->secdesc) { + ndr_print_security_descriptor(ndr, "secdesc", r->secdesc); + } + ndr->depth--; + ndr_print_spoolss_JobStatus(ndr, "status", r->status); + ndr_print_uint32(ndr, "priority", r->priority); + ndr_print_uint32(ndr, "position", r->position); + ndr_print_uint32(ndr, "start_time", r->start_time); + ndr_print_uint32(ndr, "until_time", r->until_time); + ndr_print_uint32(ndr, "total_pages", r->total_pages); + ndr_print_uint32(ndr, "size", r->size); + ndr_print_spoolss_Time(ndr, "submitted", &r->submitted); + ndr_print_uint32(ndr, "time", r->time); + ndr_print_uint32(ndr, "pages_printed", r->pages_printed); + ndr_print_uint32(ndr, "size_high", r->size_high); ndr->depth--; } @@ -2881,9 +4194,21 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_JobInfo(struct ndr_push *ndr, int nd break; } case 2: { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset)); + NDR_CHECK(ndr_push_spoolss_JobInfo2(ndr, NDR_SCALARS, &r->info2)); break; } case 3: { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset)); + NDR_CHECK(ndr_push_spoolss_JobInfo3(ndr, NDR_SCALARS, &r->info3)); + break; } + + case 4: { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset)); + NDR_CHECK(ndr_push_spoolss_JobInfo4(ndr, NDR_SCALARS, &r->info4)); break; } default: { @@ -2900,11 +4225,16 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_JobInfo(struct ndr_push *ndr, int nd break; case 2: + NDR_CHECK(ndr_push_spoolss_JobInfo2(ndr, NDR_BUFFERS, &r->info2)); break; case 3: break; + case 4: + NDR_CHECK(ndr_push_spoolss_JobInfo4(ndr, NDR_BUFFERS, &r->info4)); + break; + default: break; @@ -2928,9 +4258,21 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_JobInfo(struct ndr_pull *ndr, int nd break; } case 2: { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset)); + NDR_CHECK(ndr_pull_spoolss_JobInfo2(ndr, NDR_SCALARS, &r->info2)); break; } case 3: { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset)); + NDR_CHECK(ndr_pull_spoolss_JobInfo3(ndr, NDR_SCALARS, &r->info3)); + break; } + + case 4: { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset)); + NDR_CHECK(ndr_pull_spoolss_JobInfo4(ndr, NDR_SCALARS, &r->info4)); break; } default: { @@ -2946,11 +4288,16 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_JobInfo(struct ndr_pull *ndr, int nd break; case 2: + NDR_CHECK(ndr_pull_spoolss_JobInfo2(ndr, NDR_BUFFERS, &r->info2)); break; case 3: break; + case 4: + NDR_CHECK(ndr_pull_spoolss_JobInfo4(ndr, NDR_BUFFERS, &r->info4)); + break; + default: break; @@ -2971,9 +4318,1356 @@ _PUBLIC_ void ndr_print_spoolss_JobInfo(struct ndr_print *ndr, const char *name, break; case 2: + ndr_print_spoolss_JobInfo2(ndr, "info2", &r->info2); + break; + + case 3: + ndr_print_spoolss_JobInfo3(ndr, "info3", &r->info3); + break; + + case 4: + ndr_print_spoolss_JobInfo4(ndr, "info4", &r->info4); + break; + + default: + break; + + } +} + +static enum ndr_err_code ndr_push_spoolss_SetJobInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_SetJobInfo1 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->job_id)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->printer_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->user_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->document_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->data_type)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->text_status)); + NDR_CHECK(ndr_push_spoolss_JobStatus(ndr, NDR_SCALARS, r->status)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->position)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->total_pages)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pages_printed)); + NDR_CHECK(ndr_push_spoolss_Time(ndr, NDR_SCALARS, &r->submitted)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->printer_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->printer_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->printer_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->printer_name, ndr_charset_length(r->printer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_name, ndr_charset_length(r->server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->user_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user_name, ndr_charset_length(r->user_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->document_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->document_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->document_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->document_name, ndr_charset_length(r->document_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->data_type) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->data_type, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->data_type, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->data_type, ndr_charset_length(r->data_type, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->text_status) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->text_status, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->text_status, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->text_status, ndr_charset_length(r->text_status, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_spoolss_SetJobInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_SetJobInfo1 *r) +{ + uint32_t _ptr_printer_name; + TALLOC_CTX *_mem_save_printer_name_0; + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + uint32_t _ptr_user_name; + TALLOC_CTX *_mem_save_user_name_0; + uint32_t _ptr_document_name; + TALLOC_CTX *_mem_save_document_name_0; + uint32_t _ptr_data_type; + TALLOC_CTX *_mem_save_data_type_0; + uint32_t _ptr_text_status; + TALLOC_CTX *_mem_save_text_status_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->job_id)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printer_name)); + if (_ptr_printer_name) { + NDR_PULL_ALLOC(ndr, r->printer_name); + } else { + r->printer_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->server_name); + } else { + r->server_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user_name)); + if (_ptr_user_name) { + NDR_PULL_ALLOC(ndr, r->user_name); + } else { + r->user_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_document_name)); + if (_ptr_document_name) { + NDR_PULL_ALLOC(ndr, r->document_name); + } else { + r->document_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_type)); + if (_ptr_data_type) { + NDR_PULL_ALLOC(ndr, r->data_type); + } else { + r->data_type = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_text_status)); + if (_ptr_text_status) { + NDR_PULL_ALLOC(ndr, r->text_status); + } else { + r->text_status = NULL; + } + NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->status)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->position)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->total_pages)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pages_printed)); + NDR_CHECK(ndr_pull_spoolss_Time(ndr, NDR_SCALARS, &r->submitted)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->printer_name) { + _mem_save_printer_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->printer_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->printer_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->printer_name)); + if (ndr_get_array_length(ndr, &r->printer_name) > ndr_get_array_size(ndr, &r->printer_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->printer_name), ndr_get_array_length(ndr, &r->printer_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->printer_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->printer_name, ndr_get_array_length(ndr, &r->printer_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printer_name_0, 0); + } + if (r->server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->server_name)); + if (ndr_get_array_length(ndr, &r->server_name) > ndr_get_array_size(ndr, &r->server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_name), ndr_get_array_length(ndr, &r->server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_name, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + if (r->user_name) { + _mem_save_user_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->user_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->user_name)); + if (ndr_get_array_length(ndr, &r->user_name) > ndr_get_array_size(ndr, &r->user_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user_name), ndr_get_array_length(ndr, &r->user_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user_name, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_name_0, 0); + } + if (r->document_name) { + _mem_save_document_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->document_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->document_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->document_name)); + if (ndr_get_array_length(ndr, &r->document_name) > ndr_get_array_size(ndr, &r->document_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->document_name), ndr_get_array_length(ndr, &r->document_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->document_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->document_name, ndr_get_array_length(ndr, &r->document_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_document_name_0, 0); + } + if (r->data_type) { + _mem_save_data_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data_type, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->data_type)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->data_type)); + if (ndr_get_array_length(ndr, &r->data_type) > ndr_get_array_size(ndr, &r->data_type)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->data_type), ndr_get_array_length(ndr, &r->data_type)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->data_type), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->data_type, ndr_get_array_length(ndr, &r->data_type), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_type_0, 0); + } + if (r->text_status) { + _mem_save_text_status_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->text_status, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->text_status)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->text_status)); + if (ndr_get_array_length(ndr, &r->text_status) > ndr_get_array_size(ndr, &r->text_status)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->text_status), ndr_get_array_length(ndr, &r->text_status)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->text_status), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->text_status, ndr_get_array_length(ndr, &r->text_status), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_text_status_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_SetJobInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_SetJobInfo1 *r) +{ + ndr_print_struct(ndr, name, "spoolss_SetJobInfo1"); + ndr->depth++; + ndr_print_uint32(ndr, "job_id", r->job_id); + ndr_print_ptr(ndr, "printer_name", r->printer_name); + ndr->depth++; + if (r->printer_name) { + ndr_print_string(ndr, "printer_name", r->printer_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "server_name", r->server_name); + ndr->depth++; + if (r->server_name) { + ndr_print_string(ndr, "server_name", r->server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "user_name", r->user_name); + ndr->depth++; + if (r->user_name) { + ndr_print_string(ndr, "user_name", r->user_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "document_name", r->document_name); + ndr->depth++; + if (r->document_name) { + ndr_print_string(ndr, "document_name", r->document_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "data_type", r->data_type); + ndr->depth++; + if (r->data_type) { + ndr_print_string(ndr, "data_type", r->data_type); + } + ndr->depth--; + ndr_print_ptr(ndr, "text_status", r->text_status); + ndr->depth++; + if (r->text_status) { + ndr_print_string(ndr, "text_status", r->text_status); + } + ndr->depth--; + ndr_print_spoolss_JobStatus(ndr, "status", r->status); + ndr_print_uint32(ndr, "priority", r->priority); + ndr_print_uint32(ndr, "position", r->position); + ndr_print_uint32(ndr, "total_pages", r->total_pages); + ndr_print_uint32(ndr, "pages_printed", r->pages_printed); + ndr_print_spoolss_Time(ndr, "submitted", &r->submitted); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_spoolss_SetJobInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_SetJobInfo2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->job_id)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->printer_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->user_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->document_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->notify_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->data_type)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->print_processor)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->parameters)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->driver_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->devmode)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->text_status)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->secdesc)); + NDR_CHECK(ndr_push_spoolss_JobStatus(ndr, NDR_SCALARS, r->status)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->position)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->start_time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->until_time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->total_pages)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_spoolss_Time(ndr, NDR_SCALARS, &r->submitted)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pages_printed)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->printer_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->printer_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->printer_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->printer_name, ndr_charset_length(r->printer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_name, ndr_charset_length(r->server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->user_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user_name, ndr_charset_length(r->user_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->document_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->document_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->document_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->document_name, ndr_charset_length(r->document_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->notify_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->notify_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->notify_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->notify_name, ndr_charset_length(r->notify_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->data_type) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->data_type, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->data_type, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->data_type, ndr_charset_length(r->data_type, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->print_processor) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->print_processor, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->print_processor, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->print_processor, ndr_charset_length(r->print_processor, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->parameters) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->parameters, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->parameters, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->parameters, ndr_charset_length(r->parameters, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->driver_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->driver_name, ndr_charset_length(r->driver_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->devmode) { + NDR_CHECK(ndr_push_spoolss_DeviceMode(ndr, NDR_SCALARS, r->devmode)); + } + if (r->text_status) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->text_status, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->text_status, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->text_status, ndr_charset_length(r->text_status, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->secdesc) { + NDR_CHECK(ndr_push_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_spoolss_SetJobInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_SetJobInfo2 *r) +{ + uint32_t _ptr_printer_name; + TALLOC_CTX *_mem_save_printer_name_0; + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + uint32_t _ptr_user_name; + TALLOC_CTX *_mem_save_user_name_0; + uint32_t _ptr_document_name; + TALLOC_CTX *_mem_save_document_name_0; + uint32_t _ptr_notify_name; + TALLOC_CTX *_mem_save_notify_name_0; + uint32_t _ptr_data_type; + TALLOC_CTX *_mem_save_data_type_0; + uint32_t _ptr_print_processor; + TALLOC_CTX *_mem_save_print_processor_0; + uint32_t _ptr_parameters; + TALLOC_CTX *_mem_save_parameters_0; + uint32_t _ptr_driver_name; + TALLOC_CTX *_mem_save_driver_name_0; + uint32_t _ptr_devmode; + TALLOC_CTX *_mem_save_devmode_0; + uint32_t _ptr_text_status; + TALLOC_CTX *_mem_save_text_status_0; + uint32_t _ptr_secdesc; + TALLOC_CTX *_mem_save_secdesc_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->job_id)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printer_name)); + if (_ptr_printer_name) { + NDR_PULL_ALLOC(ndr, r->printer_name); + } else { + r->printer_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->server_name); + } else { + r->server_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user_name)); + if (_ptr_user_name) { + NDR_PULL_ALLOC(ndr, r->user_name); + } else { + r->user_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_document_name)); + if (_ptr_document_name) { + NDR_PULL_ALLOC(ndr, r->document_name); + } else { + r->document_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_notify_name)); + if (_ptr_notify_name) { + NDR_PULL_ALLOC(ndr, r->notify_name); + } else { + r->notify_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_type)); + if (_ptr_data_type) { + NDR_PULL_ALLOC(ndr, r->data_type); + } else { + r->data_type = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_print_processor)); + if (_ptr_print_processor) { + NDR_PULL_ALLOC(ndr, r->print_processor); + } else { + r->print_processor = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parameters)); + if (_ptr_parameters) { + NDR_PULL_ALLOC(ndr, r->parameters); + } else { + r->parameters = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name)); + if (_ptr_driver_name) { + NDR_PULL_ALLOC(ndr, r->driver_name); + } else { + r->driver_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devmode)); + if (_ptr_devmode) { + NDR_PULL_ALLOC(ndr, r->devmode); + } else { + r->devmode = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_text_status)); + if (_ptr_text_status) { + NDR_PULL_ALLOC(ndr, r->text_status); + } else { + r->text_status = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdesc)); + if (_ptr_secdesc) { + NDR_PULL_ALLOC(ndr, r->secdesc); + } else { + r->secdesc = NULL; + } + NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->status)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->position)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->start_time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->until_time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->total_pages)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_spoolss_Time(ndr, NDR_SCALARS, &r->submitted)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pages_printed)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->printer_name) { + _mem_save_printer_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->printer_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->printer_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->printer_name)); + if (ndr_get_array_length(ndr, &r->printer_name) > ndr_get_array_size(ndr, &r->printer_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->printer_name), ndr_get_array_length(ndr, &r->printer_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->printer_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->printer_name, ndr_get_array_length(ndr, &r->printer_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printer_name_0, 0); + } + if (r->server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->server_name)); + if (ndr_get_array_length(ndr, &r->server_name) > ndr_get_array_size(ndr, &r->server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_name), ndr_get_array_length(ndr, &r->server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_name, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + if (r->user_name) { + _mem_save_user_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->user_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->user_name)); + if (ndr_get_array_length(ndr, &r->user_name) > ndr_get_array_size(ndr, &r->user_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user_name), ndr_get_array_length(ndr, &r->user_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user_name, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_name_0, 0); + } + if (r->document_name) { + _mem_save_document_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->document_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->document_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->document_name)); + if (ndr_get_array_length(ndr, &r->document_name) > ndr_get_array_size(ndr, &r->document_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->document_name), ndr_get_array_length(ndr, &r->document_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->document_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->document_name, ndr_get_array_length(ndr, &r->document_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_document_name_0, 0); + } + if (r->notify_name) { + _mem_save_notify_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->notify_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->notify_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->notify_name)); + if (ndr_get_array_length(ndr, &r->notify_name) > ndr_get_array_size(ndr, &r->notify_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->notify_name), ndr_get_array_length(ndr, &r->notify_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->notify_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->notify_name, ndr_get_array_length(ndr, &r->notify_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_notify_name_0, 0); + } + if (r->data_type) { + _mem_save_data_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data_type, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->data_type)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->data_type)); + if (ndr_get_array_length(ndr, &r->data_type) > ndr_get_array_size(ndr, &r->data_type)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->data_type), ndr_get_array_length(ndr, &r->data_type)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->data_type), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->data_type, ndr_get_array_length(ndr, &r->data_type), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_type_0, 0); + } + if (r->print_processor) { + _mem_save_print_processor_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->print_processor, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->print_processor)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->print_processor)); + if (ndr_get_array_length(ndr, &r->print_processor) > ndr_get_array_size(ndr, &r->print_processor)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->print_processor), ndr_get_array_length(ndr, &r->print_processor)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->print_processor), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->print_processor, ndr_get_array_length(ndr, &r->print_processor), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_print_processor_0, 0); + } + if (r->parameters) { + _mem_save_parameters_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->parameters, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->parameters)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->parameters)); + if (ndr_get_array_length(ndr, &r->parameters) > ndr_get_array_size(ndr, &r->parameters)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->parameters), ndr_get_array_length(ndr, &r->parameters)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->parameters), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->parameters, ndr_get_array_length(ndr, &r->parameters), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parameters_0, 0); + } + if (r->driver_name) { + _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->driver_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->driver_name)); + if (ndr_get_array_length(ndr, &r->driver_name) > ndr_get_array_size(ndr, &r->driver_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->driver_name), ndr_get_array_length(ndr, &r->driver_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->driver_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->driver_name, ndr_get_array_length(ndr, &r->driver_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0); + } + if (r->devmode) { + _mem_save_devmode_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->devmode, 0); + NDR_CHECK(ndr_pull_spoolss_DeviceMode(ndr, NDR_SCALARS, r->devmode)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devmode_0, 0); + } + if (r->text_status) { + _mem_save_text_status_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->text_status, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->text_status)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->text_status)); + if (ndr_get_array_length(ndr, &r->text_status) > ndr_get_array_size(ndr, &r->text_status)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->text_status), ndr_get_array_length(ndr, &r->text_status)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->text_status), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->text_status, ndr_get_array_length(ndr, &r->text_status), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_text_status_0, 0); + } + if (r->secdesc) { + _mem_save_secdesc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->secdesc, 0); + NDR_CHECK(ndr_pull_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_SetJobInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_SetJobInfo2 *r) +{ + ndr_print_struct(ndr, name, "spoolss_SetJobInfo2"); + ndr->depth++; + ndr_print_uint32(ndr, "job_id", r->job_id); + ndr_print_ptr(ndr, "printer_name", r->printer_name); + ndr->depth++; + if (r->printer_name) { + ndr_print_string(ndr, "printer_name", r->printer_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "server_name", r->server_name); + ndr->depth++; + if (r->server_name) { + ndr_print_string(ndr, "server_name", r->server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "user_name", r->user_name); + ndr->depth++; + if (r->user_name) { + ndr_print_string(ndr, "user_name", r->user_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "document_name", r->document_name); + ndr->depth++; + if (r->document_name) { + ndr_print_string(ndr, "document_name", r->document_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "notify_name", r->notify_name); + ndr->depth++; + if (r->notify_name) { + ndr_print_string(ndr, "notify_name", r->notify_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "data_type", r->data_type); + ndr->depth++; + if (r->data_type) { + ndr_print_string(ndr, "data_type", r->data_type); + } + ndr->depth--; + ndr_print_ptr(ndr, "print_processor", r->print_processor); + ndr->depth++; + if (r->print_processor) { + ndr_print_string(ndr, "print_processor", r->print_processor); + } + ndr->depth--; + ndr_print_ptr(ndr, "parameters", r->parameters); + ndr->depth++; + if (r->parameters) { + ndr_print_string(ndr, "parameters", r->parameters); + } + ndr->depth--; + ndr_print_ptr(ndr, "driver_name", r->driver_name); + ndr->depth++; + if (r->driver_name) { + ndr_print_string(ndr, "driver_name", r->driver_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "devmode", r->devmode); + ndr->depth++; + if (r->devmode) { + ndr_print_spoolss_DeviceMode(ndr, "devmode", r->devmode); + } + ndr->depth--; + ndr_print_ptr(ndr, "text_status", r->text_status); + ndr->depth++; + if (r->text_status) { + ndr_print_string(ndr, "text_status", r->text_status); + } + ndr->depth--; + ndr_print_ptr(ndr, "secdesc", r->secdesc); + ndr->depth++; + if (r->secdesc) { + ndr_print_security_descriptor(ndr, "secdesc", r->secdesc); + } + ndr->depth--; + ndr_print_spoolss_JobStatus(ndr, "status", r->status); + ndr_print_uint32(ndr, "priority", r->priority); + ndr_print_uint32(ndr, "position", r->position); + ndr_print_uint32(ndr, "start_time", r->start_time); + ndr_print_uint32(ndr, "until_time", r->until_time); + ndr_print_uint32(ndr, "total_pages", r->total_pages); + ndr_print_uint32(ndr, "size", r->size); + ndr_print_spoolss_Time(ndr, "submitted", &r->submitted); + ndr_print_uint32(ndr, "time", r->time); + ndr_print_uint32(ndr, "pages_printed", r->pages_printed); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_spoolss_SetJobInfo4(struct ndr_push *ndr, int ndr_flags, const struct spoolss_SetJobInfo4 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->job_id)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->printer_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->server_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->user_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->document_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->notify_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->data_type)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->print_processor)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->parameters)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->driver_name)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->devmode)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->text_status)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->secdesc)); + NDR_CHECK(ndr_push_spoolss_JobStatus(ndr, NDR_SCALARS, r->status)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->priority)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->position)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->start_time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->until_time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->total_pages)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size)); + NDR_CHECK(ndr_push_spoolss_Time(ndr, NDR_SCALARS, &r->submitted)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->time)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->pages_printed)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->size_high)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->printer_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->printer_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->printer_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->printer_name, ndr_charset_length(r->printer_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->server_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->server_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->server_name, ndr_charset_length(r->server_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->user_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->user_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->user_name, ndr_charset_length(r->user_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->document_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->document_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->document_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->document_name, ndr_charset_length(r->document_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->notify_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->notify_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->notify_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->notify_name, ndr_charset_length(r->notify_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->data_type) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->data_type, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->data_type, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->data_type, ndr_charset_length(r->data_type, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->print_processor) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->print_processor, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->print_processor, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->print_processor, ndr_charset_length(r->print_processor, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->parameters) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->parameters, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->parameters, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->parameters, ndr_charset_length(r->parameters, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->driver_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->driver_name, ndr_charset_length(r->driver_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->devmode) { + NDR_CHECK(ndr_push_spoolss_DeviceMode(ndr, NDR_SCALARS, r->devmode)); + } + if (r->text_status) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->text_status, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->text_status, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->text_status, ndr_charset_length(r->text_status, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->secdesc) { + NDR_CHECK(ndr_push_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_spoolss_SetJobInfo4(struct ndr_pull *ndr, int ndr_flags, struct spoolss_SetJobInfo4 *r) +{ + uint32_t _ptr_printer_name; + TALLOC_CTX *_mem_save_printer_name_0; + uint32_t _ptr_server_name; + TALLOC_CTX *_mem_save_server_name_0; + uint32_t _ptr_user_name; + TALLOC_CTX *_mem_save_user_name_0; + uint32_t _ptr_document_name; + TALLOC_CTX *_mem_save_document_name_0; + uint32_t _ptr_notify_name; + TALLOC_CTX *_mem_save_notify_name_0; + uint32_t _ptr_data_type; + TALLOC_CTX *_mem_save_data_type_0; + uint32_t _ptr_print_processor; + TALLOC_CTX *_mem_save_print_processor_0; + uint32_t _ptr_parameters; + TALLOC_CTX *_mem_save_parameters_0; + uint32_t _ptr_driver_name; + TALLOC_CTX *_mem_save_driver_name_0; + uint32_t _ptr_devmode; + TALLOC_CTX *_mem_save_devmode_0; + uint32_t _ptr_text_status; + TALLOC_CTX *_mem_save_text_status_0; + uint32_t _ptr_secdesc; + TALLOC_CTX *_mem_save_secdesc_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->job_id)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_printer_name)); + if (_ptr_printer_name) { + NDR_PULL_ALLOC(ndr, r->printer_name); + } else { + r->printer_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_server_name)); + if (_ptr_server_name) { + NDR_PULL_ALLOC(ndr, r->server_name); + } else { + r->server_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_user_name)); + if (_ptr_user_name) { + NDR_PULL_ALLOC(ndr, r->user_name); + } else { + r->user_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_document_name)); + if (_ptr_document_name) { + NDR_PULL_ALLOC(ndr, r->document_name); + } else { + r->document_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_notify_name)); + if (_ptr_notify_name) { + NDR_PULL_ALLOC(ndr, r->notify_name); + } else { + r->notify_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data_type)); + if (_ptr_data_type) { + NDR_PULL_ALLOC(ndr, r->data_type); + } else { + r->data_type = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_print_processor)); + if (_ptr_print_processor) { + NDR_PULL_ALLOC(ndr, r->print_processor); + } else { + r->print_processor = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_parameters)); + if (_ptr_parameters) { + NDR_PULL_ALLOC(ndr, r->parameters); + } else { + r->parameters = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name)); + if (_ptr_driver_name) { + NDR_PULL_ALLOC(ndr, r->driver_name); + } else { + r->driver_name = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devmode)); + if (_ptr_devmode) { + NDR_PULL_ALLOC(ndr, r->devmode); + } else { + r->devmode = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_text_status)); + if (_ptr_text_status) { + NDR_PULL_ALLOC(ndr, r->text_status); + } else { + r->text_status = NULL; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdesc)); + if (_ptr_secdesc) { + NDR_PULL_ALLOC(ndr, r->secdesc); + } else { + r->secdesc = NULL; + } + NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->status)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->position)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->start_time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->until_time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->total_pages)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_spoolss_Time(ndr, NDR_SCALARS, &r->submitted)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->time)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->pages_printed)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->size_high)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->printer_name) { + _mem_save_printer_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->printer_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->printer_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->printer_name)); + if (ndr_get_array_length(ndr, &r->printer_name) > ndr_get_array_size(ndr, &r->printer_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->printer_name), ndr_get_array_length(ndr, &r->printer_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->printer_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->printer_name, ndr_get_array_length(ndr, &r->printer_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printer_name_0, 0); + } + if (r->server_name) { + _mem_save_server_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->server_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->server_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->server_name)); + if (ndr_get_array_length(ndr, &r->server_name) > ndr_get_array_size(ndr, &r->server_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->server_name), ndr_get_array_length(ndr, &r->server_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->server_name, ndr_get_array_length(ndr, &r->server_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_server_name_0, 0); + } + if (r->user_name) { + _mem_save_user_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->user_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->user_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->user_name)); + if (ndr_get_array_length(ndr, &r->user_name) > ndr_get_array_size(ndr, &r->user_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->user_name), ndr_get_array_length(ndr, &r->user_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->user_name, ndr_get_array_length(ndr, &r->user_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_user_name_0, 0); + } + if (r->document_name) { + _mem_save_document_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->document_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->document_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->document_name)); + if (ndr_get_array_length(ndr, &r->document_name) > ndr_get_array_size(ndr, &r->document_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->document_name), ndr_get_array_length(ndr, &r->document_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->document_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->document_name, ndr_get_array_length(ndr, &r->document_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_document_name_0, 0); + } + if (r->notify_name) { + _mem_save_notify_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->notify_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->notify_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->notify_name)); + if (ndr_get_array_length(ndr, &r->notify_name) > ndr_get_array_size(ndr, &r->notify_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->notify_name), ndr_get_array_length(ndr, &r->notify_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->notify_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->notify_name, ndr_get_array_length(ndr, &r->notify_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_notify_name_0, 0); + } + if (r->data_type) { + _mem_save_data_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data_type, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->data_type)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->data_type)); + if (ndr_get_array_length(ndr, &r->data_type) > ndr_get_array_size(ndr, &r->data_type)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->data_type), ndr_get_array_length(ndr, &r->data_type)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->data_type), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->data_type, ndr_get_array_length(ndr, &r->data_type), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_type_0, 0); + } + if (r->print_processor) { + _mem_save_print_processor_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->print_processor, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->print_processor)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->print_processor)); + if (ndr_get_array_length(ndr, &r->print_processor) > ndr_get_array_size(ndr, &r->print_processor)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->print_processor), ndr_get_array_length(ndr, &r->print_processor)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->print_processor), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->print_processor, ndr_get_array_length(ndr, &r->print_processor), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_print_processor_0, 0); + } + if (r->parameters) { + _mem_save_parameters_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->parameters, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->parameters)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->parameters)); + if (ndr_get_array_length(ndr, &r->parameters) > ndr_get_array_size(ndr, &r->parameters)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->parameters), ndr_get_array_length(ndr, &r->parameters)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->parameters), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->parameters, ndr_get_array_length(ndr, &r->parameters), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_parameters_0, 0); + } + if (r->driver_name) { + _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->driver_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->driver_name)); + if (ndr_get_array_length(ndr, &r->driver_name) > ndr_get_array_size(ndr, &r->driver_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->driver_name), ndr_get_array_length(ndr, &r->driver_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->driver_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->driver_name, ndr_get_array_length(ndr, &r->driver_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0); + } + if (r->devmode) { + _mem_save_devmode_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->devmode, 0); + NDR_CHECK(ndr_pull_spoolss_DeviceMode(ndr, NDR_SCALARS, r->devmode)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devmode_0, 0); + } + if (r->text_status) { + _mem_save_text_status_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->text_status, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->text_status)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->text_status)); + if (ndr_get_array_length(ndr, &r->text_status) > ndr_get_array_size(ndr, &r->text_status)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->text_status), ndr_get_array_length(ndr, &r->text_status)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->text_status), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->text_status, ndr_get_array_length(ndr, &r->text_status), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_text_status_0, 0); + } + if (r->secdesc) { + _mem_save_secdesc_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->secdesc, 0); + NDR_CHECK(ndr_pull_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_SetJobInfo4(struct ndr_print *ndr, const char *name, const struct spoolss_SetJobInfo4 *r) +{ + ndr_print_struct(ndr, name, "spoolss_SetJobInfo4"); + ndr->depth++; + ndr_print_uint32(ndr, "job_id", r->job_id); + ndr_print_ptr(ndr, "printer_name", r->printer_name); + ndr->depth++; + if (r->printer_name) { + ndr_print_string(ndr, "printer_name", r->printer_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "server_name", r->server_name); + ndr->depth++; + if (r->server_name) { + ndr_print_string(ndr, "server_name", r->server_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "user_name", r->user_name); + ndr->depth++; + if (r->user_name) { + ndr_print_string(ndr, "user_name", r->user_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "document_name", r->document_name); + ndr->depth++; + if (r->document_name) { + ndr_print_string(ndr, "document_name", r->document_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "notify_name", r->notify_name); + ndr->depth++; + if (r->notify_name) { + ndr_print_string(ndr, "notify_name", r->notify_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "data_type", r->data_type); + ndr->depth++; + if (r->data_type) { + ndr_print_string(ndr, "data_type", r->data_type); + } + ndr->depth--; + ndr_print_ptr(ndr, "print_processor", r->print_processor); + ndr->depth++; + if (r->print_processor) { + ndr_print_string(ndr, "print_processor", r->print_processor); + } + ndr->depth--; + ndr_print_ptr(ndr, "parameters", r->parameters); + ndr->depth++; + if (r->parameters) { + ndr_print_string(ndr, "parameters", r->parameters); + } + ndr->depth--; + ndr_print_ptr(ndr, "driver_name", r->driver_name); + ndr->depth++; + if (r->driver_name) { + ndr_print_string(ndr, "driver_name", r->driver_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "devmode", r->devmode); + ndr->depth++; + if (r->devmode) { + ndr_print_spoolss_DeviceMode(ndr, "devmode", r->devmode); + } + ndr->depth--; + ndr_print_ptr(ndr, "text_status", r->text_status); + ndr->depth++; + if (r->text_status) { + ndr_print_string(ndr, "text_status", r->text_status); + } + ndr->depth--; + ndr_print_ptr(ndr, "secdesc", r->secdesc); + ndr->depth++; + if (r->secdesc) { + ndr_print_security_descriptor(ndr, "secdesc", r->secdesc); + } + ndr->depth--; + ndr_print_spoolss_JobStatus(ndr, "status", r->status); + ndr_print_uint32(ndr, "priority", r->priority); + ndr_print_uint32(ndr, "position", r->position); + ndr_print_uint32(ndr, "start_time", r->start_time); + ndr_print_uint32(ndr, "until_time", r->until_time); + ndr_print_uint32(ndr, "total_pages", r->total_pages); + ndr_print_uint32(ndr, "size", r->size); + ndr_print_spoolss_Time(ndr, "submitted", &r->submitted); + ndr_print_uint32(ndr, "time", r->time); + ndr_print_uint32(ndr, "pages_printed", r->pages_printed); + ndr_print_uint32(ndr, "size_high", r->size_high); + ndr->depth--; +} + +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_SetJobInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_SetJobInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, level)); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); + break; } + + case 2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2)); + break; } + + case 3: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info3)); + break; } + + case 4: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info4)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: + if (r->info1) { + NDR_CHECK(ndr_push_spoolss_SetJobInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); + } + break; + + case 2: + if (r->info2) { + NDR_CHECK(ndr_push_spoolss_SetJobInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); + } + break; + + case 3: + if (r->info3) { + NDR_CHECK(ndr_push_spoolss_JobInfo3(ndr, NDR_SCALARS, r->info3)); + } + break; + + case 4: + if (r->info4) { + NDR_CHECK(ndr_push_spoolss_SetJobInfo4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4)); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_SetJobInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_SetJobInfo *r) +{ + int level; + uint32_t _level; + TALLOC_CTX *_mem_save_info1_0; + TALLOC_CTX *_mem_save_info2_0; + TALLOC_CTX *_mem_save_info3_0; + TALLOC_CTX *_mem_save_info4_0; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); + if (_level != level) { + return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u for r", _level); + } + switch (level) { + case 1: { + uint32_t _ptr_info1; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info1)); + if (_ptr_info1) { + NDR_PULL_ALLOC(ndr, r->info1); + } else { + r->info1 = NULL; + } + break; } + + case 2: { + uint32_t _ptr_info2; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2)); + if (_ptr_info2) { + NDR_PULL_ALLOC(ndr, r->info2); + } else { + r->info2 = NULL; + } + break; } + + case 3: { + uint32_t _ptr_info3; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info3)); + if (_ptr_info3) { + NDR_PULL_ALLOC(ndr, r->info3); + } else { + r->info3 = NULL; + } + break; } + + case 4: { + uint32_t _ptr_info4; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info4)); + if (_ptr_info4) { + NDR_PULL_ALLOC(ndr, r->info4); + } else { + r->info4 = NULL; + } + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case 1: + if (r->info1) { + _mem_save_info1_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info1, 0); + NDR_CHECK(ndr_pull_spoolss_SetJobInfo1(ndr, NDR_SCALARS|NDR_BUFFERS, r->info1)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info1_0, 0); + } + break; + + case 2: + if (r->info2) { + _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0); + NDR_CHECK(ndr_pull_spoolss_SetJobInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0); + } + break; + + case 3: + if (r->info3) { + _mem_save_info3_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info3, 0); + NDR_CHECK(ndr_pull_spoolss_JobInfo3(ndr, NDR_SCALARS, r->info3)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info3_0, 0); + } + break; + + case 4: + if (r->info4) { + _mem_save_info4_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info4, 0); + NDR_CHECK(ndr_pull_spoolss_SetJobInfo4(ndr, NDR_SCALARS|NDR_BUFFERS, r->info4)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info4_0, 0); + } + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_SetJobInfo(struct ndr_print *ndr, const char *name, const union spoolss_SetJobInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "spoolss_SetJobInfo"); + switch (level) { + case 1: + ndr_print_ptr(ndr, "info1", r->info1); + ndr->depth++; + if (r->info1) { + ndr_print_spoolss_SetJobInfo1(ndr, "info1", r->info1); + } + ndr->depth--; + break; + + case 2: + ndr_print_ptr(ndr, "info2", r->info2); + ndr->depth++; + if (r->info2) { + ndr_print_spoolss_SetJobInfo2(ndr, "info2", r->info2); + } + ndr->depth--; break; case 3: + ndr_print_ptr(ndr, "info3", r->info3); + ndr->depth++; + if (r->info3) { + ndr_print_spoolss_JobInfo3(ndr, "info3", r->info3); + } + ndr->depth--; + break; + + case 4: + ndr_print_ptr(ndr, "info4", r->info4); + ndr->depth++; + if (r->info4) { + ndr_print_spoolss_SetJobInfo4(ndr, "info4", r->info4); + } + ndr->depth--; break; default: @@ -2988,10 +5682,10 @@ static enum ndr_err_code ndr_push_spoolss_JobInfoContainer(struct ndr_push *ndr, NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->level)); NDR_CHECK(ndr_push_set_switch_value(ndr, &r->info, r->level)); - NDR_CHECK(ndr_push_spoolss_JobInfo(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_push_spoolss_SetJobInfo(ndr, NDR_SCALARS, &r->info)); } if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_push_spoolss_JobInfo(ndr, NDR_BUFFERS, &r->info)); + NDR_CHECK(ndr_push_spoolss_SetJobInfo(ndr, NDR_BUFFERS, &r->info)); } return NDR_ERR_SUCCESS; } @@ -3002,10 +5696,10 @@ static enum ndr_err_code ndr_pull_spoolss_JobInfoContainer(struct ndr_pull *ndr, NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->level)); NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->info, r->level)); - NDR_CHECK(ndr_pull_spoolss_JobInfo(ndr, NDR_SCALARS, &r->info)); + NDR_CHECK(ndr_pull_spoolss_SetJobInfo(ndr, NDR_SCALARS, &r->info)); } if (ndr_flags & NDR_BUFFERS) { - NDR_CHECK(ndr_pull_spoolss_JobInfo(ndr, NDR_BUFFERS, &r->info)); + NDR_CHECK(ndr_pull_spoolss_SetJobInfo(ndr, NDR_BUFFERS, &r->info)); } return NDR_ERR_SUCCESS; } @@ -3016,7 +5710,7 @@ _PUBLIC_ void ndr_print_spoolss_JobInfoContainer(struct ndr_print *ndr, const ch ndr->depth++; ndr_print_uint32(ndr, "level", r->level); ndr_print_set_switch_value(ndr, &r->info, r->level); - ndr_print_spoolss_JobInfo(ndr, "info", &r->info); + ndr_print_spoolss_SetJobInfo(ndr, "info", &r->info); ndr->depth--; } @@ -3046,6 +5740,8 @@ _PUBLIC_ void ndr_print_spoolss_JobControl(struct ndr_print *ndr, const char *na case SPOOLSS_JOB_CONTROL_DELETE: val = "SPOOLSS_JOB_CONTROL_DELETE"; break; case SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER: val = "SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER"; break; case SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED: val = "SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED"; break; + case SPOOLSS_JOB_CONTROL_RETAIN: val = "SPOOLSS_JOB_CONTROL_RETAIN"; break; + case SPOOLSS_JOB_CONTROL_RELEASE: val = "SPOOLSS_JOB_CONTROL_RELEASE"; break; } ndr_print_enum(ndr, name, "ENUM", val, r); } @@ -3867,36 +6563,20 @@ static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo3(struct ndr_push *ndr, { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->secdesc)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->sec_desc_ptr)); } if (ndr_flags & NDR_BUFFERS) { - if (r->secdesc) { - NDR_CHECK(ndr_push_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); - } } return NDR_ERR_SUCCESS; } static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo3(struct ndr_pull *ndr, int ndr_flags, struct spoolss_SetPrinterInfo3 *r) { - uint32_t _ptr_secdesc; - TALLOC_CTX *_mem_save_secdesc_0; if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 4)); - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_secdesc)); - if (_ptr_secdesc) { - NDR_PULL_ALLOC(ndr, r->secdesc); - } else { - r->secdesc = NULL; - } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->sec_desc_ptr)); } if (ndr_flags & NDR_BUFFERS) { - if (r->secdesc) { - _mem_save_secdesc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->secdesc, 0); - NDR_CHECK(ndr_pull_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0); - } } return NDR_ERR_SUCCESS; } @@ -3905,12 +6585,7 @@ _PUBLIC_ void ndr_print_spoolss_SetPrinterInfo3(struct ndr_print *ndr, const cha { ndr_print_struct(ndr, name, "spoolss_SetPrinterInfo3"); ndr->depth++; - ndr_print_ptr(ndr, "secdesc", r->secdesc); - ndr->depth++; - if (r->secdesc) { - ndr_print_security_descriptor(ndr, "secdesc", r->secdesc); - } - ndr->depth--; + ndr_print_uint32(ndr, "sec_desc_ptr", r->sec_desc_ptr); ndr->depth--; } @@ -4279,7 +6954,7 @@ static enum ndr_err_code ndr_push_spoolss_SetPrinterInfo(struct ndr_push *ndr, i case 3: if (r->info3) { - NDR_CHECK(ndr_push_spoolss_SetPrinterInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3)); + NDR_CHECK(ndr_push_spoolss_SetPrinterInfo3(ndr, NDR_SCALARS, r->info3)); } break; @@ -4486,7 +7161,7 @@ static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo(struct ndr_pull *ndr, i if (r->info3) { _mem_save_info3_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->info3, 0); - NDR_CHECK(ndr_pull_spoolss_SetPrinterInfo3(ndr, NDR_SCALARS|NDR_BUFFERS, r->info3)); + NDR_CHECK(ndr_pull_spoolss_SetPrinterInfo3(ndr, NDR_SCALARS, r->info3)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info3_0, 0); } break; @@ -4796,13 +7471,13 @@ _PUBLIC_ void ndr_print_spoolss_AddDriverInfo1(struct ndr_print *ndr, const char ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_DriverOSVersion(struct ndr_push *ndr, int ndr_flags, enum spoolss_DriverOSVersion r) +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverOSVersion(struct ndr_push *ndr, int ndr_flags, enum spoolss_DriverOSVersion r) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_DriverOSVersion(struct ndr_pull *ndr, int ndr_flags, enum spoolss_DriverOSVersion *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverOSVersion(struct ndr_pull *ndr, int ndr_flags, enum spoolss_DriverOSVersion *r) { uint32_t v; NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); @@ -5704,7 +8379,7 @@ static enum ndr_err_code ndr_push_spoolss_AddDriverInfo6(struct ndr_push *ndr, i NDR_CHECK(ndr_push_unique_ptr(ndr, r->dependent_files)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ((ndr_size_spoolss_StringArray(r->previous_names, ndr->iconv_convenience, ndr->flags) - 4) / 2))); NDR_CHECK(ndr_push_unique_ptr(ndr, r->previous_names)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->driver_data)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->driver_date)); NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->driver_version)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->manufacturer_name)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->manufacturer_url)); @@ -5889,7 +8564,7 @@ static enum ndr_err_code ndr_pull_spoolss_AddDriverInfo6(struct ndr_pull *ndr, i } else { r->previous_names = NULL; } - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->driver_data)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->driver_date)); NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->driver_version)); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_manufacturer_name)); if (_ptr_manufacturer_name) { @@ -6144,7 +8819,7 @@ _PUBLIC_ void ndr_print_spoolss_AddDriverInfo6(struct ndr_print *ndr, const char ndr_print_spoolss_StringArray(ndr, "previous_names", r->previous_names); } ndr->depth--; - ndr_print_NTTIME(ndr, "driver_data", r->driver_data); + ndr_print_NTTIME(ndr, "driver_date", r->driver_date); ndr_print_hyper(ndr, "driver_version", r->driver_version); ndr_print_ptr(ndr, "manufacturer_name", r->manufacturer_name); ndr->depth++; @@ -6190,7 +8865,7 @@ static enum ndr_err_code ndr_push_spoolss_AddDriverInfo8(struct ndr_push *ndr, i NDR_CHECK(ndr_push_unique_ptr(ndr, r->dependent_files)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ((ndr_size_spoolss_StringArray(r->previous_names, ndr->iconv_convenience, ndr->flags) - 4) / 2))); NDR_CHECK(ndr_push_unique_ptr(ndr, r->previous_names)); - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->driver_data)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->driver_date)); NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->driver_version)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->manufacturer_name)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->manufacturer_url)); @@ -6419,7 +9094,7 @@ static enum ndr_err_code ndr_pull_spoolss_AddDriverInfo8(struct ndr_pull *ndr, i } else { r->previous_names = NULL; } - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->driver_data)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->driver_date)); NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->driver_version)); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_manufacturer_name)); if (_ptr_manufacturer_name) { @@ -6757,7 +9432,7 @@ _PUBLIC_ void ndr_print_spoolss_AddDriverInfo8(struct ndr_print *ndr, const char ndr_print_spoolss_StringArray(ndr, "previous_names", r->previous_names); } ndr->depth--; - ndr_print_NTTIME(ndr, "driver_data", r->driver_data); + ndr_print_NTTIME(ndr, "driver_date", r->driver_date); ndr_print_hyper(ndr, "driver_version", r->driver_version); ndr_print_ptr(ndr, "manufacturer_name", r->manufacturer_name); ndr->depth++; @@ -7148,7 +9823,7 @@ _PUBLIC_ void ndr_print_spoolss_AddDriverInfoCtr(struct ndr_print *ndr, const ch ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_DriverInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo1 *r) +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo1 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -7173,7 +9848,7 @@ static enum ndr_err_code ndr_push_spoolss_DriverInfo1(struct ndr_push *ndr, int return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_DriverInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo1 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo1 *r) { uint32_t _ptr_driver_name; TALLOC_CTX *_mem_save_driver_name_0; @@ -7225,7 +9900,12 @@ _PUBLIC_ void ndr_print_spoolss_DriverInfo1(struct ndr_print *ndr, const char *n ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_DriverInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo2 *r) +_PUBLIC_ size_t ndr_size_spoolss_DriverInfo1(const struct spoolss_DriverInfo1 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo1, ic); +} + +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo2 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -7311,7 +9991,7 @@ static enum ndr_err_code ndr_push_spoolss_DriverInfo2(struct ndr_push *ndr, int return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_DriverInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo2 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo2 *r) { uint32_t _ptr_driver_name; TALLOC_CTX *_mem_save_driver_name_0; @@ -7505,7 +10185,12 @@ _PUBLIC_ void ndr_print_spoolss_DriverInfo2(struct ndr_print *ndr, const char *n ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_DriverInfo3(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo3 *r) +_PUBLIC_ size_t ndr_size_spoolss_DriverInfo2(const struct spoolss_DriverInfo2 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo2, ic); +} + +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo3(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo3 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -7651,7 +10336,7 @@ static enum ndr_err_code ndr_push_spoolss_DriverInfo3(struct ndr_push *ndr, int return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_DriverInfo3(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo3 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo3(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo3 *r) { uint32_t _ptr_driver_name; TALLOC_CTX *_mem_save_driver_name_0; @@ -7985,7 +10670,12 @@ _PUBLIC_ void ndr_print_spoolss_DriverInfo3(struct ndr_print *ndr, const char *n ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_DriverInfo4(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo4 *r) +_PUBLIC_ size_t ndr_size_spoolss_DriverInfo3(const struct spoolss_DriverInfo3 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo3, ic); +} + +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo4(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo4 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -8146,7 +10836,7 @@ static enum ndr_err_code ndr_push_spoolss_DriverInfo4(struct ndr_push *ndr, int return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_DriverInfo4(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo4 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo4(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo4 *r) { uint32_t _ptr_driver_name; TALLOC_CTX *_mem_save_driver_name_0; @@ -8515,7 +11205,12 @@ _PUBLIC_ void ndr_print_spoolss_DriverInfo4(struct ndr_print *ndr, const char *n ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_DriverInfo5(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo5 *r) +_PUBLIC_ size_t ndr_size_spoolss_DriverInfo4(const struct spoolss_DriverInfo4 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo4, ic); +} + +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo5(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo5 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -8604,7 +11299,7 @@ static enum ndr_err_code ndr_push_spoolss_DriverInfo5(struct ndr_push *ndr, int return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_DriverInfo5(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo5 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo5(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo5 *r) { uint32_t _ptr_driver_name; TALLOC_CTX *_mem_save_driver_name_0; @@ -8804,7 +11499,12 @@ _PUBLIC_ void ndr_print_spoolss_DriverInfo5(struct ndr_print *ndr, const char *n ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_DriverInfo6(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo6 *r) +_PUBLIC_ size_t ndr_size_spoolss_DriverInfo5(const struct spoolss_DriverInfo5 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo5, ic); +} + +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo6(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo6 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 8)); @@ -8869,7 +11569,7 @@ static enum ndr_err_code ndr_push_spoolss_DriverInfo6(struct ndr_push *ndr, int NDR_CHECK(ndr_push_relative_ptr1(ndr, r->previous_names)); ndr->flags = _flags_save_string_array; } - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->driver_data)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->driver_date)); NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->driver_version)); { uint32_t _flags_save_string = ndr->flags; @@ -9027,7 +11727,7 @@ static enum ndr_err_code ndr_push_spoolss_DriverInfo6(struct ndr_push *ndr, int return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_DriverInfo6(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo6 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo6(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo6 *r) { uint32_t _ptr_driver_name; TALLOC_CTX *_mem_save_driver_name_0; @@ -9180,7 +11880,7 @@ static enum ndr_err_code ndr_pull_spoolss_DriverInfo6(struct ndr_pull *ndr, int } ndr->flags = _flags_save_string_array; } - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->driver_data)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->driver_date)); NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->driver_version)); { uint32_t _flags_save_string = ndr->flags; @@ -9511,7 +12211,7 @@ _PUBLIC_ void ndr_print_spoolss_DriverInfo6(struct ndr_print *ndr, const char *n ndr_print_string_array(ndr, "previous_names", r->previous_names); } ndr->depth--; - ndr_print_NTTIME(ndr, "driver_data", r->driver_data); + ndr_print_NTTIME(ndr, "driver_date", r->driver_date); ndr_print_hyper(ndr, "driver_version", r->driver_version); ndr_print_ptr(ndr, "manufacturer_name", r->manufacturer_name); ndr->depth++; @@ -9540,7 +12240,12 @@ _PUBLIC_ void ndr_print_spoolss_DriverInfo6(struct ndr_print *ndr, const char *n ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_DriverInfo8(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo8 *r) +_PUBLIC_ size_t ndr_size_spoolss_DriverInfo6(const struct spoolss_DriverInfo6 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo6, ic); +} + +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo8(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo8 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 8)); @@ -9605,7 +12310,7 @@ static enum ndr_err_code ndr_push_spoolss_DriverInfo8(struct ndr_push *ndr, int NDR_CHECK(ndr_push_relative_ptr1(ndr, r->previous_names)); ndr->flags = _flags_save_string_array; } - NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->driver_data)); + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->driver_date)); NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->driver_version)); { uint32_t _flags_save_string = ndr->flags; @@ -9841,7 +12546,7 @@ static enum ndr_err_code ndr_push_spoolss_DriverInfo8(struct ndr_push *ndr, int return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_DriverInfo8(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo8 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo8(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo8 *r) { uint32_t _ptr_driver_name; TALLOC_CTX *_mem_save_driver_name_0; @@ -10004,7 +12709,7 @@ static enum ndr_err_code ndr_pull_spoolss_DriverInfo8(struct ndr_pull *ndr, int } ndr->flags = _flags_save_string_array; } - NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->driver_data)); + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->driver_date)); NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->driver_version)); { uint32_t _flags_save_string = ndr->flags; @@ -10473,7 +13178,7 @@ _PUBLIC_ void ndr_print_spoolss_DriverInfo8(struct ndr_print *ndr, const char *n ndr_print_string_array(ndr, "previous_names", r->previous_names); } ndr->depth--; - ndr_print_NTTIME(ndr, "driver_data", r->driver_data); + ndr_print_NTTIME(ndr, "driver_date", r->driver_date); ndr_print_hyper(ndr, "driver_version", r->driver_version); ndr_print_ptr(ndr, "manufacturer_name", r->manufacturer_name); ndr->depth++; @@ -10535,6 +13240,208 @@ _PUBLIC_ void ndr_print_spoolss_DriverInfo8(struct ndr_print *ndr, const char *n ndr->depth--; } +_PUBLIC_ size_t ndr_size_spoolss_DriverInfo8(const struct spoolss_DriverInfo8 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo8, ic); +} + +static enum ndr_err_code ndr_push_spoolss_DriverFileType(struct ndr_push *ndr, int ndr_flags, enum spoolss_DriverFileType r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_spoolss_DriverFileType(struct ndr_pull *ndr, int ndr_flags, enum spoolss_DriverFileType *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_DriverFileType(struct ndr_print *ndr, const char *name, enum spoolss_DriverFileType r) +{ + const char *val = NULL; + + switch (r) { + case SPOOLSS_DRIVER_FILE_TYPE_RENDERING: val = "SPOOLSS_DRIVER_FILE_TYPE_RENDERING"; break; + case SPOOLSS_DRIVER_FILE_TYPE_CONFIGURATION: val = "SPOOLSS_DRIVER_FILE_TYPE_CONFIGURATION"; break; + case SPOOLSS_DRIVER_FILE_TYPE_DATA: val = "SPOOLSS_DRIVER_FILE_TYPE_DATA"; break; + case SPOOLSS_DRIVER_FILE_TYPE_HELP: val = "SPOOLSS_DRIVER_FILE_TYPE_HELP"; break; + case SPOOLSS_DRIVER_FILE_TYPE_OTHER: val = "SPOOLSS_DRIVER_FILE_TYPE_OTHER"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverFileInfo(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverFileInfo *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->file_name)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_spoolss_DriverFileType(ndr, NDR_SCALARS, r->file_type)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->file_version)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->file_name) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->file_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->file_name)); + } + ndr->flags = _flags_save_string; + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverFileInfo(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverFileInfo *r) +{ + uint32_t _ptr_file_name; + TALLOC_CTX *_mem_save_file_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_file_name)); + if (_ptr_file_name) { + NDR_PULL_ALLOC(ndr, r->file_name); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->file_name, _ptr_file_name)); + } else { + r->file_name = NULL; + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_spoolss_DriverFileType(ndr, NDR_SCALARS, &r->file_type)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->file_version)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->file_name) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->file_name)); + _mem_save_file_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->file_name, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->file_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_file_name_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_DriverFileInfo(struct ndr_print *ndr, const char *name, const struct spoolss_DriverFileInfo *r) +{ + ndr_print_struct(ndr, name, "spoolss_DriverFileInfo"); + ndr->depth++; + ndr_print_ptr(ndr, "file_name", r->file_name); + ndr->depth++; + if (r->file_name) { + ndr_print_string(ndr, "file_name", r->file_name); + } + ndr->depth--; + ndr_print_spoolss_DriverFileType(ndr, "file_type", r->file_type); + ndr_print_uint32(ndr, "file_version", r->file_version); + ndr->depth--; +} + +_PUBLIC_ void ndr_print_spoolss_DriverInfo101(struct ndr_print *ndr, const char *name, const struct spoolss_DriverInfo101 *r) +{ + uint32_t cntr_file_info_1; + ndr_print_struct(ndr, name, "spoolss_DriverInfo101"); + ndr->depth++; + ndr_print_spoolss_DriverOSVersion(ndr, "version", r->version); + ndr_print_ptr(ndr, "driver_name", r->driver_name); + ndr->depth++; + if (r->driver_name) { + ndr_print_string(ndr, "driver_name", r->driver_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "architecture", r->architecture); + ndr->depth++; + if (r->architecture) { + ndr_print_string(ndr, "architecture", r->architecture); + } + ndr->depth--; + ndr_print_ptr(ndr, "file_info", r->file_info); + ndr->depth++; + if (r->file_info) { + ndr->print(ndr, "%s: ARRAY(%d)", "file_info", (int)r->file_count); + ndr->depth++; + for (cntr_file_info_1=0;cntr_file_info_1<r->file_count;cntr_file_info_1++) { + char *idx_1=NULL; + if (asprintf(&idx_1, "[%d]", cntr_file_info_1) != -1) { + ndr_print_spoolss_DriverFileInfo(ndr, "file_info", &r->file_info[cntr_file_info_1]); + free(idx_1); + } + } + ndr->depth--; + } + ndr->depth--; + ndr_print_uint32(ndr, "file_count", r->file_count); + ndr_print_ptr(ndr, "monitor_name", r->monitor_name); + ndr->depth++; + if (r->monitor_name) { + ndr_print_string(ndr, "monitor_name", r->monitor_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "default_datatype", r->default_datatype); + ndr->depth++; + if (r->default_datatype) { + ndr_print_string(ndr, "default_datatype", r->default_datatype); + } + ndr->depth--; + ndr_print_ptr(ndr, "previous_names", r->previous_names); + ndr->depth++; + if (r->previous_names) { + ndr_print_string_array(ndr, "previous_names", r->previous_names); + } + ndr->depth--; + ndr_print_NTTIME(ndr, "driver_date", r->driver_date); + ndr_print_hyper(ndr, "driver_version", r->driver_version); + ndr_print_ptr(ndr, "manufacturer_name", r->manufacturer_name); + ndr->depth++; + if (r->manufacturer_name) { + ndr_print_string(ndr, "manufacturer_name", r->manufacturer_name); + } + ndr->depth--; + ndr_print_ptr(ndr, "manufacturer_url", r->manufacturer_url); + ndr->depth++; + if (r->manufacturer_url) { + ndr_print_string(ndr, "manufacturer_url", r->manufacturer_url); + } + ndr->depth--; + ndr_print_ptr(ndr, "hardware_id", r->hardware_id); + ndr->depth++; + if (r->hardware_id) { + ndr_print_string(ndr, "hardware_id", r->hardware_id); + } + ndr->depth--; + ndr_print_ptr(ndr, "provider", r->provider); + ndr->depth++; + if (r->provider) { + ndr_print_string(ndr, "provider", r->provider); + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ size_t ndr_size_spoolss_DriverInfo101(const struct spoolss_DriverInfo101 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo101, ic); +} + _PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_DriverInfo *r) { uint32_t _save_relative_base_offset = ndr_push_get_relative_base_offset(ndr); @@ -10583,6 +13490,12 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo(struct ndr_push *ndr, int NDR_CHECK(ndr_push_spoolss_DriverInfo8(ndr, NDR_SCALARS, &r->info8)); break; } + case 101: { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset)); + NDR_CHECK(ndr_push_spoolss_DriverInfo101(ndr, NDR_SCALARS, &r->info101)); + break; } + default: { break; } @@ -10620,6 +13533,10 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo(struct ndr_push *ndr, int NDR_CHECK(ndr_push_spoolss_DriverInfo8(ndr, NDR_BUFFERS, &r->info8)); break; + case 101: + NDR_CHECK(ndr_push_spoolss_DriverInfo101(ndr, NDR_BUFFERS, &r->info101)); + break; + default: break; @@ -10678,6 +13595,12 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo(struct ndr_pull *ndr, int NDR_CHECK(ndr_pull_spoolss_DriverInfo8(ndr, NDR_SCALARS, &r->info8)); break; } + case 101: { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset)); + NDR_CHECK(ndr_pull_spoolss_DriverInfo101(ndr, NDR_SCALARS, &r->info101)); + break; } + default: { break; } @@ -10714,6 +13637,10 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo(struct ndr_pull *ndr, int NDR_CHECK(ndr_pull_spoolss_DriverInfo8(ndr, NDR_BUFFERS, &r->info8)); break; + case 101: + NDR_CHECK(ndr_pull_spoolss_DriverInfo101(ndr, NDR_BUFFERS, &r->info101)); + break; + default: break; @@ -10757,6 +13684,10 @@ _PUBLIC_ void ndr_print_spoolss_DriverInfo(struct ndr_print *ndr, const char *na ndr_print_spoolss_DriverInfo8(ndr, "info8", &r->info8); break; + case 101: + ndr_print_spoolss_DriverInfo101(ndr, "info101", &r->info101); + break; + default: break; @@ -11121,6 +14052,9 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrintProcessorDirectoryInfo(struct n break; } default: { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset)); + NDR_CHECK(ndr_push_spoolss_PrintProcessorDirectoryInfo1(ndr, NDR_SCALARS, &r->info1)); break; } } @@ -11155,6 +14089,9 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrintProcessorDirectoryInfo(struct n break; } default: { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset)); + NDR_CHECK(ndr_pull_spoolss_PrintProcessorDirectoryInfo1(ndr, NDR_SCALARS, &r->info1)); break; } } @@ -11185,6 +14122,7 @@ _PUBLIC_ void ndr_print_spoolss_PrintProcessorDirectoryInfo(struct ndr_print *nd break; default: + ndr_print_spoolss_PrintProcessorDirectoryInfo1(ndr, "info1", &r->info1); break; } @@ -11997,6 +14935,275 @@ _PUBLIC_ void ndr_print_spoolss_FormInfo1(struct ndr_print *ndr, const char *nam ndr->depth--; } +static enum ndr_err_code ndr_push_spoolss_FormStringType(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_spoolss_FormStringType(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_FormStringType(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SPOOLSS_FORM_STRING_TYPE_NONE", SPOOLSS_FORM_STRING_TYPE_NONE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SPOOLSS_FORM_STRING_TYPE_MUI_DLL", SPOOLSS_FORM_STRING_TYPE_MUI_DLL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "SPOOLSS_FORM_STRING_TYPE_LANG_PAIR", SPOOLSS_FORM_STRING_TYPE_LANG_PAIR, r); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_spoolss_FormInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_FormInfo2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_spoolss_FormFlags(ndr, NDR_SCALARS, r->flags)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->form_name)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_spoolss_FormSize(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_push_spoolss_FormArea(ndr, NDR_SCALARS, &r->area)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->keyword)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_spoolss_FormStringType(ndr, NDR_SCALARS, r->string_type)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->mui_dll)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ressource_id)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->display_name)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lang_id)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->form_name) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->form_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->form_name)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + if (r->keyword) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->keyword)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->keyword)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->mui_dll) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->mui_dll)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->mui_dll)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->display_name) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->display_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->display_name)); + } + ndr->flags = _flags_save_string; + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_spoolss_FormInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_FormInfo2 *r) +{ + uint32_t _ptr_form_name; + TALLOC_CTX *_mem_save_form_name_0; + uint32_t _ptr_keyword; + TALLOC_CTX *_mem_save_keyword_0; + uint32_t _ptr_mui_dll; + TALLOC_CTX *_mem_save_mui_dll_0; + uint32_t _ptr_display_name; + TALLOC_CTX *_mem_save_display_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_spoolss_FormFlags(ndr, NDR_SCALARS, &r->flags)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_form_name)); + if (_ptr_form_name) { + NDR_PULL_ALLOC(ndr, r->form_name); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->form_name, _ptr_form_name)); + } else { + r->form_name = NULL; + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_spoolss_FormSize(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_spoolss_FormArea(ndr, NDR_SCALARS, &r->area)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_keyword)); + if (_ptr_keyword) { + NDR_PULL_ALLOC(ndr, r->keyword); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->keyword, _ptr_keyword)); + } else { + r->keyword = NULL; + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_spoolss_FormStringType(ndr, NDR_SCALARS, &r->string_type)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_mui_dll)); + if (_ptr_mui_dll) { + NDR_PULL_ALLOC(ndr, r->mui_dll); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->mui_dll, _ptr_mui_dll)); + } else { + r->mui_dll = NULL; + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ressource_id)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name)); + if (_ptr_display_name) { + NDR_PULL_ALLOC(ndr, r->display_name); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->display_name, _ptr_display_name)); + } else { + r->display_name = NULL; + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lang_id)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->form_name) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->form_name)); + _mem_save_form_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->form_name, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->form_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_form_name_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM); + if (r->keyword) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->keyword)); + _mem_save_keyword_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->keyword, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->keyword)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keyword_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->mui_dll) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->mui_dll)); + _mem_save_mui_dll_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->mui_dll, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->mui_dll)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_mui_dll_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->display_name) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->display_name)); + _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->display_name, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->display_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_FormInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_FormInfo2 *r) +{ + ndr_print_struct(ndr, name, "spoolss_FormInfo2"); + ndr->depth++; + ndr_print_spoolss_FormFlags(ndr, "flags", r->flags); + ndr_print_ptr(ndr, "form_name", r->form_name); + ndr->depth++; + if (r->form_name) { + ndr_print_string(ndr, "form_name", r->form_name); + } + ndr->depth--; + ndr_print_spoolss_FormSize(ndr, "size", &r->size); + ndr_print_spoolss_FormArea(ndr, "area", &r->area); + ndr_print_ptr(ndr, "keyword", r->keyword); + ndr->depth++; + if (r->keyword) { + ndr_print_string(ndr, "keyword", r->keyword); + } + ndr->depth--; + ndr_print_spoolss_FormStringType(ndr, "string_type", r->string_type); + ndr_print_ptr(ndr, "mui_dll", r->mui_dll); + ndr->depth++; + if (r->mui_dll) { + ndr_print_string(ndr, "mui_dll", r->mui_dll); + } + ndr->depth--; + ndr_print_uint32(ndr, "ressource_id", r->ressource_id); + ndr_print_ptr(ndr, "display_name", r->display_name); + ndr->depth++; + if (r->display_name) { + ndr_print_string(ndr, "display_name", r->display_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "lang_id", r->lang_id); + ndr->depth--; +} + _PUBLIC_ enum ndr_err_code ndr_push_spoolss_FormInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_FormInfo *r) { uint32_t _save_relative_base_offset = ndr_push_get_relative_base_offset(ndr); @@ -12009,6 +15216,12 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_FormInfo(struct ndr_push *ndr, int n NDR_CHECK(ndr_push_spoolss_FormInfo1(ndr, NDR_SCALARS, &r->info1)); break; } + case 2: { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset)); + NDR_CHECK(ndr_push_spoolss_FormInfo2(ndr, NDR_SCALARS, &r->info2)); + break; } + default: { break; } @@ -12022,6 +15235,10 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_FormInfo(struct ndr_push *ndr, int n NDR_CHECK(ndr_push_spoolss_FormInfo1(ndr, NDR_BUFFERS, &r->info1)); break; + case 2: + NDR_CHECK(ndr_push_spoolss_FormInfo2(ndr, NDR_BUFFERS, &r->info2)); + break; + default: break; @@ -12044,6 +15261,12 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_FormInfo(struct ndr_pull *ndr, int n NDR_CHECK(ndr_pull_spoolss_FormInfo1(ndr, NDR_SCALARS, &r->info1)); break; } + case 2: { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset)); + NDR_CHECK(ndr_pull_spoolss_FormInfo2(ndr, NDR_SCALARS, &r->info2)); + break; } + default: { break; } @@ -12056,6 +15279,10 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_FormInfo(struct ndr_pull *ndr, int n NDR_CHECK(ndr_pull_spoolss_FormInfo1(ndr, NDR_BUFFERS, &r->info1)); break; + case 2: + NDR_CHECK(ndr_pull_spoolss_FormInfo2(ndr, NDR_BUFFERS, &r->info2)); + break; + default: break; @@ -12075,6 +15302,10 @@ _PUBLIC_ void ndr_print_spoolss_FormInfo(struct ndr_print *ndr, const char *name ndr_print_spoolss_FormInfo1(ndr, "info1", &r->info1); break; + case 2: + ndr_print_spoolss_FormInfo2(ndr, "info2", &r->info2); + break; + default: break; @@ -12155,6 +15386,183 @@ _PUBLIC_ void ndr_print_spoolss_AddFormInfo1(struct ndr_print *ndr, const char * ndr->depth--; } +static enum ndr_err_code ndr_push_spoolss_AddFormInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_AddFormInfo2 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_spoolss_FormFlags(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->form_name)); + NDR_CHECK(ndr_push_spoolss_FormSize(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_push_spoolss_FormArea(ndr, NDR_SCALARS, &r->area)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->keyword)); + NDR_CHECK(ndr_push_spoolss_FormStringType(ndr, NDR_SCALARS, r->string_type)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->mui_dll)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ressource_id)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->display_name)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->lang_id)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->form_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->form_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->form_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->form_name, ndr_charset_length(r->form_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->keyword) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->keyword, CH_DOS))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->keyword, CH_DOS))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->keyword, ndr_charset_length(r->keyword, CH_DOS), sizeof(uint8_t), CH_DOS)); + } + if (r->mui_dll) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->mui_dll, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->mui_dll, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->mui_dll, ndr_charset_length(r->mui_dll, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + if (r->display_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->display_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->display_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->display_name, ndr_charset_length(r->display_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_spoolss_AddFormInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_AddFormInfo2 *r) +{ + uint32_t _ptr_form_name; + TALLOC_CTX *_mem_save_form_name_0; + uint32_t _ptr_keyword; + TALLOC_CTX *_mem_save_keyword_0; + uint32_t _ptr_mui_dll; + TALLOC_CTX *_mem_save_mui_dll_0; + uint32_t _ptr_display_name; + TALLOC_CTX *_mem_save_display_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_spoolss_FormFlags(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_form_name)); + if (_ptr_form_name) { + NDR_PULL_ALLOC(ndr, r->form_name); + } else { + r->form_name = NULL; + } + NDR_CHECK(ndr_pull_spoolss_FormSize(ndr, NDR_SCALARS, &r->size)); + NDR_CHECK(ndr_pull_spoolss_FormArea(ndr, NDR_SCALARS, &r->area)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_keyword)); + if (_ptr_keyword) { + NDR_PULL_ALLOC(ndr, r->keyword); + } else { + r->keyword = NULL; + } + NDR_CHECK(ndr_pull_spoolss_FormStringType(ndr, NDR_SCALARS, &r->string_type)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_mui_dll)); + if (_ptr_mui_dll) { + NDR_PULL_ALLOC(ndr, r->mui_dll); + } else { + r->mui_dll = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ressource_id)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_display_name)); + if (_ptr_display_name) { + NDR_PULL_ALLOC(ndr, r->display_name); + } else { + r->display_name = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->lang_id)); + } + if (ndr_flags & NDR_BUFFERS) { + if (r->form_name) { + _mem_save_form_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->form_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->form_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->form_name)); + if (ndr_get_array_length(ndr, &r->form_name) > ndr_get_array_size(ndr, &r->form_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->form_name), ndr_get_array_length(ndr, &r->form_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->form_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->form_name, ndr_get_array_length(ndr, &r->form_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_form_name_0, 0); + } + if (r->keyword) { + _mem_save_keyword_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->keyword, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->keyword)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->keyword)); + if (ndr_get_array_length(ndr, &r->keyword) > ndr_get_array_size(ndr, &r->keyword)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->keyword), ndr_get_array_length(ndr, &r->keyword)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->keyword), sizeof(uint8_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->keyword, ndr_get_array_length(ndr, &r->keyword), sizeof(uint8_t), CH_DOS)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_keyword_0, 0); + } + if (r->mui_dll) { + _mem_save_mui_dll_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->mui_dll, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->mui_dll)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->mui_dll)); + if (ndr_get_array_length(ndr, &r->mui_dll) > ndr_get_array_size(ndr, &r->mui_dll)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->mui_dll), ndr_get_array_length(ndr, &r->mui_dll)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->mui_dll), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->mui_dll, ndr_get_array_length(ndr, &r->mui_dll), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_mui_dll_0, 0); + } + if (r->display_name) { + _mem_save_display_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->display_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->display_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->display_name)); + if (ndr_get_array_length(ndr, &r->display_name) > ndr_get_array_size(ndr, &r->display_name)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->display_name), ndr_get_array_length(ndr, &r->display_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->display_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->display_name, ndr_get_array_length(ndr, &r->display_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_display_name_0, 0); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_AddFormInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_AddFormInfo2 *r) +{ + ndr_print_struct(ndr, name, "spoolss_AddFormInfo2"); + ndr->depth++; + ndr_print_spoolss_FormFlags(ndr, "flags", r->flags); + ndr_print_ptr(ndr, "form_name", r->form_name); + ndr->depth++; + if (r->form_name) { + ndr_print_string(ndr, "form_name", r->form_name); + } + ndr->depth--; + ndr_print_spoolss_FormSize(ndr, "size", &r->size); + ndr_print_spoolss_FormArea(ndr, "area", &r->area); + ndr_print_ptr(ndr, "keyword", r->keyword); + ndr->depth++; + if (r->keyword) { + ndr_print_string(ndr, "keyword", r->keyword); + } + ndr->depth--; + ndr_print_spoolss_FormStringType(ndr, "string_type", r->string_type); + ndr_print_ptr(ndr, "mui_dll", r->mui_dll); + ndr->depth++; + if (r->mui_dll) { + ndr_print_string(ndr, "mui_dll", r->mui_dll); + } + ndr->depth--; + ndr_print_uint32(ndr, "ressource_id", r->ressource_id); + ndr_print_ptr(ndr, "display_name", r->display_name); + ndr->depth++; + if (r->display_name) { + ndr_print_string(ndr, "display_name", r->display_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "lang_id", r->lang_id); + ndr->depth--; +} + static enum ndr_err_code ndr_push_spoolss_AddFormInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_AddFormInfo *r) { if (ndr_flags & NDR_SCALARS) { @@ -12165,6 +15573,10 @@ static enum ndr_err_code ndr_push_spoolss_AddFormInfo(struct ndr_push *ndr, int NDR_CHECK(ndr_push_unique_ptr(ndr, r->info1)); break; } + case 2: { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->info2)); + break; } + default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); } @@ -12178,6 +15590,12 @@ static enum ndr_err_code ndr_push_spoolss_AddFormInfo(struct ndr_push *ndr, int } break; + case 2: + if (r->info2) { + NDR_CHECK(ndr_push_spoolss_AddFormInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); + } + break; + default: return ndr_push_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); } @@ -12190,6 +15608,7 @@ static enum ndr_err_code ndr_pull_spoolss_AddFormInfo(struct ndr_pull *ndr, int int level; uint32_t _level; TALLOC_CTX *_mem_save_info1_0; + TALLOC_CTX *_mem_save_info2_0; level = ndr_pull_get_switch_value(ndr, r); if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); @@ -12207,6 +15626,16 @@ static enum ndr_err_code ndr_pull_spoolss_AddFormInfo(struct ndr_pull *ndr, int } break; } + case 2: { + uint32_t _ptr_info2; + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info2)); + if (_ptr_info2) { + NDR_PULL_ALLOC(ndr, r->info2); + } else { + r->info2 = NULL; + } + break; } + default: return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); } @@ -12222,6 +15651,15 @@ static enum ndr_err_code ndr_pull_spoolss_AddFormInfo(struct ndr_pull *ndr, int } break; + case 2: + if (r->info2) { + _mem_save_info2_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->info2, 0); + NDR_CHECK(ndr_pull_spoolss_AddFormInfo2(ndr, NDR_SCALARS|NDR_BUFFERS, r->info2)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info2_0, 0); + } + break; + default: return ndr_pull_error(ndr, NDR_ERR_BAD_SWITCH, "Bad switch value %u", level); } @@ -12244,6 +15682,15 @@ _PUBLIC_ void ndr_print_spoolss_AddFormInfo(struct ndr_print *ndr, const char *n ndr->depth--; break; + case 2: + ndr_print_ptr(ndr, "info2", r->info2); + ndr->depth++; + if (r->info2) { + ndr_print_spoolss_AddFormInfo2(ndr, "info2", r->info2); + } + ndr->depth--; + break; + default: ndr_print_bad_level(ndr, name, level); } @@ -12534,6 +15981,231 @@ _PUBLIC_ void ndr_print_spoolss_PortInfo2(struct ndr_print *ndr, const char *nam ndr->depth--; } +static enum ndr_err_code ndr_push_spoolss_PortStatus(struct ndr_push *ndr, int ndr_flags, enum spoolss_PortStatus r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_spoolss_PortStatus(struct ndr_pull *ndr, int ndr_flags, enum spoolss_PortStatus *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_PortStatus(struct ndr_print *ndr, const char *name, enum spoolss_PortStatus r) +{ + const char *val = NULL; + + switch (r) { + case PORT_STATUS_CLEAR: val = "PORT_STATUS_CLEAR"; break; + case PORT_STATUS_OFFLINE: val = "PORT_STATUS_OFFLINE"; break; + case PORT_STATUS_PAPER_JAM: val = "PORT_STATUS_PAPER_JAM"; break; + case PORT_STATUS_PAPER_OUT: val = "PORT_STATUS_PAPER_OUT"; break; + case PORT_STATUS_OUTPUT_BIN_FULL: val = "PORT_STATUS_OUTPUT_BIN_FULL"; break; + case PORT_STATUS_PAPER_PROBLEM: val = "PORT_STATUS_PAPER_PROBLEM"; break; + case PORT_STATUS_NO_TONER: val = "PORT_STATUS_NO_TONER"; break; + case PORT_STATUS_DOOR_OPEN: val = "PORT_STATUS_DOOR_OPEN"; break; + case PORT_STATUS_USER_INTERVENTION: val = "PORT_STATUS_USER_INTERVENTION"; break; + case PORT_STATUS_OUT_OF_MEMORY: val = "PORT_STATUS_OUT_OF_MEMORY"; break; + case PORT_STATUS_TONER_LOW: val = "PORT_STATUS_TONER_LOW"; break; + case PORT_STATUS_WARMING_UP: val = "PORT_STATUS_WARMING_UP"; break; + case PORT_STATUS_POWER_SAVE: val = "PORT_STATUS_POWER_SAVE"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_spoolss_PortSeverity(struct ndr_push *ndr, int ndr_flags, enum spoolss_PortSeverity r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_spoolss_PortSeverity(struct ndr_pull *ndr, int ndr_flags, enum spoolss_PortSeverity *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_PortSeverity(struct ndr_print *ndr, const char *name, enum spoolss_PortSeverity r) +{ + const char *val = NULL; + + switch (r) { + case PORT_STATUS_TYPE_ERROR: val = "PORT_STATUS_TYPE_ERROR"; break; + case PORT_STATUS_TYPE_WARNING: val = "PORT_STATUS_TYPE_WARNING"; break; + case PORT_STATUS_TYPE_INFO: val = "PORT_STATUS_TYPE_INFO"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +static enum ndr_err_code ndr_push_spoolss_PortInfo3(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PortInfo3 *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_spoolss_PortStatus(ndr, NDR_SCALARS, r->status)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->status_string)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_spoolss_PortSeverity(ndr, NDR_SCALARS, r->severity)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->status_string) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->status_string)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->status_string)); + } + ndr->flags = _flags_save_string; + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_spoolss_PortInfo3(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PortInfo3 *r) +{ + uint32_t _ptr_status_string; + TALLOC_CTX *_mem_save_status_string_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_spoolss_PortStatus(ndr, NDR_SCALARS, &r->status)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_status_string)); + if (_ptr_status_string) { + NDR_PULL_ALLOC(ndr, r->status_string); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->status_string, _ptr_status_string)); + } else { + r->status_string = NULL; + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_spoolss_PortSeverity(ndr, NDR_SCALARS, &r->severity)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->status_string) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->status_string)); + _mem_save_status_string_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->status_string, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->status_string)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_status_string_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_PortInfo3(struct ndr_print *ndr, const char *name, const struct spoolss_PortInfo3 *r) +{ + ndr_print_struct(ndr, name, "spoolss_PortInfo3"); + ndr->depth++; + ndr_print_spoolss_PortStatus(ndr, "status", r->status); + ndr_print_ptr(ndr, "status_string", r->status_string); + ndr->depth++; + if (r->status_string) { + ndr_print_string(ndr, "status_string", r->status_string); + } + ndr->depth--; + ndr_print_spoolss_PortSeverity(ndr, "severity", r->severity); + ndr->depth--; +} + +static enum ndr_err_code ndr_push_spoolss_PortInfoFF(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PortInfoFF *r) +{ + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->port_name)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->monitor_data)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->port_name) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->port_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->port_name)); + } + ndr->flags = _flags_save_string; + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_spoolss_PortInfoFF(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PortInfoFF *r) +{ + uint32_t _ptr_port_name; + TALLOC_CTX *_mem_save_port_name_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_port_name)); + if (_ptr_port_name) { + NDR_PULL_ALLOC(ndr, r->port_name); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->port_name, _ptr_port_name)); + } else { + r->port_name = NULL; + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->monitor_data)); + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->port_name) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->port_name)); + _mem_save_port_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->port_name, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->port_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_port_name_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_PortInfoFF(struct ndr_print *ndr, const char *name, const struct spoolss_PortInfoFF *r) +{ + ndr_print_struct(ndr, name, "spoolss_PortInfoFF"); + ndr->depth++; + ndr_print_ptr(ndr, "port_name", r->port_name); + ndr->depth++; + if (r->port_name) { + ndr_print_string(ndr, "port_name", r->port_name); + } + ndr->depth--; + ndr_print_DATA_BLOB(ndr, "monitor_data", r->monitor_data); + ndr->depth--; +} + _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PortInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_PortInfo *r) { uint32_t _save_relative_base_offset = ndr_push_get_relative_base_offset(ndr); @@ -12553,6 +16225,15 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PortInfo(struct ndr_push *ndr, int n break; } case 3: { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset)); + NDR_CHECK(ndr_push_spoolss_PortInfo3(ndr, NDR_SCALARS, &r->info3)); + break; } + + case 0xff: { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset)); + NDR_CHECK(ndr_push_spoolss_PortInfoFF(ndr, NDR_SCALARS, &r->infoFF)); break; } default: { @@ -12573,6 +16254,11 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PortInfo(struct ndr_push *ndr, int n break; case 3: + NDR_CHECK(ndr_push_spoolss_PortInfo3(ndr, NDR_BUFFERS, &r->info3)); + break; + + case 0xff: + NDR_CHECK(ndr_push_spoolss_PortInfoFF(ndr, NDR_BUFFERS, &r->infoFF)); break; default: @@ -12604,6 +16290,15 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PortInfo(struct ndr_pull *ndr, int n break; } case 3: { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset)); + NDR_CHECK(ndr_pull_spoolss_PortInfo3(ndr, NDR_SCALARS, &r->info3)); + break; } + + case 0xff: { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset)); + NDR_CHECK(ndr_pull_spoolss_PortInfoFF(ndr, NDR_SCALARS, &r->infoFF)); break; } default: { @@ -12623,6 +16318,11 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PortInfo(struct ndr_pull *ndr, int n break; case 3: + NDR_CHECK(ndr_pull_spoolss_PortInfo3(ndr, NDR_BUFFERS, &r->info3)); + break; + + case 0xff: + NDR_CHECK(ndr_pull_spoolss_PortInfoFF(ndr, NDR_BUFFERS, &r->infoFF)); break; default: @@ -12649,6 +16349,11 @@ _PUBLIC_ void ndr_print_spoolss_PortInfo(struct ndr_print *ndr, const char *name break; case 3: + ndr_print_spoolss_PortInfo3(ndr, "info3", &r->info3); + break; + + case 0xff: + ndr_print_spoolss_PortInfoFF(ndr, "infoFF", &r->infoFF); break; default: @@ -13053,6 +16758,7 @@ _PUBLIC_ void ndr_print_spoolss_PrinterChangeFlags(struct ndr_print *ndr, const ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_DELETE_PORT", PRINTER_CHANGE_DELETE_PORT, r); ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_ADD_PRINT_PROCESSOR", PRINTER_CHANGE_ADD_PRINT_PROCESSOR, r); ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_DELETE_PRINT_PROCESSOR", PRINTER_CHANGE_DELETE_PRINT_PROCESSOR, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_SERVER", PRINTER_CHANGE_SERVER, r); ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_ADD_PRINTER_DRIVER", PRINTER_CHANGE_ADD_PRINTER_DRIVER, r); ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_SET_PRINTER_DRIVER", PRINTER_CHANGE_SET_PRINTER_DRIVER, r); ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_CHANGE_DELETE_PRINTER_DRIVER", PRINTER_CHANGE_DELETE_PRINTER_DRIVER, r); @@ -13226,13 +16932,35 @@ _PUBLIC_ void ndr_print_spoolss_NotifyOptionType(struct ndr_print *ndr, const ch ndr->depth--; } +static enum ndr_err_code ndr_push_spoolssNotifyOptionFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) +{ + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_spoolssNotifyOptionFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) +{ + uint32_t v; + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolssNotifyOptionFlags(struct ndr_print *ndr, const char *name, uint32_t r) +{ + ndr_print_uint32(ndr, name, r); + ndr->depth++; + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_NOTIFY_OPTIONS_REFRESH", PRINTER_NOTIFY_OPTIONS_REFRESH, r); + ndr->depth--; +} + static enum ndr_err_code ndr_push_spoolss_NotifyOption(struct ndr_push *ndr, int ndr_flags, const struct spoolss_NotifyOption *r) { uint32_t cntr_types_1; if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->flags)); + NDR_CHECK(ndr_push_spoolssNotifyOptionFlags(ndr, NDR_SCALARS, r->flags)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->types)); } @@ -13259,7 +16987,7 @@ static enum ndr_err_code ndr_pull_spoolss_NotifyOption(struct ndr_pull *ndr, int if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->version)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->flags)); + NDR_CHECK(ndr_pull_spoolssNotifyOptionFlags(ndr, NDR_SCALARS, &r->flags)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->count)); NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_types)); if (_ptr_types) { @@ -13298,7 +17026,7 @@ _PUBLIC_ void ndr_print_spoolss_NotifyOption(struct ndr_print *ndr, const char * ndr_print_struct(ndr, name, "spoolss_NotifyOption"); ndr->depth++; ndr_print_uint32(ndr, "version", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2:r->version); - ndr_print_uint32(ndr, "flags", r->flags); + ndr_print_spoolssNotifyOptionFlags(ndr, "flags", r->flags); ndr_print_uint32(ndr, "count", r->count); ndr_print_ptr(ndr, "types", r->types); ndr->depth++; @@ -13423,7 +17151,7 @@ static enum ndr_err_code ndr_push_spoolss_NotifyData(struct ndr_push *ndr, int n break; } case 3: { - NDR_CHECK(ndr_push_unique_ptr(ndr, r->devmode)); + NDR_CHECK(ndr_push_spoolss_DevmodeContainer(ndr, NDR_SCALARS, &r->devmode)); break; } case 4: { @@ -13449,9 +17177,7 @@ static enum ndr_err_code ndr_push_spoolss_NotifyData(struct ndr_push *ndr, int n break; case 3: - if (r->devmode) { - NDR_CHECK(ndr_push_spoolss_DeviceMode(ndr, NDR_SCALARS, r->devmode)); - } + NDR_CHECK(ndr_push_spoolss_DevmodeContainer(ndr, NDR_BUFFERS, &r->devmode)); break; case 4: @@ -13473,7 +17199,6 @@ static enum ndr_err_code ndr_pull_spoolss_NotifyData(struct ndr_pull *ndr, int n { int level; uint32_t _level; - TALLOC_CTX *_mem_save_devmode_0; level = ndr_pull_get_switch_value(ndr, r); if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &_level)); @@ -13493,13 +17218,7 @@ static enum ndr_err_code ndr_pull_spoolss_NotifyData(struct ndr_pull *ndr, int n break; } case 3: { - uint32_t _ptr_devmode; - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devmode)); - if (_ptr_devmode) { - NDR_PULL_ALLOC(ndr, r->devmode); - } else { - r->devmode = NULL; - } + NDR_CHECK(ndr_pull_spoolss_DevmodeContainer(ndr, NDR_SCALARS, &r->devmode)); break; } case 4: { @@ -13524,12 +17243,7 @@ static enum ndr_err_code ndr_pull_spoolss_NotifyData(struct ndr_pull *ndr, int n break; case 3: - if (r->devmode) { - _mem_save_devmode_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->devmode, 0); - NDR_CHECK(ndr_pull_spoolss_DeviceMode(ndr, NDR_SCALARS, r->devmode)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devmode_0, 0); - } + NDR_CHECK(ndr_pull_spoolss_DevmodeContainer(ndr, NDR_BUFFERS, &r->devmode)); break; case 4: @@ -13572,12 +17286,7 @@ _PUBLIC_ void ndr_print_spoolss_NotifyData(struct ndr_print *ndr, const char *na break; case 3: - ndr_print_ptr(ndr, "devmode", r->devmode); - ndr->depth++; - if (r->devmode) { - ndr_print_spoolss_DeviceMode(ndr, "devmode", r->devmode); - } - ndr->depth--; + ndr_print_spoolss_DevmodeContainer(ndr, "devmode", &r->devmode); break; case 4: @@ -14320,6 +18029,7 @@ _PUBLIC_ void ndr_print_spoolss_AccessRights(struct ndr_print *ndr, const char * ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ACCESS_ADMINISTER", PRINTER_ACCESS_ADMINISTER, r); ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_ACCESS_USE", PRINTER_ACCESS_USE, r); ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_ACCESS_ADMINISTER", JOB_ACCESS_ADMINISTER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_ACCESS_READ", JOB_ACCESS_READ, r); ndr->depth--; } @@ -16809,7 +20519,7 @@ static enum ndr_err_code ndr_push_spoolss_GetPrintProcessorDirectory(struct ndr_ struct ndr_push *_ndr_info; NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info, 4, r->in.offered)); NDR_CHECK(ndr_push_set_switch_value(_ndr_info, r->out.info, r->in.level)); - NDR_CHECK(ndr_push_spoolss_PrintProcessorDirectoryInfo(_ndr_info, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_CHECK(ndr_push_spoolss_PrintProcessorDirectoryInfo(_ndr_info, NDR_SCALARS, r->out.info)); NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 4, r->in.offered)); } } @@ -16903,7 +20613,7 @@ static enum ndr_err_code ndr_pull_spoolss_GetPrintProcessorDirectory(struct ndr_ struct ndr_pull *_ndr_info; NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info, 4, r->in.offered)); NDR_CHECK(ndr_pull_set_switch_value(_ndr_info, r->out.info, r->in.level)); - NDR_CHECK(ndr_pull_spoolss_PrintProcessorDirectoryInfo(_ndr_info, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_CHECK(ndr_pull_spoolss_PrintProcessorDirectoryInfo(_ndr_info, NDR_SCALARS, r->out.info)); NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info, 4, r->in.offered)); } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); @@ -19836,7 +23546,13 @@ static enum ndr_err_code ndr_push_spoolss_GetPrinterDriver2(struct ndr_push *ndr if (flags & NDR_OUT) { NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.info)); if (r->out.info) { - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->out.info)); + { + struct ndr_push *_ndr_info; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_info, 4, r->in.offered)); + NDR_CHECK(ndr_push_set_switch_value(_ndr_info, r->out.info, r->in.level)); + NDR_CHECK(ndr_push_spoolss_DriverInfo(_ndr_info, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_info, 4, r->in.offered)); + } } if (r->out.needed == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); @@ -19928,7 +23644,13 @@ static enum ndr_err_code ndr_pull_spoolss_GetPrinterDriver2(struct ndr_pull *ndr if (r->out.info) { _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->out.info)); + { + struct ndr_pull *_ndr_info; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_info, 4, r->in.offered)); + NDR_CHECK(ndr_pull_set_switch_value(_ndr_info, r->out.info, r->in.level)); + NDR_CHECK(ndr_pull_spoolss_DriverInfo(_ndr_info, NDR_SCALARS|NDR_BUFFERS, r->out.info)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_info, 4, r->in.offered)); + } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); } if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { @@ -19995,7 +23717,8 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinterDriver2(struct ndr_print *ndr, const c ndr_print_ptr(ndr, "info", r->out.info); ndr->depth++; if (r->out.info) { - ndr_print_DATA_BLOB(ndr, "info", *r->out.info); + ndr_print_set_switch_value(ndr, r->out.info, r->in.level); + ndr_print_spoolss_DriverInfo(ndr, "info", r->out.info); } ndr->depth--; ndr_print_ptr(ndr, "needed", r->out.needed); diff --git a/librpc/gen_ndr/ndr_spoolss.h b/librpc/gen_ndr/ndr_spoolss.h index f8d97c19a7..84ab8b7d05 100644 --- a/librpc/gen_ndr/ndr_spoolss.h +++ b/librpc/gen_ndr/ndr_spoolss.h @@ -235,10 +235,20 @@ enum ndr_err_code ndr_push_spoolss_PrinterInfo(struct ndr_push *ndr, int ndr_fla enum ndr_err_code ndr_pull_spoolss_PrinterInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_PrinterInfo *r); void ndr_print_spoolss_PrinterInfo(struct ndr_print *ndr, const char *name, const union spoolss_PrinterInfo *r); void ndr_print_spoolss_DevmodeContainer(struct ndr_print *ndr, const char *name, const struct spoolss_DevmodeContainer *r); +void ndr_print_spoolss_JobStatus(struct ndr_print *ndr, const char *name, uint32_t r); void ndr_print_spoolss_JobInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_JobInfo1 *r); +void ndr_print_spoolss_JobInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_JobInfo2 *r); +void ndr_print_spoolss_JobInfo3(struct ndr_print *ndr, const char *name, const struct spoolss_JobInfo3 *r); +void ndr_print_spoolss_JobInfo4(struct ndr_print *ndr, const char *name, const struct spoolss_JobInfo4 *r); enum ndr_err_code ndr_push_spoolss_JobInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_JobInfo *r); enum ndr_err_code ndr_pull_spoolss_JobInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_JobInfo *r); void ndr_print_spoolss_JobInfo(struct ndr_print *ndr, const char *name, const union spoolss_JobInfo *r); +void ndr_print_spoolss_SetJobInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_SetJobInfo1 *r); +void ndr_print_spoolss_SetJobInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_SetJobInfo2 *r); +void ndr_print_spoolss_SetJobInfo4(struct ndr_print *ndr, const char *name, const struct spoolss_SetJobInfo4 *r); +enum ndr_err_code ndr_push_spoolss_SetJobInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_SetJobInfo *r); +enum ndr_err_code ndr_pull_spoolss_SetJobInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_SetJobInfo *r); +void ndr_print_spoolss_SetJobInfo(struct ndr_print *ndr, const char *name, const union spoolss_SetJobInfo *r); void ndr_print_spoolss_JobInfoContainer(struct ndr_print *ndr, const char *name, const struct spoolss_JobInfoContainer *r); void ndr_print_spoolss_JobControl(struct ndr_print *ndr, const char *name, enum spoolss_JobControl r); void ndr_print_spoolss_PrinterControl(struct ndr_print *ndr, const char *name, enum spoolss_PrinterControl r); @@ -256,6 +266,8 @@ enum ndr_err_code ndr_push_spoolss_StringArray(struct ndr_push *ndr, int ndr_fla enum ndr_err_code ndr_pull_spoolss_StringArray(struct ndr_pull *ndr, int ndr_flags, struct spoolss_StringArray *r); void ndr_print_spoolss_StringArray(struct ndr_print *ndr, const char *name, const struct spoolss_StringArray *r); void ndr_print_spoolss_AddDriverInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_AddDriverInfo1 *r); +enum ndr_err_code ndr_push_spoolss_DriverOSVersion(struct ndr_push *ndr, int ndr_flags, enum spoolss_DriverOSVersion r); +enum ndr_err_code ndr_pull_spoolss_DriverOSVersion(struct ndr_pull *ndr, int ndr_flags, enum spoolss_DriverOSVersion *r); void ndr_print_spoolss_DriverOSVersion(struct ndr_print *ndr, const char *name, enum spoolss_DriverOSVersion r); void ndr_print_spoolss_AddDriverInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_AddDriverInfo2 *r); void ndr_print_spoolss_AddDriverInfo3(struct ndr_print *ndr, const char *name, const struct spoolss_AddDriverInfo3 *r); @@ -264,13 +276,42 @@ void ndr_print_spoolss_AddDriverInfo6(struct ndr_print *ndr, const char *name, c void ndr_print_spoolss_AddDriverInfo8(struct ndr_print *ndr, const char *name, const struct spoolss_AddDriverInfo8 *r); void ndr_print_spoolss_AddDriverInfo(struct ndr_print *ndr, const char *name, const union spoolss_AddDriverInfo *r); void ndr_print_spoolss_AddDriverInfoCtr(struct ndr_print *ndr, const char *name, const struct spoolss_AddDriverInfoCtr *r); +enum ndr_err_code ndr_push_spoolss_DriverInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo1 *r); +enum ndr_err_code ndr_pull_spoolss_DriverInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo1 *r); void ndr_print_spoolss_DriverInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_DriverInfo1 *r); +size_t ndr_size_spoolss_DriverInfo1(const struct spoolss_DriverInfo1 *r, struct smb_iconv_convenience *ic, int flags); +enum ndr_err_code ndr_push_spoolss_DriverInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo2 *r); +enum ndr_err_code ndr_pull_spoolss_DriverInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo2 *r); void ndr_print_spoolss_DriverInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_DriverInfo2 *r); +size_t ndr_size_spoolss_DriverInfo2(const struct spoolss_DriverInfo2 *r, struct smb_iconv_convenience *ic, int flags); +enum ndr_err_code ndr_push_spoolss_DriverInfo3(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo3 *r); +enum ndr_err_code ndr_pull_spoolss_DriverInfo3(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo3 *r); void ndr_print_spoolss_DriverInfo3(struct ndr_print *ndr, const char *name, const struct spoolss_DriverInfo3 *r); +size_t ndr_size_spoolss_DriverInfo3(const struct spoolss_DriverInfo3 *r, struct smb_iconv_convenience *ic, int flags); +enum ndr_err_code ndr_push_spoolss_DriverInfo4(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo4 *r); +enum ndr_err_code ndr_pull_spoolss_DriverInfo4(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo4 *r); void ndr_print_spoolss_DriverInfo4(struct ndr_print *ndr, const char *name, const struct spoolss_DriverInfo4 *r); +size_t ndr_size_spoolss_DriverInfo4(const struct spoolss_DriverInfo4 *r, struct smb_iconv_convenience *ic, int flags); +enum ndr_err_code ndr_push_spoolss_DriverInfo5(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo5 *r); +enum ndr_err_code ndr_pull_spoolss_DriverInfo5(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo5 *r); void ndr_print_spoolss_DriverInfo5(struct ndr_print *ndr, const char *name, const struct spoolss_DriverInfo5 *r); +size_t ndr_size_spoolss_DriverInfo5(const struct spoolss_DriverInfo5 *r, struct smb_iconv_convenience *ic, int flags); +enum ndr_err_code ndr_push_spoolss_DriverInfo6(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo6 *r); +enum ndr_err_code ndr_pull_spoolss_DriverInfo6(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo6 *r); void ndr_print_spoolss_DriverInfo6(struct ndr_print *ndr, const char *name, const struct spoolss_DriverInfo6 *r); +size_t ndr_size_spoolss_DriverInfo6(const struct spoolss_DriverInfo6 *r, struct smb_iconv_convenience *ic, int flags); +enum ndr_err_code ndr_push_spoolss_DriverInfo8(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo8 *r); +enum ndr_err_code ndr_pull_spoolss_DriverInfo8(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo8 *r); void ndr_print_spoolss_DriverInfo8(struct ndr_print *ndr, const char *name, const struct spoolss_DriverInfo8 *r); +size_t ndr_size_spoolss_DriverInfo8(const struct spoolss_DriverInfo8 *r, struct smb_iconv_convenience *ic, int flags); +void ndr_print_spoolss_DriverFileType(struct ndr_print *ndr, const char *name, enum spoolss_DriverFileType r); +enum ndr_err_code ndr_push_spoolss_DriverFileInfo(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverFileInfo *r); +enum ndr_err_code ndr_pull_spoolss_DriverFileInfo(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverFileInfo *r); +void ndr_print_spoolss_DriverFileInfo(struct ndr_print *ndr, const char *name, const struct spoolss_DriverFileInfo *r); +enum ndr_err_code ndr_push_spoolss_DriverInfo101(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo101 *r); +enum ndr_err_code ndr_pull_spoolss_DriverInfo101(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo101 *r); +void ndr_print_spoolss_DriverInfo101(struct ndr_print *ndr, const char *name, const struct spoolss_DriverInfo101 *r); +size_t ndr_size_spoolss_DriverInfo101(const struct spoolss_DriverInfo101 *r, struct smb_iconv_convenience *ic, int flags); enum ndr_err_code ndr_push_spoolss_DriverInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_DriverInfo *r); enum ndr_err_code ndr_pull_spoolss_DriverInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_DriverInfo *r); void ndr_print_spoolss_DriverInfo(struct ndr_print *ndr, const char *name, const union spoolss_DriverInfo *r); @@ -313,15 +354,22 @@ void ndr_print_spoolss_FormFlags(struct ndr_print *ndr, const char *name, enum s void ndr_print_spoolss_FormSize(struct ndr_print *ndr, const char *name, const struct spoolss_FormSize *r); void ndr_print_spoolss_FormArea(struct ndr_print *ndr, const char *name, const struct spoolss_FormArea *r); void ndr_print_spoolss_FormInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_FormInfo1 *r); +void ndr_print_spoolss_FormStringType(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_spoolss_FormInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_FormInfo2 *r); enum ndr_err_code ndr_push_spoolss_FormInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_FormInfo *r); enum ndr_err_code ndr_pull_spoolss_FormInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_FormInfo *r); void ndr_print_spoolss_FormInfo(struct ndr_print *ndr, const char *name, const union spoolss_FormInfo *r); size_t ndr_size_spoolss_FormInfo(const union spoolss_FormInfo *r, uint32_t level, struct smb_iconv_convenience *ic, int flags); void ndr_print_spoolss_AddFormInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_AddFormInfo1 *r); +void ndr_print_spoolss_AddFormInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_AddFormInfo2 *r); void ndr_print_spoolss_AddFormInfo(struct ndr_print *ndr, const char *name, const union spoolss_AddFormInfo *r); void ndr_print_spoolss_PortInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_PortInfo1 *r); void ndr_print_spoolss_PortType(struct ndr_print *ndr, const char *name, uint32_t r); void ndr_print_spoolss_PortInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_PortInfo2 *r); +void ndr_print_spoolss_PortStatus(struct ndr_print *ndr, const char *name, enum spoolss_PortStatus r); +void ndr_print_spoolss_PortSeverity(struct ndr_print *ndr, const char *name, enum spoolss_PortSeverity r); +void ndr_print_spoolss_PortInfo3(struct ndr_print *ndr, const char *name, const struct spoolss_PortInfo3 *r); +void ndr_print_spoolss_PortInfoFF(struct ndr_print *ndr, const char *name, const struct spoolss_PortInfoFF *r); enum ndr_err_code ndr_push_spoolss_PortInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_PortInfo *r); enum ndr_err_code ndr_pull_spoolss_PortInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_PortInfo *r); void ndr_print_spoolss_PortInfo(struct ndr_print *ndr, const char *name, const union spoolss_PortInfo *r); @@ -334,6 +382,7 @@ void ndr_print_spoolss_PrinterChangeFlags(struct ndr_print *ndr, const char *nam void ndr_print_spoolss_Field(struct ndr_print *ndr, const char *name, enum spoolss_Field r); void ndr_print_spoolss_NotifyType(struct ndr_print *ndr, const char *name, enum spoolss_NotifyType r); void ndr_print_spoolss_NotifyOptionType(struct ndr_print *ndr, const char *name, const struct spoolss_NotifyOptionType *r); +void ndr_print_spoolssNotifyOptionFlags(struct ndr_print *ndr, const char *name, uint32_t r); void ndr_print_spoolss_NotifyOption(struct ndr_print *ndr, const char *name, const struct spoolss_NotifyOption *r); void ndr_print_spoolss_NotifyString(struct ndr_print *ndr, const char *name, const struct spoolss_NotifyString *r); void ndr_print_spoolss_NotifyTable(struct ndr_print *ndr, const char *name, enum spoolss_NotifyTable r); diff --git a/librpc/gen_ndr/netlogon.h b/librpc/gen_ndr/netlogon.h index d1038d76c8..892e770bad 100644 --- a/librpc/gen_ndr/netlogon.h +++ b/librpc/gen_ndr/netlogon.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #include "librpc/gen_ndr/misc.h" #include "librpc/gen_ndr/lsa.h" #include "librpc/gen_ndr/samr.h" diff --git a/librpc/gen_ndr/ntsvcs.h b/librpc/gen_ndr/ntsvcs.h index 5021aa2252..804c452816 100644 --- a/librpc/gen_ndr/ntsvcs.h +++ b/librpc/gen_ndr/ntsvcs.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #include "librpc/gen_ndr/winreg.h" #ifndef _HEADER_ntsvcs #define _HEADER_ntsvcs diff --git a/librpc/gen_ndr/samr.h b/librpc/gen_ndr/samr.h index 782987de1c..044756469e 100644 --- a/librpc/gen_ndr/samr.h +++ b/librpc/gen_ndr/samr.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #include "librpc/gen_ndr/misc.h" #include "librpc/gen_ndr/lsa.h" #include "librpc/gen_ndr/security.h" diff --git a/librpc/gen_ndr/security.h b/librpc/gen_ndr/security.h index 4fa9a8084c..32ea2eaacd 100644 --- a/librpc/gen_ndr/security.h +++ b/librpc/gen_ndr/security.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #include "librpc/gen_ndr/misc.h" #define dom_sid2 dom_sid #define dom_sid28 dom_sid diff --git a/librpc/gen_ndr/spoolss.h b/librpc/gen_ndr/spoolss.h index 2faeea2e40..b66e4ab2a8 100644 --- a/librpc/gen_ndr/spoolss.h +++ b/librpc/gen_ndr/spoolss.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #include "librpc/gen_ndr/misc.h" #include "librpc/gen_ndr/security.h" #include "librpc/gen_ndr/winreg.h" @@ -9,14 +11,16 @@ #define _HEADER_spoolss #define PRINTER_ENUM_ICONMASK ( (PRINTER_ENUM_ICON1|PRINTER_ENUM_ICON2|PRINTER_ENUM_ICON3|PRINTER_ENUM_ICON4|PRINTER_ENUM_ICON5|PRINTER_ENUM_ICON6|PRINTER_ENUM_ICON7|PRINTER_ENUM_ICON8) ) +#define JOB_STATUS_QUEUED ( 0x0000 ) #define SPOOLSS_ARCHITECTURE_NT_X86 ( "Windows NT x86" ) -#define PRINTER_CHANGE_PRINTER ( (PRINTER_CHANGE_ADD_PRINTER|PRINTER_CHANGE_SET_PRINTER|PRINTER_CHANGE_DELETE_PRINTER|PRINTER_CHANGE_FAILED_CONNECTION_PRINTER) ) -#define PRINTER_CHANGE_JOB ( (PRINTER_CHANGE_ADD_JOB|PRINTER_CHANGE_SET_JOB|PRINTER_CHANGE_DELETE_JOB|PRINTER_CHANGE_WRITE_JOB) ) +#define SPOOLSS_DEFAULT_SERVER_PATH ( "C:\\WINDOWS\\system32\\spool" ) +#define PRINTER_CHANGE_PRINTER ( 0x000000FF ) +#define PRINTER_CHANGE_JOB ( 0x0000FF00 ) #define PRINTER_CHANGE_FORM ( (PRINTER_CHANGE_ADD_FORM|PRINTER_CHANGE_SET_FORM|PRINTER_CHANGE_DELETE_FORM) ) #define PRINTER_CHANGE_PORT ( (PRINTER_CHANGE_ADD_PORT|PRINTER_CHANGE_CONFIGURE_PORT|PRINTER_CHANGE_DELETE_PORT) ) -#define PRINTER_CHANGE_PRINT_PROCESSOR ( (PRINTER_CHANGE_ADD_PRINT_PROCESSOR|PRINTER_CHANGE_DELETE_PRINT_PROCESSOR) ) +#define PRINTER_CHANGE_PRINT_PROCESSOR ( 0x07000000 ) #define PRINTER_CHANGE_PRINTER_DRIVER ( (PRINTER_CHANGE_ADD_PRINTER_DRIVER|PRINTER_CHANGE_SET_PRINTER_DRIVER|PRINTER_CHANGE_DELETE_PRINTER_DRIVER) ) -#define PRINTER_CHANGE_ALL ( (PRINTER_CHANGE_JOB|PRINTER_CHANGE_FORM|PRINTER_CHANGE_PORT|PRINTER_CHANGE_PRINT_PROCESSOR|PRINTER_CHANGE_PRINTER_DRIVER) ) +#define PRINTER_CHANGE_ALL ( (PRINTER_CHANGE_PRINTER|PRINTER_CHANGE_JOB|PRINTER_CHANGE_FORM|PRINTER_CHANGE_PORT|PRINTER_CHANGE_PRINT_PROCESSOR|PRINTER_CHANGE_PRINTER_DRIVER) ) #define SERVER_ALL_ACCESS ( SEC_STD_REQUIRED|SERVER_ACCESS_ADMINISTER|SERVER_ACCESS_ENUMERATE ) #define SERVER_READ ( SEC_STD_READ_CONTROL|SERVER_ACCESS_ENUMERATE ) #define SERVER_WRITE ( STANDARD_RIGHTS_WRITE_ACCESS|SERVER_ACCESS_ADMINISTER|SERVER_ACCESS_ENUMERATE ) @@ -369,6 +373,21 @@ struct spoolss_DevmodeContainer { struct spoolss_DeviceMode *devmode;/* [unique,subcontext_size(_ndr_size),subcontext(4)] */ }; +/* bitmap spoolss_JobStatus */ +#define JOB_STATUS_PAUSED ( 0x00000001 ) +#define JOB_STATUS_ERROR ( 0x00000002 ) +#define JOB_STATUS_DELETING ( 0x00000004 ) +#define JOB_STATUS_SPOOLING ( 0x00000008 ) +#define JOB_STATUS_PRINTING ( 0x00000010 ) +#define JOB_STATUS_OFFLINE ( 0x00000020 ) +#define JOB_STATUS_PAPEROUT ( 0x00000040 ) +#define JOB_STATUS_PRINTED ( 0x00000080 ) +#define JOB_STATUS_DELETED ( 0x00000100 ) +#define JOB_STATUS_BLOCKED_DEVQ ( 0x00000200 ) +#define JOB_STATUS_USER_INTERVENTION ( 0x00000400 ) +#define JOB_STATUS_RESTART ( 0x00000800 ) +#define JOB_STATUS_COMPLETE ( 0x00001000 ) + struct spoolss_JobInfo1 { uint32_t job_id; const char * printer_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ @@ -382,16 +401,154 @@ struct spoolss_JobInfo1 { uint32_t position; uint32_t total_pages; uint32_t pages_printed; - struct spoolss_Time time; + struct spoolss_Time submitted; +}; + +struct spoolss_JobInfo2 { + uint32_t job_id; + const char * printer_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * server_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * user_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * document_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * notify_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * data_type;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * print_processor;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * parameters;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * driver_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + struct spoolss_DeviceMode *devmode;/* [relative] */ + const char * text_status;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + struct security_descriptor *secdesc;/* [relative] */ + uint32_t status; + uint32_t priority; + uint32_t position; + uint32_t start_time; + uint32_t until_time; + uint32_t total_pages; + uint32_t size; + struct spoolss_Time submitted; + uint32_t time; + uint32_t pages_printed; +}; + +struct spoolss_JobInfo3 { + uint32_t job_id; + uint32_t next_job_id; + uint32_t reserved; +}; + +struct spoolss_JobInfo4 { + uint32_t job_id; + const char * printer_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * server_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * user_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * document_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * notify_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * data_type;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * print_processor;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * parameters;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * driver_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + struct spoolss_DeviceMode *devmode;/* [relative] */ + const char * text_status;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + struct security_descriptor *secdesc;/* [relative] */ + uint32_t status; + uint32_t priority; + uint32_t position; + uint32_t start_time; + uint32_t until_time; + uint32_t total_pages; + uint32_t size; + struct spoolss_Time submitted; + uint32_t time; + uint32_t pages_printed; + uint32_t size_high; }; union spoolss_JobInfo { struct spoolss_JobInfo1 info1;/* [case] */ + struct spoolss_JobInfo2 info2;/* [case(2)] */ + struct spoolss_JobInfo3 info3;/* [case(3)] */ + struct spoolss_JobInfo4 info4;/* [case(4)] */ }/* [relative_base,nodiscriminant,public] */; +struct spoolss_SetJobInfo1 { + uint32_t job_id; + const char *printer_name;/* [unique,charset(UTF16)] */ + const char *server_name;/* [unique,charset(UTF16)] */ + const char *user_name;/* [unique,charset(UTF16)] */ + const char *document_name;/* [unique,charset(UTF16)] */ + const char *data_type;/* [unique,charset(UTF16)] */ + const char *text_status;/* [unique,charset(UTF16)] */ + uint32_t status; + uint32_t priority; + uint32_t position; + uint32_t total_pages; + uint32_t pages_printed; + struct spoolss_Time submitted; +}; + +struct spoolss_SetJobInfo2 { + uint32_t job_id; + const char *printer_name;/* [unique,charset(UTF16)] */ + const char *server_name;/* [unique,charset(UTF16)] */ + const char *user_name;/* [unique,charset(UTF16)] */ + const char *document_name;/* [unique,charset(UTF16)] */ + const char *notify_name;/* [unique,charset(UTF16)] */ + const char *data_type;/* [unique,charset(UTF16)] */ + const char *print_processor;/* [unique,charset(UTF16)] */ + const char *parameters;/* [unique,charset(UTF16)] */ + const char *driver_name;/* [unique,charset(UTF16)] */ + struct spoolss_DeviceMode *devmode;/* [unique] */ + const char *text_status;/* [unique,charset(UTF16)] */ + struct security_descriptor *secdesc;/* [unique] */ + uint32_t status; + uint32_t priority; + uint32_t position; + uint32_t start_time; + uint32_t until_time; + uint32_t total_pages; + uint32_t size; + struct spoolss_Time submitted; + uint32_t time; + uint32_t pages_printed; +}; + +struct spoolss_SetJobInfo4 { + uint32_t job_id; + const char *printer_name;/* [unique,charset(UTF16)] */ + const char *server_name;/* [unique,charset(UTF16)] */ + const char *user_name;/* [unique,charset(UTF16)] */ + const char *document_name;/* [unique,charset(UTF16)] */ + const char *notify_name;/* [unique,charset(UTF16)] */ + const char *data_type;/* [unique,charset(UTF16)] */ + const char *print_processor;/* [unique,charset(UTF16)] */ + const char *parameters;/* [unique,charset(UTF16)] */ + const char *driver_name;/* [unique,charset(UTF16)] */ + struct spoolss_DeviceMode *devmode;/* [unique] */ + const char *text_status;/* [unique,charset(UTF16)] */ + struct security_descriptor *secdesc;/* [unique] */ + uint32_t status; + uint32_t priority; + uint32_t position; + uint32_t start_time; + uint32_t until_time; + uint32_t total_pages; + uint32_t size; + struct spoolss_Time submitted; + uint32_t time; + uint32_t pages_printed; + uint32_t size_high; +}; + +union spoolss_SetJobInfo { + struct spoolss_SetJobInfo1 *info1;/* [unique,case] */ + struct spoolss_SetJobInfo2 *info2;/* [unique,case(2)] */ + struct spoolss_JobInfo3 *info3;/* [unique,case(3)] */ + struct spoolss_SetJobInfo4 *info4;/* [unique,case(4)] */ +}/* [public] */; + struct spoolss_JobInfoContainer { uint32_t level; - union spoolss_JobInfo info;/* [switch_is(level)] */ + union spoolss_SetJobInfo info;/* [switch_is(level)] */ }; enum spoolss_JobControl @@ -403,7 +560,9 @@ enum spoolss_JobControl SPOOLSS_JOB_CONTROL_RESTART=4, SPOOLSS_JOB_CONTROL_DELETE=5, SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER=6, - SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED=7 + SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED=7, + SPOOLSS_JOB_CONTROL_RETAIN=8, + SPOOLSS_JOB_CONTROL_RELEASE=9 } #else { __donnot_use_enum_spoolss_JobControl=0x7FFFFFFF} @@ -414,6 +573,8 @@ enum spoolss_JobControl #define SPOOLSS_JOB_CONTROL_DELETE ( 5 ) #define SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER ( 6 ) #define SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED ( 7 ) +#define SPOOLSS_JOB_CONTROL_RETAIN ( 8 ) +#define SPOOLSS_JOB_CONTROL_RELEASE ( 9 ) #endif ; @@ -500,7 +661,7 @@ struct spoolss_SetPrinterInfo2 { }; struct spoolss_SetPrinterInfo3 { - struct security_descriptor *secdesc;/* [unique] */ + uint32_t sec_desc_ptr; }; struct spoolss_SetPrinterInfo4 { @@ -635,7 +796,7 @@ struct spoolss_AddDriverInfo6 { struct spoolss_StringArray *dependent_files;/* [unique] */ uint32_t _ndr_size_previous_names;/* [value(((ndr_size_spoolss_StringArray(previous_names,ndr->iconv_convenience,ndr->flags)-4)/2))] */ struct spoolss_StringArray *previous_names;/* [unique] */ - NTTIME driver_data; + NTTIME driver_date; uint64_t driver_version; const char *manufacturer_name;/* [unique,charset(UTF16)] */ const char *manufacturer_url;/* [unique,charset(UTF16)] */ @@ -657,7 +818,7 @@ struct spoolss_AddDriverInfo8 { struct spoolss_StringArray *dependent_files;/* [unique] */ uint32_t _ndr_size_previous_names;/* [value(((ndr_size_spoolss_StringArray(previous_names,ndr->iconv_convenience,ndr->flags)-4)/2))] */ struct spoolss_StringArray *previous_names;/* [unique] */ - NTTIME driver_data; + NTTIME driver_date; uint64_t driver_version; const char *manufacturer_name;/* [unique,charset(UTF16)] */ const char *manufacturer_url;/* [unique,charset(UTF16)] */ @@ -691,7 +852,7 @@ struct spoolss_AddDriverInfoCtr { struct spoolss_DriverInfo1 { const char * driver_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ -}; +}/* [gensize,public] */; struct spoolss_DriverInfo2 { enum spoolss_DriverOSVersion version; @@ -700,7 +861,7 @@ struct spoolss_DriverInfo2 { const char * driver_path;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * data_file;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * config_file;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ -}; +}/* [gensize,public] */; struct spoolss_DriverInfo3 { enum spoolss_DriverOSVersion version; @@ -713,7 +874,7 @@ struct spoolss_DriverInfo3 { const char ** dependent_files;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * monitor_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * default_datatype;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ -}; +}/* [gensize,public] */; struct spoolss_DriverInfo4 { enum spoolss_DriverOSVersion version; @@ -727,7 +888,7 @@ struct spoolss_DriverInfo4 { const char * monitor_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * default_datatype;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char ** previous_names;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ -}; +}/* [gensize,public] */; struct spoolss_DriverInfo5 { enum spoolss_DriverOSVersion version; @@ -739,7 +900,7 @@ struct spoolss_DriverInfo5 { uint32_t driver_attributes; uint32_t config_version; uint32_t driver_version; -}; +}/* [gensize,public] */; struct spoolss_DriverInfo6 { enum spoolss_DriverOSVersion version; @@ -753,13 +914,13 @@ struct spoolss_DriverInfo6 { const char * monitor_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * default_datatype;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char ** previous_names;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ - NTTIME driver_data; + NTTIME driver_date; uint64_t driver_version; const char * manufacturer_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * manufacturer_url;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * hardware_id;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * provider;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ -}; +}/* [gensize,public] */; struct spoolss_DriverInfo8 { enum spoolss_DriverOSVersion version; @@ -773,7 +934,7 @@ struct spoolss_DriverInfo8 { const char * default_datatype;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char ** dependent_files;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char ** previous_names;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ - NTTIME driver_data; + NTTIME driver_date; uint64_t driver_version; const char * manufacturer_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * manufacturer_url;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ @@ -787,7 +948,49 @@ struct spoolss_DriverInfo8 { const char ** core_driver_dependencies;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ NTTIME min_inbox_driver_ver_date; uint64_t min_inbox_driver_ver_version; -}; +}/* [gensize,public] */; + +enum spoolss_DriverFileType +#ifndef USE_UINT_ENUMS + { + SPOOLSS_DRIVER_FILE_TYPE_RENDERING=0x00000000, + SPOOLSS_DRIVER_FILE_TYPE_CONFIGURATION=0x00000001, + SPOOLSS_DRIVER_FILE_TYPE_DATA=0x00000002, + SPOOLSS_DRIVER_FILE_TYPE_HELP=0x00000003, + SPOOLSS_DRIVER_FILE_TYPE_OTHER=0x00000004 +} +#else + { __donnot_use_enum_spoolss_DriverFileType=0x7FFFFFFF} +#define SPOOLSS_DRIVER_FILE_TYPE_RENDERING ( 0x00000000 ) +#define SPOOLSS_DRIVER_FILE_TYPE_CONFIGURATION ( 0x00000001 ) +#define SPOOLSS_DRIVER_FILE_TYPE_DATA ( 0x00000002 ) +#define SPOOLSS_DRIVER_FILE_TYPE_HELP ( 0x00000003 ) +#define SPOOLSS_DRIVER_FILE_TYPE_OTHER ( 0x00000004 ) +#endif +; + +struct spoolss_DriverFileInfo { + const char * file_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + enum spoolss_DriverFileType file_type; + uint32_t file_version; +}/* [public] */; + +struct spoolss_DriverInfo101 { + enum spoolss_DriverOSVersion version; + const char * driver_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * architecture;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + struct spoolss_DriverFileInfo *file_info;/* [relative,size_is(file_count)] */ + uint32_t file_count; + const char * monitor_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * default_datatype;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char ** previous_names;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + NTTIME driver_date; + uint64_t driver_version; + const char * manufacturer_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * manufacturer_url;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * hardware_id;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + const char * provider;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ +}/* [gensize,nopush,public,nopull] */; union spoolss_DriverInfo { struct spoolss_DriverInfo1 info1;/* [case] */ @@ -797,6 +1000,7 @@ union spoolss_DriverInfo { struct spoolss_DriverInfo5 info5;/* [case(5)] */ struct spoolss_DriverInfo6 info6;/* [case(6)] */ struct spoolss_DriverInfo8 info8;/* [case(8)] */ + struct spoolss_DriverInfo101 info101;/* [case(101)] */ }/* [relative_base,nodiscriminant,public] */; struct spoolss_DriverDirectoryInfo1 { @@ -914,8 +1118,27 @@ struct spoolss_FormInfo1 { struct spoolss_FormArea area; }; +/* bitmap spoolss_FormStringType */ +#define SPOOLSS_FORM_STRING_TYPE_NONE ( 0x00000001 ) +#define SPOOLSS_FORM_STRING_TYPE_MUI_DLL ( 0x00000002 ) +#define SPOOLSS_FORM_STRING_TYPE_LANG_PAIR ( 0x00000004 ) + +struct spoolss_FormInfo2 { + enum spoolss_FormFlags flags; + const char * form_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + struct spoolss_FormSize size; + struct spoolss_FormArea area; + const char * keyword;/* [relative,flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] */ + uint32_t string_type; + const char * mui_dll;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + uint32_t ressource_id; + const char * display_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + uint32_t lang_id; +}; + union spoolss_FormInfo { struct spoolss_FormInfo1 info1;/* [case] */ + struct spoolss_FormInfo2 info2;/* [case(2)] */ }/* [relative_base,gensize,public,nodiscriminant] */; struct spoolss_AddFormInfo1 { @@ -925,8 +1148,22 @@ struct spoolss_AddFormInfo1 { struct spoolss_FormArea area; }; +struct spoolss_AddFormInfo2 { + enum spoolss_FormFlags flags; + const char *form_name;/* [unique,charset(UTF16)] */ + struct spoolss_FormSize size; + struct spoolss_FormArea area; + const char *keyword;/* [unique,charset(DOS)] */ + uint32_t string_type; + const char *mui_dll;/* [unique,charset(UTF16)] */ + uint32_t ressource_id; + const char *display_name;/* [unique,charset(UTF16)] */ + uint32_t lang_id; +}; + union spoolss_AddFormInfo { struct spoolss_AddFormInfo1 *info1;/* [unique,case] */ + struct spoolss_AddFormInfo2 *info2;/* [unique,case(2)] */ }/* [switch_type(uint32)] */; struct spoolss_PortInfo1 { @@ -947,9 +1184,72 @@ struct spoolss_PortInfo2 { uint32_t reserved; }; +enum spoolss_PortStatus +#ifndef USE_UINT_ENUMS + { + PORT_STATUS_CLEAR=0x00000000, + PORT_STATUS_OFFLINE=0x00000001, + PORT_STATUS_PAPER_JAM=0x00000002, + PORT_STATUS_PAPER_OUT=0x00000003, + PORT_STATUS_OUTPUT_BIN_FULL=0x00000004, + PORT_STATUS_PAPER_PROBLEM=0x00000005, + PORT_STATUS_NO_TONER=0x00000006, + PORT_STATUS_DOOR_OPEN=0x00000007, + PORT_STATUS_USER_INTERVENTION=0x00000008, + PORT_STATUS_OUT_OF_MEMORY=0x00000009, + PORT_STATUS_TONER_LOW=0x0000000A, + PORT_STATUS_WARMING_UP=0x0000000B, + PORT_STATUS_POWER_SAVE=0x0000000C +} +#else + { __donnot_use_enum_spoolss_PortStatus=0x7FFFFFFF} +#define PORT_STATUS_CLEAR ( 0x00000000 ) +#define PORT_STATUS_OFFLINE ( 0x00000001 ) +#define PORT_STATUS_PAPER_JAM ( 0x00000002 ) +#define PORT_STATUS_PAPER_OUT ( 0x00000003 ) +#define PORT_STATUS_OUTPUT_BIN_FULL ( 0x00000004 ) +#define PORT_STATUS_PAPER_PROBLEM ( 0x00000005 ) +#define PORT_STATUS_NO_TONER ( 0x00000006 ) +#define PORT_STATUS_DOOR_OPEN ( 0x00000007 ) +#define PORT_STATUS_USER_INTERVENTION ( 0x00000008 ) +#define PORT_STATUS_OUT_OF_MEMORY ( 0x00000009 ) +#define PORT_STATUS_TONER_LOW ( 0x0000000A ) +#define PORT_STATUS_WARMING_UP ( 0x0000000B ) +#define PORT_STATUS_POWER_SAVE ( 0x0000000C ) +#endif +; + +enum spoolss_PortSeverity +#ifndef USE_UINT_ENUMS + { + PORT_STATUS_TYPE_ERROR=0x00000001, + PORT_STATUS_TYPE_WARNING=0x00000002, + PORT_STATUS_TYPE_INFO=0x00000003 +} +#else + { __donnot_use_enum_spoolss_PortSeverity=0x7FFFFFFF} +#define PORT_STATUS_TYPE_ERROR ( 0x00000001 ) +#define PORT_STATUS_TYPE_WARNING ( 0x00000002 ) +#define PORT_STATUS_TYPE_INFO ( 0x00000003 ) +#endif +; + +struct spoolss_PortInfo3 { + enum spoolss_PortStatus status; + const char * status_string;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + enum spoolss_PortSeverity severity; +}; + +struct spoolss_PortInfoFF { + const char * port_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + DATA_BLOB monitor_data; +}; + union spoolss_PortInfo { struct spoolss_PortInfo1 info1;/* [case] */ struct spoolss_PortInfo2 info2;/* [case(2)] */ + struct spoolss_PortInfo3 info3;/* [case(3)] */ + struct spoolss_PortInfoFF infoFF;/* [case(0xff)] */ }/* [relative_base,nodiscriminant,public] */; struct spoolss_MonitorInfo1 { @@ -984,6 +1284,7 @@ union spoolss_MonitorInfo { #define PRINTER_CHANGE_DELETE_PORT ( 0x00400000 ) #define PRINTER_CHANGE_ADD_PRINT_PROCESSOR ( 0x01000000 ) #define PRINTER_CHANGE_DELETE_PRINT_PROCESSOR ( 0x04000000 ) +#define PRINTER_CHANGE_SERVER ( 0x08000000 ) #define PRINTER_CHANGE_ADD_PRINTER_DRIVER ( 0x10000000 ) #define PRINTER_CHANGE_SET_PRINTER_DRIVER ( 0x20000000 ) #define PRINTER_CHANGE_DELETE_PRINTER_DRIVER ( 0x40000000 ) @@ -1072,6 +1373,9 @@ struct spoolss_NotifyOptionType { enum spoolss_Field *fields;/* [unique,size_is(count)] */ }; +/* bitmap spoolssNotifyOptionFlags */ +#define PRINTER_NOTIFY_OPTIONS_REFRESH ( 0x00000001 ) + struct spoolss_NotifyOption { uint32_t version;/* [value(2)] */ uint32_t flags; @@ -1106,7 +1410,7 @@ enum spoolss_NotifyTable union spoolss_NotifyData { uint32_t integer[2];/* [case] */ struct spoolss_NotifyString string;/* [case(2)] */ - struct spoolss_DeviceMode *devmode;/* [unique,case(3)] */ + struct spoolss_DevmodeContainer devmode;/* [case(3)] */ struct spoolss_TimeCtr time;/* [case(4)] */ struct sec_desc_buf sd;/* [case(5)] */ }/* [switch_type(uint32)] */; @@ -1179,6 +1483,7 @@ struct spoolss_UserLevelCtr { #define PRINTER_ACCESS_ADMINISTER ( 0x00000004 ) #define PRINTER_ACCESS_USE ( 0x00000008 ) #define JOB_ACCESS_ADMINISTER ( 0x00000010 ) +#define JOB_ACCESS_READ ( 0x00000020 ) /* bitmap spoolss_DeleteDriverFlags */ #define DPD_DELETE_UNUSED_FILES ( 0x00000001 ) @@ -2235,7 +2540,7 @@ struct spoolss_GetPrinterDriver2 { } in; struct { - DATA_BLOB *info;/* [unique] */ + union spoolss_DriverInfo *info;/* [unique,subcontext_size(offered),subcontext(4),switch_is(level)] */ uint32_t *needed;/* [ref] */ uint32_t *server_major_version;/* [ref] */ uint32_t *server_minor_version;/* [ref] */ diff --git a/librpc/gen_ndr/srv_eventlog.c b/librpc/gen_ndr/srv_eventlog.c index 795afc9a5a..2cab792adf 100644 --- a/librpc/gen_ndr/srv_eventlog.c +++ b/librpc/gen_ndr/srv_eventlog.c @@ -1673,18 +1673,18 @@ static bool api_eventlog_WriteClusterEvents(pipes_struct *p) return true; } -static bool api_eventlog_GetLogIntormation(pipes_struct *p) +static bool api_eventlog_GetLogInformation(pipes_struct *p) { const struct ndr_interface_call *call; struct ndr_pull *pull; struct ndr_push *push; enum ndr_err_code ndr_err; DATA_BLOB blob; - struct eventlog_GetLogIntormation *r; + struct eventlog_GetLogInformation *r; - call = &ndr_table_eventlog.calls[NDR_EVENTLOG_GETLOGINTORMATION]; + call = &ndr_table_eventlog.calls[NDR_EVENTLOG_GETLOGINFORMATION]; - r = talloc(talloc_tos(), struct eventlog_GetLogIntormation); + r = talloc(talloc_tos(), struct eventlog_GetLogInformation); if (r == NULL) { return false; } @@ -1708,7 +1708,7 @@ static bool api_eventlog_GetLogIntormation(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_IN_DEBUG(eventlog_GetLogIntormation, r); + NDR_PRINT_IN_DEBUG(eventlog_GetLogInformation, r); } ZERO_STRUCT(r->out); @@ -1724,7 +1724,7 @@ static bool api_eventlog_GetLogIntormation(pipes_struct *p) return false; } - r->out.result = _eventlog_GetLogIntormation(p, r); + r->out.result = _eventlog_GetLogInformation(p, r); if (p->rng_fault_state) { talloc_free(r); @@ -1733,7 +1733,7 @@ static bool api_eventlog_GetLogIntormation(pipes_struct *p) } if (DEBUGLEVEL >= 10) { - NDR_PRINT_OUT_DEBUG(eventlog_GetLogIntormation, r); + NDR_PRINT_OUT_DEBUG(eventlog_GetLogInformation, r); } push = ndr_push_init_ctx(r, NULL); @@ -1934,7 +1934,7 @@ static struct api_struct api_eventlog_cmds[] = {"EVENTLOG_REGISTERCLUSTERSVC", NDR_EVENTLOG_REGISTERCLUSTERSVC, api_eventlog_RegisterClusterSvc}, {"EVENTLOG_DEREGISTERCLUSTERSVC", NDR_EVENTLOG_DEREGISTERCLUSTERSVC, api_eventlog_DeregisterClusterSvc}, {"EVENTLOG_WRITECLUSTEREVENTS", NDR_EVENTLOG_WRITECLUSTEREVENTS, api_eventlog_WriteClusterEvents}, - {"EVENTLOG_GETLOGINTORMATION", NDR_EVENTLOG_GETLOGINTORMATION, api_eventlog_GetLogIntormation}, + {"EVENTLOG_GETLOGINFORMATION", NDR_EVENTLOG_GETLOGINFORMATION, api_eventlog_GetLogInformation}, {"EVENTLOG_FLUSHEVENTLOG", NDR_EVENTLOG_FLUSHEVENTLOG, api_eventlog_FlushEventLog}, {"EVENTLOG_REPORTEVENTANDSOURCEW", NDR_EVENTLOG_REPORTEVENTANDSOURCEW, api_eventlog_ReportEventAndSourceW}, }; @@ -2138,8 +2138,8 @@ NTSTATUS rpc_eventlog_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, return NT_STATUS_OK; } - case NDR_EVENTLOG_GETLOGINTORMATION: { - struct eventlog_GetLogIntormation *r = (struct eventlog_GetLogIntormation *)_r; + case NDR_EVENTLOG_GETLOGINFORMATION: { + struct eventlog_GetLogInformation *r = (struct eventlog_GetLogInformation *)_r; ZERO_STRUCT(r->out); r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.buf_size); if (r->out.buffer == NULL) { @@ -2151,7 +2151,7 @@ NTSTATUS rpc_eventlog_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - r->out.result = _eventlog_GetLogIntormation(cli->pipes_struct, r); + r->out.result = _eventlog_GetLogInformation(cli->pipes_struct, r); return NT_STATUS_OK; } diff --git a/librpc/gen_ndr/srv_eventlog.h b/librpc/gen_ndr/srv_eventlog.h index 11d6886a24..7da7cddbd2 100644 --- a/librpc/gen_ndr/srv_eventlog.h +++ b/librpc/gen_ndr/srv_eventlog.h @@ -23,7 +23,7 @@ NTSTATUS _eventlog_ReportEventA(pipes_struct *p, struct eventlog_ReportEventA *r NTSTATUS _eventlog_RegisterClusterSvc(pipes_struct *p, struct eventlog_RegisterClusterSvc *r); NTSTATUS _eventlog_DeregisterClusterSvc(pipes_struct *p, struct eventlog_DeregisterClusterSvc *r); NTSTATUS _eventlog_WriteClusterEvents(pipes_struct *p, struct eventlog_WriteClusterEvents *r); -NTSTATUS _eventlog_GetLogIntormation(pipes_struct *p, struct eventlog_GetLogIntormation *r); +NTSTATUS _eventlog_GetLogInformation(pipes_struct *p, struct eventlog_GetLogInformation *r); NTSTATUS _eventlog_FlushEventLog(pipes_struct *p, struct eventlog_FlushEventLog *r); NTSTATUS _eventlog_ReportEventAndSourceW(pipes_struct *p, struct eventlog_ReportEventAndSourceW *r); void eventlog_get_pipe_fns(struct api_struct **fns, int *n_fns); @@ -50,7 +50,7 @@ NTSTATUS _eventlog_ReportEventA(pipes_struct *p, struct eventlog_ReportEventA *r NTSTATUS _eventlog_RegisterClusterSvc(pipes_struct *p, struct eventlog_RegisterClusterSvc *r); NTSTATUS _eventlog_DeregisterClusterSvc(pipes_struct *p, struct eventlog_DeregisterClusterSvc *r); NTSTATUS _eventlog_WriteClusterEvents(pipes_struct *p, struct eventlog_WriteClusterEvents *r); -NTSTATUS _eventlog_GetLogIntormation(pipes_struct *p, struct eventlog_GetLogIntormation *r); +NTSTATUS _eventlog_GetLogInformation(pipes_struct *p, struct eventlog_GetLogInformation *r); NTSTATUS _eventlog_FlushEventLog(pipes_struct *p, struct eventlog_FlushEventLog *r); NTSTATUS _eventlog_ReportEventAndSourceW(pipes_struct *p, struct eventlog_ReportEventAndSourceW *r); NTSTATUS rpc_eventlog_init(void); diff --git a/librpc/gen_ndr/srv_spoolss.c b/librpc/gen_ndr/srv_spoolss.c index f6c17cb1fa..891be85376 100644 --- a/librpc/gen_ndr/srv_spoolss.c +++ b/librpc/gen_ndr/srv_spoolss.c @@ -4169,7 +4169,7 @@ static bool api_spoolss_GetPrinterDriver2(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.info = talloc_zero(r, DATA_BLOB); + r->out.info = talloc_zero(r, union spoolss_DriverInfo); if (r->out.info == NULL) { talloc_free(r); return false; @@ -8080,7 +8080,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, case NDR_SPOOLSS_GETPRINTERDRIVER2: { struct spoolss_GetPrinterDriver2 *r = (struct spoolss_GetPrinterDriver2 *)_r; ZERO_STRUCT(r->out); - r->out.info = talloc_zero(mem_ctx, DATA_BLOB); + r->out.info = talloc_zero(mem_ctx, union spoolss_DriverInfo); if (r->out.info == NULL) { return NT_STATUS_NO_MEMORY; } diff --git a/librpc/gen_ndr/srvsvc.h b/librpc/gen_ndr/srvsvc.h index 6467f72a5b..4a8fd051f6 100644 --- a/librpc/gen_ndr/srvsvc.h +++ b/librpc/gen_ndr/srvsvc.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #include "librpc/gen_ndr/security.h" #include "librpc/gen_ndr/svcctl.h" #ifndef _HEADER_srvsvc diff --git a/librpc/gen_ndr/svcctl.h b/librpc/gen_ndr/svcctl.h index 328d8ab517..6ba0e4f378 100644 --- a/librpc/gen_ndr/svcctl.h +++ b/librpc/gen_ndr/svcctl.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #include "librpc/gen_ndr/misc.h" #include "librpc/gen_ndr/security.h" #ifndef _HEADER_svcctl diff --git a/librpc/gen_ndr/winreg.h b/librpc/gen_ndr/winreg.h index 79cf33e769..e0300fd0e7 100644 --- a/librpc/gen_ndr/winreg.h +++ b/librpc/gen_ndr/winreg.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #include "librpc/gen_ndr/lsa.h" #include "librpc/gen_ndr/security.h" #ifndef _HEADER_winreg diff --git a/librpc/gen_ndr/wkssvc.h b/librpc/gen_ndr/wkssvc.h index dc12fe2a3f..19aa126322 100644 --- a/librpc/gen_ndr/wkssvc.h +++ b/librpc/gen_ndr/wkssvc.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #include "librpc/gen_ndr/srvsvc.h" #include "librpc/gen_ndr/lsa.h" #ifndef _HEADER_wkssvc diff --git a/librpc/gen_ndr/xattr.h b/librpc/gen_ndr/xattr.h index 1148a0acec..1ce58f7ec6 100644 --- a/librpc/gen_ndr/xattr.h +++ b/librpc/gen_ndr/xattr.h @@ -2,6 +2,8 @@ #include <stdint.h> +#include "libcli/util/ntstatus.h" + #include "librpc/gen_ndr/security.h" #ifndef _HEADER_xattr #define _HEADER_xattr diff --git a/librpc/idl/eventlog.idl b/librpc/idl/eventlog.idl index c7524f3c38..6b46acec7d 100644 --- a/librpc/idl/eventlog.idl +++ b/librpc/idl/eventlog.idl @@ -31,32 +31,6 @@ import "lsa.idl", "security.idl"; uint16 unknown0; uint16 unknown1; } eventlog_OpenUnknown0; - - typedef [flag(NDR_NOALIGN),public] struct { - uint32 size; - [charset(DOS),value("eLfL")] uint8 reserved[4]; - uint32 record_number; - time_t time_generated; - time_t time_written; - uint32 event_id; - eventlogEventTypes event_type; - [range(0,256)] uint16 num_of_strings; - uint16 event_category; - uint16 reserved_flags; - uint32 closing_record_number; - uint32 stringoffset; - [value(ndr_size_dom_sid0(&sid, ndr->flags))] uint32 sid_size; - uint32 sid_offset; - uint32 data_length; - uint32 data_offset; - nstring source_name; - nstring computer_name; - [subcontext(0),subcontext_size(sid_size)] dom_sid0 sid; - nstring strings[num_of_strings]; - astring raw_data; - [flag(NDR_ALIGN4)] DATA_BLOB _padding; - [value(size)] uint32 size2; - } eventlog_Record; /* compat structure for samba3 on-disc eventlog format, this is *NOT* used on the wire. - gd */ @@ -314,7 +288,7 @@ import "lsa.idl", "security.idl"; boolean32 full; } EVENTLOG_FULL_INFORMATION; - NTSTATUS eventlog_GetLogIntormation( + NTSTATUS eventlog_GetLogInformation( [in] policy_handle *handle, [in] uint32 level, [out,ref] [size_is(buf_size)] uint8 *buffer, diff --git a/librpc/idl/spoolss.idl b/librpc/idl/spoolss.idl index 4bb68fac00..f2944b0f39 100644 --- a/librpc/idl/spoolss.idl +++ b/librpc/idl/spoolss.idl @@ -378,6 +378,27 @@ import "misc.idl", "security.idl", "winreg.idl"; /******************/ /* Function: 0x02 */ + + /* JOB status codes. */ + + const int JOB_STATUS_QUEUED = 0x0000; + + typedef [bitmap32bit] bitmap { + JOB_STATUS_PAUSED = 0x00000001, + JOB_STATUS_ERROR = 0x00000002, + JOB_STATUS_DELETING = 0x00000004, + JOB_STATUS_SPOOLING = 0x00000008, + JOB_STATUS_PRINTING = 0x00000010, + JOB_STATUS_OFFLINE = 0x00000020, + JOB_STATUS_PAPEROUT = 0x00000040, + JOB_STATUS_PRINTED = 0x00000080, + JOB_STATUS_DELETED = 0x00000100, + JOB_STATUS_BLOCKED_DEVQ = 0x00000200, + JOB_STATUS_USER_INTERVENTION = 0x00000400, + JOB_STATUS_RESTART = 0x00000800, + JOB_STATUS_COMPLETE = 0x00001000 + } spoolss_JobStatus; + typedef struct { uint32 job_id; [relative] nstring *printer_name; @@ -386,24 +407,161 @@ import "misc.idl", "security.idl", "winreg.idl"; [relative] nstring *document_name; [relative] nstring *data_type; [relative] nstring *text_status; - uint32 status; + spoolss_JobStatus status; uint32 priority; uint32 position; uint32 total_pages; uint32 pages_printed; - spoolss_Time time; + spoolss_Time submitted; } spoolss_JobInfo1; + typedef struct { + uint32 job_id; + [relative] nstring *printer_name; + [relative] nstring *server_name; + [relative] nstring *user_name; + [relative] nstring *document_name; + [relative] nstring *notify_name; + [relative] nstring *data_type; + [relative] nstring *print_processor; + [relative] nstring *parameters; + [relative] nstring *driver_name; + [relative] spoolss_DeviceMode *devmode; + [relative] nstring *text_status; + [relative] security_descriptor *secdesc; + spoolss_JobStatus status; + uint32 priority; + uint32 position; + uint32 start_time; + uint32 until_time; + uint32 total_pages; + uint32 size; + spoolss_Time submitted; + uint32 time; + uint32 pages_printed; + } spoolss_JobInfo2; + + typedef struct { + uint32 job_id; + uint32 next_job_id; + uint32 reserved; + } spoolss_JobInfo3; + + typedef struct { + uint32 job_id; + [relative] nstring *printer_name; + [relative] nstring *server_name; + [relative] nstring *user_name; + [relative] nstring *document_name; + [relative] nstring *notify_name; + [relative] nstring *data_type; + [relative] nstring *print_processor; + [relative] nstring *parameters; + [relative] nstring *driver_name; + [relative] spoolss_DeviceMode *devmode; + [relative] nstring *text_status; + [relative] security_descriptor *secdesc; + spoolss_JobStatus status; + uint32 priority; + uint32 position; + uint32 start_time; + uint32 until_time; + uint32 total_pages; + uint32 size; + spoolss_Time submitted; + uint32 time; + uint32 pages_printed; + uint32 size_high; + } spoolss_JobInfo4; + typedef [nodiscriminant,relative_base,public] union { [case(1)] spoolss_JobInfo1 info1; - [case(2)]; /* TODO */ - [case(3)]; /* TODO */ + [case(2)] spoolss_JobInfo2 info2; + [case(3)] spoolss_JobInfo3 info3; + [case(4)] spoolss_JobInfo4 info4; [default]; } spoolss_JobInfo; typedef struct { + uint32 job_id; + [string,charset(UTF16)] uint16 *printer_name; + [string,charset(UTF16)] uint16 *server_name; + [string,charset(UTF16)] uint16 *user_name; + [string,charset(UTF16)] uint16 *document_name; + [string,charset(UTF16)] uint16 *data_type; + [string,charset(UTF16)] uint16 *text_status; + spoolss_JobStatus status; + uint32 priority; + uint32 position; + uint32 total_pages; + uint32 pages_printed; + spoolss_Time submitted; + } spoolss_SetJobInfo1; + + typedef struct { + uint32 job_id; + [string,charset(UTF16)] uint16 *printer_name; + [string,charset(UTF16)] uint16 *server_name; + [string,charset(UTF16)] uint16 *user_name; + [string,charset(UTF16)] uint16 *document_name; + [string,charset(UTF16)] uint16 *notify_name; + [string,charset(UTF16)] uint16 *data_type; + [string,charset(UTF16)] uint16 *print_processor; + [string,charset(UTF16)] uint16 *parameters; + [string,charset(UTF16)] uint16 *driver_name; + spoolss_DeviceMode *devmode; + [string,charset(UTF16)] uint16 *text_status; + security_descriptor *secdesc; + spoolss_JobStatus status; + uint32 priority; + uint32 position; + uint32 start_time; + uint32 until_time; + uint32 total_pages; + uint32 size; + spoolss_Time submitted; + uint32 time; + uint32 pages_printed; + } spoolss_SetJobInfo2; + + typedef struct { + uint32 job_id; + [string,charset(UTF16)] uint16 *printer_name; + [string,charset(UTF16)] uint16 *server_name; + [string,charset(UTF16)] uint16 *user_name; + [string,charset(UTF16)] uint16 *document_name; + [string,charset(UTF16)] uint16 *notify_name; + [string,charset(UTF16)] uint16 *data_type; + [string,charset(UTF16)] uint16 *print_processor; + [string,charset(UTF16)] uint16 *parameters; + [string,charset(UTF16)] uint16 *driver_name; + spoolss_DeviceMode *devmode; + [string,charset(UTF16)] uint16 *text_status; + security_descriptor *secdesc; + spoolss_JobStatus status; + uint32 priority; + uint32 position; + uint32 start_time; + uint32 until_time; + uint32 total_pages; + uint32 size; + spoolss_Time submitted; + uint32 time; + uint32 pages_printed; + uint32 size_high; + } spoolss_SetJobInfo4; + + typedef [public] union { + [case(1)] spoolss_SetJobInfo1 *info1; + [case(2)] spoolss_SetJobInfo2 *info2; + [case(3)] spoolss_JobInfo3 *info3; + [case(4)] spoolss_SetJobInfo4 *info4; + [default]; + } spoolss_SetJobInfo; + + typedef struct { uint32 level; - [switch_is(level)] spoolss_JobInfo info; + [switch_is(level)] spoolss_SetJobInfo info; } spoolss_JobInfoContainer; typedef [v1_enum] enum { @@ -413,7 +571,9 @@ import "misc.idl", "security.idl", "winreg.idl"; SPOOLSS_JOB_CONTROL_RESTART = 4, SPOOLSS_JOB_CONTROL_DELETE = 5, SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER = 6, - SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED = 7 + SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED = 7, + SPOOLSS_JOB_CONTROL_RETAIN = 8, + SPOOLSS_JOB_CONTROL_RELEASE = 9 } spoolss_JobControl; WERROR spoolss_SetJob( @@ -552,7 +712,7 @@ import "misc.idl", "security.idl", "winreg.idl"; } spoolss_SetPrinterInfo2; typedef struct { - security_descriptor *secdesc; + uint32 sec_desc_ptr; } spoolss_SetPrinterInfo3; typedef struct { @@ -628,7 +788,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [string,charset(UTF16)] uint16 *driver_name; } spoolss_AddDriverInfo1; - typedef [v1_enum] enum { + typedef [v1_enum,public] enum { SPOOLSS_DRIVER_VERSION_9X = 0, SPOOLSS_DRIVER_VERSION_NT35 = 1, SPOOLSS_DRIVER_VERSION_NT4 = 2, @@ -700,7 +860,7 @@ import "misc.idl", "security.idl", "winreg.idl"; spoolss_StringArray *dependent_files; [value(((ndr_size_spoolss_StringArray(previous_names, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names; spoolss_StringArray *previous_names; - NTTIME driver_data; + NTTIME driver_date; hyper driver_version; [string,charset(UTF16)] uint16 *manufacturer_name; [string,charset(UTF16)] uint16 *manufacturer_url; @@ -722,7 +882,7 @@ import "misc.idl", "security.idl", "winreg.idl"; spoolss_StringArray *dependent_files; [value(((ndr_size_spoolss_StringArray(previous_names, ndr->iconv_convenience, ndr->flags)-4)/2))] uint32 _ndr_size_previous_names; spoolss_StringArray *previous_names; - NTTIME driver_data; + NTTIME driver_date; hyper driver_version; [string,charset(UTF16)] uint16 *manufacturer_name; [string,charset(UTF16)] uint16 *manufacturer_url; @@ -759,11 +919,11 @@ import "misc.idl", "security.idl", "winreg.idl"; [in,ref] spoolss_AddDriverInfoCtr *info_ctr ); - typedef struct { + typedef [public,gensize] struct { [relative] nstring *driver_name; } spoolss_DriverInfo1; - typedef struct { + typedef [public,gensize] struct { spoolss_DriverOSVersion version; [relative] nstring *driver_name; [relative] nstring *architecture; @@ -772,7 +932,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [relative] nstring *config_file; } spoolss_DriverInfo2; - typedef struct { + typedef [public,gensize] struct { spoolss_DriverOSVersion version; [relative] nstring *driver_name; [relative] nstring *architecture; @@ -785,7 +945,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [relative] nstring *default_datatype; } spoolss_DriverInfo3; - typedef struct { + typedef [public,gensize] struct { spoolss_DriverOSVersion version; [relative] nstring *driver_name; [relative] nstring *architecture; @@ -799,7 +959,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [relative] nstring_array *previous_names; } spoolss_DriverInfo4; - typedef struct { + typedef [public,gensize] struct { spoolss_DriverOSVersion version; [relative] nstring *driver_name; [relative] nstring *architecture; @@ -811,7 +971,7 @@ import "misc.idl", "security.idl", "winreg.idl"; uint32 driver_version; } spoolss_DriverInfo5; - typedef struct { + typedef [public,gensize] struct { spoolss_DriverOSVersion version; [relative] nstring *driver_name; [relative] nstring *architecture; @@ -823,7 +983,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [relative] nstring *monitor_name; [relative] nstring *default_datatype; [relative] nstring_array *previous_names; - NTTIME driver_data; + NTTIME driver_date; hyper driver_version; [relative] nstring *manufacturer_name; [relative] nstring *manufacturer_url; @@ -831,7 +991,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [relative] nstring *provider; } spoolss_DriverInfo6; - typedef struct { + typedef [public,gensize] struct { spoolss_DriverOSVersion version; [relative] nstring *driver_name; [relative] nstring *architecture; @@ -843,7 +1003,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [relative] nstring *default_datatype; [relative] nstring_array *dependent_files; [relative] nstring_array *previous_names; - NTTIME driver_data; + NTTIME driver_date; hyper driver_version; [relative] nstring *manufacturer_name; [relative] nstring *manufacturer_url; @@ -859,6 +1019,37 @@ import "misc.idl", "security.idl", "winreg.idl"; hyper min_inbox_driver_ver_version; } spoolss_DriverInfo8; + typedef [v1_enum] enum { + SPOOLSS_DRIVER_FILE_TYPE_RENDERING = 0x00000000, + SPOOLSS_DRIVER_FILE_TYPE_CONFIGURATION = 0x00000001, + SPOOLSS_DRIVER_FILE_TYPE_DATA = 0x00000002, + SPOOLSS_DRIVER_FILE_TYPE_HELP = 0x00000003, + SPOOLSS_DRIVER_FILE_TYPE_OTHER = 0x00000004 + } spoolss_DriverFileType; + + typedef [public] struct { + [relative] nstring *file_name; + spoolss_DriverFileType file_type; + uint32 file_version; + } spoolss_DriverFileInfo; + + typedef [public,gensize,nopush,nopull] struct { + spoolss_DriverOSVersion version; + [relative] nstring *driver_name; + [relative] nstring *architecture; + [relative] [size_is(file_count)] spoolss_DriverFileInfo *file_info; + uint32 file_count; + [relative] nstring *monitor_name; + [relative] nstring *default_datatype; + [relative] nstring_array *previous_names; + NTTIME driver_date; + hyper driver_version; + [relative] nstring *manufacturer_name; + [relative] nstring *manufacturer_url; + [relative] nstring *hardware_id; + [relative] nstring *provider; + } spoolss_DriverInfo101; + typedef [nodiscriminant,relative_base,public] union { [case(1)] spoolss_DriverInfo1 info1; [case(2)] spoolss_DriverInfo2 info2; @@ -867,6 +1058,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [case(5)] spoolss_DriverInfo5 info5; [case(6)] spoolss_DriverInfo6 info6; [case(8)] spoolss_DriverInfo8 info8; + [case(101)] spoolss_DriverInfo101 info101; [default]; } spoolss_DriverInfo; @@ -989,7 +1181,7 @@ import "misc.idl", "security.idl", "winreg.idl"; typedef [nodiscriminant,relative_base,gensize,public] union { [case(1)] spoolss_PrintProcessorDirectoryInfo1 info1; - [default]; + [default] spoolss_PrintProcessorDirectoryInfo1 info1; } spoolss_PrintProcessorDirectoryInfo; WERROR spoolss_GetPrintProcessorDirectory( @@ -1086,6 +1278,7 @@ import "misc.idl", "security.idl", "winreg.idl"; /******************/ /* Function: 0x1a */ const string SPOOLSS_ARCHITECTURE_NT_X86 = "Windows NT x86"; + const string SPOOLSS_DEFAULT_SERVER_PATH = "C:\\WINDOWS\\system32\\spool"; typedef [public,gensize] struct { [value(ndr_size_spoolss_OSVersion(r,ndr->iconv_convenience,ndr->flags))] uint32 _ndr_size; @@ -1204,8 +1397,28 @@ import "misc.idl", "security.idl", "winreg.idl"; spoolss_FormArea area; } spoolss_FormInfo1; + typedef [bitmap32bit] bitmap { + SPOOLSS_FORM_STRING_TYPE_NONE = 0x00000001, + SPOOLSS_FORM_STRING_TYPE_MUI_DLL = 0x00000002, + SPOOLSS_FORM_STRING_TYPE_LANG_PAIR = 0x00000004 + } spoolss_FormStringType; + + typedef struct { + spoolss_FormFlags flags; + [relative] nstring *form_name; + spoolss_FormSize size; + spoolss_FormArea area; + [relative] astring *keyword; + spoolss_FormStringType string_type; + [relative] nstring *mui_dll; + uint32 ressource_id; + [relative] nstring *display_name; + uint32 lang_id; + } spoolss_FormInfo2; + typedef [nodiscriminant,relative_base,public,gensize] union { [case(1)] spoolss_FormInfo1 info1; + [case(2)] spoolss_FormInfo2 info2; [default]; } spoolss_FormInfo; @@ -1216,8 +1429,22 @@ import "misc.idl", "security.idl", "winreg.idl"; spoolss_FormArea area; } spoolss_AddFormInfo1; + typedef struct { + spoolss_FormFlags flags; + [string,charset(UTF16)] uint16 *form_name; + spoolss_FormSize size; + spoolss_FormArea area; + [string,charset(DOS)] uint8 *keyword; + spoolss_FormStringType string_type; + [string,charset(UTF16)] uint16 *mui_dll; + uint32 ressource_id; + [string,charset(UTF16)] uint16 *display_name; + uint32 lang_id; + } spoolss_AddFormInfo2; + typedef [switch_type(uint32)] union { [case(1)] spoolss_AddFormInfo1 *info1; + [case(2)] spoolss_AddFormInfo2 *info2; } spoolss_AddFormInfo; WERROR spoolss_AddForm( @@ -1299,10 +1526,44 @@ import "misc.idl", "security.idl", "winreg.idl"; uint32 reserved; } spoolss_PortInfo2; + typedef [v1_enum] enum { + PORT_STATUS_CLEAR = 0x00000000, + PORT_STATUS_OFFLINE = 0x00000001, + PORT_STATUS_PAPER_JAM = 0x00000002, + PORT_STATUS_PAPER_OUT = 0x00000003, + PORT_STATUS_OUTPUT_BIN_FULL = 0x00000004, + PORT_STATUS_PAPER_PROBLEM = 0x00000005, + PORT_STATUS_NO_TONER = 0x00000006, + PORT_STATUS_DOOR_OPEN = 0x00000007, + PORT_STATUS_USER_INTERVENTION = 0x00000008, + PORT_STATUS_OUT_OF_MEMORY = 0x00000009, + PORT_STATUS_TONER_LOW = 0x0000000A, + PORT_STATUS_WARMING_UP = 0x0000000B, + PORT_STATUS_POWER_SAVE = 0x0000000C + } spoolss_PortStatus; + + typedef [v1_enum] enum { + PORT_STATUS_TYPE_ERROR = 0x00000001, + PORT_STATUS_TYPE_WARNING = 0x00000002, + PORT_STATUS_TYPE_INFO = 0x00000003 + } spoolss_PortSeverity; + + typedef struct { + spoolss_PortStatus status; + [relative] nstring *status_string; + spoolss_PortSeverity severity; + } spoolss_PortInfo3; + + typedef struct { + [relative] nstring *port_name; + DATA_BLOB monitor_data; /* relative ?? */ + } spoolss_PortInfoFF; + typedef [nodiscriminant,relative_base,public] union { [case(1)] spoolss_PortInfo1 info1; [case(2)] spoolss_PortInfo2 info2; - [case(3)]; /* TODO */ + [case(3)] spoolss_PortInfo3 info3; + [case(0xff)] spoolss_PortInfoFF infoFF; [default]; } spoolss_PortInfo; @@ -1472,7 +1733,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [in] uint32 offered, [in] uint32 client_major_version, [in] uint32 client_minor_version, - [out,unique] DATA_BLOB *info, + [out,unique,subcontext(4),subcontext_size(offered),switch_is(level)] spoolss_DriverInfo *info, [out,ref] uint32 *needed, [out,ref] uint32 *server_major_version, [out,ref] uint32 *server_minor_version @@ -1530,21 +1791,16 @@ import "misc.idl", "security.idl", "winreg.idl"; PRINTER_CHANGE_DELETE_PORT = 0x00400000, PRINTER_CHANGE_ADD_PRINT_PROCESSOR = 0x01000000, PRINTER_CHANGE_DELETE_PRINT_PROCESSOR = 0x04000000, + PRINTER_CHANGE_SERVER = 0x08000000, PRINTER_CHANGE_ADD_PRINTER_DRIVER = 0x10000000, PRINTER_CHANGE_SET_PRINTER_DRIVER = 0x20000000, PRINTER_CHANGE_DELETE_PRINTER_DRIVER = 0x40000000, PRINTER_CHANGE_TIMEOUT = 0x80000000 } spoolss_PrinterChangeFlags; - const int PRINTER_CHANGE_PRINTER = (PRINTER_CHANGE_ADD_PRINTER | - PRINTER_CHANGE_SET_PRINTER | - PRINTER_CHANGE_DELETE_PRINTER | - PRINTER_CHANGE_FAILED_CONNECTION_PRINTER); /* 0x000000FF */ + const int PRINTER_CHANGE_PRINTER = 0x000000FF; - const int PRINTER_CHANGE_JOB = (PRINTER_CHANGE_ADD_JOB | - PRINTER_CHANGE_SET_JOB | - PRINTER_CHANGE_DELETE_JOB | - PRINTER_CHANGE_WRITE_JOB); /* 0x0000FF00 */ + const int PRINTER_CHANGE_JOB = 0x0000FF00; const int PRINTER_CHANGE_FORM = (PRINTER_CHANGE_ADD_FORM | PRINTER_CHANGE_SET_FORM | @@ -1554,14 +1810,14 @@ import "misc.idl", "security.idl", "winreg.idl"; PRINTER_CHANGE_CONFIGURE_PORT | PRINTER_CHANGE_DELETE_PORT); /* 0x00700000 */ - const int PRINTER_CHANGE_PRINT_PROCESSOR = (PRINTER_CHANGE_ADD_PRINT_PROCESSOR | - PRINTER_CHANGE_DELETE_PRINT_PROCESSOR); /* 0x07000000 */ + const int PRINTER_CHANGE_PRINT_PROCESSOR = 0x07000000; const int PRINTER_CHANGE_PRINTER_DRIVER = (PRINTER_CHANGE_ADD_PRINTER_DRIVER | PRINTER_CHANGE_SET_PRINTER_DRIVER | PRINTER_CHANGE_DELETE_PRINTER_DRIVER); /* 0x70000000 */ - const int PRINTER_CHANGE_ALL = (PRINTER_CHANGE_JOB | + const int PRINTER_CHANGE_ALL = (PRINTER_CHANGE_PRINTER | + PRINTER_CHANGE_JOB | PRINTER_CHANGE_FORM | PRINTER_CHANGE_PORT | PRINTER_CHANGE_PRINT_PROCESSOR | @@ -1644,9 +1900,13 @@ import "misc.idl", "security.idl", "winreg.idl"; [size_is(count)] spoolss_Field *fields; } spoolss_NotifyOptionType; + typedef [bitmap32bit] bitmap { + PRINTER_NOTIFY_OPTIONS_REFRESH = 0x00000001 + } spoolssNotifyOptionFlags; + typedef struct { [value(2)] uint32 version; - uint32 flags; + spoolssNotifyOptionFlags flags; uint32 count; [size_is(count)] spoolss_NotifyOptionType *types; } spoolss_NotifyOption; @@ -1679,7 +1939,7 @@ import "misc.idl", "security.idl", "winreg.idl"; typedef [switch_type(uint32)] union { [case(1)] uint32 integer[2]; [case(2)] spoolss_NotifyString string; - [case(3)] spoolss_DeviceMode *devmode; + [case(3)] spoolss_DevmodeContainer devmode; [case(4)] spoolss_TimeCtr time; [case(5)] sec_desc_buf sd; } spoolss_NotifyData; @@ -1775,7 +2035,8 @@ import "misc.idl", "security.idl", "winreg.idl"; SERVER_ACCESS_ENUMERATE = 0x00000002, PRINTER_ACCESS_ADMINISTER = 0x00000004, PRINTER_ACCESS_USE = 0x00000008, - JOB_ACCESS_ADMINISTER = 0x00000010 + JOB_ACCESS_ADMINISTER = 0x00000010, + JOB_ACCESS_READ = 0x00000020 } spoolss_AccessRights; /* Access rights for print servers */ diff --git a/librpc/ndr/ndr_sec_helper.c b/librpc/ndr/ndr_sec_helper.c index 8f84c02f91..62194707c2 100644 --- a/librpc/ndr/ndr_sec_helper.c +++ b/librpc/ndr/ndr_sec_helper.c @@ -91,14 +91,14 @@ enum ndr_err_code ndr_pull_security_ace(struct ndr_pull *ndr, int ndr_flags, str /* return the wire size of a security_acl */ -size_t ndr_size_security_acl(const struct security_acl *acl, struct smb_iconv_convenience *ic, int flags) +size_t ndr_size_security_acl(const struct security_acl *theacl, struct smb_iconv_convenience *ic, int flags) { size_t ret; int i; - if (!acl) return 0; + if (!theacl) return 0; ret = 8; - for (i=0;i<acl->num_aces;i++) { - ret += ndr_size_security_ace(&acl->aces[i], ic, flags); + for (i=0;i<theacl->num_aces;i++) { + ret += ndr_size_security_ace(&theacl->aces[i], ic, flags); } return ret; } diff --git a/librpc/ndr/ndr_spoolss_buf.c b/librpc/ndr/ndr_spoolss_buf.c index d7e28ccf0e..afc06be4e0 100644 --- a/librpc/ndr/ndr_spoolss_buf.c +++ b/librpc/ndr/ndr_spoolss_buf.c @@ -544,3 +544,481 @@ _PUBLIC_ size_t ndr_size_spoolss_StringArray(const struct spoolss_StringArray *r return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_StringArray, ic); } +/* hand marshall as pidl cannot (yet) generate a relative pointer to a fixed array of + * structs */ + +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo101(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo101 *r) +{ + uint32_t cntr_file_info_1; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 8)); + NDR_CHECK(ndr_push_spoolss_DriverOSVersion(ndr, NDR_SCALARS, r->version)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->driver_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->architecture)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->file_info)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->file_count)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->monitor_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->default_datatype)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string_array = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->previous_names)); + ndr->flags = _flags_save_string_array; + } + NDR_CHECK(ndr_push_NTTIME(ndr, NDR_SCALARS, r->driver_date)); + NDR_CHECK(ndr_push_hyper(ndr, NDR_SCALARS, r->driver_version)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->manufacturer_name)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->manufacturer_url)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->hardware_id)); + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->provider)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->driver_name) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->driver_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->driver_name)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->architecture) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->architecture)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->architecture)); + } + ndr->flags = _flags_save_string; + } + if (r->file_info) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->file_info)); +#if 0 + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->file_count)); +#endif + for (cntr_file_info_1 = 0; cntr_file_info_1 < r->file_count; cntr_file_info_1++) { + NDR_CHECK(ndr_push_spoolss_DriverFileInfo(ndr, NDR_SCALARS, &r->file_info[cntr_file_info_1])); + } + for (cntr_file_info_1 = 0; cntr_file_info_1 < r->file_count; cntr_file_info_1++) { + NDR_CHECK(ndr_push_spoolss_DriverFileInfo(ndr, NDR_BUFFERS, &r->file_info[cntr_file_info_1])); + } + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->monitor_name) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->monitor_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->monitor_name)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->default_datatype) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->default_datatype)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->default_datatype)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string_array = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->previous_names) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->previous_names)); + NDR_CHECK(ndr_push_string_array(ndr, NDR_SCALARS, r->previous_names)); + } + ndr->flags = _flags_save_string_array; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->manufacturer_name) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->manufacturer_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->manufacturer_name)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->manufacturer_url) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->manufacturer_url)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->manufacturer_url)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->hardware_id) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->hardware_id)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->hardware_id)); + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->provider) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->provider)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->provider)); + } + ndr->flags = _flags_save_string; + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo101(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo101 *r) +{ + uint32_t _ptr_driver_name; + TALLOC_CTX *_mem_save_driver_name_0; + uint32_t _ptr_architecture; + TALLOC_CTX *_mem_save_architecture_0; + uint32_t _ptr_file_info; + uint32_t cntr_file_info_1; + TALLOC_CTX *_mem_save_file_info_0; + TALLOC_CTX *_mem_save_file_info_1; + uint32_t _ptr_monitor_name; + TALLOC_CTX *_mem_save_monitor_name_0; + uint32_t _ptr_default_datatype; + TALLOC_CTX *_mem_save_default_datatype_0; + uint32_t _ptr_previous_names; + TALLOC_CTX *_mem_save_previous_names_0; + uint32_t _ptr_manufacturer_name; + TALLOC_CTX *_mem_save_manufacturer_name_0; + uint32_t _ptr_manufacturer_url; + TALLOC_CTX *_mem_save_manufacturer_url_0; + uint32_t _ptr_hardware_id; + TALLOC_CTX *_mem_save_hardware_id_0; + uint32_t _ptr_provider; + TALLOC_CTX *_mem_save_provider_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 8)); + NDR_CHECK(ndr_pull_spoolss_DriverOSVersion(ndr, NDR_SCALARS, &r->version)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_driver_name)); + if (_ptr_driver_name) { + NDR_PULL_ALLOC(ndr, r->driver_name); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->driver_name, _ptr_driver_name)); + } else { + r->driver_name = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_architecture)); + if (_ptr_architecture) { + NDR_PULL_ALLOC(ndr, r->architecture); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->architecture, _ptr_architecture)); + } else { + r->architecture = NULL; + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_file_info)); + if (_ptr_file_info) { + NDR_PULL_ALLOC(ndr, r->file_info); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->file_info, _ptr_file_info)); + } else { + r->file_info = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->file_count)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_monitor_name)); + if (_ptr_monitor_name) { + NDR_PULL_ALLOC(ndr, r->monitor_name); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->monitor_name, _ptr_monitor_name)); + } else { + r->monitor_name = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_default_datatype)); + if (_ptr_default_datatype) { + NDR_PULL_ALLOC(ndr, r->default_datatype); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->default_datatype, _ptr_default_datatype)); + } else { + r->default_datatype = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string_array = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_previous_names)); + if (_ptr_previous_names) { + NDR_PULL_ALLOC(ndr, r->previous_names); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->previous_names, _ptr_previous_names)); + } else { + r->previous_names = NULL; + } + ndr->flags = _flags_save_string_array; + } + NDR_CHECK(ndr_pull_NTTIME(ndr, NDR_SCALARS, &r->driver_date)); + NDR_CHECK(ndr_pull_hyper(ndr, NDR_SCALARS, &r->driver_version)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_manufacturer_name)); + if (_ptr_manufacturer_name) { + NDR_PULL_ALLOC(ndr, r->manufacturer_name); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->manufacturer_name, _ptr_manufacturer_name)); + } else { + r->manufacturer_name = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_manufacturer_url)); + if (_ptr_manufacturer_url) { + NDR_PULL_ALLOC(ndr, r->manufacturer_url); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->manufacturer_url, _ptr_manufacturer_url)); + } else { + r->manufacturer_url = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_hardware_id)); + if (_ptr_hardware_id) { + NDR_PULL_ALLOC(ndr, r->hardware_id); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->hardware_id, _ptr_hardware_id)); + } else { + r->hardware_id = NULL; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_provider)); + if (_ptr_provider) { + NDR_PULL_ALLOC(ndr, r->provider); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->provider, _ptr_provider)); + } else { + r->provider = NULL; + } + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->driver_name) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->driver_name)); + _mem_save_driver_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->driver_name, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->driver_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->architecture) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->architecture)); + _mem_save_architecture_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->architecture, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->architecture)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_architecture_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + if (r->file_info) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->file_info)); + _mem_save_file_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->file_info, 0); +#if 0 + NDR_CHECK(ndr_pull_array_size(ndr, &r->file_info)); +#else + NDR_CHECK(ndr_token_store(ndr, &ndr->array_size_list, &r->file_info, r->file_count)); +#endif + NDR_PULL_ALLOC_N(ndr, r->file_info, ndr_get_array_size(ndr, &r->file_info)); + _mem_save_file_info_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->file_info, 0); + for (cntr_file_info_1 = 0; cntr_file_info_1 < r->file_count; cntr_file_info_1++) { + NDR_CHECK(ndr_pull_spoolss_DriverFileInfo(ndr, NDR_SCALARS, &r->file_info[cntr_file_info_1])); + } + for (cntr_file_info_1 = 0; cntr_file_info_1 < r->file_count; cntr_file_info_1++) { + NDR_CHECK(ndr_pull_spoolss_DriverFileInfo(ndr, NDR_BUFFERS, &r->file_info[cntr_file_info_1])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_file_info_1, 0); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_file_info_0, 0); + ndr->offset = _relative_save_offset; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->monitor_name) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->monitor_name)); + _mem_save_monitor_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->monitor_name, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->monitor_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_monitor_name_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->default_datatype) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->default_datatype)); + _mem_save_default_datatype_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->default_datatype, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->default_datatype)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_default_datatype_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string_array = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->previous_names) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->previous_names)); + _mem_save_previous_names_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->previous_names, 0); + NDR_CHECK(ndr_pull_string_array(ndr, NDR_SCALARS, &r->previous_names)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_previous_names_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string_array; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->manufacturer_name) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->manufacturer_name)); + _mem_save_manufacturer_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->manufacturer_name, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->manufacturer_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_manufacturer_name_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->manufacturer_url) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->manufacturer_url)); + _mem_save_manufacturer_url_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->manufacturer_url, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->manufacturer_url)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_manufacturer_url_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->hardware_id) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->hardware_id)); + _mem_save_hardware_id_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->hardware_id, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->hardware_id)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_hardware_id_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->provider) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->provider)); + _mem_save_provider_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->provider, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->provider)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_provider_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + if (r->file_info) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->file_info, r->file_count)); + } + } + return NDR_ERR_SUCCESS; +} diff --git a/librpc/ndr/ndr_spoolss_buf.h b/librpc/ndr/ndr_spoolss_buf.h index 801737610f..5ed848d7e0 100644 --- a/librpc/ndr/ndr_spoolss_buf.h +++ b/librpc/ndr/ndr_spoolss_buf.h @@ -39,6 +39,9 @@ enum ndr_err_code ndr_pull_spoolss_GetPrinterData(struct ndr_pull *ndr, int flag enum ndr_err_code ndr_push_spoolss_SetPrinterData(struct ndr_push *ndr, int flags, const struct spoolss_SetPrinterData *r); uint32_t _ndr_size_spoolss_DeviceMode(struct spoolss_DeviceMode *devmode, struct smb_iconv_convenience *ic, uint32_t flags); size_t ndr_size_spoolss_StringArray(const struct spoolss_StringArray *r, struct smb_iconv_convenience *ic, int flags); +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo101(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo101 *r); +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo101(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo101 *r); + #undef _PRINTF_ATTRIBUTE #define _PRINTF_ATTRIBUTE(a1, a2) |