diff options
Diffstat (limited to 'librpc')
-rw-r--r-- | librpc/gen_ndr/dfs.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/drsblobs.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/drsuapi.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/dssetup.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/echo.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/epmapper.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/eventlog.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/initshutdown.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/krb5pac.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/lsa.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/misc.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/named_pipe_auth.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/nbt.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_drsblobs.c | 6 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_spoolss.c | 3517 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_spoolss.h | 19 | ||||
-rw-r--r-- | librpc/gen_ndr/netlogon.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/ntsvcs.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/samr.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/security.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/spoolss.h | 318 | ||||
-rw-r--r-- | librpc/gen_ndr/srvsvc.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/svcctl.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/winreg.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/wkssvc.h | 2 | ||||
-rw-r--r-- | librpc/gen_ndr/xattr.h | 2 | ||||
-rw-r--r-- | librpc/idl/spoolss.idl | 309 |
27 files changed, 4072 insertions, 141 deletions
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 2a9b824601..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 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_drsblobs.c b/librpc/gen_ndr/ndr_drsblobs.c index 72e182d3ff..ee7c9933c2 100644 --- a/librpc/gen_ndr/ndr_drsblobs.c +++ b/librpc/gen_ndr/ndr_drsblobs.c @@ -1870,9 +1870,6 @@ static enum ndr_err_code ndr_push_package_PrimaryKerberosCtr4(struct ndr_push *n for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_SCALARS, &r->keys[cntr_keys_0])); } - for (cntr_service_keys_0 = 0; cntr_service_keys_0 < 0; cntr_service_keys_0++) { - NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_SCALARS, &r->service_keys[cntr_service_keys_0])); - } for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; cntr_old_keys_0++) { NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_SCALARS, &r->old_keys[cntr_old_keys_0])); } @@ -1885,9 +1882,6 @@ static enum ndr_err_code ndr_push_package_PrimaryKerberosCtr4(struct ndr_push *n for (cntr_keys_0 = 0; cntr_keys_0 < r->num_keys; cntr_keys_0++) { NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_BUFFERS, &r->keys[cntr_keys_0])); } - for (cntr_service_keys_0 = 0; cntr_service_keys_0 < 0; cntr_service_keys_0++) { - NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_BUFFERS, &r->service_keys[cntr_service_keys_0])); - } for (cntr_old_keys_0 = 0; cntr_old_keys_0 < r->num_old_keys; cntr_old_keys_0++) { NDR_CHECK(ndr_push_package_PrimaryKerberosKey4(ndr, NDR_BUFFERS, &r->old_keys[cntr_old_keys_0])); } diff --git a/librpc/gen_ndr/ndr_spoolss.c b/librpc/gen_ndr/ndr_spoolss.c index fdafa2582b..f82f42e146 100644 --- a/librpc/gen_ndr/ndr_spoolss.c +++ b/librpc/gen_ndr/ndr_spoolss.c @@ -224,6 +224,86 @@ _PUBLIC_ void ndr_print_spoolss_MinorVersion(struct ndr_print *ndr, const char * ndr_print_enum(ndr, name, "ENUM", val, r); } +static enum ndr_err_code ndr_push_spoolss_PrinterStatus(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_PrinterStatus(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_PrinterStatus(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_STATUS_PAUSED", PRINTER_STATUS_PAUSED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_ERROR", PRINTER_STATUS_ERROR, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_PENDING_DELETION", PRINTER_STATUS_PENDING_DELETION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_PAPER_JAM", PRINTER_STATUS_PAPER_JAM, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_PAPER_OUT", PRINTER_STATUS_PAPER_OUT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_MANUAL_FEED", PRINTER_STATUS_MANUAL_FEED, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_PAPER_PROBLEM", PRINTER_STATUS_PAPER_PROBLEM, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_OFFLINE", PRINTER_STATUS_OFFLINE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_IO_ACTIVE", PRINTER_STATUS_IO_ACTIVE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_BUSY", PRINTER_STATUS_BUSY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_PRINTING", PRINTER_STATUS_PRINTING, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_OUTPUT_BIN_FULL", PRINTER_STATUS_OUTPUT_BIN_FULL, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_NOT_AVAILABLE", PRINTER_STATUS_NOT_AVAILABLE, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_WAITING", PRINTER_STATUS_WAITING, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_PROCESSING", PRINTER_STATUS_PROCESSING, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_INITIALIZING", PRINTER_STATUS_INITIALIZING, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_WARMING_UP", PRINTER_STATUS_WARMING_UP, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_TONER_LOW", PRINTER_STATUS_TONER_LOW, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_NO_TONER", PRINTER_STATUS_NO_TONER, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_PAGE_PUNT", PRINTER_STATUS_PAGE_PUNT, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_USER_INTERVENTION", PRINTER_STATUS_USER_INTERVENTION, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_OUT_OF_MEMORY", PRINTER_STATUS_OUT_OF_MEMORY, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_DOOR_OPEN", PRINTER_STATUS_DOOR_OPEN, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_SERVER_UNKNOWN", PRINTER_STATUS_SERVER_UNKNOWN, r); + ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_POWER_SAVE", PRINTER_STATUS_POWER_SAVE, r); + 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_PrinterInfo0(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo0 *r) { if (ndr_flags & NDR_SCALARS) { @@ -253,13 +333,13 @@ static enum ndr_err_code ndr_push_spoolss_PrinterInfo0(struct ndr_push *ndr, int NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->session_counter)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_error_out_of_paper)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->num_error_not_ready)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->job_error)); + NDR_CHECK(ndr_push_spoolss_JobStatus(ndr, NDR_SCALARS, r->job_error)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->number_of_processors)); NDR_CHECK(ndr_push_spoolss_ProcessorType(ndr, NDR_SCALARS, r->processor_type)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->high_part_total_bytes)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->change_id)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->last_error)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->status)); + NDR_CHECK(ndr_push_spoolss_PrinterStatus(ndr, NDR_SCALARS, r->status)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->enumerate_network_printers)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->c_setprinter)); NDR_CHECK(ndr_push_spoolss_ProcessorArchitecture(ndr, NDR_SCALARS, r->processor_architecture)); @@ -336,13 +416,13 @@ static enum ndr_err_code ndr_pull_spoolss_PrinterInfo0(struct ndr_pull *ndr, int NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->session_counter)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_error_out_of_paper)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->num_error_not_ready)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->job_error)); + NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->job_error)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->number_of_processors)); NDR_CHECK(ndr_pull_spoolss_ProcessorType(ndr, NDR_SCALARS, &r->processor_type)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->high_part_total_bytes)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->change_id)); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->last_error)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->status)); + NDR_CHECK(ndr_pull_spoolss_PrinterStatus(ndr, NDR_SCALARS, &r->status)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->enumerate_network_printers)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->c_setprinter)); NDR_CHECK(ndr_pull_spoolss_ProcessorArchitecture(ndr, NDR_SCALARS, &r->processor_architecture)); @@ -415,13 +495,13 @@ _PUBLIC_ void ndr_print_spoolss_PrinterInfo0(struct ndr_print *ndr, const char * ndr_print_uint32(ndr, "session_counter", r->session_counter); ndr_print_uint32(ndr, "num_error_out_of_paper", r->num_error_out_of_paper); ndr_print_uint32(ndr, "num_error_not_ready", r->num_error_not_ready); - ndr_print_uint32(ndr, "job_error", r->job_error); + ndr_print_spoolss_JobStatus(ndr, "job_error", r->job_error); ndr_print_uint32(ndr, "number_of_processors", r->number_of_processors); ndr_print_spoolss_ProcessorType(ndr, "processor_type", r->processor_type); ndr_print_uint32(ndr, "high_part_total_bytes", r->high_part_total_bytes); ndr_print_uint32(ndr, "change_id", r->change_id); ndr_print_WERROR(ndr, "last_error", r->last_error); - ndr_print_uint32(ndr, "status", r->status); + ndr_print_spoolss_PrinterStatus(ndr, "status", r->status); ndr_print_uint32(ndr, "enumerate_network_printers", r->enumerate_network_printers); ndr_print_uint32(ndr, "c_setprinter", r->c_setprinter); ndr_print_spoolss_ProcessorArchitecture(ndr, "processor_architecture", r->processor_architecture); @@ -895,52 +975,6 @@ _PUBLIC_ void ndr_print_spoolss_PrinterAttributes(struct ndr_print *ndr, const c ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_PrinterStatus(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_PrinterStatus(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_PrinterStatus(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_STATUS_PAUSED", PRINTER_STATUS_PAUSED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_ERROR", PRINTER_STATUS_ERROR, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_PENDING_DELETION", PRINTER_STATUS_PENDING_DELETION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_PAPER_JAM", PRINTER_STATUS_PAPER_JAM, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_PAPER_OUT", PRINTER_STATUS_PAPER_OUT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_MANUAL_FEED", PRINTER_STATUS_MANUAL_FEED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_PAPER_PROBLEM", PRINTER_STATUS_PAPER_PROBLEM, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_OFFLINE", PRINTER_STATUS_OFFLINE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_IO_ACTIVE", PRINTER_STATUS_IO_ACTIVE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_BUSY", PRINTER_STATUS_BUSY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_PRINTING", PRINTER_STATUS_PRINTING, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_OUTPUT_BIN_FULL", PRINTER_STATUS_OUTPUT_BIN_FULL, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_NOT_AVAILABLE", PRINTER_STATUS_NOT_AVAILABLE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_WAITING", PRINTER_STATUS_WAITING, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_PROCESSING", PRINTER_STATUS_PROCESSING, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_INITIALIZING", PRINTER_STATUS_INITIALIZING, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_WARMING_UP", PRINTER_STATUS_WARMING_UP, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_TONER_LOW", PRINTER_STATUS_TONER_LOW, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_NO_TONER", PRINTER_STATUS_NO_TONER, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_PAGE_PUNT", PRINTER_STATUS_PAGE_PUNT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_USER_INTERVENTION", PRINTER_STATUS_USER_INTERVENTION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_OUT_OF_MEMORY", PRINTER_STATUS_OUT_OF_MEMORY, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_DOOR_OPEN", PRINTER_STATUS_DOOR_OPEN, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_SERVER_UNKNOWN", PRINTER_STATUS_SERVER_UNKNOWN, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "PRINTER_STATUS_POWER_SAVE", PRINTER_STATUS_POWER_SAVE, r); - ndr->depth--; -} - static enum ndr_err_code ndr_push_spoolss_PrinterInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo2 *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,1272 @@ _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_uint32(ndr, NDR_SCALARS, r->_devmode_ptr)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->text_status)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->_secdesc_ptr)); + 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->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_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_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_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_uint32(ndr, NDR_SCALARS, &r->_devmode_ptr)); + 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_uint32(ndr, NDR_SCALARS, &r->_secdesc_ptr)); + 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->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_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_uint32(ndr, "_devmode_ptr", r->_devmode_ptr); + 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_uint32(ndr, "_secdesc_ptr", r->_secdesc_ptr); + 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_uint32(ndr, NDR_SCALARS, r->_devmode_ptr)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->text_status)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->_secdesc_ptr)); + 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->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_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_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_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_uint32(ndr, NDR_SCALARS, &r->_devmode_ptr)); + 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_uint32(ndr, NDR_SCALARS, &r->_secdesc_ptr)); + 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->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_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_uint32(ndr, "_devmode_ptr", r->_devmode_ptr); + 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_uint32(ndr, "_secdesc_ptr", r->_secdesc_ptr); + 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 +5598,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 +5612,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 +5626,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 +5656,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); } @@ -11356,6 +13968,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; } } @@ -11390,6 +14005,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; } } @@ -11420,6 +14038,7 @@ _PUBLIC_ void ndr_print_spoolss_PrintProcessorDirectoryInfo(struct ndr_print *nd break; default: + ndr_print_spoolss_PrintProcessorDirectoryInfo1(ndr, "info1", &r->info1); break; } @@ -12232,6 +14851,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); @@ -12244,6 +15132,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; } @@ -12257,6 +15151,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; @@ -12279,6 +15177,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; } @@ -12291,6 +15195,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; @@ -12310,6 +15218,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; @@ -12390,6 +15302,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) { @@ -12400,6 +15489,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); } @@ -12413,6 +15506,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); } @@ -12425,6 +15524,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)); @@ -12442,6 +15542,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); } @@ -12457,6 +15567,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); } @@ -12479,6 +15598,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); } @@ -12769,6 +15897,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); @@ -12788,6 +16141,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: { @@ -12808,6 +16170,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: @@ -12839,6 +16206,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: { @@ -12858,6 +16234,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: @@ -12884,6 +16265,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: @@ -14559,6 +17945,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--; } @@ -17048,7 +20435,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)); } } @@ -17142,7 +20529,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); diff --git a/librpc/gen_ndr/ndr_spoolss.h b/librpc/gen_ndr/ndr_spoolss.h index 5b32d510c0..eaa16e81a1 100644 --- a/librpc/gen_ndr/ndr_spoolss.h +++ b/librpc/gen_ndr/ndr_spoolss.h @@ -211,6 +211,8 @@ void ndr_print_spoolss_ProcessorArchitecture(struct ndr_print *ndr, const char * void ndr_print_spoolss_ProcessorType(struct ndr_print *ndr, const char *name, enum spoolss_ProcessorType r); void ndr_print_spoolss_MajorVersion(struct ndr_print *ndr, const char *name, enum spoolss_MajorVersion r); void ndr_print_spoolss_MinorVersion(struct ndr_print *ndr, const char *name, enum spoolss_MinorVersion r); +void ndr_print_spoolss_PrinterStatus(struct ndr_print *ndr, const char *name, uint32_t r); +void ndr_print_spoolss_JobStatus(struct ndr_print *ndr, const char *name, uint32_t r); void ndr_print_spoolss_PrinterInfo0(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo0 *r); void ndr_print_spoolss_DeviceModeFields(struct ndr_print *ndr, const char *name, uint32_t r); enum ndr_err_code ndr_push_spoolss_DeviceMode(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DeviceMode *r); @@ -222,7 +224,6 @@ enum ndr_err_code ndr_pull_spoolss_EnumPrinterFlags(struct ndr_pull *ndr, int nd void ndr_print_spoolss_EnumPrinterFlags(struct ndr_print *ndr, const char *name, uint32_t r); void ndr_print_spoolss_PrinterInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo1 *r); void ndr_print_spoolss_PrinterAttributes(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_spoolss_PrinterStatus(struct ndr_print *ndr, const char *name, uint32_t r); void ndr_print_spoolss_PrinterInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo2 *r); void ndr_print_spoolss_PrinterInfo3(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo3 *r); void ndr_print_spoolss_PrinterInfo4(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo4 *r); @@ -236,9 +237,18 @@ enum ndr_err_code ndr_pull_spoolss_PrinterInfo(struct ndr_pull *ndr, int ndr_fla 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_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); @@ -344,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); 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 ad4554dbe5..9c5496e07c 100644 --- a/librpc/gen_ndr/spoolss.h +++ b/librpc/gen_ndr/spoolss.h @@ -2,12 +2,16 @@ #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" #ifndef _HEADER_spoolss #define _HEADER_spoolss +#define PRINTER_STATUS_OK ( 0x00000000 ) +#define JOB_STATUS_QUEUED ( 0x0000 ) #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 SPOOLSS_ARCHITECTURE_NT_X86 ( "Windows NT x86" ) #define SPOOLSS_DEFAULT_SERVER_PATH ( "C:\\WINDOWS\\system32\\spool" ) @@ -117,6 +121,48 @@ enum spoolss_MinorVersion #endif ; +/* bitmap spoolss_PrinterStatus */ +#define PRINTER_STATUS_PAUSED ( 0x00000001 ) +#define PRINTER_STATUS_ERROR ( 0x00000002 ) +#define PRINTER_STATUS_PENDING_DELETION ( 0x00000004 ) +#define PRINTER_STATUS_PAPER_JAM ( 0x00000008 ) +#define PRINTER_STATUS_PAPER_OUT ( 0x00000010 ) +#define PRINTER_STATUS_MANUAL_FEED ( 0x00000020 ) +#define PRINTER_STATUS_PAPER_PROBLEM ( 0x00000040 ) +#define PRINTER_STATUS_OFFLINE ( 0x00000080 ) +#define PRINTER_STATUS_IO_ACTIVE ( 0x00000100 ) +#define PRINTER_STATUS_BUSY ( 0x00000200 ) +#define PRINTER_STATUS_PRINTING ( 0x00000400 ) +#define PRINTER_STATUS_OUTPUT_BIN_FULL ( 0x00000800 ) +#define PRINTER_STATUS_NOT_AVAILABLE ( 0x00001000 ) +#define PRINTER_STATUS_WAITING ( 0x00002000 ) +#define PRINTER_STATUS_PROCESSING ( 0x00004000 ) +#define PRINTER_STATUS_INITIALIZING ( 0x00008000 ) +#define PRINTER_STATUS_WARMING_UP ( 0x00010000 ) +#define PRINTER_STATUS_TONER_LOW ( 0x00020000 ) +#define PRINTER_STATUS_NO_TONER ( 0x00040000 ) +#define PRINTER_STATUS_PAGE_PUNT ( 0x00080000 ) +#define PRINTER_STATUS_USER_INTERVENTION ( 0x00100000 ) +#define PRINTER_STATUS_OUT_OF_MEMORY ( 0x00200000 ) +#define PRINTER_STATUS_DOOR_OPEN ( 0x00400000 ) +#define PRINTER_STATUS_SERVER_UNKNOWN ( 0x00800000 ) +#define PRINTER_STATUS_POWER_SAVE ( 0x01000000 ) + +/* 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_PrinterInfo0 { const char * printername;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * servername;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ @@ -263,33 +309,6 @@ struct spoolss_PrinterInfo1 { #define PRINTER_ATTRIBUTE_FAX ( 0x00004000 ) #define PRINTER_ATTRIBUTE_TS ( 0x00008000 ) -/* bitmap spoolss_PrinterStatus */ -#define PRINTER_STATUS_PAUSED ( 0x00000001 ) -#define PRINTER_STATUS_ERROR ( 0x00000002 ) -#define PRINTER_STATUS_PENDING_DELETION ( 0x00000004 ) -#define PRINTER_STATUS_PAPER_JAM ( 0x00000008 ) -#define PRINTER_STATUS_PAPER_OUT ( 0x00000010 ) -#define PRINTER_STATUS_MANUAL_FEED ( 0x00000020 ) -#define PRINTER_STATUS_PAPER_PROBLEM ( 0x00000040 ) -#define PRINTER_STATUS_OFFLINE ( 0x00000080 ) -#define PRINTER_STATUS_IO_ACTIVE ( 0x00000100 ) -#define PRINTER_STATUS_BUSY ( 0x00000200 ) -#define PRINTER_STATUS_PRINTING ( 0x00000400 ) -#define PRINTER_STATUS_OUTPUT_BIN_FULL ( 0x00000800 ) -#define PRINTER_STATUS_NOT_AVAILABLE ( 0x00001000 ) -#define PRINTER_STATUS_WAITING ( 0x00002000 ) -#define PRINTER_STATUS_PROCESSING ( 0x00004000 ) -#define PRINTER_STATUS_INITIALIZING ( 0x00008000 ) -#define PRINTER_STATUS_WARMING_UP ( 0x00010000 ) -#define PRINTER_STATUS_TONER_LOW ( 0x00020000 ) -#define PRINTER_STATUS_NO_TONER ( 0x00040000 ) -#define PRINTER_STATUS_PAGE_PUNT ( 0x00080000 ) -#define PRINTER_STATUS_USER_INTERVENTION ( 0x00100000 ) -#define PRINTER_STATUS_OUT_OF_MEMORY ( 0x00200000 ) -#define PRINTER_STATUS_DOOR_OPEN ( 0x00400000 ) -#define PRINTER_STATUS_SERVER_UNKNOWN ( 0x00800000 ) -#define PRINTER_STATUS_POWER_SAVE ( 0x01000000 ) - struct spoolss_PrinterInfo2 { const char * servername;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * printername;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ @@ -383,16 +402,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)] */ + uint32_t _devmode_ptr; + const char *text_status;/* [unique,charset(UTF16)] */ + uint32_t _secdesc_ptr; + 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)] */ + uint32_t _devmode_ptr; + const char *text_status;/* [unique,charset(UTF16)] */ + uint32_t _secdesc_ptr; + 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 @@ -404,7 +561,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} @@ -415,6 +574,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 ; @@ -958,8 +1119,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 { @@ -969,8 +1149,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 { @@ -991,9 +1185,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 { @@ -1227,6 +1484,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 ) 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/spoolss.idl b/librpc/idl/spoolss.idl index 3e35399f8d..f9ca4c1476 100644 --- a/librpc/idl/spoolss.idl +++ b/librpc/idl/spoolss.idl @@ -66,6 +66,56 @@ import "misc.idl", "security.idl", "winreg.idl"; SPOOLSS_MINOR_VERSION_ME = 0x0000005a } spoolss_MinorVersion; + const int PRINTER_STATUS_OK = 0x00000000; + + typedef bitmap { + PRINTER_STATUS_PAUSED = 0x00000001, + PRINTER_STATUS_ERROR = 0x00000002, + PRINTER_STATUS_PENDING_DELETION = 0x00000004, + PRINTER_STATUS_PAPER_JAM = 0x00000008, + PRINTER_STATUS_PAPER_OUT = 0x00000010, + PRINTER_STATUS_MANUAL_FEED = 0x00000020, + PRINTER_STATUS_PAPER_PROBLEM = 0x00000040, + PRINTER_STATUS_OFFLINE = 0x00000080, + PRINTER_STATUS_IO_ACTIVE = 0x00000100, + PRINTER_STATUS_BUSY = 0x00000200, + PRINTER_STATUS_PRINTING = 0x00000400, + PRINTER_STATUS_OUTPUT_BIN_FULL = 0x00000800, + PRINTER_STATUS_NOT_AVAILABLE = 0x00001000, + PRINTER_STATUS_WAITING = 0x00002000, + PRINTER_STATUS_PROCESSING = 0x00004000, + PRINTER_STATUS_INITIALIZING = 0x00008000, + PRINTER_STATUS_WARMING_UP = 0x00010000, + PRINTER_STATUS_TONER_LOW = 0x00020000, + PRINTER_STATUS_NO_TONER = 0x00040000, + PRINTER_STATUS_PAGE_PUNT = 0x00080000, + PRINTER_STATUS_USER_INTERVENTION= 0x00100000, + PRINTER_STATUS_OUT_OF_MEMORY = 0x00200000, + PRINTER_STATUS_DOOR_OPEN = 0x00400000, + PRINTER_STATUS_SERVER_UNKNOWN = 0x00800000, + PRINTER_STATUS_POWER_SAVE = 0x01000000 + } spoolss_PrinterStatus; + + /* 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 { [relative] nstring *printername; [relative] nstring *servername; @@ -82,13 +132,13 @@ import "misc.idl", "security.idl", "winreg.idl"; uint32 session_counter; uint32 num_error_out_of_paper; uint32 num_error_not_ready; - uint32 job_error; + spoolss_JobStatus job_error; uint32 number_of_processors; spoolss_ProcessorType processor_type; uint32 high_part_total_bytes; uint32 change_id; WERROR last_error; - uint32 status; + spoolss_PrinterStatus status; uint32 enumerate_network_printers; uint32 c_setprinter; spoolss_ProcessorArchitecture processor_architecture; @@ -224,34 +274,6 @@ import "misc.idl", "security.idl", "winreg.idl"; PRINTER_ATTRIBUTE_TS = 0x00008000 } spoolss_PrinterAttributes; - typedef bitmap { - PRINTER_STATUS_PAUSED = 0x00000001, - PRINTER_STATUS_ERROR = 0x00000002, - PRINTER_STATUS_PENDING_DELETION = 0x00000004, - PRINTER_STATUS_PAPER_JAM = 0x00000008, - PRINTER_STATUS_PAPER_OUT = 0x00000010, - PRINTER_STATUS_MANUAL_FEED = 0x00000020, - PRINTER_STATUS_PAPER_PROBLEM = 0x00000040, - PRINTER_STATUS_OFFLINE = 0x00000080, - PRINTER_STATUS_IO_ACTIVE = 0x00000100, - PRINTER_STATUS_BUSY = 0x00000200, - PRINTER_STATUS_PRINTING = 0x00000400, - PRINTER_STATUS_OUTPUT_BIN_FULL = 0x00000800, - PRINTER_STATUS_NOT_AVAILABLE = 0x00001000, - PRINTER_STATUS_WAITING = 0x00002000, - PRINTER_STATUS_PROCESSING = 0x00004000, - PRINTER_STATUS_INITIALIZING = 0x00008000, - PRINTER_STATUS_WARMING_UP = 0x00010000, - PRINTER_STATUS_TONER_LOW = 0x00020000, - PRINTER_STATUS_NO_TONER = 0x00040000, - PRINTER_STATUS_PAGE_PUNT = 0x00080000, - PRINTER_STATUS_USER_INTERVENTION= 0x00100000, - PRINTER_STATUS_OUT_OF_MEMORY = 0x00200000, - PRINTER_STATUS_DOOR_OPEN = 0x00400000, - PRINTER_STATUS_SERVER_UNKNOWN = 0x00800000, - PRINTER_STATUS_POWER_SAVE = 0x01000000 - } spoolss_PrinterStatus; - typedef struct { [relative] nstring *servername; [relative] nstring *printername; @@ -378,6 +400,7 @@ import "misc.idl", "security.idl", "winreg.idl"; /******************/ /* Function: 0x02 */ + typedef struct { uint32 job_id; [relative] nstring *printer_name; @@ -386,24 +409,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; + uint32 _devmode_ptr; /* pointer to truncated devicemode */ + [string,charset(UTF16)] uint16 *text_status; + uint32 _secdesc_ptr; + 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; + uint32 _devmode_ptr; /* pointer to truncated devicemode */ + [string,charset(UTF16)] uint16 *text_status; + uint32 _secdesc_ptr; + 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 +573,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( @@ -1021,7 +1183,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( @@ -1237,8 +1399,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; @@ -1249,8 +1431,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( @@ -1332,10 +1528,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; @@ -1807,7 +2037,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 */ |