diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2009-03-20 01:30:36 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-03-20 01:30:36 +0100 |
commit | 5fe2b28f45289dc5578cdd536600f0d30a14d820 (patch) | |
tree | 4bdf36d0d4d8bdddcb3d618b4b01839370ed57c3 /librpc | |
parent | ec9aeeab00584f4d3dfe9afb83dc1a77b8463b81 (diff) | |
parent | 3a4638db0351368d3b148bf547546f28fa0b1479 (diff) | |
download | samba-5fe2b28f45289dc5578cdd536600f0d30a14d820.tar.gz samba-5fe2b28f45289dc5578cdd536600f0d30a14d820.tar.bz2 samba-5fe2b28f45289dc5578cdd536600f0d30a14d820.zip |
Merge branch 'master' of git://git.samba.org/samba into minschema
Diffstat (limited to 'librpc')
-rw-r--r-- | librpc/gen_ndr/cli_spoolss.c | 94 | ||||
-rw-r--r-- | librpc/gen_ndr/cli_spoolss.h | 44 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_drsblobs.c | 1 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_spoolss.c | 1761 | ||||
-rw-r--r-- | librpc/gen_ndr/ndr_spoolss.h | 104 | ||||
-rw-r--r-- | librpc/gen_ndr/spoolss.h | 513 | ||||
-rw-r--r-- | librpc/gen_ndr/srv_spoolss.c | 126 | ||||
-rw-r--r-- | librpc/idl/spoolss.idl | 409 | ||||
-rw-r--r-- | librpc/ndr/ndr.c | 10 | ||||
-rw-r--r-- | librpc/ndr/ndr_spoolss_buf.c | 242 | ||||
-rw-r--r-- | librpc/ndr/ndr_spoolss_buf.h | 15 |
11 files changed, 2353 insertions, 966 deletions
diff --git a/librpc/gen_ndr/cli_spoolss.c b/librpc/gen_ndr/cli_spoolss.c index 2aa42b93bf..1e94a2a63c 100644 --- a/librpc/gen_ndr/cli_spoolss.c +++ b/librpc/gen_ndr/cli_spoolss.c @@ -14,7 +14,7 @@ NTSTATUS rpccli_spoolss_EnumPrinters(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, uint32_t *count /* [out] [ref] */, - union spoolss_PrinterInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, + union spoolss_PrinterInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */, uint32_t *needed /* [out] [ref] */, WERROR *werror) { @@ -52,9 +52,7 @@ NTSTATUS rpccli_spoolss_EnumPrinters(struct rpc_pipe_client *cli, /* Return variables */ *count = *r.out.count; - if (info && r.out.info) { - memcpy(info, r.out.info, *count * sizeof(*info)); - } + *info = *r.out.info; *needed = *r.out.needed; /* Return result */ @@ -231,7 +229,7 @@ NTSTATUS rpccli_spoolss_EnumJobs(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, uint32_t *count /* [out] [ref] */, - union spoolss_JobInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, + union spoolss_JobInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */, uint32_t *needed /* [out] [ref] */, WERROR *werror) { @@ -270,9 +268,7 @@ NTSTATUS rpccli_spoolss_EnumJobs(struct rpc_pipe_client *cli, /* Return variables */ *count = *r.out.count; - if (info && r.out.info) { - memcpy(info, r.out.info, *count * sizeof(*info)); - } + *info = *r.out.info; *needed = *r.out.needed; /* Return result */ @@ -526,7 +522,7 @@ NTSTATUS rpccli_spoolss_EnumPrinterDrivers(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, uint32_t *count /* [out] [ref] */, - union spoolss_DriverInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, + union spoolss_DriverInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */, uint32_t *needed /* [out] [ref] */, WERROR *werror) { @@ -564,9 +560,7 @@ NTSTATUS rpccli_spoolss_EnumPrinterDrivers(struct rpc_pipe_client *cli, /* Return variables */ *count = *r.out.count; - if (info && r.out.info) { - memcpy(info, r.out.info, *count * sizeof(*info)); - } + *info = *r.out.info; *needed = *r.out.needed; /* Return result */ @@ -779,7 +773,7 @@ NTSTATUS rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, uint32_t *count /* [out] [ref] */, - union spoolss_PrintProcessorInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, + union spoolss_PrintProcessorInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */, uint32_t *needed /* [out] [ref] */, WERROR *werror) { @@ -817,9 +811,7 @@ NTSTATUS rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli, /* Return variables */ *count = *r.out.count; - if (info && r.out.info) { - memcpy(info, r.out.info, *count * sizeof(*info)); - } + *info = *r.out.info; *needed = *r.out.needed; /* Return result */ @@ -1310,8 +1302,8 @@ NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli, struct policy_handle *handle /* [in] [ref] */, const char *value_name /* [in] [charset(UTF16)] */, uint32_t offered /* [in] */, - enum spoolss_PrinterDataType *type /* [out] [ref] */, - union spoolss_PrinterData data /* [out] [subcontext_size(offered),subcontext(4),switch_is(*type)] */, + enum winreg_Type *type /* [out] [ref] */, + union spoolss_PrinterData *data /* [out] [subcontext_size(offered),ref,subcontext(4),switch_is(*type)] */, uint32_t *needed /* [out] [ref] */, WERROR *werror) { @@ -1347,7 +1339,7 @@ NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli, /* Return variables */ *type = *r.out.type; - return NT_STATUS_NOT_SUPPORTED; + *data = *r.out.data; *needed = *r.out.needed; /* Return result */ @@ -1362,7 +1354,7 @@ NTSTATUS rpccli_spoolss_SetPrinterData(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle /* [in] [ref] */, const char *value_name /* [in] [charset(UTF16)] */, - enum spoolss_PrinterDataType type /* [in] */, + enum winreg_Type type /* [in] */, union spoolss_PrinterData data /* [in] [subcontext(4),switch_is(type)] */, uint32_t _offered /* [in] [value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] */, WERROR *werror) @@ -1699,7 +1691,7 @@ NTSTATUS rpccli_spoolss_EnumForms(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, uint32_t *count /* [out] [ref] */, - union spoolss_FormInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, + union spoolss_FormInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */, uint32_t *needed /* [out] [ref] */, WERROR *werror) { @@ -1736,9 +1728,7 @@ NTSTATUS rpccli_spoolss_EnumForms(struct rpc_pipe_client *cli, /* Return variables */ *count = *r.out.count; - if (info && r.out.info) { - memcpy(info, r.out.info, *count * sizeof(*info)); - } + *info = *r.out.info; *needed = *r.out.needed; /* Return result */ @@ -1756,7 +1746,7 @@ NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, uint32_t *count /* [out] [ref] */, - union spoolss_PortInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, + union spoolss_PortInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */, uint32_t *needed /* [out] [ref] */, WERROR *werror) { @@ -1793,9 +1783,7 @@ NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli, /* Return variables */ *count = *r.out.count; - if (info && r.out.info) { - memcpy(info, r.out.info, *count * sizeof(*info)); - } + *info = *r.out.info; *needed = *r.out.needed; /* Return result */ @@ -1813,7 +1801,7 @@ NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, uint32_t *count /* [out] [ref] */, - union spoolss_MonitorInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, + union spoolss_MonitorInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */, uint32_t *needed /* [out] [ref] */, WERROR *werror) { @@ -1850,9 +1838,7 @@ NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli, /* Return variables */ *count = *r.out.count; - if (info && r.out.info) { - memcpy(info, r.out.info, *count * sizeof(*info)); - } + *info = *r.out.info; *needed = *r.out.needed; /* Return result */ @@ -2445,12 +2431,25 @@ NTSTATUS rpccli_spoolss_DeletePrintProvidor(struct rpc_pipe_client *cli, NTSTATUS rpccli_spoolss_EnumPrintProcDataTypes(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *servername /* [in] [unique,charset(UTF16)] */, + const char *print_processor_name /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + DATA_BLOB *buffer /* [in] [unique] */, + uint32_t offered /* [in] */, + uint32_t *count /* [out] [ref] */, + union spoolss_PrintProcDataTypesInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */, + uint32_t *needed /* [out] [ref] */, WERROR *werror) { struct spoolss_EnumPrintProcDataTypes r; NTSTATUS status; /* In parameters */ + r.in.servername = servername; + r.in.print_processor_name = print_processor_name; + r.in.level = level; + r.in.buffer = buffer; + r.in.offered = offered; if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcDataTypes, &r); @@ -2475,6 +2474,9 @@ NTSTATUS rpccli_spoolss_EnumPrintProcDataTypes(struct rpc_pipe_client *cli, } /* Return variables */ + *count = *r.out.count; + *info = *r.out.info; + *needed = *r.out.needed; /* Return result */ if (werror) { @@ -3424,8 +3426,8 @@ NTSTATUS rpccli_spoolss_EnumPrinterData(struct rpc_pipe_client *cli, const char *value_name /* [out] [charset(UTF16),size_is(value_offered/2)] */, uint32_t value_offered /* [in] */, uint32_t *value_needed /* [out] [ref] */, - uint32_t *printerdata_type /* [out] [ref] */, - DATA_BLOB *buffer /* [out] [ref] */, + enum winreg_Type *type /* [out] [ref] */, + uint8_t *data /* [out] [ref,flag(LIBNDR_PRINT_ARRAY_HEX),size_is(data_offered)] */, uint32_t data_offered /* [in] */, uint32_t *data_needed /* [out] [ref] */, WERROR *werror) @@ -3464,8 +3466,8 @@ NTSTATUS rpccli_spoolss_EnumPrinterData(struct rpc_pipe_client *cli, /* Return variables */ memcpy(CONST_DISCARD(char *, value_name), r.out.value_name, r.in.value_offered / 2 * sizeof(*value_name)); *value_needed = *r.out.value_needed; - *printerdata_type = *r.out.printerdata_type; - *buffer = *r.out.buffer; + *type = *r.out.type; + memcpy(data, r.out.data, r.in.data_offered * sizeof(*data)); *data_needed = *r.out.data_needed; /* Return result */ @@ -3649,7 +3651,7 @@ NTSTATUS rpccli_spoolss_SetPrinterDataEx(struct rpc_pipe_client *cli, struct policy_handle *handle /* [in] [ref] */, const char *key_name /* [in] [charset(UTF16)] */, const char *value_name /* [in] [charset(UTF16)] */, - uint32_t type /* [in] */, + enum winreg_Type type /* [in] */, uint8_t *buffer /* [in] [ref,size_is(offered)] */, uint32_t offered /* [in] */, WERROR *werror) @@ -3702,7 +3704,7 @@ NTSTATUS rpccli_spoolss_GetPrinterDataEx(struct rpc_pipe_client *cli, struct policy_handle *handle /* [in] [ref] */, const char *key_name /* [in] [charset(UTF16)] */, const char *value_name /* [in] [charset(UTF16)] */, - uint32_t *type /* [out] [ref] */, + enum winreg_Type *type /* [out] [ref] */, uint8_t *buffer /* [out] [ref,size_is(offered)] */, uint32_t offered /* [in] */, uint32_t *needed /* [out] [ref] */, @@ -3756,10 +3758,10 @@ NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle /* [in] [ref] */, const char *key_name /* [in] [charset(UTF16)] */, - uint8_t *buffer /* [out] [ref,size_is(offered)] */, uint32_t offered /* [in] */, - uint32_t *needed /* [out] [ref] */, uint32_t *count /* [out] [ref] */, + struct spoolss_PrinterEnumValues **info /* [out] [ref,size_is(,*count)] */, + uint32_t *needed /* [out] [ref] */, WERROR *werror) { struct spoolss_EnumPrinterDataEx r; @@ -3793,9 +3795,9 @@ NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli, } /* Return variables */ - memcpy(buffer, r.out.buffer, r.in.offered * sizeof(*buffer)); - *needed = *r.out.needed; *count = *r.out.count; + *info = *r.out.info; + *needed = *r.out.needed; /* Return result */ if (werror) { @@ -3809,8 +3811,8 @@ NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle /* [in] [ref] */, const char *key_name /* [in] [charset(UTF16)] */, - uint16_t *key_buffer /* [out] [ref,size_is(key_buffer_size/2)] */, - uint32_t key_buffer_size /* [in] */, + const char ** *key_buffer /* [out] [subcontext_size(offered),ref,subcontext(0),flag(LIBNDR_FLAG_STR_NULLTERM)] */, + uint32_t offered /* [in] */, uint32_t *needed /* [out] [ref] */, WERROR *werror) { @@ -3820,7 +3822,7 @@ NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli, /* In parameters */ r.in.handle = handle; r.in.key_name = key_name; - r.in.key_buffer_size = key_buffer_size; + r.in.offered = offered; if (DEBUGLEVEL >= 10) { NDR_PRINT_IN_DEBUG(spoolss_EnumPrinterKey, &r); @@ -3845,7 +3847,7 @@ NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli, } /* Return variables */ - memcpy(key_buffer, r.out.key_buffer, r.in.key_buffer_size / 2 * sizeof(*key_buffer)); + *key_buffer = *r.out.key_buffer; *needed = *r.out.needed; /* Return result */ diff --git a/librpc/gen_ndr/cli_spoolss.h b/librpc/gen_ndr/cli_spoolss.h index 83b2e28729..eb86e8c6a0 100644 --- a/librpc/gen_ndr/cli_spoolss.h +++ b/librpc/gen_ndr/cli_spoolss.h @@ -9,7 +9,7 @@ NTSTATUS rpccli_spoolss_EnumPrinters(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, uint32_t *count /* [out] [ref] */, - union spoolss_PrinterInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, + union spoolss_PrinterInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */, uint32_t *needed /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_OpenPrinter(struct rpc_pipe_client *cli, @@ -46,7 +46,7 @@ NTSTATUS rpccli_spoolss_EnumJobs(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, uint32_t *count /* [out] [ref] */, - union spoolss_JobInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, + union spoolss_JobInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */, uint32_t *needed /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_AddPrinter(struct rpc_pipe_client *cli, @@ -86,7 +86,7 @@ NTSTATUS rpccli_spoolss_EnumPrinterDrivers(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, uint32_t *count /* [out] [ref] */, - union spoolss_DriverInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, + union spoolss_DriverInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */, uint32_t *needed /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_GetPrinterDriver(struct rpc_pipe_client *cli, @@ -123,7 +123,7 @@ NTSTATUS rpccli_spoolss_EnumPrintProcessors(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, uint32_t *count /* [out] [ref] */, - union spoolss_PrintProcessorInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, + union spoolss_PrintProcessorInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */, uint32_t *needed /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_GetPrintProcessorDirectory(struct rpc_pipe_client *cli, @@ -191,15 +191,15 @@ NTSTATUS rpccli_spoolss_GetPrinterData(struct rpc_pipe_client *cli, struct policy_handle *handle /* [in] [ref] */, const char *value_name /* [in] [charset(UTF16)] */, uint32_t offered /* [in] */, - enum spoolss_PrinterDataType *type /* [out] [ref] */, - union spoolss_PrinterData data /* [out] [subcontext_size(offered),subcontext(4),switch_is(*type)] */, + enum winreg_Type *type /* [out] [ref] */, + union spoolss_PrinterData *data /* [out] [subcontext_size(offered),ref,subcontext(4),switch_is(*type)] */, uint32_t *needed /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_SetPrinterData(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle /* [in] [ref] */, const char *value_name /* [in] [charset(UTF16)] */, - enum spoolss_PrinterDataType type /* [in] */, + enum winreg_Type type /* [in] */, union spoolss_PrinterData data /* [in] [subcontext(4),switch_is(type)] */, uint32_t _offered /* [in] [value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] */, WERROR *werror); @@ -245,7 +245,7 @@ NTSTATUS rpccli_spoolss_EnumForms(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, uint32_t *count /* [out] [ref] */, - union spoolss_FormInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, + union spoolss_FormInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */, uint32_t *needed /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli, @@ -255,7 +255,7 @@ NTSTATUS rpccli_spoolss_EnumPorts(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, uint32_t *count /* [out] [ref] */, - union spoolss_PortInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, + union spoolss_PortInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */, uint32_t *needed /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli, @@ -265,7 +265,7 @@ NTSTATUS rpccli_spoolss_EnumMonitors(struct rpc_pipe_client *cli, DATA_BLOB *buffer /* [in] [unique] */, uint32_t offered /* [in] */, uint32_t *count /* [out] [ref] */, - union spoolss_MonitorInfo *info /* [out] [unique,switch_is(level),size_is(*count)] */, + union spoolss_MonitorInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */, uint32_t *needed /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_AddPort(struct rpc_pipe_client *cli, @@ -315,6 +315,14 @@ NTSTATUS rpccli_spoolss_DeletePrintProvidor(struct rpc_pipe_client *cli, WERROR *werror); NTSTATUS rpccli_spoolss_EnumPrintProcDataTypes(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, + const char *servername /* [in] [unique,charset(UTF16)] */, + const char *print_processor_name /* [in] [unique,charset(UTF16)] */, + uint32_t level /* [in] */, + DATA_BLOB *buffer /* [in] [unique] */, + uint32_t offered /* [in] */, + uint32_t *count /* [out] [ref] */, + union spoolss_PrintProcDataTypesInfo **info /* [out] [ref,switch_is(level),size_is(,*count)] */, + uint32_t *needed /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_ResetPrinter(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, @@ -438,8 +446,8 @@ NTSTATUS rpccli_spoolss_EnumPrinterData(struct rpc_pipe_client *cli, const char *value_name /* [out] [charset(UTF16),size_is(value_offered/2)] */, uint32_t value_offered /* [in] */, uint32_t *value_needed /* [out] [ref] */, - uint32_t *printerdata_type /* [out] [ref] */, - DATA_BLOB *buffer /* [out] [ref] */, + enum winreg_Type *type /* [out] [ref] */, + uint8_t *data /* [out] [ref,flag(LIBNDR_PRINT_ARRAY_HEX),size_is(data_offered)] */, uint32_t data_offered /* [in] */, uint32_t *data_needed /* [out] [ref] */, WERROR *werror); @@ -462,7 +470,7 @@ NTSTATUS rpccli_spoolss_SetPrinterDataEx(struct rpc_pipe_client *cli, struct policy_handle *handle /* [in] [ref] */, const char *key_name /* [in] [charset(UTF16)] */, const char *value_name /* [in] [charset(UTF16)] */, - uint32_t type /* [in] */, + enum winreg_Type type /* [in] */, uint8_t *buffer /* [in] [ref,size_is(offered)] */, uint32_t offered /* [in] */, WERROR *werror); @@ -471,7 +479,7 @@ NTSTATUS rpccli_spoolss_GetPrinterDataEx(struct rpc_pipe_client *cli, struct policy_handle *handle /* [in] [ref] */, const char *key_name /* [in] [charset(UTF16)] */, const char *value_name /* [in] [charset(UTF16)] */, - uint32_t *type /* [out] [ref] */, + enum winreg_Type *type /* [out] [ref] */, uint8_t *buffer /* [out] [ref,size_is(offered)] */, uint32_t offered /* [in] */, uint32_t *needed /* [out] [ref] */, @@ -480,17 +488,17 @@ NTSTATUS rpccli_spoolss_EnumPrinterDataEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle /* [in] [ref] */, const char *key_name /* [in] [charset(UTF16)] */, - uint8_t *buffer /* [out] [ref,size_is(offered)] */, uint32_t offered /* [in] */, - uint32_t *needed /* [out] [ref] */, uint32_t *count /* [out] [ref] */, + struct spoolss_PrinterEnumValues **info /* [out] [ref,size_is(,*count)] */, + uint32_t *needed /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_EnumPrinterKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, struct policy_handle *handle /* [in] [ref] */, const char *key_name /* [in] [charset(UTF16)] */, - uint16_t *key_buffer /* [out] [ref,size_is(key_buffer_size/2)] */, - uint32_t key_buffer_size /* [in] */, + const char ** *key_buffer /* [out] [subcontext_size(offered),ref,subcontext(0),flag(LIBNDR_FLAG_STR_NULLTERM)] */, + uint32_t offered /* [in] */, uint32_t *needed /* [out] [ref] */, WERROR *werror); NTSTATUS rpccli_spoolss_DeletePrinterDataEx(struct rpc_pipe_client *cli, diff --git a/librpc/gen_ndr/ndr_drsblobs.c b/librpc/gen_ndr/ndr_drsblobs.c index ee7c9933c2..426ade259c 100644 --- a/librpc/gen_ndr/ndr_drsblobs.c +++ b/librpc/gen_ndr/ndr_drsblobs.c @@ -1856,7 +1856,6 @@ _PUBLIC_ void ndr_print_package_PrimaryKerberosKey4(struct ndr_print *ndr, const static enum ndr_err_code ndr_push_package_PrimaryKerberosCtr4(struct ndr_push *ndr, int ndr_flags, const struct package_PrimaryKerberosCtr4 *r) { uint32_t cntr_keys_0; - uint32_t cntr_service_keys_0; uint32_t cntr_old_keys_0; uint32_t cntr_older_keys_0; if (ndr_flags & NDR_SCALARS) { diff --git a/librpc/gen_ndr/ndr_spoolss.c b/librpc/gen_ndr/ndr_spoolss.c index 31220edc62..f5b161a9c7 100644 --- a/librpc/gen_ndr/ndr_spoolss.c +++ b/librpc/gen_ndr/ndr_spoolss.c @@ -224,7 +224,87 @@ _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_PrinterInfo0(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo0 *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--; +} + +_PUBLIC_ 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) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -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)); @@ -291,7 +371,7 @@ static enum ndr_err_code ndr_push_spoolss_PrinterInfo0(struct ndr_push *ndr, int return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_PrinterInfo0(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo0 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo0(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo0 *r) { uint32_t _ptr_printername; TALLOC_CTX *_mem_save_printername_0; @@ -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); @@ -432,6 +512,11 @@ _PUBLIC_ void ndr_print_spoolss_PrinterInfo0(struct ndr_print *ndr, const char * ndr->depth--; } +_PUBLIC_ size_t ndr_size_spoolss_PrinterInfo0(const struct spoolss_PrinterInfo0 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo0, ic); +} + static enum ndr_err_code ndr_push_spoolss_DeviceModeFields(struct ndr_push *ndr, int ndr_flags, uint32_t r) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); @@ -678,7 +763,7 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinterFlags(struct ndr_print *ndr, const ch ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_PrinterInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo1 *r) +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo1 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -734,7 +819,7 @@ static enum ndr_err_code ndr_push_spoolss_PrinterInfo1(struct ndr_push *ndr, int return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_PrinterInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo1 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo1 *r) { uint32_t _ptr_name; TALLOC_CTX *_mem_save_name_0; @@ -858,6 +943,11 @@ _PUBLIC_ void ndr_print_spoolss_PrinterInfo1(struct ndr_print *ndr, const char * ndr->depth--; } +_PUBLIC_ size_t ndr_size_spoolss_PrinterInfo1(const struct spoolss_PrinterInfo1 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo1, ic); +} + static enum ndr_err_code ndr_push_spoolss_PrinterAttributes(struct ndr_push *ndr, int ndr_flags, uint32_t r) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); @@ -895,53 +985,7 @@ _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) +_PUBLIC_ 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) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -1144,7 +1188,7 @@ static enum ndr_err_code ndr_push_spoolss_PrinterInfo2(struct ndr_push *ndr, int return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_PrinterInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo2 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo2 *r) { uint32_t _ptr_servername; TALLOC_CTX *_mem_save_servername_0; @@ -1322,6 +1366,9 @@ static enum ndr_err_code ndr_pull_spoolss_PrinterInfo2(struct ndr_pull *ndr, int } NDR_CHECK(ndr_pull_spoolss_PrinterAttributes(ndr, NDR_SCALARS, &r->attributes)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority)); + if (r->priority > 99) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->defaultpriority)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->starttime)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->untiltime)); @@ -1622,7 +1669,12 @@ _PUBLIC_ void ndr_print_spoolss_PrinterInfo2(struct ndr_print *ndr, const char * ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_PrinterInfo3(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo3 *r) +_PUBLIC_ size_t ndr_size_spoolss_PrinterInfo2(const struct spoolss_PrinterInfo2 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo2, ic); +} + +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo3(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo3 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -1642,7 +1694,7 @@ static enum ndr_err_code ndr_push_spoolss_PrinterInfo3(struct ndr_push *ndr, int return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_PrinterInfo3(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo3 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo3(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo3 *r) { uint32_t _ptr_secdesc; TALLOC_CTX *_mem_save_secdesc_0; @@ -1689,7 +1741,12 @@ _PUBLIC_ void ndr_print_spoolss_PrinterInfo3(struct ndr_print *ndr, const char * ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_PrinterInfo4(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo4 *r) +_PUBLIC_ size_t ndr_size_spoolss_PrinterInfo3(const struct spoolss_PrinterInfo3 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo3, ic); +} + +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo4(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo4 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -1730,7 +1787,7 @@ static enum ndr_err_code ndr_push_spoolss_PrinterInfo4(struct ndr_push *ndr, int return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_PrinterInfo4(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo4 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo4(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo4 *r) { uint32_t _ptr_printername; TALLOC_CTX *_mem_save_printername_0; @@ -1819,7 +1876,12 @@ _PUBLIC_ void ndr_print_spoolss_PrinterInfo4(struct ndr_print *ndr, const char * ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_PrinterInfo5(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo5 *r) +_PUBLIC_ size_t ndr_size_spoolss_PrinterInfo4(const struct spoolss_PrinterInfo4 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo4, ic); +} + +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo5(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo5 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -1862,7 +1924,7 @@ static enum ndr_err_code ndr_push_spoolss_PrinterInfo5(struct ndr_push *ndr, int return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_PrinterInfo5(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo5 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo5(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo5 *r) { uint32_t _ptr_printername; TALLOC_CTX *_mem_save_printername_0; @@ -1955,7 +2017,12 @@ _PUBLIC_ void ndr_print_spoolss_PrinterInfo5(struct ndr_print *ndr, const char * ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_PrinterInfo6(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo6 *r) +_PUBLIC_ size_t ndr_size_spoolss_PrinterInfo5(const struct spoolss_PrinterInfo5 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo5, ic); +} + +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo6(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo6 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -1966,7 +2033,7 @@ static enum ndr_err_code ndr_push_spoolss_PrinterInfo6(struct ndr_push *ndr, int return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_PrinterInfo6(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo6 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo6(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo6 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 4)); @@ -1985,6 +2052,11 @@ _PUBLIC_ void ndr_print_spoolss_PrinterInfo6(struct ndr_print *ndr, const char * ndr->depth--; } +_PUBLIC_ size_t ndr_size_spoolss_PrinterInfo6(const struct spoolss_PrinterInfo6 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo6, ic); +} + static enum ndr_err_code ndr_push_spoolss_DsPrintAction(struct ndr_push *ndr, int ndr_flags, uint32_t r) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); @@ -2011,7 +2083,7 @@ _PUBLIC_ void ndr_print_spoolss_DsPrintAction(struct ndr_print *ndr, const char ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_PrinterInfo7(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo7 *r) +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterInfo7(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo7 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -2037,7 +2109,7 @@ static enum ndr_err_code ndr_push_spoolss_PrinterInfo7(struct ndr_push *ndr, int return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_PrinterInfo7(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo7 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterInfo7(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo7 *r) { uint32_t _ptr_guid; TALLOC_CTX *_mem_save_guid_0; @@ -2091,6 +2163,11 @@ _PUBLIC_ void ndr_print_spoolss_PrinterInfo7(struct ndr_print *ndr, const char * ndr->depth--; } +_PUBLIC_ size_t ndr_size_spoolss_PrinterInfo7(const struct spoolss_PrinterInfo7 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo7, ic); +} + static enum ndr_err_code ndr_push_spoolss_DeviceModeInfo(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DeviceModeInfo *r) { if (ndr_flags & NDR_SCALARS) { @@ -2456,6 +2533,11 @@ _PUBLIC_ void ndr_print_spoolss_PrinterInfo(struct ndr_print *ndr, const char *n } } +_PUBLIC_ size_t ndr_size_spoolss_PrinterInfo(const union spoolss_PrinterInfo *r, uint32_t level, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterInfo, ic); +} + static enum ndr_err_code ndr_push_spoolss_DevmodeContainer(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DevmodeContainer *r) { if (ndr_flags & NDR_SCALARS) { @@ -2520,41 +2602,7 @@ _PUBLIC_ void ndr_print_spoolss_DevmodeContainer(struct ndr_print *ndr, const ch ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_JobStatus(struct ndr_push *ndr, int ndr_flags, uint32_t r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_spoolss_JobStatus(struct ndr_pull *ndr, int ndr_flags, uint32_t *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_spoolss_JobStatus(struct ndr_print *ndr, const char *name, uint32_t r) -{ - ndr_print_uint32(ndr, name, r); - ndr->depth++; - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_PAUSED", JOB_STATUS_PAUSED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_ERROR", JOB_STATUS_ERROR, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_DELETING", JOB_STATUS_DELETING, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_SPOOLING", JOB_STATUS_SPOOLING, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_PRINTING", JOB_STATUS_PRINTING, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_OFFLINE", JOB_STATUS_OFFLINE, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_PAPEROUT", JOB_STATUS_PAPEROUT, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_PRINTED", JOB_STATUS_PRINTED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_DELETED", JOB_STATUS_DELETED, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_BLOCKED_DEVQ", JOB_STATUS_BLOCKED_DEVQ, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_USER_INTERVENTION", JOB_STATUS_USER_INTERVENTION, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_RESTART", JOB_STATUS_RESTART, r); - ndr_print_bitmap_flag(ndr, sizeof(uint32_t), "JOB_STATUS_COMPLETE", JOB_STATUS_COMPLETE, r); - ndr->depth--; -} - -static enum ndr_err_code ndr_push_spoolss_JobInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_JobInfo1 *r) +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_JobInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_JobInfo1 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -2661,7 +2709,7 @@ static enum ndr_err_code ndr_push_spoolss_JobInfo1(struct ndr_push *ndr, int ndr return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_JobInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_JobInfo1 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_JobInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_JobInfo1 *r) { uint32_t _ptr_printer_name; TALLOC_CTX *_mem_save_printer_name_0; @@ -2752,6 +2800,9 @@ static enum ndr_err_code ndr_pull_spoolss_JobInfo1(struct ndr_pull *ndr, int ndr } NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->status)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority)); + if (r->priority > 99) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } 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)); @@ -2902,7 +2953,12 @@ _PUBLIC_ void ndr_print_spoolss_JobInfo1(struct ndr_print *ndr, const char *name ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_JobInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_JobInfo2 *r) +_PUBLIC_ size_t ndr_size_spoolss_JobInfo1(const struct spoolss_JobInfo1 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_JobInfo1, ic); +} + +_PUBLIC_ 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)); @@ -3083,7 +3139,7 @@ static enum ndr_err_code ndr_push_spoolss_JobInfo2(struct ndr_push *ndr, int ndr return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_JobInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_JobInfo2 *r) +_PUBLIC_ 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; @@ -3248,6 +3304,9 @@ static enum ndr_err_code ndr_pull_spoolss_JobInfo2(struct ndr_pull *ndr, int ndr } NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->status)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority)); + if (r->priority > 99) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } 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)); @@ -3522,7 +3581,12 @@ _PUBLIC_ void ndr_print_spoolss_JobInfo2(struct ndr_print *ndr, const char *name ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_JobInfo3(struct ndr_push *ndr, int ndr_flags, const struct spoolss_JobInfo3 *r) +_PUBLIC_ size_t ndr_size_spoolss_JobInfo2(const struct spoolss_JobInfo2 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_JobInfo2, ic); +} + +_PUBLIC_ 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)); @@ -3535,7 +3599,7 @@ static enum ndr_err_code ndr_push_spoolss_JobInfo3(struct ndr_push *ndr, int ndr return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_JobInfo3(struct ndr_pull *ndr, int ndr_flags, struct spoolss_JobInfo3 *r) +_PUBLIC_ 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)); @@ -3558,7 +3622,12 @@ _PUBLIC_ void ndr_print_spoolss_JobInfo3(struct ndr_print *ndr, const char *name ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_JobInfo4(struct ndr_push *ndr, int ndr_flags, const struct spoolss_JobInfo4 *r) +_PUBLIC_ size_t ndr_size_spoolss_JobInfo3(const struct spoolss_JobInfo3 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_JobInfo3, ic); +} + +_PUBLIC_ 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)); @@ -3740,7 +3809,7 @@ static enum ndr_err_code ndr_push_spoolss_JobInfo4(struct ndr_push *ndr, int ndr return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_JobInfo4(struct ndr_pull *ndr, int ndr_flags, struct spoolss_JobInfo4 *r) +_PUBLIC_ 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; @@ -3905,6 +3974,9 @@ static enum ndr_err_code ndr_pull_spoolss_JobInfo4(struct ndr_pull *ndr, int ndr } NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->status)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority)); + if (r->priority > 99) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } 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)); @@ -4181,6 +4253,11 @@ _PUBLIC_ void ndr_print_spoolss_JobInfo4(struct ndr_print *ndr, const char *name ndr->depth--; } +_PUBLIC_ size_t ndr_size_spoolss_JobInfo4(const struct spoolss_JobInfo4 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_JobInfo4, ic); +} + _PUBLIC_ enum ndr_err_code ndr_push_spoolss_JobInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_JobInfo *r) { uint32_t _save_relative_base_offset = ndr_push_get_relative_base_offset(ndr); @@ -4335,6 +4412,11 @@ _PUBLIC_ void ndr_print_spoolss_JobInfo(struct ndr_print *ndr, const char *name, } } +_PUBLIC_ size_t ndr_size_spoolss_JobInfo(const union spoolss_JobInfo *r, uint32_t level, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_spoolss_JobInfo, ic); +} + 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) { @@ -4449,6 +4531,9 @@ static enum ndr_err_code ndr_pull_spoolss_SetJobInfo1(struct ndr_pull *ndr, int } NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->status)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority)); + if (r->priority > 99) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } 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)); @@ -4595,9 +4680,9 @@ static enum ndr_err_code ndr_push_spoolss_SetJobInfo2(struct ndr_push *ndr, int NDR_CHECK(ndr_push_unique_ptr(ndr, r->print_processor)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->parameters)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->driver_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->devmode)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->_devmode_ptr)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->text_status)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->secdesc)); + 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)); @@ -4664,18 +4749,12 @@ static enum ndr_err_code ndr_push_spoolss_SetJobInfo2(struct ndr_push *ndr, int NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_name, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->driver_name, ndr_charset_length(r->driver_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - if (r->devmode) { - NDR_CHECK(ndr_push_spoolss_DeviceMode(ndr, NDR_SCALARS, r->devmode)); - } if (r->text_status) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->text_status, CH_UTF16))); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->text_status, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->text_status, ndr_charset_length(r->text_status, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - if (r->secdesc) { - NDR_CHECK(ndr_push_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); - } } return NDR_ERR_SUCCESS; } @@ -4700,12 +4779,8 @@ static enum ndr_err_code ndr_pull_spoolss_SetJobInfo2(struct ndr_pull *ndr, int 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)); @@ -4763,26 +4838,19 @@ static enum ndr_err_code ndr_pull_spoolss_SetJobInfo2(struct ndr_pull *ndr, int } else { r->driver_name = NULL; } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devmode)); - if (_ptr_devmode) { - NDR_PULL_ALLOC(ndr, r->devmode); - } else { - r->devmode = NULL; - } + NDR_CHECK(ndr_pull_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_generic_ptr(ndr, &_ptr_secdesc)); - if (_ptr_secdesc) { - NDR_PULL_ALLOC(ndr, r->secdesc); - } else { - r->secdesc = NULL; - } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_secdesc_ptr)); NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->status)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority)); + if (r->priority > 99) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } 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)); @@ -4901,12 +4969,6 @@ static enum ndr_err_code ndr_pull_spoolss_SetJobInfo2(struct ndr_pull *ndr, int NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->driver_name, ndr_get_array_length(ndr, &r->driver_name), sizeof(uint16_t), CH_UTF16)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0); } - if (r->devmode) { - _mem_save_devmode_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->devmode, 0); - NDR_CHECK(ndr_pull_spoolss_DeviceMode(ndr, NDR_SCALARS, r->devmode)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devmode_0, 0); - } if (r->text_status) { _mem_save_text_status_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->text_status, 0); @@ -4919,12 +4981,6 @@ static enum ndr_err_code ndr_pull_spoolss_SetJobInfo2(struct ndr_pull *ndr, int NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->text_status, ndr_get_array_length(ndr, &r->text_status), sizeof(uint16_t), CH_UTF16)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_text_status_0, 0); } - if (r->secdesc) { - _mem_save_secdesc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->secdesc, 0); - NDR_CHECK(ndr_pull_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0); - } } return NDR_ERR_SUCCESS; } @@ -4988,24 +5044,14 @@ _PUBLIC_ void ndr_print_spoolss_SetJobInfo2(struct ndr_print *ndr, const char *n 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_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_ptr(ndr, "secdesc", r->secdesc); - ndr->depth++; - if (r->secdesc) { - ndr_print_security_descriptor(ndr, "secdesc", r->secdesc); - } - 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); @@ -5033,9 +5079,9 @@ static enum ndr_err_code ndr_push_spoolss_SetJobInfo4(struct ndr_push *ndr, int NDR_CHECK(ndr_push_unique_ptr(ndr, r->print_processor)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->parameters)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->driver_name)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->devmode)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->_devmode_ptr)); NDR_CHECK(ndr_push_unique_ptr(ndr, r->text_status)); - NDR_CHECK(ndr_push_unique_ptr(ndr, r->secdesc)); + 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)); @@ -5103,18 +5149,12 @@ static enum ndr_err_code ndr_push_spoolss_SetJobInfo4(struct ndr_push *ndr, int NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->driver_name, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->driver_name, ndr_charset_length(r->driver_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - if (r->devmode) { - NDR_CHECK(ndr_push_spoolss_DeviceMode(ndr, NDR_SCALARS, r->devmode)); - } if (r->text_status) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->text_status, CH_UTF16))); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->text_status, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->text_status, ndr_charset_length(r->text_status, CH_UTF16), sizeof(uint16_t), CH_UTF16)); } - if (r->secdesc) { - NDR_CHECK(ndr_push_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); - } } return NDR_ERR_SUCCESS; } @@ -5139,12 +5179,8 @@ static enum ndr_err_code ndr_pull_spoolss_SetJobInfo4(struct ndr_pull *ndr, int 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)); @@ -5202,26 +5238,19 @@ static enum ndr_err_code ndr_pull_spoolss_SetJobInfo4(struct ndr_pull *ndr, int } else { r->driver_name = NULL; } - NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_devmode)); - if (_ptr_devmode) { - NDR_PULL_ALLOC(ndr, r->devmode); - } else { - r->devmode = NULL; - } + NDR_CHECK(ndr_pull_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_generic_ptr(ndr, &_ptr_secdesc)); - if (_ptr_secdesc) { - NDR_PULL_ALLOC(ndr, r->secdesc); - } else { - r->secdesc = NULL; - } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->_secdesc_ptr)); NDR_CHECK(ndr_pull_spoolss_JobStatus(ndr, NDR_SCALARS, &r->status)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority)); + if (r->priority > 99) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } 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)); @@ -5341,12 +5370,6 @@ static enum ndr_err_code ndr_pull_spoolss_SetJobInfo4(struct ndr_pull *ndr, int NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->driver_name, ndr_get_array_length(ndr, &r->driver_name), sizeof(uint16_t), CH_UTF16)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_driver_name_0, 0); } - if (r->devmode) { - _mem_save_devmode_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->devmode, 0); - NDR_CHECK(ndr_pull_spoolss_DeviceMode(ndr, NDR_SCALARS, r->devmode)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_devmode_0, 0); - } if (r->text_status) { _mem_save_text_status_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->text_status, 0); @@ -5359,12 +5382,6 @@ static enum ndr_err_code ndr_pull_spoolss_SetJobInfo4(struct ndr_pull *ndr, int NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->text_status, ndr_get_array_length(ndr, &r->text_status), sizeof(uint16_t), CH_UTF16)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_text_status_0, 0); } - if (r->secdesc) { - _mem_save_secdesc_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->secdesc, 0); - NDR_CHECK(ndr_pull_security_descriptor(ndr, NDR_SCALARS|NDR_BUFFERS, r->secdesc)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_secdesc_0, 0); - } } return NDR_ERR_SUCCESS; } @@ -5428,24 +5445,14 @@ _PUBLIC_ void ndr_print_spoolss_SetJobInfo4(struct ndr_print *ndr, const char *n 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_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_ptr(ndr, "secdesc", r->secdesc); - ndr->depth++; - if (r->secdesc) { - ndr_print_security_descriptor(ndr, "secdesc", r->secdesc); - } - 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); @@ -6300,6 +6307,9 @@ static enum ndr_err_code ndr_pull_spoolss_SetPrinterInfo2(struct ndr_pull *ndr, } NDR_CHECK(ndr_pull_spoolss_PrinterAttributes(ndr, NDR_SCALARS, &r->attributes)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->priority)); + if (r->priority > 99) { + return ndr_pull_error(ndr, NDR_ERR_RANGE, "value out of range"); + } NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->defaultpriority)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->starttime)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->untiltime)); @@ -13694,6 +13704,11 @@ _PUBLIC_ void ndr_print_spoolss_DriverInfo(struct ndr_print *ndr, const char *na } } +_PUBLIC_ size_t ndr_size_spoolss_DriverInfo(const union spoolss_DriverInfo *r, uint32_t level, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverInfo, ic); +} + _PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverDirectoryInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverDirectoryInfo1 *r) { if (ndr_flags & NDR_SCALARS) { @@ -13833,7 +13848,7 @@ _PUBLIC_ size_t ndr_size_spoolss_DriverDirectoryInfo(const union spoolss_DriverD return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_spoolss_DriverDirectoryInfo, ic); } -static enum ndr_err_code ndr_push_spoolss_PrintProcessorInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrintProcessorInfo1 *r) +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrintProcessorInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrintProcessorInfo1 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -13858,7 +13873,7 @@ static enum ndr_err_code ndr_push_spoolss_PrintProcessorInfo1(struct ndr_push *n return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_PrintProcessorInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrintProcessorInfo1 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrintProcessorInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrintProcessorInfo1 *r) { uint32_t _ptr_print_processor_name; TALLOC_CTX *_mem_save_print_processor_name_0; @@ -13910,6 +13925,11 @@ _PUBLIC_ void ndr_print_spoolss_PrintProcessorInfo1(struct ndr_print *ndr, const ndr->depth--; } +_PUBLIC_ size_t ndr_size_spoolss_PrintProcessorInfo1(const struct spoolss_PrintProcessorInfo1 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrintProcessorInfo1, ic); +} + _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrintProcessorInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_PrintProcessorInfo *r) { uint32_t _save_relative_base_offset = ndr_push_get_relative_base_offset(ndr); @@ -14534,43 +14554,15 @@ _PUBLIC_ size_t ndr_size_spoolss_OSVersionEx(const struct spoolss_OSVersionEx *r return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_OSVersionEx, ic); } -static enum ndr_err_code ndr_push_spoolss_PrinterDataType(struct ndr_push *ndr, int ndr_flags, enum spoolss_PrinterDataType r) -{ - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); - return NDR_ERR_SUCCESS; -} - -static enum ndr_err_code ndr_pull_spoolss_PrinterDataType(struct ndr_pull *ndr, int ndr_flags, enum spoolss_PrinterDataType *r) -{ - uint32_t v; - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &v)); - *r = v; - return NDR_ERR_SUCCESS; -} - -_PUBLIC_ void ndr_print_spoolss_PrinterDataType(struct ndr_print *ndr, const char *name, enum spoolss_PrinterDataType r) -{ - const char *val = NULL; - - switch (r) { - case SPOOLSS_PRINTER_DATA_TYPE_NULL: val = "SPOOLSS_PRINTER_DATA_TYPE_NULL"; break; - case SPOOLSS_PRINTER_DATA_TYPE_STRING: val = "SPOOLSS_PRINTER_DATA_TYPE_STRING"; break; - case SPOOLSS_PRINTER_DATA_TYPE_BINARY: val = "SPOOLSS_PRINTER_DATA_TYPE_BINARY"; break; - case SPOOLSS_PRINTER_DATA_TYPE_UINT32: val = "SPOOLSS_PRINTER_DATA_TYPE_UINT32"; break; - case SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY: val = "SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY"; break; - } - ndr_print_enum(ndr, name, "ENUM", val, r); -} - _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterData(struct ndr_push *ndr, int ndr_flags, const union spoolss_PrinterData *r) { if (ndr_flags & NDR_SCALARS) { int level = ndr_push_get_switch_value(ndr, r); switch (level) { - case SPOOLSS_PRINTER_DATA_TYPE_NULL: { + case REG_NONE: { break; } - case SPOOLSS_PRINTER_DATA_TYPE_STRING: { + case REG_SZ: { { uint32_t _flags_save_string = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); @@ -14579,7 +14571,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterData(struct ndr_push *ndr, in } break; } - case SPOOLSS_PRINTER_DATA_TYPE_BINARY: { + case REG_BINARY: { { uint32_t _flags_save_DATA_BLOB = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); @@ -14588,11 +14580,11 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterData(struct ndr_push *ndr, in } break; } - case SPOOLSS_PRINTER_DATA_TYPE_UINT32: { + case REG_DWORD: { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->value)); break; } - case SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY: { + case REG_MULTI_SZ: { { uint32_t _flags_save_string_array = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); @@ -14615,19 +14607,19 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterData(struct ndr_push *ndr, in if (ndr_flags & NDR_BUFFERS) { int level = ndr_push_get_switch_value(ndr, r); switch (level) { - case SPOOLSS_PRINTER_DATA_TYPE_NULL: + case REG_NONE: break; - case SPOOLSS_PRINTER_DATA_TYPE_STRING: + case REG_SZ: break; - case SPOOLSS_PRINTER_DATA_TYPE_BINARY: + case REG_BINARY: break; - case SPOOLSS_PRINTER_DATA_TYPE_UINT32: + case REG_DWORD: break; - case SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY: + case REG_MULTI_SZ: break; default: @@ -14644,10 +14636,10 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterData(struct ndr_pull *ndr, in level = ndr_pull_get_switch_value(ndr, r); if (ndr_flags & NDR_SCALARS) { switch (level) { - case SPOOLSS_PRINTER_DATA_TYPE_NULL: { + case REG_NONE: { break; } - case SPOOLSS_PRINTER_DATA_TYPE_STRING: { + case REG_SZ: { { uint32_t _flags_save_string = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); @@ -14656,7 +14648,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterData(struct ndr_pull *ndr, in } break; } - case SPOOLSS_PRINTER_DATA_TYPE_BINARY: { + case REG_BINARY: { { uint32_t _flags_save_DATA_BLOB = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_REMAINING); @@ -14665,11 +14657,11 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterData(struct ndr_pull *ndr, in } break; } - case SPOOLSS_PRINTER_DATA_TYPE_UINT32: { + case REG_DWORD: { NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->value)); break; } - case SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY: { + case REG_MULTI_SZ: { { uint32_t _flags_save_string_array = ndr->flags; ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); @@ -14691,19 +14683,19 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterData(struct ndr_pull *ndr, in } if (ndr_flags & NDR_BUFFERS) { switch (level) { - case SPOOLSS_PRINTER_DATA_TYPE_NULL: + case REG_NONE: break; - case SPOOLSS_PRINTER_DATA_TYPE_STRING: + case REG_SZ: break; - case SPOOLSS_PRINTER_DATA_TYPE_BINARY: + case REG_BINARY: break; - case SPOOLSS_PRINTER_DATA_TYPE_UINT32: + case REG_DWORD: break; - case SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY: + case REG_MULTI_SZ: break; default: @@ -14720,22 +14712,22 @@ _PUBLIC_ void ndr_print_spoolss_PrinterData(struct ndr_print *ndr, const char *n level = ndr_print_get_switch_value(ndr, r); ndr_print_union(ndr, name, level, "spoolss_PrinterData"); switch (level) { - case SPOOLSS_PRINTER_DATA_TYPE_NULL: + case REG_NONE: break; - case SPOOLSS_PRINTER_DATA_TYPE_STRING: + case REG_SZ: ndr_print_string(ndr, "string", r->string); break; - case SPOOLSS_PRINTER_DATA_TYPE_BINARY: + case REG_BINARY: ndr_print_DATA_BLOB(ndr, "binary", r->binary); break; - case SPOOLSS_PRINTER_DATA_TYPE_UINT32: + case REG_DWORD: ndr_print_uint32(ndr, "value", r->value); break; - case SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY: + case REG_MULTI_SZ: ndr_print_string_array(ndr, "string_array", r->string_array); break; @@ -14849,7 +14841,7 @@ _PUBLIC_ void ndr_print_spoolss_FormArea(struct ndr_print *ndr, const char *name ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_FormInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_FormInfo1 *r) +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_FormInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_FormInfo1 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -14877,7 +14869,7 @@ static enum ndr_err_code ndr_push_spoolss_FormInfo1(struct ndr_push *ndr, int nd return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_FormInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_FormInfo1 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_FormInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_FormInfo1 *r) { uint32_t _ptr_form_name; TALLOC_CTX *_mem_save_form_name_0; @@ -14935,6 +14927,11 @@ _PUBLIC_ void ndr_print_spoolss_FormInfo1(struct ndr_print *ndr, const char *nam ndr->depth--; } +_PUBLIC_ size_t ndr_size_spoolss_FormInfo1(const struct spoolss_FormInfo1 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_FormInfo1, ic); +} + 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)); @@ -14959,7 +14956,7 @@ _PUBLIC_ void ndr_print_spoolss_FormStringType(struct ndr_print *ndr, const char ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_FormInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_FormInfo2 *r) +_PUBLIC_ 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)); @@ -15035,7 +15032,7 @@ static enum ndr_err_code ndr_push_spoolss_FormInfo2(struct ndr_push *ndr, int nd return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_FormInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_FormInfo2 *r) +_PUBLIC_ 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; @@ -15204,6 +15201,11 @@ _PUBLIC_ void ndr_print_spoolss_FormInfo2(struct ndr_print *ndr, const char *nam ndr->depth--; } +_PUBLIC_ size_t ndr_size_spoolss_FormInfo2(const struct spoolss_FormInfo2 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_FormInfo2, ic); +} + _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); @@ -15696,7 +15698,7 @@ _PUBLIC_ void ndr_print_spoolss_AddFormInfo(struct ndr_print *ndr, const char *n } } -static enum ndr_err_code ndr_push_spoolss_PortInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PortInfo1 *r) +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PortInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PortInfo1 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -15721,7 +15723,7 @@ static enum ndr_err_code ndr_push_spoolss_PortInfo1(struct ndr_push *ndr, int nd return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_PortInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PortInfo1 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PortInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PortInfo1 *r) { uint32_t _ptr_port_name; TALLOC_CTX *_mem_save_port_name_0; @@ -15773,6 +15775,11 @@ _PUBLIC_ void ndr_print_spoolss_PortInfo1(struct ndr_print *ndr, const char *nam ndr->depth--; } +_PUBLIC_ size_t ndr_size_spoolss_PortInfo1(const struct spoolss_PortInfo1 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PortInfo1, ic); +} + static enum ndr_err_code ndr_push_spoolss_PortType(struct ndr_push *ndr, int ndr_flags, uint32_t r) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); @@ -15798,7 +15805,7 @@ _PUBLIC_ void ndr_print_spoolss_PortType(struct ndr_print *ndr, const char *name ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_PortInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PortInfo2 *r) +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PortInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PortInfo2 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -15855,7 +15862,7 @@ static enum ndr_err_code ndr_push_spoolss_PortInfo2(struct ndr_push *ndr, int nd return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_PortInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PortInfo2 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PortInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PortInfo2 *r) { uint32_t _ptr_port_name; TALLOC_CTX *_mem_save_port_name_0; @@ -15981,6 +15988,11 @@ _PUBLIC_ void ndr_print_spoolss_PortInfo2(struct ndr_print *ndr, const char *nam ndr->depth--; } +_PUBLIC_ size_t ndr_size_spoolss_PortInfo2(const struct spoolss_PortInfo2 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PortInfo2, ic); +} + 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)); @@ -16043,7 +16055,7 @@ _PUBLIC_ void ndr_print_spoolss_PortSeverity(struct ndr_print *ndr, const char * 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) +_PUBLIC_ 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)); @@ -16070,7 +16082,7 @@ static enum ndr_err_code ndr_push_spoolss_PortInfo3(struct ndr_push *ndr, int nd return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_PortInfo3(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PortInfo3 *r) +_PUBLIC_ 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; @@ -16126,7 +16138,12 @@ _PUBLIC_ void ndr_print_spoolss_PortInfo3(struct ndr_print *ndr, const char *nam ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_PortInfoFF(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PortInfoFF *r) +_PUBLIC_ size_t ndr_size_spoolss_PortInfo3(const struct spoolss_PortInfo3 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PortInfo3, ic); +} + +_PUBLIC_ 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)); @@ -16152,7 +16169,7 @@ static enum ndr_err_code ndr_push_spoolss_PortInfoFF(struct ndr_push *ndr, int n return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_PortInfoFF(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PortInfoFF *r) +_PUBLIC_ 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; @@ -16206,6 +16223,11 @@ _PUBLIC_ void ndr_print_spoolss_PortInfoFF(struct ndr_print *ndr, const char *na ndr->depth--; } +_PUBLIC_ size_t ndr_size_spoolss_PortInfoFF(const struct spoolss_PortInfoFF *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PortInfoFF, ic); +} + _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); @@ -16362,7 +16384,7 @@ _PUBLIC_ void ndr_print_spoolss_PortInfo(struct ndr_print *ndr, const char *name } } -static enum ndr_err_code ndr_push_spoolss_MonitorInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_MonitorInfo1 *r) +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_MonitorInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_MonitorInfo1 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -16387,7 +16409,7 @@ static enum ndr_err_code ndr_push_spoolss_MonitorInfo1(struct ndr_push *ndr, int return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_MonitorInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_MonitorInfo1 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_MonitorInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_MonitorInfo1 *r) { uint32_t _ptr_monitor_name; TALLOC_CTX *_mem_save_monitor_name_0; @@ -16439,7 +16461,12 @@ _PUBLIC_ void ndr_print_spoolss_MonitorInfo1(struct ndr_print *ndr, const char * ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_MonitorInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_MonitorInfo2 *r) +_PUBLIC_ size_t ndr_size_spoolss_MonitorInfo1(const struct spoolss_MonitorInfo1 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_MonitorInfo1, ic); +} + +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_MonitorInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_MonitorInfo2 *r) { if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); @@ -16494,7 +16521,7 @@ static enum ndr_err_code ndr_push_spoolss_MonitorInfo2(struct ndr_push *ndr, int return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_MonitorInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_MonitorInfo2 *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_MonitorInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_MonitorInfo2 *r) { uint32_t _ptr_monitor_name; TALLOC_CTX *_mem_save_monitor_name_0; @@ -16616,6 +16643,11 @@ _PUBLIC_ void ndr_print_spoolss_MonitorInfo2(struct ndr_print *ndr, const char * ndr->depth--; } +_PUBLIC_ size_t ndr_size_spoolss_MonitorInfo2(const struct spoolss_MonitorInfo2 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_MonitorInfo2, ic); +} + _PUBLIC_ enum ndr_err_code ndr_push_spoolss_MonitorInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_MonitorInfo *r) { uint32_t _save_relative_base_offset = ndr_push_get_relative_base_offset(ndr); @@ -16724,6 +16756,172 @@ _PUBLIC_ void ndr_print_spoolss_MonitorInfo(struct ndr_print *ndr, const char *n } } +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrintProcDataTypesInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrintProcDataTypesInfo1 *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->name_array)); + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->name_array) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->name_array)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->name_array)); + } + ndr->flags = _flags_save_string; + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrintProcDataTypesInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrintProcDataTypesInfo1 *r) +{ + uint32_t _ptr_name_array; + TALLOC_CTX *_mem_save_name_array_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_name_array)); + if (_ptr_name_array) { + NDR_PULL_ALLOC(ndr, r->name_array); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->name_array, _ptr_name_array)); + } else { + r->name_array = NULL; + } + ndr->flags = _flags_save_string; + } + } + if (ndr_flags & NDR_BUFFERS) { + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->name_array) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->name_array)); + _mem_save_name_array_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->name_array, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->name_array)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_name_array_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_PrintProcDataTypesInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_PrintProcDataTypesInfo1 *r) +{ + ndr_print_struct(ndr, name, "spoolss_PrintProcDataTypesInfo1"); + ndr->depth++; + ndr_print_ptr(ndr, "name_array", r->name_array); + ndr->depth++; + if (r->name_array) { + ndr_print_string(ndr, "name_array", r->name_array); + } + ndr->depth--; + ndr->depth--; +} + +_PUBLIC_ size_t ndr_size_spoolss_PrintProcDataTypesInfo1(const struct spoolss_PrintProcDataTypesInfo1 *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrintProcDataTypesInfo1, ic); +} + +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrintProcDataTypesInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_PrintProcDataTypesInfo *r) +{ + uint32_t _save_relative_base_offset = ndr_push_get_relative_base_offset(ndr); + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case 1: { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset)); + NDR_CHECK(ndr_push_spoolss_PrintProcDataTypesInfo1(ndr, NDR_SCALARS, &r->info1)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + NDR_CHECK(ndr_push_setup_relative_base_offset2(ndr, r)); + switch (level) { + case 1: + NDR_CHECK(ndr_push_spoolss_PrintProcDataTypesInfo1(ndr, NDR_BUFFERS, &r->info1)); + break; + + default: + break; + + } + } + ndr_push_restore_relative_base_offset(ndr, _save_relative_base_offset); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrintProcDataTypesInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_PrintProcDataTypesInfo *r) +{ + uint32_t _save_relative_base_offset = ndr_pull_get_relative_base_offset(ndr); + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case 1: { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset)); + NDR_CHECK(ndr_pull_spoolss_PrintProcDataTypesInfo1(ndr, NDR_SCALARS, &r->info1)); + break; } + + default: { + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_setup_relative_base_offset2(ndr, r)); + switch (level) { + case 1: + NDR_CHECK(ndr_pull_spoolss_PrintProcDataTypesInfo1(ndr, NDR_BUFFERS, &r->info1)); + break; + + default: + break; + + } + } + ndr_pull_restore_relative_base_offset(ndr, _save_relative_base_offset); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_PrintProcDataTypesInfo(struct ndr_print *ndr, const char *name, const union spoolss_PrintProcDataTypesInfo *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "spoolss_PrintProcDataTypesInfo"); + switch (level) { + case 1: + ndr_print_spoolss_PrintProcDataTypesInfo1(ndr, "info1", &r->info1); + break; + + default: + break; + + } +} + static enum ndr_err_code ndr_push_spoolss_PrinterChangeFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); @@ -16766,13 +16964,60 @@ _PUBLIC_ void ndr_print_spoolss_PrinterChangeFlags(struct ndr_print *ndr, const ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_Field(struct ndr_push *ndr, int ndr_flags, enum spoolss_Field r) +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_JobNotifyField(struct ndr_push *ndr, int ndr_flags, enum spoolss_JobNotifyField r) +{ + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_JobNotifyField(struct ndr_pull *ndr, int ndr_flags, enum spoolss_JobNotifyField *r) +{ + uint16_t v; + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); + *r = v; + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_JobNotifyField(struct ndr_print *ndr, const char *name, enum spoolss_JobNotifyField r) +{ + const char *val = NULL; + + switch (r) { + case JOB_NOTIFY_FIELD_PRINTER_NAME: val = "JOB_NOTIFY_FIELD_PRINTER_NAME"; break; + case JOB_NOTIFY_FIELD_MACHINE_NAME: val = "JOB_NOTIFY_FIELD_MACHINE_NAME"; break; + case JOB_NOTIFY_FIELD_PORT_NAME: val = "JOB_NOTIFY_FIELD_PORT_NAME"; break; + case JOB_NOTIFY_FIELD_USER_NAME: val = "JOB_NOTIFY_FIELD_USER_NAME"; break; + case JOB_NOTIFY_FIELD_NOTIFY_NAME: val = "JOB_NOTIFY_FIELD_NOTIFY_NAME"; break; + case JOB_NOTIFY_FIELD_DATATYPE: val = "JOB_NOTIFY_FIELD_DATATYPE"; break; + case JOB_NOTIFY_FIELD_PRINT_PROCESSOR: val = "JOB_NOTIFY_FIELD_PRINT_PROCESSOR"; break; + case JOB_NOTIFY_FIELD_PARAMETERS: val = "JOB_NOTIFY_FIELD_PARAMETERS"; break; + case JOB_NOTIFY_FIELD_DRIVER_NAME: val = "JOB_NOTIFY_FIELD_DRIVER_NAME"; break; + case JOB_NOTIFY_FIELD_DEVMODE: val = "JOB_NOTIFY_FIELD_DEVMODE"; break; + case JOB_NOTIFY_FIELD_STATUS: val = "JOB_NOTIFY_FIELD_STATUS"; break; + case JOB_NOTIFY_FIELD_STATUS_STRING: val = "JOB_NOTIFY_FIELD_STATUS_STRING"; break; + case JOB_NOTIFY_FIELD_SECURITY_DESCRIPTOR: val = "JOB_NOTIFY_FIELD_SECURITY_DESCRIPTOR"; break; + case JOB_NOTIFY_FIELD_DOCUMENT: val = "JOB_NOTIFY_FIELD_DOCUMENT"; break; + case JOB_NOTIFY_FIELD_PRIORITY: val = "JOB_NOTIFY_FIELD_PRIORITY"; break; + case JOB_NOTIFY_FIELD_POSITION: val = "JOB_NOTIFY_FIELD_POSITION"; break; + case JOB_NOTIFY_FIELD_SUBMITTED: val = "JOB_NOTIFY_FIELD_SUBMITTED"; break; + case JOB_NOTIFY_FIELD_START_TIME: val = "JOB_NOTIFY_FIELD_START_TIME"; break; + case JOB_NOTIFY_FIELD_UNTIL_TIME: val = "JOB_NOTIFY_FIELD_UNTIL_TIME"; break; + case JOB_NOTIFY_FIELD_TIME: val = "JOB_NOTIFY_FIELD_TIME"; break; + case JOB_NOTIFY_FIELD_TOTAL_PAGES: val = "JOB_NOTIFY_FIELD_TOTAL_PAGES"; break; + case JOB_NOTIFY_FIELD_PAGES_PRINTED: val = "JOB_NOTIFY_FIELD_PAGES_PRINTED"; break; + case JOB_NOTIFY_FIELD_TOTAL_BYTES: val = "JOB_NOTIFY_FIELD_TOTAL_BYTES"; break; + case JOB_NOTIFY_FIELD_BYTES_PRINTED: val = "JOB_NOTIFY_FIELD_BYTES_PRINTED"; break; + } + ndr_print_enum(ndr, name, "ENUM", val, r); +} + +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrintNotifyField(struct ndr_push *ndr, int ndr_flags, enum spoolss_PrintNotifyField r) { NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r)); return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_Field(struct ndr_pull *ndr, int ndr_flags, enum spoolss_Field *r) +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrintNotifyField(struct ndr_pull *ndr, int ndr_flags, enum spoolss_PrintNotifyField *r) { uint16_t v; NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &v)); @@ -16780,37 +17025,39 @@ static enum ndr_err_code ndr_pull_spoolss_Field(struct ndr_pull *ndr, int ndr_fl return NDR_ERR_SUCCESS; } -_PUBLIC_ void ndr_print_spoolss_Field(struct ndr_print *ndr, const char *name, enum spoolss_Field r) +_PUBLIC_ void ndr_print_spoolss_PrintNotifyField(struct ndr_print *ndr, const char *name, enum spoolss_PrintNotifyField r) { const char *val = NULL; switch (r) { - case SPOOLSS_FIELD_SERVER_NAME: val = "SPOOLSS_FIELD_SERVER_NAME"; break; - case SPOOLSS_FIELD_PRINTER_NAME: val = "SPOOLSS_FIELD_PRINTER_NAME"; break; - case SPOOLSS_FIELD_SHARE_NAME: val = "SPOOLSS_FIELD_SHARE_NAME"; break; - case SPOOLSS_FIELD_PORT_NAME: val = "SPOOLSS_FIELD_PORT_NAME"; break; - case SPOOLSS_FIELD_DRIVER_NAME: val = "SPOOLSS_FIELD_DRIVER_NAME"; break; - case SPOOLSS_FIELD_COMMENT: val = "SPOOLSS_FIELD_COMMENT"; break; - case SPOOLSS_FIELD_LOCATION: val = "SPOOLSS_FIELD_LOCATION"; break; - case SPOOLSS_FIELD_DEVMODE: val = "SPOOLSS_FIELD_DEVMODE"; break; - case SPOOLSS_FIELD_SEPFILE: val = "SPOOLSS_FIELD_SEPFILE"; break; - case SPOOLSS_FIELD_PRINT_PROCESSOR: val = "SPOOLSS_FIELD_PRINT_PROCESSOR"; break; - case SPOOLSS_FIELD_PARAMETERS: val = "SPOOLSS_FIELD_PARAMETERS"; break; - case SPOOLSS_FIELD_DATATYPE: val = "SPOOLSS_FIELD_DATATYPE"; break; - case SPOOLSS_FIELD_SECURITY_DESCRIPTOR: val = "SPOOLSS_FIELD_SECURITY_DESCRIPTOR"; break; - case SPOOLSS_FIELD_ATTRIBUTES: val = "SPOOLSS_FIELD_ATTRIBUTES"; break; - case SPOOLSS_FIELD_PRIORITY: val = "SPOOLSS_FIELD_PRIORITY"; break; - case SPOOLSS_FIELD_DEFAULT_PRIORITY: val = "SPOOLSS_FIELD_DEFAULT_PRIORITY"; break; - case SPOOLSS_FIELD_START_TIME: val = "SPOOLSS_FIELD_START_TIME"; break; - case SPOOLSS_FIELD_UNTIL_TIME: val = "SPOOLSS_FIELD_UNTIL_TIME"; break; - case SPOOLSS_FIELD_STATUS: val = "SPOOLSS_FIELD_STATUS"; break; - case SPOOLSS_FIELD_STATUS_STRING: val = "SPOOLSS_FIELD_STATUS_STRING"; break; - case SPOOLSS_FIELD_CJOBS: val = "SPOOLSS_FIELD_CJOBS"; break; - case SPOOLSS_FIELD_AVERAGE_PPM: val = "SPOOLSS_FIELD_AVERAGE_PPM"; break; - case SPOOLSS_FIELD_TOTAL_PAGES: val = "SPOOLSS_FIELD_TOTAL_PAGES"; break; - case SPOOLSS_FIELD_PAGES_PRINTED: val = "SPOOLSS_FIELD_PAGES_PRINTED"; break; - case SPOOLSS_FIELD_TOTAL_BYTES: val = "SPOOLSS_FIELD_TOTAL_BYTES"; break; - case SPOOLSS_FIELD_BYTES_PRINTED: val = "SPOOLSS_FIELD_BYTES_PRINTED"; break; + case PRINTER_NOTIFY_FIELD_SERVER_NAME: val = "PRINTER_NOTIFY_FIELD_SERVER_NAME"; break; + case PRINTER_NOTIFY_FIELD_PRINTER_NAME: val = "PRINTER_NOTIFY_FIELD_PRINTER_NAME"; break; + case PRINTER_NOTIFY_FIELD_SHARE_NAME: val = "PRINTER_NOTIFY_FIELD_SHARE_NAME"; break; + case PRINTER_NOTIFY_FIELD_PORT_NAME: val = "PRINTER_NOTIFY_FIELD_PORT_NAME"; break; + case PRINTER_NOTIFY_FIELD_DRIVER_NAME: val = "PRINTER_NOTIFY_FIELD_DRIVER_NAME"; break; + case PRINTER_NOTIFY_FIELD_COMMENT: val = "PRINTER_NOTIFY_FIELD_COMMENT"; break; + case PRINTER_NOTIFY_FIELD_LOCATION: val = "PRINTER_NOTIFY_FIELD_LOCATION"; break; + case PRINTER_NOTIFY_FIELD_DEVMODE: val = "PRINTER_NOTIFY_FIELD_DEVMODE"; break; + case PRINTER_NOTIFY_FIELD_SEPFILE: val = "PRINTER_NOTIFY_FIELD_SEPFILE"; break; + case PRINTER_NOTIFY_FIELD_PRINT_PROCESSOR: val = "PRINTER_NOTIFY_FIELD_PRINT_PROCESSOR"; break; + case PRINTER_NOTIFY_FIELD_PARAMETERS: val = "PRINTER_NOTIFY_FIELD_PARAMETERS"; break; + case PRINTER_NOTIFY_FIELD_DATATYPE: val = "PRINTER_NOTIFY_FIELD_DATATYPE"; break; + case PRINTER_NOTIFY_FIELD_SECURITY_DESCRIPTOR: val = "PRINTER_NOTIFY_FIELD_SECURITY_DESCRIPTOR"; break; + case PRINTER_NOTIFY_FIELD_ATTRIBUTES: val = "PRINTER_NOTIFY_FIELD_ATTRIBUTES"; break; + case PRINTER_NOTIFY_FIELD_PRIORITY: val = "PRINTER_NOTIFY_FIELD_PRIORITY"; break; + case PRINTER_NOTIFY_FIELD_DEFAULT_PRIORITY: val = "PRINTER_NOTIFY_FIELD_DEFAULT_PRIORITY"; break; + case PRINTER_NOTIFY_FIELD_START_TIME: val = "PRINTER_NOTIFY_FIELD_START_TIME"; break; + case PRINTER_NOTIFY_FIELD_UNTIL_TIME: val = "PRINTER_NOTIFY_FIELD_UNTIL_TIME"; break; + case PRINTER_NOTIFY_FIELD_STATUS: val = "PRINTER_NOTIFY_FIELD_STATUS"; break; + case PRINTER_NOTIFY_FIELD_STATUS_STRING: val = "PRINTER_NOTIFY_FIELD_STATUS_STRING"; break; + case PRINTER_NOTIFY_FIELD_CJOBS: val = "PRINTER_NOTIFY_FIELD_CJOBS"; break; + case PRINTER_NOTIFY_FIELD_AVERAGE_PPM: val = "PRINTER_NOTIFY_FIELD_AVERAGE_PPM"; break; + case PRINTER_NOTIFY_FIELD_TOTAL_PAGES: val = "PRINTER_NOTIFY_FIELD_TOTAL_PAGES"; break; + case PRINTER_NOTIFY_FIELD_PAGES_PRINTED: val = "PRINTER_NOTIFY_FIELD_PAGES_PRINTED"; break; + case PRINTER_NOTIFY_FIELD_TOTAL_BYTES: val = "PRINTER_NOTIFY_FIELD_TOTAL_BYTES"; break; + case PRINTER_NOTIFY_FIELD_BYTES_PRINTED: val = "PRINTER_NOTIFY_FIELD_BYTES_PRINTED"; break; + case PRINTER_NOTIFY_FIELD_OBJECT_GUID: val = "PRINTER_NOTIFY_FIELD_OBJECT_GUID"; break; + case PRINTER_NOTIFY_FIELD_FRIENDLY_NAME: val = "PRINTER_NOTIFY_FIELD_FRIENDLY_NAME"; break; } ndr_print_enum(ndr, name, "ENUM", val, r); } @@ -16834,12 +17081,84 @@ _PUBLIC_ void ndr_print_spoolss_NotifyType(struct ndr_print *ndr, const char *na const char *val = NULL; switch (r) { - case SPOOLSS_NOTIFY_PRINTER: val = "SPOOLSS_NOTIFY_PRINTER"; break; - case SPOOLSS_NOTIFY_JOB: val = "SPOOLSS_NOTIFY_JOB"; break; + case PRINTER_NOTIFY_TYPE: val = "PRINTER_NOTIFY_TYPE"; break; + case JOB_NOTIFY_TYPE: val = "JOB_NOTIFY_TYPE"; break; } ndr_print_enum(ndr, name, "ENUM", val, r); } +static enum ndr_err_code ndr_push_spoolss_Field(struct ndr_push *ndr, int ndr_flags, const union spoolss_Field *r) +{ + if (ndr_flags & NDR_SCALARS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case PRINTER_NOTIFY_TYPE: { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->field)); + break; } + + case JOB_NOTIFY_TYPE: { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->field)); + break; } + + default: { + NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->field)); + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + int level = ndr_push_get_switch_value(ndr, r); + switch (level) { + case PRINTER_NOTIFY_TYPE: + break; + + case JOB_NOTIFY_TYPE: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + +static enum ndr_err_code ndr_pull_spoolss_Field(struct ndr_pull *ndr, int ndr_flags, union spoolss_Field *r) +{ + int level; + level = ndr_pull_get_switch_value(ndr, r); + if (ndr_flags & NDR_SCALARS) { + switch (level) { + case PRINTER_NOTIFY_TYPE: { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->field)); + break; } + + case JOB_NOTIFY_TYPE: { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->field)); + break; } + + default: { + NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->field)); + break; } + + } + } + if (ndr_flags & NDR_BUFFERS) { + switch (level) { + case PRINTER_NOTIFY_TYPE: + break; + + case JOB_NOTIFY_TYPE: + break; + + default: + break; + + } + } + return NDR_ERR_SUCCESS; +} + static enum ndr_err_code ndr_push_spoolss_NotifyOptionType(struct ndr_push *ndr, int ndr_flags, const struct spoolss_NotifyOptionType *r) { uint32_t cntr_fields_1; @@ -16856,7 +17175,8 @@ static enum ndr_err_code ndr_push_spoolss_NotifyOptionType(struct ndr_push *ndr, if (r->fields) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->count)); for (cntr_fields_1 = 0; cntr_fields_1 < r->count; cntr_fields_1++) { - NDR_CHECK(ndr_push_spoolss_Field(ndr, NDR_SCALARS, r->fields[cntr_fields_1])); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->fields[cntr_fields_1], r->type)); + NDR_CHECK(ndr_push_spoolss_Field(ndr, NDR_SCALARS, &r->fields[cntr_fields_1])); } } } @@ -16892,6 +17212,7 @@ static enum ndr_err_code ndr_pull_spoolss_NotifyOptionType(struct ndr_pull *ndr, _mem_save_fields_1 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->fields, 0); for (cntr_fields_1 = 0; cntr_fields_1 < r->count; cntr_fields_1++) { + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->fields[cntr_fields_1], r->type)); NDR_CHECK(ndr_pull_spoolss_Field(ndr, NDR_SCALARS, &r->fields[cntr_fields_1])); } NDR_PULL_SET_MEM_CTX(ndr, _mem_save_fields_1, 0); @@ -16922,7 +17243,8 @@ _PUBLIC_ void ndr_print_spoolss_NotifyOptionType(struct ndr_print *ndr, const ch for (cntr_fields_1=0;cntr_fields_1<r->count;cntr_fields_1++) { char *idx_1=NULL; if (asprintf(&idx_1, "[%d]", cntr_fields_1) != -1) { - ndr_print_spoolss_Field(ndr, "fields", r->fields[cntr_fields_1]); + ndr_print_set_switch_value(ndr, &r->fields[cntr_fields_1], r->type); + ndr_print_spoolss_Field(ndr, "fields", &r->fields[cntr_fields_1]); free(idx_1); } } @@ -17307,7 +17629,8 @@ static enum ndr_err_code ndr_push_spoolss_Notify(struct ndr_push *ndr, int ndr_f if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_push_align(ndr, 4)); NDR_CHECK(ndr_push_spoolss_NotifyType(ndr, NDR_SCALARS, r->type)); - NDR_CHECK(ndr_push_spoolss_Field(ndr, NDR_SCALARS, r->field)); + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->field, r->type)); + NDR_CHECK(ndr_push_spoolss_Field(ndr, NDR_SCALARS, &r->field)); NDR_CHECK(ndr_push_spoolss_NotifyTable(ndr, NDR_SCALARS, r->variable_type)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->job_id)); NDR_CHECK(ndr_push_set_switch_value(ndr, &r->data, r->variable_type)); @@ -17324,6 +17647,7 @@ static enum ndr_err_code ndr_pull_spoolss_Notify(struct ndr_pull *ndr, int ndr_f if (ndr_flags & NDR_SCALARS) { NDR_CHECK(ndr_pull_align(ndr, 4)); NDR_CHECK(ndr_pull_spoolss_NotifyType(ndr, NDR_SCALARS, &r->type)); + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->field, r->type)); NDR_CHECK(ndr_pull_spoolss_Field(ndr, NDR_SCALARS, &r->field)); NDR_CHECK(ndr_pull_spoolss_NotifyTable(ndr, NDR_SCALARS, &r->variable_type)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->job_id)); @@ -17341,7 +17665,8 @@ _PUBLIC_ void ndr_print_spoolss_Notify(struct ndr_print *ndr, const char *name, ndr_print_struct(ndr, name, "spoolss_Notify"); ndr->depth++; ndr_print_spoolss_NotifyType(ndr, "type", r->type); - ndr_print_spoolss_Field(ndr, "field", r->field); + ndr_print_set_switch_value(ndr, &r->field, r->type); + ndr_print_spoolss_Field(ndr, "field", &r->field); ndr_print_spoolss_NotifyTable(ndr, "variable_type", r->variable_type); ndr_print_uint32(ndr, "job_id", r->job_id); ndr_print_set_switch_value(ndr, &r->data, r->variable_type); @@ -18033,6 +18358,148 @@ _PUBLIC_ void ndr_print_spoolss_AccessRights(struct ndr_print *ndr, const char * ndr->depth--; } +_PUBLIC_ enum ndr_err_code ndr_push_spoolss_PrinterEnumValues(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterEnumValues *r) +{ + uint32_t _save_relative_base_offset = ndr_push_get_relative_base_offset(ndr); + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_push_align(ndr, 4)); + NDR_CHECK(ndr_push_setup_relative_base_offset1(ndr, r, ndr->offset)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->value_name)); + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 2 * strlen_m_term(r->value_name))); + NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, r->type)); + NDR_CHECK(ndr_push_relative_ptr1(ndr, r->data)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_size_spoolss_PrinterData(r->data, r->type, ndr->iconv_convenience, ndr->flags))); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_push_setup_relative_base_offset2(ndr, r)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->value_name) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->value_name)); + NDR_CHECK(ndr_push_string(ndr, NDR_SCALARS, r->value_name)); + } + ndr->flags = _flags_save_string; + } + if (r->data) { + NDR_CHECK(ndr_push_relative_ptr2(ndr, r->data)); + { + struct ndr_push *_ndr_data; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_data, 0, r->data_length)); + NDR_CHECK(ndr_push_set_switch_value(_ndr_data, r->data, r->type)); + NDR_CHECK(ndr_push_spoolss_PrinterData(_ndr_data, NDR_SCALARS|NDR_BUFFERS, r->data)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_data, 0, r->data_length)); + } + } + } + ndr_push_restore_relative_base_offset(ndr, _save_relative_base_offset); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_PrinterEnumValues(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterEnumValues *r) +{ + uint32_t _save_relative_base_offset = ndr_pull_get_relative_base_offset(ndr); + uint32_t _ptr_value_name; + TALLOC_CTX *_mem_save_value_name_0; + uint32_t _ptr_data; + TALLOC_CTX *_mem_save_data_0; + if (ndr_flags & NDR_SCALARS) { + NDR_CHECK(ndr_pull_align(ndr, 4)); + NDR_CHECK(ndr_pull_setup_relative_base_offset1(ndr, r, ndr->offset)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_value_name)); + if (_ptr_value_name) { + NDR_PULL_ALLOC(ndr, r->value_name); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->value_name, _ptr_value_name)); + } else { + r->value_name = NULL; + } + ndr->flags = _flags_save_string; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->value_name_len)); + NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, &r->type)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_data)); + if (_ptr_data) { + NDR_PULL_ALLOC(ndr, r->data); + NDR_CHECK(ndr_pull_relative_ptr1(ndr, r->data, _ptr_data)); + } else { + r->data = NULL; + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->data_length)); + } + if (ndr_flags & NDR_BUFFERS) { + NDR_CHECK(ndr_pull_setup_relative_base_offset2(ndr, r)); + { + uint32_t _flags_save_string = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->value_name) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->value_name)); + _mem_save_value_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->value_name, 0); + NDR_CHECK(ndr_pull_string(ndr, NDR_SCALARS, &r->value_name)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_name_0, 0); + ndr->offset = _relative_save_offset; + } + ndr->flags = _flags_save_string; + } + if (r->data) { + uint32_t _relative_save_offset; + _relative_save_offset = ndr->offset; + NDR_CHECK(ndr_pull_relative_ptr2(ndr, r->data)); + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->data, 0); + { + struct ndr_pull *_ndr_data; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_data, 0, r->data_length)); + NDR_CHECK(ndr_pull_set_switch_value(_ndr_data, r->data, r->type)); + NDR_CHECK(ndr_pull_spoolss_PrinterData(_ndr_data, NDR_SCALARS|NDR_BUFFERS, r->data)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_data, 0, r->data_length)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, 0); + ndr->offset = _relative_save_offset; + } + } + ndr_pull_restore_relative_base_offset(ndr, _save_relative_base_offset); + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ void ndr_print_spoolss_PrinterEnumValues(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterEnumValues *r) +{ + ndr_print_struct(ndr, name, "spoolss_PrinterEnumValues"); + ndr->depth++; + ndr_print_ptr(ndr, "value_name", r->value_name); + ndr->depth++; + if (r->value_name) { + ndr_print_string(ndr, "value_name", r->value_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "value_name_len", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?2 * strlen_m_term(r->value_name):r->value_name_len); + ndr_print_winreg_Type(ndr, "type", r->type); + ndr_print_ptr(ndr, "data", r->data); + ndr->depth++; + if (r->data) { + ndr_print_set_switch_value(ndr, r->data, r->type); + ndr_print_spoolss_PrinterData(ndr, "data", r->data); + } + ndr->depth--; + ndr_print_uint32(ndr, "data_length", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_spoolss_PrinterData(r->data, r->type, ndr->iconv_convenience, ndr->flags):r->data_length); + ndr->depth--; +} + +_PUBLIC_ size_t ndr_size_spoolss_PrinterEnumValues(const struct spoolss_PrinterEnumValues *r, struct smb_iconv_convenience *ic, int flags) +{ + return ndr_size_struct(r, flags, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterEnumValues, ic); +} + _PUBLIC_ enum ndr_err_code ndr_push_spoolss_DeleteDriverFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r) { NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r)); @@ -18458,7 +18925,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull___spoolss_EnumPrinters(struct ndr_pull *ndr, _PUBLIC_ void ndr_print_spoolss_EnumPrinters(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_EnumPrinters *r) { - uint32_t cntr_info_1; + uint32_t cntr_info_2; ndr_print_struct(ndr, name, "spoolss_EnumPrinters"); ndr->depth++; if (flags & NDR_SET_VALUES) { @@ -18493,20 +18960,23 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinters(struct ndr_print *ndr, const char * ndr->depth--; ndr_print_ptr(ndr, "info", r->out.info); ndr->depth++; - if (r->out.info) { + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)*r->out.count); ndr->depth++; - for (cntr_info_1=0;cntr_info_1<*r->out.count;cntr_info_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_info_1) != -1) { - ndr_print_set_switch_value(ndr, &r->out.info[cntr_info_1], r->in.level); - ndr_print_spoolss_PrinterInfo(ndr, "info", &r->out.info[cntr_info_1]); - free(idx_1); + for (cntr_info_2=0;cntr_info_2<*r->out.count;cntr_info_2++) { + char *idx_2=NULL; + if (asprintf(&idx_2, "[%d]", cntr_info_2) != -1) { + ndr_print_set_switch_value(ndr, &(*r->out.info)[cntr_info_2], r->in.level); + ndr_print_spoolss_PrinterInfo(ndr, "info", &(*r->out.info)[cntr_info_2]); + free(idx_2); } } ndr->depth--; } ndr->depth--; + ndr->depth--; ndr_print_ptr(ndr, "needed", r->out.needed); ndr->depth++; ndr_print_uint32(ndr, "needed", *r->out.needed); @@ -19037,7 +19507,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull___spoolss_EnumJobs(struct ndr_pull *ndr, int _PUBLIC_ void ndr_print_spoolss_EnumJobs(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_EnumJobs *r) { - uint32_t cntr_info_1; + uint32_t cntr_info_2; ndr_print_struct(ndr, name, "spoolss_EnumJobs"); ndr->depth++; if (flags & NDR_SET_VALUES) { @@ -19071,20 +19541,23 @@ _PUBLIC_ void ndr_print_spoolss_EnumJobs(struct ndr_print *ndr, const char *name ndr->depth--; ndr_print_ptr(ndr, "info", r->out.info); ndr->depth++; - if (r->out.info) { + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)*r->out.count); ndr->depth++; - for (cntr_info_1=0;cntr_info_1<*r->out.count;cntr_info_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_info_1) != -1) { - ndr_print_set_switch_value(ndr, &r->out.info[cntr_info_1], r->in.level); - ndr_print_spoolss_JobInfo(ndr, "info", &r->out.info[cntr_info_1]); - free(idx_1); + for (cntr_info_2=0;cntr_info_2<*r->out.count;cntr_info_2++) { + char *idx_2=NULL; + if (asprintf(&idx_2, "[%d]", cntr_info_2) != -1) { + ndr_print_set_switch_value(ndr, &(*r->out.info)[cntr_info_2], r->in.level); + ndr_print_spoolss_JobInfo(ndr, "info", &(*r->out.info)[cntr_info_2]); + free(idx_2); } } ndr->depth--; } ndr->depth--; + ndr->depth--; ndr_print_ptr(ndr, "needed", r->out.needed); ndr->depth++; ndr_print_uint32(ndr, "needed", *r->out.needed); @@ -19726,7 +20199,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull___spoolss_EnumPrinterDrivers(struct ndr_pull _PUBLIC_ void ndr_print_spoolss_EnumPrinterDrivers(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_EnumPrinterDrivers *r) { - uint32_t cntr_info_1; + uint32_t cntr_info_2; ndr_print_struct(ndr, name, "spoolss_EnumPrinterDrivers"); ndr->depth++; if (flags & NDR_SET_VALUES) { @@ -19766,20 +20239,23 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinterDrivers(struct ndr_print *ndr, const ndr->depth--; ndr_print_ptr(ndr, "info", r->out.info); ndr->depth++; - if (r->out.info) { + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)*r->out.count); ndr->depth++; - for (cntr_info_1=0;cntr_info_1<*r->out.count;cntr_info_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_info_1) != -1) { - ndr_print_set_switch_value(ndr, &r->out.info[cntr_info_1], r->in.level); - ndr_print_spoolss_DriverInfo(ndr, "info", &r->out.info[cntr_info_1]); - free(idx_1); + for (cntr_info_2=0;cntr_info_2<*r->out.count;cntr_info_2++) { + char *idx_2=NULL; + if (asprintf(&idx_2, "[%d]", cntr_info_2) != -1) { + ndr_print_set_switch_value(ndr, &(*r->out.info)[cntr_info_2], r->in.level); + ndr_print_spoolss_DriverInfo(ndr, "info", &(*r->out.info)[cntr_info_2]); + free(idx_2); } } ndr->depth--; } ndr->depth--; + ndr->depth--; ndr_print_ptr(ndr, "needed", r->out.needed); ndr->depth++; ndr_print_uint32(ndr, "needed", *r->out.needed); @@ -20424,7 +20900,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull___spoolss_EnumPrintProcessors(struct ndr_pul _PUBLIC_ void ndr_print_spoolss_EnumPrintProcessors(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_EnumPrintProcessors *r) { - uint32_t cntr_info_1; + uint32_t cntr_info_2; ndr_print_struct(ndr, name, "spoolss_EnumPrintProcessors"); ndr->depth++; if (flags & NDR_SET_VALUES) { @@ -20464,20 +20940,23 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrintProcessors(struct ndr_print *ndr, const ndr->depth--; ndr_print_ptr(ndr, "info", r->out.info); ndr->depth++; - if (r->out.info) { + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)*r->out.count); ndr->depth++; - for (cntr_info_1=0;cntr_info_1<*r->out.count;cntr_info_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_info_1) != -1) { - ndr_print_set_switch_value(ndr, &r->out.info[cntr_info_1], r->in.level); - ndr_print_spoolss_PrintProcessorInfo(ndr, "info", &r->out.info[cntr_info_1]); - free(idx_1); + for (cntr_info_2=0;cntr_info_2<*r->out.count;cntr_info_2++) { + char *idx_2=NULL; + if (asprintf(&idx_2, "[%d]", cntr_info_2) != -1) { + ndr_print_set_switch_value(ndr, &(*r->out.info)[cntr_info_2], r->in.level); + ndr_print_spoolss_PrintProcessorInfo(ndr, "info", &(*r->out.info)[cntr_info_2]); + free(idx_2); } } ndr->depth--; } ndr->depth--; + ndr->depth--; ndr_print_ptr(ndr, "needed", r->out.needed); ndr->depth++; ndr_print_uint32(ndr, "needed", *r->out.needed); @@ -21396,8 +21875,11 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_GetPrinterData(struct ndr_push *ndr if (r->out.type == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - NDR_CHECK(ndr_push_spoolss_PrinterDataType(ndr, NDR_SCALARS, *r->out.type)); - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->out.data)); + NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->out.type)); + if (r->out.data == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->out.data)); if (r->out.needed == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } @@ -21411,6 +21893,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_GetPrinterData(struct ndr_pull *ndr { TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_type_0; + TALLOC_CTX *_mem_save_data_0; TALLOC_CTX *_mem_save_needed_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -21432,6 +21915,8 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_GetPrinterData(struct ndr_pull *ndr NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); NDR_PULL_ALLOC(ndr, r->out.type); ZERO_STRUCTP(r->out.type); + NDR_PULL_ALLOC(ndr, r->out.data); + ZERO_STRUCTP(r->out.data); NDR_PULL_ALLOC(ndr, r->out.needed); ZERO_STRUCTP(r->out.needed); } @@ -21441,9 +21926,15 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_GetPrinterData(struct ndr_pull *ndr } _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->out.type, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_spoolss_PrinterDataType(ndr, NDR_SCALARS, r->out.type)); + NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, r->out.type)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->out.data)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.data); + } + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.data, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->out.data)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->out.needed); } @@ -21459,25 +21950,37 @@ _PUBLIC_ enum ndr_err_code ndr_pull__spoolss_GetPrinterData(struct ndr_pull *ndr _PUBLIC_ enum ndr_err_code ndr_push___spoolss_GetPrinterData(struct ndr_push *ndr, int flags, const struct __spoolss_GetPrinterData *r) { if (flags & NDR_IN) { - NDR_CHECK(ndr_push_spoolss_PrinterDataType(ndr, NDR_SCALARS, r->in.type)); + NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, r->in.type)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->out.data, r->in.type)); - NDR_CHECK(ndr_push_spoolss_PrinterData(ndr, NDR_SCALARS|NDR_BUFFERS, &r->out.data)); + if (r->out.data == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.data, r->in.type)); + NDR_CHECK(ndr_push_spoolss_PrinterData(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.data)); } return NDR_ERR_SUCCESS; } _PUBLIC_ enum ndr_err_code ndr_pull___spoolss_GetPrinterData(struct ndr_pull *ndr, int flags, struct __spoolss_GetPrinterData *r) { + TALLOC_CTX *_mem_save_data_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); - NDR_CHECK(ndr_pull_spoolss_PrinterDataType(ndr, NDR_SCALARS, &r->in.type)); + NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, &r->in.type)); + NDR_PULL_ALLOC(ndr, r->out.data); + ZERO_STRUCTP(r->out.data); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->out.data, r->in.type)); - NDR_CHECK(ndr_pull_spoolss_PrinterData(ndr, NDR_SCALARS|NDR_BUFFERS, &r->out.data)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.data); + } + _mem_save_data_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.data, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_set_switch_value(ndr, r->out.data, r->in.type)); + NDR_CHECK(ndr_pull_spoolss_PrinterData(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.data)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_data_0, LIBNDR_FLAG_REF_ALLOC); } return NDR_ERR_SUCCESS; } @@ -21505,10 +22008,13 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinterData(struct ndr_print *ndr, const char ndr->depth++; ndr_print_ptr(ndr, "type", r->out.type); ndr->depth++; - ndr_print_spoolss_PrinterDataType(ndr, "type", *r->out.type); + ndr_print_winreg_Type(ndr, "type", *r->out.type); + ndr->depth--; + ndr_print_ptr(ndr, "data", r->out.data); + ndr->depth++; + ndr_print_set_switch_value(ndr, r->out.data, *r->out.type); + ndr_print_spoolss_PrinterData(ndr, "data", r->out.data); ndr->depth--; - ndr_print_set_switch_value(ndr, &r->out.data, *r->out.type); - ndr_print_spoolss_PrinterData(ndr, "data", &r->out.data); ndr_print_ptr(ndr, "needed", r->out.needed); ndr->depth++; ndr_print_uint32(ndr, "needed", *r->out.needed); @@ -21530,7 +22036,7 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_SetPrinterData(struct ndr_push *ndr NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.value_name, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.value_name, ndr_charset_length(r->in.value_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_spoolss_PrinterDataType(ndr, NDR_SCALARS, r->in.type)); + NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, r->in.type)); NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->in.data)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in._offered)); } @@ -21543,11 +22049,14 @@ _PUBLIC_ enum ndr_err_code ndr_push__spoolss_SetPrinterData(struct ndr_push *ndr _PUBLIC_ enum ndr_err_code ndr_push___spoolss_SetPrinterData(struct ndr_push *ndr, int flags, const struct __spoolss_SetPrinterData *r) { if (flags & NDR_IN) { - NDR_CHECK(ndr_push_spoolss_PrinterDataType(ndr, NDR_SCALARS, r->in.type)); + NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, r->in.type)); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_push_set_switch_value(ndr, &r->out.data, r->in.type)); - NDR_CHECK(ndr_push_spoolss_PrinterData(ndr, NDR_SCALARS|NDR_BUFFERS, &r->out.data)); + if (r->out.data == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_set_switch_value(ndr, r->out.data, r->in.type)); + NDR_CHECK(ndr_push_spoolss_PrinterData(ndr, NDR_SCALARS|NDR_BUFFERS, r->out.data)); } return NDR_ERR_SUCCESS; } @@ -21570,7 +22079,7 @@ static enum ndr_err_code ndr_pull_spoolss_SetPrinterData(struct ndr_pull *ndr, i } NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.value_name), sizeof(uint16_t))); NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.value_name, ndr_get_array_length(ndr, &r->in.value_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_spoolss_PrinterDataType(ndr, NDR_SCALARS, &r->in.type)); + NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, &r->in.type)); { struct ndr_pull *_ndr_data; NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_data, 4, -1)); @@ -21601,7 +22110,7 @@ _PUBLIC_ void ndr_print_spoolss_SetPrinterData(struct ndr_print *ndr, const char ndr_print_policy_handle(ndr, "handle", r->in.handle); ndr->depth--; ndr_print_string(ndr, "value_name", r->in.value_name); - ndr_print_spoolss_PrinterDataType(ndr, "type", r->in.type); + ndr_print_winreg_Type(ndr, "type", r->in.type); ndr_print_set_switch_value(ndr, &r->in.data, r->in.type); ndr_print_spoolss_PrinterData(ndr, "data", &r->in.data); ndr_print_uint32(ndr, "_offered", (ndr->flags & LIBNDR_PRINT_SET_VALUES)?ndr_size_spoolss_PrinterData(&r->in.data, r->in.type, ndr->iconv_convenience, flags):r->in._offered); @@ -22251,7 +22760,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull___spoolss_EnumForms(struct ndr_pull *ndr, in _PUBLIC_ void ndr_print_spoolss_EnumForms(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_EnumForms *r) { - uint32_t cntr_info_1; + uint32_t cntr_info_2; ndr_print_struct(ndr, name, "spoolss_EnumForms"); ndr->depth++; if (flags & NDR_SET_VALUES) { @@ -22283,20 +22792,23 @@ _PUBLIC_ void ndr_print_spoolss_EnumForms(struct ndr_print *ndr, const char *nam ndr->depth--; ndr_print_ptr(ndr, "info", r->out.info); ndr->depth++; - if (r->out.info) { + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)*r->out.count); ndr->depth++; - for (cntr_info_1=0;cntr_info_1<*r->out.count;cntr_info_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_info_1) != -1) { - ndr_print_set_switch_value(ndr, &r->out.info[cntr_info_1], r->in.level); - ndr_print_spoolss_FormInfo(ndr, "info", &r->out.info[cntr_info_1]); - free(idx_1); + for (cntr_info_2=0;cntr_info_2<*r->out.count;cntr_info_2++) { + char *idx_2=NULL; + if (asprintf(&idx_2, "[%d]", cntr_info_2) != -1) { + ndr_print_set_switch_value(ndr, &(*r->out.info)[cntr_info_2], r->in.level); + ndr_print_spoolss_FormInfo(ndr, "info", &(*r->out.info)[cntr_info_2]); + free(idx_2); } } ndr->depth--; } ndr->depth--; + ndr->depth--; ndr_print_ptr(ndr, "needed", r->out.needed); ndr->depth++; ndr_print_uint32(ndr, "needed", *r->out.needed); @@ -22471,7 +22983,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull___spoolss_EnumPorts(struct ndr_pull *ndr, in _PUBLIC_ void ndr_print_spoolss_EnumPorts(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_EnumPorts *r) { - uint32_t cntr_info_1; + uint32_t cntr_info_2; ndr_print_struct(ndr, name, "spoolss_EnumPorts"); ndr->depth++; if (flags & NDR_SET_VALUES) { @@ -22505,20 +23017,23 @@ _PUBLIC_ void ndr_print_spoolss_EnumPorts(struct ndr_print *ndr, const char *nam ndr->depth--; ndr_print_ptr(ndr, "info", r->out.info); ndr->depth++; - if (r->out.info) { + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)*r->out.count); ndr->depth++; - for (cntr_info_1=0;cntr_info_1<*r->out.count;cntr_info_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_info_1) != -1) { - ndr_print_set_switch_value(ndr, &r->out.info[cntr_info_1], r->in.level); - ndr_print_spoolss_PortInfo(ndr, "info", &r->out.info[cntr_info_1]); - free(idx_1); + for (cntr_info_2=0;cntr_info_2<*r->out.count;cntr_info_2++) { + char *idx_2=NULL; + if (asprintf(&idx_2, "[%d]", cntr_info_2) != -1) { + ndr_print_set_switch_value(ndr, &(*r->out.info)[cntr_info_2], r->in.level); + ndr_print_spoolss_PortInfo(ndr, "info", &(*r->out.info)[cntr_info_2]); + free(idx_2); } } ndr->depth--; } ndr->depth--; + ndr->depth--; ndr_print_ptr(ndr, "needed", r->out.needed); ndr->depth++; ndr_print_uint32(ndr, "needed", *r->out.needed); @@ -22693,7 +23208,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull___spoolss_EnumMonitors(struct ndr_pull *ndr, _PUBLIC_ void ndr_print_spoolss_EnumMonitors(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_EnumMonitors *r) { - uint32_t cntr_info_1; + uint32_t cntr_info_2; ndr_print_struct(ndr, name, "spoolss_EnumMonitors"); ndr->depth++; if (flags & NDR_SET_VALUES) { @@ -22727,20 +23242,23 @@ _PUBLIC_ void ndr_print_spoolss_EnumMonitors(struct ndr_print *ndr, const char * ndr->depth--; ndr_print_ptr(ndr, "info", r->out.info); ndr->depth++; - if (r->out.info) { + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)*r->out.count); ndr->depth++; - for (cntr_info_1=0;cntr_info_1<*r->out.count;cntr_info_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_info_1) != -1) { - ndr_print_set_switch_value(ndr, &r->out.info[cntr_info_1], r->in.level); - ndr_print_spoolss_MonitorInfo(ndr, "info", &r->out.info[cntr_info_1]); - free(idx_1); + for (cntr_info_2=0;cntr_info_2<*r->out.count;cntr_info_2++) { + char *idx_2=NULL; + if (asprintf(&idx_2, "[%d]", cntr_info_2) != -1) { + ndr_print_set_switch_value(ndr, &(*r->out.info)[cntr_info_2], r->in.level); + ndr_print_spoolss_MonitorInfo(ndr, "info", &(*r->out.info)[cntr_info_2]); + free(idx_2); } } ndr->depth--; } ndr->depth--; + ndr->depth--; ndr_print_ptr(ndr, "needed", r->out.needed); ndr->depth++; ndr_print_uint32(ndr, "needed", *r->out.needed); @@ -23373,28 +23891,198 @@ _PUBLIC_ void ndr_print_spoolss_DeletePrintProvidor(struct ndr_print *ndr, const ndr->depth--; } -static enum ndr_err_code ndr_push_spoolss_EnumPrintProcDataTypes(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrintProcDataTypes *r) +_PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumPrintProcDataTypes(struct ndr_push *ndr, int flags, const struct _spoolss_EnumPrintProcDataTypes *r) { if (flags & NDR_IN) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.servername)); + if (r->in.servername) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.servername, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.servername, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.servername, ndr_charset_length(r->in.servername, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.print_processor_name)); + if (r->in.print_processor_name) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.print_processor_name, CH_UTF16))); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.print_processor_name, CH_UTF16))); + NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.print_processor_name, ndr_charset_length(r->in.print_processor_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_unique_ptr(ndr, r->in.buffer)); + if (r->in.buffer) { + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->in.buffer)); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered)); } if (flags & NDR_OUT) { + NDR_CHECK(ndr_push_unique_ptr(ndr, r->out.info)); + if (r->out.info) { + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->out.info)); + } + if (r->out.needed == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.needed)); + if (r->out.count == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.count)); NDR_CHECK(ndr_push_WERROR(ndr, NDR_SCALARS, r->out.result)); } return NDR_ERR_SUCCESS; } -static enum ndr_err_code ndr_pull_spoolss_EnumPrintProcDataTypes(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrintProcDataTypes *r) +_PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrintProcDataTypes(struct ndr_pull *ndr, int flags, struct _spoolss_EnumPrintProcDataTypes *r) { + uint32_t _ptr_servername; + uint32_t _ptr_print_processor_name; + uint32_t _ptr_buffer; + uint32_t _ptr_info; + TALLOC_CTX *_mem_save_servername_0; + TALLOC_CTX *_mem_save_print_processor_name_0; + TALLOC_CTX *_mem_save_buffer_0; + TALLOC_CTX *_mem_save_info_0; + TALLOC_CTX *_mem_save_needed_0; + TALLOC_CTX *_mem_save_count_0; if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_servername)); + if (_ptr_servername) { + NDR_PULL_ALLOC(ndr, r->in.servername); + } else { + r->in.servername = NULL; + } + if (r->in.servername) { + _mem_save_servername_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.servername, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.servername)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.servername)); + if (ndr_get_array_length(ndr, &r->in.servername) > ndr_get_array_size(ndr, &r->in.servername)) { + return ndr_pull_error(ndr, NDR_ERR_ARRAY_SIZE, "Bad array size %u should exceed array length %u", ndr_get_array_size(ndr, &r->in.servername), ndr_get_array_length(ndr, &r->in.servername)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.servername, ndr_get_array_length(ndr, &r->in.servername), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_servername_0, 0); + } + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_print_processor_name)); + if (_ptr_print_processor_name) { + NDR_PULL_ALLOC(ndr, r->in.print_processor_name); + } else { + r->in.print_processor_name = NULL; + } + if (r->in.print_processor_name) { + _mem_save_print_processor_name_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.print_processor_name, 0); + NDR_CHECK(ndr_pull_array_size(ndr, &r->in.print_processor_name)); + NDR_CHECK(ndr_pull_array_length(ndr, &r->in.print_processor_name)); + if (ndr_get_array_length(ndr, &r->in.print_processor_name) > ndr_get_array_size(ndr, &r->in.print_processor_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->in.print_processor_name), ndr_get_array_length(ndr, &r->in.print_processor_name)); + } + NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.print_processor_name), sizeof(uint16_t))); + NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.print_processor_name, ndr_get_array_length(ndr, &r->in.print_processor_name), sizeof(uint16_t), CH_UTF16)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_print_processor_name_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_buffer)); + if (_ptr_buffer) { + NDR_PULL_ALLOC(ndr, r->in.buffer); + } else { + r->in.buffer = NULL; + } + if (r->in.buffer) { + _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->in.buffer, 0); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->in.buffer)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, 0); + } + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); + NDR_PULL_ALLOC(ndr, r->out.needed); + ZERO_STRUCTP(r->out.needed); + NDR_PULL_ALLOC(ndr, r->out.count); + ZERO_STRUCTP(r->out.count); } if (flags & NDR_OUT) { + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_info)); + if (_ptr_info) { + NDR_PULL_ALLOC(ndr, r->out.info); + } else { + r->out.info = NULL; + } + if (r->out.info) { + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->out.info)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + } + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.needed); + } + _mem_save_needed_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.needed, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.count); + } + _mem_save_count_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.count, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); } return NDR_ERR_SUCCESS; } +_PUBLIC_ enum ndr_err_code ndr_push___spoolss_EnumPrintProcDataTypes(struct ndr_push *ndr, int flags, const struct __spoolss_EnumPrintProcDataTypes *r) +{ + uint32_t cntr_info_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.level)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count)); + } + if (flags & NDR_OUT) { + for (cntr_info_0 = 0; cntr_info_0 < r->in.count; cntr_info_0++) { + NDR_CHECK(ndr_push_set_switch_value(ndr, &r->out.info[cntr_info_0], r->in.level)); + NDR_CHECK(ndr_push_spoolss_PrintProcDataTypesInfo(ndr, NDR_SCALARS, &r->out.info[cntr_info_0])); + } + for (cntr_info_0 = 0; cntr_info_0 < r->in.count; cntr_info_0++) { + NDR_CHECK(ndr_push_spoolss_PrintProcDataTypesInfo(ndr, NDR_BUFFERS, &r->out.info[cntr_info_0])); + } + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_pull___spoolss_EnumPrintProcDataTypes(struct ndr_pull *ndr, int flags, struct __spoolss_EnumPrintProcDataTypes *r) +{ + uint32_t cntr_info_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.level)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.count)); + } + if (flags & NDR_OUT) { + NDR_PULL_ALLOC_N(ndr, r->out.info, r->in.count); + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0); + for (cntr_info_0 = 0; cntr_info_0 < r->in.count; cntr_info_0++) { + NDR_CHECK(ndr_pull_set_switch_value(ndr, &r->out.info[cntr_info_0], r->in.level)); + NDR_CHECK(ndr_pull_spoolss_PrintProcDataTypesInfo(ndr, NDR_SCALARS, &r->out.info[cntr_info_0])); + } + for (cntr_info_0 = 0; cntr_info_0 < r->in.count; cntr_info_0++) { + NDR_CHECK(ndr_pull_spoolss_PrintProcDataTypesInfo(ndr, NDR_BUFFERS, &r->out.info[cntr_info_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + } + return NDR_ERR_SUCCESS; +} + _PUBLIC_ void ndr_print_spoolss_EnumPrintProcDataTypes(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_EnumPrintProcDataTypes *r) { + uint32_t cntr_info_2; ndr_print_struct(ndr, name, "spoolss_EnumPrintProcDataTypes"); ndr->depth++; if (flags & NDR_SET_VALUES) { @@ -23403,11 +24091,58 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrintProcDataTypes(struct ndr_print *ndr, co if (flags & NDR_IN) { ndr_print_struct(ndr, "in", "spoolss_EnumPrintProcDataTypes"); ndr->depth++; + ndr_print_ptr(ndr, "servername", r->in.servername); + ndr->depth++; + if (r->in.servername) { + ndr_print_string(ndr, "servername", r->in.servername); + } + ndr->depth--; + ndr_print_ptr(ndr, "print_processor_name", r->in.print_processor_name); + ndr->depth++; + if (r->in.print_processor_name) { + ndr_print_string(ndr, "print_processor_name", r->in.print_processor_name); + } + ndr->depth--; + ndr_print_uint32(ndr, "level", r->in.level); + ndr_print_ptr(ndr, "buffer", r->in.buffer); + ndr->depth++; + if (r->in.buffer) { + ndr_print_DATA_BLOB(ndr, "buffer", *r->in.buffer); + } + ndr->depth--; + ndr_print_uint32(ndr, "offered", r->in.offered); ndr->depth--; } if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "spoolss_EnumPrintProcDataTypes"); ndr->depth++; + ndr_print_ptr(ndr, "count", r->out.count); + ndr->depth++; + ndr_print_uint32(ndr, "count", *r->out.count); + ndr->depth--; + ndr_print_ptr(ndr, "info", r->out.info); + ndr->depth++; + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)*r->out.count); + ndr->depth++; + for (cntr_info_2=0;cntr_info_2<*r->out.count;cntr_info_2++) { + char *idx_2=NULL; + if (asprintf(&idx_2, "[%d]", cntr_info_2) != -1) { + ndr_print_set_switch_value(ndr, &(*r->out.info)[cntr_info_2], r->in.level); + ndr_print_spoolss_PrintProcDataTypesInfo(ndr, "info", &(*r->out.info)[cntr_info_2]); + free(idx_2); + } + } + ndr->depth--; + } + ndr->depth--; + ndr->depth--; + ndr_print_ptr(ndr, "needed", r->out.needed); + ndr->depth++; + ndr_print_uint32(ndr, "needed", *r->out.needed); + ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; } @@ -25110,14 +25845,20 @@ static enum ndr_err_code ndr_push_spoolss_EnumPrinterData(struct ndr_push *ndr, return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.value_needed)); - if (r->out.printerdata_type == NULL) { + if (r->out.type == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.printerdata_type)); - if (r->out.buffer == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->out.type)); + { + uint32_t _flags_save_uint8 = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + if (r->out.data == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.data_offered)); + NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.data, r->in.data_offered)); + ndr->flags = _flags_save_uint8; } - NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, *r->out.buffer)); if (r->out.data_needed == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } @@ -25131,8 +25872,7 @@ static enum ndr_err_code ndr_pull_spoolss_EnumPrinterData(struct ndr_pull *ndr, { TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_value_needed_0; - TALLOC_CTX *_mem_save_printerdata_type_0; - TALLOC_CTX *_mem_save_buffer_0; + TALLOC_CTX *_mem_save_type_0; TALLOC_CTX *_mem_save_data_needed_0; if (flags & NDR_IN) { ZERO_STRUCT(r->out); @@ -25149,10 +25889,10 @@ static enum ndr_err_code ndr_pull_spoolss_EnumPrinterData(struct ndr_pull *ndr, NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.data_offered)); NDR_PULL_ALLOC(ndr, r->out.value_needed); ZERO_STRUCTP(r->out.value_needed); - NDR_PULL_ALLOC(ndr, r->out.printerdata_type); - ZERO_STRUCTP(r->out.printerdata_type); - NDR_PULL_ALLOC(ndr, r->out.buffer); - ZERO_STRUCTP(r->out.buffer); + NDR_PULL_ALLOC(ndr, r->out.type); + ZERO_STRUCTP(r->out.type); + NDR_PULL_ALLOC_N(ndr, r->out.data, r->in.data_offered); + memset(r->out.data, 0, (r->in.data_offered) * sizeof(*r->out.data)); NDR_PULL_ALLOC(ndr, r->out.data_needed); ZERO_STRUCTP(r->out.data_needed); } @@ -25167,19 +25907,22 @@ static enum ndr_err_code ndr_pull_spoolss_EnumPrinterData(struct ndr_pull *ndr, NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.value_needed)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_value_needed_0, LIBNDR_FLAG_REF_ALLOC); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.printerdata_type); + NDR_PULL_ALLOC(ndr, r->out.type); } - _mem_save_printerdata_type_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.printerdata_type, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.printerdata_type)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_printerdata_type_0, LIBNDR_FLAG_REF_ALLOC); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC(ndr, r->out.buffer); + _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.type, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, r->out.type)); + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, LIBNDR_FLAG_REF_ALLOC); + { + uint32_t _flags_save_uint8 = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_PRINT_ARRAY_HEX); + NDR_CHECK(ndr_pull_array_size(ndr, &r->out.data)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC_N(ndr, r->out.data, ndr_get_array_size(ndr, &r->out.data)); + } + NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.data, ndr_get_array_size(ndr, &r->out.data))); + ndr->flags = _flags_save_uint8; } - _mem_save_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.buffer, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, r->out.buffer)); - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_buffer_0, LIBNDR_FLAG_REF_ALLOC); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->out.data_needed); } @@ -25191,6 +25934,9 @@ static enum ndr_err_code ndr_pull_spoolss_EnumPrinterData(struct ndr_pull *ndr, if (r->out.value_name) { NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.value_name, r->in.value_offered / 2)); } + if (r->out.data) { + NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.data, r->in.data_offered)); + } } return NDR_ERR_SUCCESS; } @@ -25222,13 +25968,13 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinterData(struct ndr_print *ndr, const cha ndr->depth++; ndr_print_uint32(ndr, "value_needed", *r->out.value_needed); ndr->depth--; - ndr_print_ptr(ndr, "printerdata_type", r->out.printerdata_type); + ndr_print_ptr(ndr, "type", r->out.type); ndr->depth++; - ndr_print_uint32(ndr, "printerdata_type", *r->out.printerdata_type); + ndr_print_winreg_Type(ndr, "type", *r->out.type); ndr->depth--; - ndr_print_ptr(ndr, "buffer", r->out.buffer); + ndr_print_ptr(ndr, "data", r->out.data); ndr->depth++; - ndr_print_DATA_BLOB(ndr, "buffer", *r->out.buffer); + ndr_print_array_uint8(ndr, "data", r->out.data, r->in.data_offered); ndr->depth--; ndr_print_ptr(ndr, "data_needed", r->out.data_needed); ndr->depth++; @@ -25447,7 +26193,7 @@ static enum ndr_err_code ndr_push_spoolss_SetPrinterDataEx(struct ndr_push *ndr, NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.value_name, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.value_name, ndr_charset_length(r->in.value_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.type)); + NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, r->in.type)); if (r->in.buffer == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } @@ -25486,7 +26232,7 @@ static enum ndr_err_code ndr_pull_spoolss_SetPrinterDataEx(struct ndr_pull *ndr, } NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.value_name), sizeof(uint16_t))); NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.value_name, ndr_get_array_length(ndr, &r->in.value_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.type)); + NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, &r->in.type)); NDR_CHECK(ndr_pull_array_size(ndr, &r->in.buffer)); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC_N(ndr, r->in.buffer, ndr_get_array_size(ndr, &r->in.buffer)); @@ -25519,7 +26265,7 @@ _PUBLIC_ void ndr_print_spoolss_SetPrinterDataEx(struct ndr_print *ndr, const ch ndr->depth--; ndr_print_string(ndr, "key_name", r->in.key_name); ndr_print_string(ndr, "value_name", r->in.value_name); - ndr_print_uint32(ndr, "type", r->in.type); + ndr_print_winreg_Type(ndr, "type", r->in.type); ndr_print_ptr(ndr, "buffer", r->in.buffer); ndr->depth++; ndr_print_array_uint8(ndr, "buffer", r->in.buffer, r->in.offered); @@ -25557,7 +26303,7 @@ static enum ndr_err_code ndr_push_spoolss_GetPrinterDataEx(struct ndr_push *ndr, if (r->out.type == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, *r->out.type)); + NDR_CHECK(ndr_push_winreg_Type(ndr, NDR_SCALARS, *r->out.type)); if (r->out.buffer == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } @@ -25615,7 +26361,7 @@ static enum ndr_err_code ndr_pull_spoolss_GetPrinterDataEx(struct ndr_pull *ndr, } _mem_save_type_0 = NDR_PULL_GET_MEM_CTX(ndr); NDR_PULL_SET_MEM_CTX(ndr, r->out.type, LIBNDR_FLAG_REF_ALLOC); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.type)); + NDR_CHECK(ndr_pull_winreg_Type(ndr, NDR_SCALARS, r->out.type)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_type_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer)); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { @@ -25661,7 +26407,7 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinterDataEx(struct ndr_print *ndr, const ch ndr->depth++; ndr_print_ptr(ndr, "type", r->out.type); ndr->depth++; - ndr_print_uint32(ndr, "type", *r->out.type); + ndr_print_winreg_Type(ndr, "type", *r->out.type); ndr->depth--; ndr_print_ptr(ndr, "buffer", r->out.buffer); ndr->depth++; @@ -25677,7 +26423,7 @@ _PUBLIC_ void ndr_print_spoolss_GetPrinterDataEx(struct ndr_print *ndr, const ch ndr->depth--; } -_PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinterDataEx *r) +_PUBLIC_ enum ndr_err_code ndr_push__spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct _spoolss_EnumPrinterDataEx *r) { if (flags & NDR_IN) { if (r->in.handle == NULL) { @@ -25691,11 +26437,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *n NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered)); } if (flags & NDR_OUT) { - if (r->out.buffer == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered)); - NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->out.buffer, r->in.offered)); + NDR_CHECK(ndr_push_DATA_BLOB(ndr, NDR_SCALARS, r->out.info)); if (r->out.needed == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); } @@ -25709,7 +26451,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *n return NDR_ERR_SUCCESS; } -_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterDataEx *r) +_PUBLIC_ enum ndr_err_code ndr_pull__spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct _spoolss_EnumPrinterDataEx *r) { TALLOC_CTX *_mem_save_handle_0; TALLOC_CTX *_mem_save_needed_0; @@ -25732,19 +26474,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *n NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.key_name), sizeof(uint16_t))); NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.key_name, ndr_get_array_length(ndr, &r->in.key_name), sizeof(uint16_t), CH_UTF16)); NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); - NDR_PULL_ALLOC_N(ndr, r->out.buffer, r->in.offered); - memset(r->out.buffer, 0, (r->in.offered) * sizeof(*r->out.buffer)); NDR_PULL_ALLOC(ndr, r->out.needed); ZERO_STRUCTP(r->out.needed); NDR_PULL_ALLOC(ndr, r->out.count); ZERO_STRUCTP(r->out.count); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.buffer)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer)); - } - NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->out.buffer, ndr_get_array_size(ndr, &r->out.buffer))); + NDR_CHECK(ndr_pull_DATA_BLOB(ndr, NDR_SCALARS, &r->out.info)); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->out.needed); } @@ -25760,15 +26496,54 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *n NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.count)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_count_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.buffer) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.buffer, r->in.offered)); + } + return NDR_ERR_SUCCESS; +} + +_PUBLIC_ enum ndr_err_code ndr_push___spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct __spoolss_EnumPrinterDataEx *r) +{ + uint32_t cntr_info_0; + if (flags & NDR_IN) { + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.count)); + } + if (flags & NDR_OUT) { + for (cntr_info_0 = 0; cntr_info_0 < r->in.count; cntr_info_0++) { + NDR_CHECK(ndr_push_spoolss_PrinterEnumValues(ndr, NDR_SCALARS, &r->out.info[cntr_info_0])); + } + for (cntr_info_0 = 0; cntr_info_0 < r->in.count; cntr_info_0++) { + NDR_CHECK(ndr_push_spoolss_PrinterEnumValues(ndr, NDR_BUFFERS, &r->out.info[cntr_info_0])); } } return NDR_ERR_SUCCESS; } +_PUBLIC_ enum ndr_err_code ndr_pull___spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct __spoolss_EnumPrinterDataEx *r) +{ + uint32_t cntr_info_0; + TALLOC_CTX *_mem_save_info_0; + if (flags & NDR_IN) { + ZERO_STRUCT(r->out); + + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.count)); + } + if (flags & NDR_OUT) { + NDR_PULL_ALLOC_N(ndr, r->out.info, r->in.count); + _mem_save_info_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.info, 0); + for (cntr_info_0 = 0; cntr_info_0 < r->in.count; cntr_info_0++) { + NDR_CHECK(ndr_pull_spoolss_PrinterEnumValues(ndr, NDR_SCALARS, &r->out.info[cntr_info_0])); + } + for (cntr_info_0 = 0; cntr_info_0 < r->in.count; cntr_info_0++) { + NDR_CHECK(ndr_pull_spoolss_PrinterEnumValues(ndr, NDR_BUFFERS, &r->out.info[cntr_info_0])); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_info_0, 0); + } + return NDR_ERR_SUCCESS; +} + _PUBLIC_ void ndr_print_spoolss_EnumPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_EnumPrinterDataEx *r) { + uint32_t cntr_info_2; ndr_print_struct(ndr, name, "spoolss_EnumPrinterDataEx"); ndr->depth++; if (flags & NDR_SET_VALUES) { @@ -25788,17 +26563,31 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinterDataEx(struct ndr_print *ndr, const c if (flags & NDR_OUT) { ndr_print_struct(ndr, "out", "spoolss_EnumPrinterDataEx"); ndr->depth++; - ndr_print_ptr(ndr, "buffer", r->out.buffer); + ndr_print_ptr(ndr, "count", r->out.count); ndr->depth++; - ndr_print_array_uint8(ndr, "buffer", r->out.buffer, r->in.offered); + ndr_print_uint32(ndr, "count", *r->out.count); ndr->depth--; - ndr_print_ptr(ndr, "needed", r->out.needed); + ndr_print_ptr(ndr, "info", r->out.info); ndr->depth++; - ndr_print_uint32(ndr, "needed", *r->out.needed); + ndr_print_ptr(ndr, "info", *r->out.info); + ndr->depth++; + if (*r->out.info) { + ndr->print(ndr, "%s: ARRAY(%d)", "info", (int)*r->out.count); + ndr->depth++; + for (cntr_info_2=0;cntr_info_2<*r->out.count;cntr_info_2++) { + char *idx_2=NULL; + if (asprintf(&idx_2, "[%d]", cntr_info_2) != -1) { + ndr_print_spoolss_PrinterEnumValues(ndr, "info", &(*r->out.info)[cntr_info_2]); + free(idx_2); + } + } + ndr->depth--; + } ndr->depth--; - ndr_print_ptr(ndr, "count", r->out.count); + ndr->depth--; + ndr_print_ptr(ndr, "needed", r->out.needed); ndr->depth++; - ndr_print_uint32(ndr, "count", *r->out.count); + ndr_print_uint32(ndr, "needed", *r->out.needed); ndr->depth--; ndr_print_WERROR(ndr, "result", r->out.result); ndr->depth--; @@ -25808,7 +26597,6 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinterDataEx(struct ndr_print *ndr, const c _PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterKey(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinterKey *r) { - uint32_t cntr_key_buffer_1; if (flags & NDR_IN) { if (r->in.handle == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); @@ -25818,15 +26606,25 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterKey(struct ndr_push *ndr, NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, 0)); NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, ndr_charset_length(r->in.key_name, CH_UTF16))); NDR_CHECK(ndr_push_charset(ndr, NDR_SCALARS, r->in.key_name, ndr_charset_length(r->in.key_name, CH_UTF16), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.key_buffer_size)); + NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.offered)); } if (flags & NDR_OUT) { - if (r->out.key_buffer == NULL) { - return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); - } - NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->in.key_buffer_size / 2)); - for (cntr_key_buffer_1 = 0; cntr_key_buffer_1 < r->in.key_buffer_size / 2; cntr_key_buffer_1++) { - NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->out.key_buffer[cntr_key_buffer_1])); + { + uint32_t _flags_save_string_array = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (r->out.key_buffer == NULL) { + return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); + } + NDR_CHECK(ndr_push_unique_ptr(ndr, *r->out.key_buffer)); + if (*r->out.key_buffer) { + { + struct ndr_push *_ndr_key_buffer; + NDR_CHECK(ndr_push_subcontext_start(ndr, &_ndr_key_buffer, 0, r->in.offered)); + NDR_CHECK(ndr_push_string_array(_ndr_key_buffer, NDR_SCALARS, *r->out.key_buffer)); + NDR_CHECK(ndr_push_subcontext_end(ndr, _ndr_key_buffer, 0, r->in.offered)); + } + } + ndr->flags = _flags_save_string_array; } if (r->out.needed == NULL) { return ndr_push_error(ndr, NDR_ERR_INVALID_POINTER, "NULL [ref] pointer"); @@ -25839,8 +26637,9 @@ _PUBLIC_ enum ndr_err_code ndr_push_spoolss_EnumPrinterKey(struct ndr_push *ndr, _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterKey(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterKey *r) { - uint32_t cntr_key_buffer_1; + uint32_t _ptr_key_buffer; TALLOC_CTX *_mem_save_handle_0; + TALLOC_CTX *_mem_save_key_buffer_0; TALLOC_CTX *_mem_save_key_buffer_1; TALLOC_CTX *_mem_save_needed_0; if (flags & NDR_IN) { @@ -25860,23 +26659,41 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterKey(struct ndr_pull *ndr, } NDR_CHECK(ndr_check_string_terminator(ndr, ndr_get_array_length(ndr, &r->in.key_name), sizeof(uint16_t))); NDR_CHECK(ndr_pull_charset(ndr, NDR_SCALARS, &r->in.key_name, ndr_get_array_length(ndr, &r->in.key_name), sizeof(uint16_t), CH_UTF16)); - NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.key_buffer_size)); - NDR_PULL_ALLOC_N(ndr, r->out.key_buffer, r->in.key_buffer_size / 2); - memset(r->out.key_buffer, 0, (r->in.key_buffer_size / 2) * sizeof(*r->out.key_buffer)); + NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->in.offered)); + NDR_PULL_ALLOC(ndr, r->out.key_buffer); + ZERO_STRUCTP(r->out.key_buffer); NDR_PULL_ALLOC(ndr, r->out.needed); ZERO_STRUCTP(r->out.needed); } if (flags & NDR_OUT) { - NDR_CHECK(ndr_pull_array_size(ndr, &r->out.key_buffer)); - if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { - NDR_PULL_ALLOC_N(ndr, r->out.key_buffer, ndr_get_array_size(ndr, &r->out.key_buffer)); - } - _mem_save_key_buffer_1 = NDR_PULL_GET_MEM_CTX(ndr); - NDR_PULL_SET_MEM_CTX(ndr, r->out.key_buffer, 0); - for (cntr_key_buffer_1 = 0; cntr_key_buffer_1 < r->in.key_buffer_size / 2; cntr_key_buffer_1++) { - NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->out.key_buffer[cntr_key_buffer_1])); + { + uint32_t _flags_save_string_array = ndr->flags; + ndr_set_flags(&ndr->flags, LIBNDR_FLAG_STR_NULLTERM); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.key_buffer); + } + _mem_save_key_buffer_0 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, r->out.key_buffer, LIBNDR_FLAG_REF_ALLOC); + NDR_CHECK(ndr_pull_generic_ptr(ndr, &_ptr_key_buffer)); + if (_ptr_key_buffer) { + NDR_PULL_ALLOC(ndr, *r->out.key_buffer); + } else { + *r->out.key_buffer = NULL; + } + if (*r->out.key_buffer) { + _mem_save_key_buffer_1 = NDR_PULL_GET_MEM_CTX(ndr); + NDR_PULL_SET_MEM_CTX(ndr, *r->out.key_buffer, 0); + { + struct ndr_pull *_ndr_key_buffer; + NDR_CHECK(ndr_pull_subcontext_start(ndr, &_ndr_key_buffer, 0, r->in.offered)); + NDR_CHECK(ndr_pull_string_array(_ndr_key_buffer, NDR_SCALARS, r->out.key_buffer)); + NDR_CHECK(ndr_pull_subcontext_end(ndr, _ndr_key_buffer, 0, r->in.offered)); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_buffer_1, 0); + } + NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_buffer_0, LIBNDR_FLAG_REF_ALLOC); + ndr->flags = _flags_save_string_array; } - NDR_PULL_SET_MEM_CTX(ndr, _mem_save_key_buffer_1, 0); if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { NDR_PULL_ALLOC(ndr, r->out.needed); } @@ -25885,16 +26702,12 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_EnumPrinterKey(struct ndr_pull *ndr, NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, r->out.needed)); NDR_PULL_SET_MEM_CTX(ndr, _mem_save_needed_0, LIBNDR_FLAG_REF_ALLOC); NDR_CHECK(ndr_pull_WERROR(ndr, NDR_SCALARS, &r->out.result)); - if (r->out.key_buffer) { - NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->out.key_buffer, r->in.key_buffer_size / 2)); - } } return NDR_ERR_SUCCESS; } _PUBLIC_ void ndr_print_spoolss_EnumPrinterKey(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_EnumPrinterKey *r) { - uint32_t cntr_key_buffer_1; ndr_print_struct(ndr, name, "spoolss_EnumPrinterKey"); ndr->depth++; if (flags & NDR_SET_VALUES) { @@ -25908,7 +26721,7 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinterKey(struct ndr_print *ndr, const char ndr_print_policy_handle(ndr, "handle", r->in.handle); ndr->depth--; ndr_print_string(ndr, "key_name", r->in.key_name); - ndr_print_uint32(ndr, "key_buffer_size", r->in.key_buffer_size); + ndr_print_uint32(ndr, "offered", r->in.offered); ndr->depth--; } if (flags & NDR_OUT) { @@ -25916,14 +26729,10 @@ _PUBLIC_ void ndr_print_spoolss_EnumPrinterKey(struct ndr_print *ndr, const char ndr->depth++; ndr_print_ptr(ndr, "key_buffer", r->out.key_buffer); ndr->depth++; - ndr->print(ndr, "%s: ARRAY(%d)", "key_buffer", (int)r->in.key_buffer_size / 2); + ndr_print_ptr(ndr, "key_buffer", *r->out.key_buffer); ndr->depth++; - for (cntr_key_buffer_1=0;cntr_key_buffer_1<r->in.key_buffer_size / 2;cntr_key_buffer_1++) { - char *idx_1=NULL; - if (asprintf(&idx_1, "[%d]", cntr_key_buffer_1) != -1) { - ndr_print_uint16(ndr, "key_buffer", r->out.key_buffer[cntr_key_buffer_1]); - free(idx_1); - } + if (*r->out.key_buffer) { + ndr_print_string_array(ndr, "key_buffer", *r->out.key_buffer); } ndr->depth--; ndr->depth--; diff --git a/librpc/gen_ndr/ndr_spoolss.h b/librpc/gen_ndr/ndr_spoolss.h index 84ab8b7d05..0feb4a2c5e 100644 --- a/librpc/gen_ndr/ndr_spoolss.h +++ b/librpc/gen_ndr/ndr_spoolss.h @@ -211,7 +211,12 @@ 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); +enum ndr_err_code ndr_push_spoolss_PrinterInfo0(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo0 *r); +enum ndr_err_code ndr_pull_spoolss_PrinterInfo0(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo0 *r); void ndr_print_spoolss_PrinterInfo0(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo0 *r); +size_t ndr_size_spoolss_PrinterInfo0(const struct spoolss_PrinterInfo0 *r, struct smb_iconv_convenience *ic, int flags); 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); enum ndr_err_code ndr_pull_spoolss_DeviceMode(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DeviceMode *r); @@ -220,29 +225,62 @@ size_t ndr_size_spoolss_DeviceMode(const struct spoolss_DeviceMode *r, struct sm enum ndr_err_code ndr_push_spoolss_EnumPrinterFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r); enum ndr_err_code ndr_pull_spoolss_EnumPrinterFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); void ndr_print_spoolss_EnumPrinterFlags(struct ndr_print *ndr, const char *name, uint32_t r); +enum ndr_err_code ndr_push_spoolss_PrinterInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo1 *r); +enum ndr_err_code ndr_pull_spoolss_PrinterInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo1 *r); void ndr_print_spoolss_PrinterInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo1 *r); +size_t ndr_size_spoolss_PrinterInfo1(const struct spoolss_PrinterInfo1 *r, struct smb_iconv_convenience *ic, int flags); 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); +enum ndr_err_code ndr_push_spoolss_PrinterInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo2 *r); +enum ndr_err_code ndr_pull_spoolss_PrinterInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo2 *r); void ndr_print_spoolss_PrinterInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo2 *r); +size_t ndr_size_spoolss_PrinterInfo2(const struct spoolss_PrinterInfo2 *r, struct smb_iconv_convenience *ic, int flags); +enum ndr_err_code ndr_push_spoolss_PrinterInfo3(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo3 *r); +enum ndr_err_code ndr_pull_spoolss_PrinterInfo3(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo3 *r); void ndr_print_spoolss_PrinterInfo3(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo3 *r); +size_t ndr_size_spoolss_PrinterInfo3(const struct spoolss_PrinterInfo3 *r, struct smb_iconv_convenience *ic, int flags); +enum ndr_err_code ndr_push_spoolss_PrinterInfo4(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo4 *r); +enum ndr_err_code ndr_pull_spoolss_PrinterInfo4(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo4 *r); void ndr_print_spoolss_PrinterInfo4(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo4 *r); +size_t ndr_size_spoolss_PrinterInfo4(const struct spoolss_PrinterInfo4 *r, struct smb_iconv_convenience *ic, int flags); +enum ndr_err_code ndr_push_spoolss_PrinterInfo5(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo5 *r); +enum ndr_err_code ndr_pull_spoolss_PrinterInfo5(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo5 *r); void ndr_print_spoolss_PrinterInfo5(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo5 *r); +size_t ndr_size_spoolss_PrinterInfo5(const struct spoolss_PrinterInfo5 *r, struct smb_iconv_convenience *ic, int flags); +enum ndr_err_code ndr_push_spoolss_PrinterInfo6(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo6 *r); +enum ndr_err_code ndr_pull_spoolss_PrinterInfo6(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo6 *r); void ndr_print_spoolss_PrinterInfo6(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo6 *r); +size_t ndr_size_spoolss_PrinterInfo6(const struct spoolss_PrinterInfo6 *r, struct smb_iconv_convenience *ic, int flags); void ndr_print_spoolss_DsPrintAction(struct ndr_print *ndr, const char *name, uint32_t r); +enum ndr_err_code ndr_push_spoolss_PrinterInfo7(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterInfo7 *r); +enum ndr_err_code ndr_pull_spoolss_PrinterInfo7(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterInfo7 *r); void ndr_print_spoolss_PrinterInfo7(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterInfo7 *r); +size_t ndr_size_spoolss_PrinterInfo7(const struct spoolss_PrinterInfo7 *r, struct smb_iconv_convenience *ic, int flags); void ndr_print_spoolss_DeviceModeInfo(struct ndr_print *ndr, const char *name, const struct spoolss_DeviceModeInfo *r); enum ndr_err_code ndr_push_spoolss_PrinterInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_PrinterInfo *r); enum ndr_err_code ndr_pull_spoolss_PrinterInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_PrinterInfo *r); void ndr_print_spoolss_PrinterInfo(struct ndr_print *ndr, const char *name, const union spoolss_PrinterInfo *r); +size_t ndr_size_spoolss_PrinterInfo(const union spoolss_PrinterInfo *r, uint32_t level, struct smb_iconv_convenience *ic, int flags); void ndr_print_spoolss_DevmodeContainer(struct ndr_print *ndr, const char *name, const struct spoolss_DevmodeContainer *r); -void ndr_print_spoolss_JobStatus(struct ndr_print *ndr, const char *name, uint32_t r); +enum ndr_err_code ndr_push_spoolss_JobInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_JobInfo1 *r); +enum ndr_err_code ndr_pull_spoolss_JobInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_JobInfo1 *r); void ndr_print_spoolss_JobInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_JobInfo1 *r); +size_t ndr_size_spoolss_JobInfo1(const struct spoolss_JobInfo1 *r, struct smb_iconv_convenience *ic, int flags); +enum ndr_err_code ndr_push_spoolss_JobInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_JobInfo2 *r); +enum ndr_err_code ndr_pull_spoolss_JobInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_JobInfo2 *r); void ndr_print_spoolss_JobInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_JobInfo2 *r); +size_t ndr_size_spoolss_JobInfo2(const struct spoolss_JobInfo2 *r, struct smb_iconv_convenience *ic, int flags); +enum ndr_err_code ndr_push_spoolss_JobInfo3(struct ndr_push *ndr, int ndr_flags, const struct spoolss_JobInfo3 *r); +enum ndr_err_code ndr_pull_spoolss_JobInfo3(struct ndr_pull *ndr, int ndr_flags, struct spoolss_JobInfo3 *r); void ndr_print_spoolss_JobInfo3(struct ndr_print *ndr, const char *name, const struct spoolss_JobInfo3 *r); +size_t ndr_size_spoolss_JobInfo3(const struct spoolss_JobInfo3 *r, struct smb_iconv_convenience *ic, int flags); +enum ndr_err_code ndr_push_spoolss_JobInfo4(struct ndr_push *ndr, int ndr_flags, const struct spoolss_JobInfo4 *r); +enum ndr_err_code ndr_pull_spoolss_JobInfo4(struct ndr_pull *ndr, int ndr_flags, struct spoolss_JobInfo4 *r); void ndr_print_spoolss_JobInfo4(struct ndr_print *ndr, const char *name, const struct spoolss_JobInfo4 *r); +size_t ndr_size_spoolss_JobInfo4(const struct spoolss_JobInfo4 *r, struct smb_iconv_convenience *ic, int flags); 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); +size_t ndr_size_spoolss_JobInfo(const union spoolss_JobInfo *r, uint32_t level, struct smb_iconv_convenience *ic, int flags); 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); @@ -315,6 +353,7 @@ size_t ndr_size_spoolss_DriverInfo101(const struct spoolss_DriverInfo101 *r, str enum ndr_err_code ndr_push_spoolss_DriverInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_DriverInfo *r); enum ndr_err_code ndr_pull_spoolss_DriverInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_DriverInfo *r); void ndr_print_spoolss_DriverInfo(struct ndr_print *ndr, const char *name, const union spoolss_DriverInfo *r); +size_t ndr_size_spoolss_DriverInfo(const union spoolss_DriverInfo *r, uint32_t level, struct smb_iconv_convenience *ic, int flags); enum ndr_err_code ndr_push_spoolss_DriverDirectoryInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverDirectoryInfo1 *r); enum ndr_err_code ndr_pull_spoolss_DriverDirectoryInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverDirectoryInfo1 *r); void ndr_print_spoolss_DriverDirectoryInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_DriverDirectoryInfo1 *r); @@ -323,7 +362,10 @@ enum ndr_err_code ndr_push_spoolss_DriverDirectoryInfo(struct ndr_push *ndr, int enum ndr_err_code ndr_pull_spoolss_DriverDirectoryInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_DriverDirectoryInfo *r); void ndr_print_spoolss_DriverDirectoryInfo(struct ndr_print *ndr, const char *name, const union spoolss_DriverDirectoryInfo *r); size_t ndr_size_spoolss_DriverDirectoryInfo(const union spoolss_DriverDirectoryInfo *r, uint32_t level, struct smb_iconv_convenience *ic, int flags); +enum ndr_err_code ndr_push_spoolss_PrintProcessorInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrintProcessorInfo1 *r); +enum ndr_err_code ndr_pull_spoolss_PrintProcessorInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrintProcessorInfo1 *r); void ndr_print_spoolss_PrintProcessorInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_PrintProcessorInfo1 *r); +size_t ndr_size_spoolss_PrintProcessorInfo1(const struct spoolss_PrintProcessorInfo1 *r, struct smb_iconv_convenience *ic, int flags); enum ndr_err_code ndr_push_spoolss_PrintProcessorInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_PrintProcessorInfo *r); enum ndr_err_code ndr_pull_spoolss_PrintProcessorInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_PrintProcessorInfo *r); void ndr_print_spoolss_PrintProcessorInfo(struct ndr_print *ndr, const char *name, const union spoolss_PrintProcessorInfo *r); @@ -345,7 +387,6 @@ enum ndr_err_code ndr_push_spoolss_OSVersionEx(struct ndr_push *ndr, int ndr_fla enum ndr_err_code ndr_pull_spoolss_OSVersionEx(struct ndr_pull *ndr, int ndr_flags, struct spoolss_OSVersionEx *r); void ndr_print_spoolss_OSVersionEx(struct ndr_print *ndr, const char *name, const struct spoolss_OSVersionEx *r); size_t ndr_size_spoolss_OSVersionEx(const struct spoolss_OSVersionEx *r, struct smb_iconv_convenience *ic, int flags); -void ndr_print_spoolss_PrinterDataType(struct ndr_print *ndr, const char *name, enum spoolss_PrinterDataType r); enum ndr_err_code ndr_push_spoolss_PrinterData(struct ndr_push *ndr, int ndr_flags, const union spoolss_PrinterData *r); enum ndr_err_code ndr_pull_spoolss_PrinterData(struct ndr_pull *ndr, int ndr_flags, union spoolss_PrinterData *r); void ndr_print_spoolss_PrinterData(struct ndr_print *ndr, const char *name, const union spoolss_PrinterData *r); @@ -353,9 +394,15 @@ size_t ndr_size_spoolss_PrinterData(const union spoolss_PrinterData *r, uint32_t void ndr_print_spoolss_FormFlags(struct ndr_print *ndr, const char *name, enum spoolss_FormFlags r); 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); +enum ndr_err_code ndr_push_spoolss_FormInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_FormInfo1 *r); +enum ndr_err_code ndr_pull_spoolss_FormInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_FormInfo1 *r); void ndr_print_spoolss_FormInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_FormInfo1 *r); +size_t ndr_size_spoolss_FormInfo1(const struct spoolss_FormInfo1 *r, struct smb_iconv_convenience *ic, int flags); void ndr_print_spoolss_FormStringType(struct ndr_print *ndr, const char *name, uint32_t r); +enum ndr_err_code ndr_push_spoolss_FormInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_FormInfo2 *r); +enum ndr_err_code ndr_pull_spoolss_FormInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_FormInfo2 *r); void ndr_print_spoolss_FormInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_FormInfo2 *r); +size_t ndr_size_spoolss_FormInfo2(const struct spoolss_FormInfo2 *r, struct smb_iconv_convenience *ic, int flags); 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); @@ -363,24 +410,55 @@ size_t ndr_size_spoolss_FormInfo(const union spoolss_FormInfo *r, uint32_t level 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); +enum ndr_err_code ndr_push_spoolss_PortInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PortInfo1 *r); +enum ndr_err_code ndr_pull_spoolss_PortInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PortInfo1 *r); void ndr_print_spoolss_PortInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_PortInfo1 *r); +size_t ndr_size_spoolss_PortInfo1(const struct spoolss_PortInfo1 *r, struct smb_iconv_convenience *ic, int flags); void ndr_print_spoolss_PortType(struct ndr_print *ndr, const char *name, uint32_t r); +enum ndr_err_code ndr_push_spoolss_PortInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PortInfo2 *r); +enum ndr_err_code ndr_pull_spoolss_PortInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PortInfo2 *r); void ndr_print_spoolss_PortInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_PortInfo2 *r); +size_t ndr_size_spoolss_PortInfo2(const struct spoolss_PortInfo2 *r, struct smb_iconv_convenience *ic, int flags); 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); +enum ndr_err_code ndr_push_spoolss_PortInfo3(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PortInfo3 *r); +enum ndr_err_code ndr_pull_spoolss_PortInfo3(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PortInfo3 *r); void ndr_print_spoolss_PortInfo3(struct ndr_print *ndr, const char *name, const struct spoolss_PortInfo3 *r); +size_t ndr_size_spoolss_PortInfo3(const struct spoolss_PortInfo3 *r, struct smb_iconv_convenience *ic, int flags); +enum ndr_err_code ndr_push_spoolss_PortInfoFF(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PortInfoFF *r); +enum ndr_err_code ndr_pull_spoolss_PortInfoFF(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PortInfoFF *r); void ndr_print_spoolss_PortInfoFF(struct ndr_print *ndr, const char *name, const struct spoolss_PortInfoFF *r); +size_t ndr_size_spoolss_PortInfoFF(const struct spoolss_PortInfoFF *r, struct smb_iconv_convenience *ic, int flags); 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); +enum ndr_err_code ndr_push_spoolss_MonitorInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_MonitorInfo1 *r); +enum ndr_err_code ndr_pull_spoolss_MonitorInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_MonitorInfo1 *r); void ndr_print_spoolss_MonitorInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_MonitorInfo1 *r); +size_t ndr_size_spoolss_MonitorInfo1(const struct spoolss_MonitorInfo1 *r, struct smb_iconv_convenience *ic, int flags); +enum ndr_err_code ndr_push_spoolss_MonitorInfo2(struct ndr_push *ndr, int ndr_flags, const struct spoolss_MonitorInfo2 *r); +enum ndr_err_code ndr_pull_spoolss_MonitorInfo2(struct ndr_pull *ndr, int ndr_flags, struct spoolss_MonitorInfo2 *r); void ndr_print_spoolss_MonitorInfo2(struct ndr_print *ndr, const char *name, const struct spoolss_MonitorInfo2 *r); +size_t ndr_size_spoolss_MonitorInfo2(const struct spoolss_MonitorInfo2 *r, struct smb_iconv_convenience *ic, int flags); enum ndr_err_code ndr_push_spoolss_MonitorInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_MonitorInfo *r); enum ndr_err_code ndr_pull_spoolss_MonitorInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_MonitorInfo *r); void ndr_print_spoolss_MonitorInfo(struct ndr_print *ndr, const char *name, const union spoolss_MonitorInfo *r); +enum ndr_err_code ndr_push_spoolss_PrintProcDataTypesInfo1(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrintProcDataTypesInfo1 *r); +enum ndr_err_code ndr_pull_spoolss_PrintProcDataTypesInfo1(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrintProcDataTypesInfo1 *r); +void ndr_print_spoolss_PrintProcDataTypesInfo1(struct ndr_print *ndr, const char *name, const struct spoolss_PrintProcDataTypesInfo1 *r); +size_t ndr_size_spoolss_PrintProcDataTypesInfo1(const struct spoolss_PrintProcDataTypesInfo1 *r, struct smb_iconv_convenience *ic, int flags); +enum ndr_err_code ndr_push_spoolss_PrintProcDataTypesInfo(struct ndr_push *ndr, int ndr_flags, const union spoolss_PrintProcDataTypesInfo *r); +enum ndr_err_code ndr_pull_spoolss_PrintProcDataTypesInfo(struct ndr_pull *ndr, int ndr_flags, union spoolss_PrintProcDataTypesInfo *r); +void ndr_print_spoolss_PrintProcDataTypesInfo(struct ndr_print *ndr, const char *name, const union spoolss_PrintProcDataTypesInfo *r); void ndr_print_spoolss_PrinterChangeFlags(struct ndr_print *ndr, const char *name, uint32_t r); -void ndr_print_spoolss_Field(struct ndr_print *ndr, const char *name, enum spoolss_Field r); +enum ndr_err_code ndr_push_spoolss_JobNotifyField(struct ndr_push *ndr, int ndr_flags, enum spoolss_JobNotifyField r); +enum ndr_err_code ndr_pull_spoolss_JobNotifyField(struct ndr_pull *ndr, int ndr_flags, enum spoolss_JobNotifyField *r); +void ndr_print_spoolss_JobNotifyField(struct ndr_print *ndr, const char *name, enum spoolss_JobNotifyField r); +enum ndr_err_code ndr_push_spoolss_PrintNotifyField(struct ndr_push *ndr, int ndr_flags, enum spoolss_PrintNotifyField r); +enum ndr_err_code ndr_pull_spoolss_PrintNotifyField(struct ndr_pull *ndr, int ndr_flags, enum spoolss_PrintNotifyField *r); +void ndr_print_spoolss_PrintNotifyField(struct ndr_print *ndr, const char *name, enum spoolss_PrintNotifyField r); void ndr_print_spoolss_NotifyType(struct ndr_print *ndr, const char *name, enum spoolss_NotifyType r); +void ndr_print_spoolss_Field(struct ndr_print *ndr, const char *name, const union spoolss_Field *r); void ndr_print_spoolss_NotifyOptionType(struct ndr_print *ndr, const char *name, const struct spoolss_NotifyOptionType *r); void ndr_print_spoolssNotifyOptionFlags(struct ndr_print *ndr, const char *name, uint32_t r); void ndr_print_spoolss_NotifyOption(struct ndr_print *ndr, const char *name, const struct spoolss_NotifyOption *r); @@ -397,6 +475,10 @@ void ndr_print_spoolss_UserLevel3(struct ndr_print *ndr, const char *name, const void ndr_print_spoolss_UserLevel(struct ndr_print *ndr, const char *name, const union spoolss_UserLevel *r); void ndr_print_spoolss_UserLevelCtr(struct ndr_print *ndr, const char *name, const struct spoolss_UserLevelCtr *r); void ndr_print_spoolss_AccessRights(struct ndr_print *ndr, const char *name, uint32_t r); +enum ndr_err_code ndr_push_spoolss_PrinterEnumValues(struct ndr_push *ndr, int ndr_flags, const struct spoolss_PrinterEnumValues *r); +enum ndr_err_code ndr_pull_spoolss_PrinterEnumValues(struct ndr_pull *ndr, int ndr_flags, struct spoolss_PrinterEnumValues *r); +void ndr_print_spoolss_PrinterEnumValues(struct ndr_print *ndr, const char *name, const struct spoolss_PrinterEnumValues *r); +size_t ndr_size_spoolss_PrinterEnumValues(const struct spoolss_PrinterEnumValues *r, struct smb_iconv_convenience *ic, int flags); enum ndr_err_code ndr_push_spoolss_DeleteDriverFlags(struct ndr_push *ndr, int ndr_flags, uint32_t r); enum ndr_err_code ndr_pull_spoolss_DeleteDriverFlags(struct ndr_pull *ndr, int ndr_flags, uint32_t *r); void ndr_print_spoolss_DeleteDriverFlags(struct ndr_print *ndr, const char *name, uint32_t r); @@ -541,6 +623,14 @@ void ndr_print_spoolss_DeleteMonitor(struct ndr_print *ndr, const char *name, in void ndr_print_spoolss_DeletePrintProcessor(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_DeletePrintProcessor *r); void ndr_print_spoolss_AddPrintProvidor(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_AddPrintProvidor *r); void ndr_print_spoolss_DeletePrintProvidor(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_DeletePrintProvidor *r); +enum ndr_err_code ndr_push__spoolss_EnumPrintProcDataTypes(struct ndr_push *ndr, int flags, const struct _spoolss_EnumPrintProcDataTypes *r); +enum ndr_err_code ndr_pull__spoolss_EnumPrintProcDataTypes(struct ndr_pull *ndr, int flags, struct _spoolss_EnumPrintProcDataTypes *r); +void ndr_print__spoolss_EnumPrintProcDataTypes(struct ndr_print *ndr, const char *name, int flags, const struct _spoolss_EnumPrintProcDataTypes *r); +enum ndr_err_code ndr_push___spoolss_EnumPrintProcDataTypes(struct ndr_push *ndr, int flags, const struct __spoolss_EnumPrintProcDataTypes *r); +enum ndr_err_code ndr_pull___spoolss_EnumPrintProcDataTypes(struct ndr_pull *ndr, int flags, struct __spoolss_EnumPrintProcDataTypes *r); +void ndr_print___spoolss_EnumPrintProcDataTypes(struct ndr_print *ndr, const char *name, int flags, const struct __spoolss_EnumPrintProcDataTypes *r); +enum ndr_err_code ndr_push_spoolss_EnumPrintProcDataTypes(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrintProcDataTypes *r); +enum ndr_err_code ndr_pull_spoolss_EnumPrintProcDataTypes(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrintProcDataTypes *r); void ndr_print_spoolss_EnumPrintProcDataTypes(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_EnumPrintProcDataTypes *r); void ndr_print_spoolss_ResetPrinter(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_ResetPrinter *r); void ndr_print_spoolss_GetPrinterDriver2(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_GetPrinterDriver2 *r); @@ -581,6 +671,12 @@ void ndr_print_spoolss_4b(struct ndr_print *ndr, const char *name, int flags, co void ndr_print_spoolss_4c(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_4c *r); void ndr_print_spoolss_SetPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_SetPrinterDataEx *r); void ndr_print_spoolss_GetPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_GetPrinterDataEx *r); +enum ndr_err_code ndr_push__spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct _spoolss_EnumPrinterDataEx *r); +enum ndr_err_code ndr_pull__spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct _spoolss_EnumPrinterDataEx *r); +void ndr_print__spoolss_EnumPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct _spoolss_EnumPrinterDataEx *r); +enum ndr_err_code ndr_push___spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct __spoolss_EnumPrinterDataEx *r); +enum ndr_err_code ndr_pull___spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct __spoolss_EnumPrinterDataEx *r); +void ndr_print___spoolss_EnumPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct __spoolss_EnumPrinterDataEx *r); enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinterDataEx *r); enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterDataEx *r); void ndr_print_spoolss_EnumPrinterDataEx(struct ndr_print *ndr, const char *name, int flags, const struct spoolss_EnumPrinterDataEx *r); diff --git a/librpc/gen_ndr/spoolss.h b/librpc/gen_ndr/spoolss.h index b66e4ab2a8..8340b34e45 100644 --- a/librpc/gen_ndr/spoolss.h +++ b/librpc/gen_ndr/spoolss.h @@ -10,10 +10,15 @@ #ifndef _HEADER_spoolss #define _HEADER_spoolss -#define PRINTER_ENUM_ICONMASK ( (PRINTER_ENUM_ICON1|PRINTER_ENUM_ICON2|PRINTER_ENUM_ICON3|PRINTER_ENUM_ICON4|PRINTER_ENUM_ICON5|PRINTER_ENUM_ICON6|PRINTER_ENUM_ICON7|PRINTER_ENUM_ICON8) ) +#define 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" ) +#define SPL_LOCAL_PORT ( "Local Port" ) +#define SPL_TCPIP_PORT ( "Standard TCP/IP Port" ) +#define SPL_XCV_MONITOR_LOCALMON ( ",XcvMonitor Local Port" ) +#define SPL_XCV_MONITOR_TCPMON ( ",XcvMonitor Standard TCP/IP Port" ) #define PRINTER_CHANGE_PRINTER ( 0x000000FF ) #define PRINTER_CHANGE_JOB ( 0x0000FF00 ) #define PRINTER_CHANGE_FORM ( (PRINTER_CHANGE_ADD_FORM|PRINTER_CHANGE_SET_FORM|PRINTER_CHANGE_DELETE_FORM) ) @@ -120,6 +125,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)] */ @@ -150,7 +197,7 @@ struct spoolss_PrinterInfo0 { uint32_t ref_ic; uint32_t reserved2; uint32_t reserved3; -}; +}/* [gensize,public] */; /* bitmap spoolss_DeviceModeFields */ #define DEVMODE_ORIENTATION ( 0x00000001 ) @@ -246,7 +293,7 @@ struct spoolss_PrinterInfo1 { const char * name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * description;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * comment;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ -}; +}/* [gensize,public] */; /* bitmap spoolss_PrinterAttributes */ #define PRINTER_ATTRIBUTE_QUEUED ( 0x00000001 ) @@ -266,33 +313,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)] */ @@ -308,24 +328,24 @@ struct spoolss_PrinterInfo2 { const char * parameters;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ struct security_descriptor *secdesc;/* [relative,subcontext(0)] */ uint32_t attributes; - uint32_t priority; + uint32_t priority;/* [range(0,99)] */ uint32_t defaultpriority; uint32_t starttime; uint32_t untiltime; uint32_t status; uint32_t cjobs; uint32_t averageppm; -}; +}/* [gensize,public] */; struct spoolss_PrinterInfo3 { struct security_descriptor *secdesc;/* [relative,subcontext(0)] */ -}; +}/* [gensize,public] */; struct spoolss_PrinterInfo4 { const char * printername;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * servername;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ uint32_t attributes; -}; +}/* [gensize,public] */; struct spoolss_PrinterInfo5 { const char * printername;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ @@ -333,11 +353,11 @@ struct spoolss_PrinterInfo5 { uint32_t attributes; uint32_t device_not_selected_timeout; uint32_t transmission_retry_timeout; -}; +}/* [gensize,public] */; struct spoolss_PrinterInfo6 { uint32_t status; -}; +}/* [gensize,public] */; /* bitmap spoolss_DsPrintAction */ #define DSPRINT_PUBLISH ( 0x00000001 ) @@ -349,7 +369,7 @@ struct spoolss_PrinterInfo6 { struct spoolss_PrinterInfo7 { const char * guid;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ uint32_t action; -}; +}/* [gensize,public] */; struct spoolss_DeviceModeInfo { struct spoolss_DeviceMode *devmode;/* [relative,subcontext(0)] */ @@ -366,28 +386,13 @@ union spoolss_PrinterInfo { struct spoolss_PrinterInfo7 info7;/* [case(7)] */ struct spoolss_DeviceModeInfo info8;/* [case(8)] */ struct spoolss_DeviceModeInfo info9;/* [case(9)] */ -}/* [relative_base,nodiscriminant,public] */; +}/* [relative_base,gensize,public,nodiscriminant] */; struct spoolss_DevmodeContainer { uint32_t _ndr_size;/* [value(_ndr_size_spoolss_DeviceMode(devmode,ndr->iconv_convenience,ndr->flags))] */ struct spoolss_DeviceMode *devmode;/* [unique,subcontext_size(_ndr_size),subcontext(4)] */ }; -/* bitmap spoolss_JobStatus */ -#define JOB_STATUS_PAUSED ( 0x00000001 ) -#define JOB_STATUS_ERROR ( 0x00000002 ) -#define JOB_STATUS_DELETING ( 0x00000004 ) -#define JOB_STATUS_SPOOLING ( 0x00000008 ) -#define JOB_STATUS_PRINTING ( 0x00000010 ) -#define JOB_STATUS_OFFLINE ( 0x00000020 ) -#define JOB_STATUS_PAPEROUT ( 0x00000040 ) -#define JOB_STATUS_PRINTED ( 0x00000080 ) -#define JOB_STATUS_DELETED ( 0x00000100 ) -#define JOB_STATUS_BLOCKED_DEVQ ( 0x00000200 ) -#define JOB_STATUS_USER_INTERVENTION ( 0x00000400 ) -#define JOB_STATUS_RESTART ( 0x00000800 ) -#define JOB_STATUS_COMPLETE ( 0x00001000 ) - struct spoolss_JobInfo1 { uint32_t job_id; const char * printer_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ @@ -397,12 +402,12 @@ struct spoolss_JobInfo1 { const char * data_type;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * text_status;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ uint32_t status; - uint32_t priority; + uint32_t priority;/* [range(0,99)] */ uint32_t position; uint32_t total_pages; uint32_t pages_printed; struct spoolss_Time submitted; -}; +}/* [gensize,public] */; struct spoolss_JobInfo2 { uint32_t job_id; @@ -419,7 +424,7 @@ struct spoolss_JobInfo2 { const char * text_status;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ struct security_descriptor *secdesc;/* [relative] */ uint32_t status; - uint32_t priority; + uint32_t priority;/* [range(0,99)] */ uint32_t position; uint32_t start_time; uint32_t until_time; @@ -428,13 +433,13 @@ struct spoolss_JobInfo2 { struct spoolss_Time submitted; uint32_t time; uint32_t pages_printed; -}; +}/* [gensize,public] */; struct spoolss_JobInfo3 { uint32_t job_id; uint32_t next_job_id; uint32_t reserved; -}; +}/* [gensize,public] */; struct spoolss_JobInfo4 { uint32_t job_id; @@ -451,7 +456,7 @@ struct spoolss_JobInfo4 { const char * text_status;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ struct security_descriptor *secdesc;/* [relative] */ uint32_t status; - uint32_t priority; + uint32_t priority;/* [range(0,99)] */ uint32_t position; uint32_t start_time; uint32_t until_time; @@ -461,14 +466,14 @@ struct spoolss_JobInfo4 { uint32_t time; uint32_t pages_printed; uint32_t size_high; -}; +}/* [gensize,public] */; 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] */; +}/* [relative_base,gensize,public,nodiscriminant] */; struct spoolss_SetJobInfo1 { uint32_t job_id; @@ -479,7 +484,7 @@ struct spoolss_SetJobInfo1 { const char *data_type;/* [unique,charset(UTF16)] */ const char *text_status;/* [unique,charset(UTF16)] */ uint32_t status; - uint32_t priority; + uint32_t priority;/* [range(0,99)] */ uint32_t position; uint32_t total_pages; uint32_t pages_printed; @@ -497,11 +502,11 @@ struct spoolss_SetJobInfo2 { const char *print_processor;/* [unique,charset(UTF16)] */ const char *parameters;/* [unique,charset(UTF16)] */ const char *driver_name;/* [unique,charset(UTF16)] */ - struct spoolss_DeviceMode *devmode;/* [unique] */ + uint32_t _devmode_ptr; const char *text_status;/* [unique,charset(UTF16)] */ - struct security_descriptor *secdesc;/* [unique] */ + uint32_t _secdesc_ptr; uint32_t status; - uint32_t priority; + uint32_t priority;/* [range(0,99)] */ uint32_t position; uint32_t start_time; uint32_t until_time; @@ -523,11 +528,11 @@ struct spoolss_SetJobInfo4 { const char *print_processor;/* [unique,charset(UTF16)] */ const char *parameters;/* [unique,charset(UTF16)] */ const char *driver_name;/* [unique,charset(UTF16)] */ - struct spoolss_DeviceMode *devmode;/* [unique] */ + uint32_t _devmode_ptr; const char *text_status;/* [unique,charset(UTF16)] */ - struct security_descriptor *secdesc;/* [unique] */ + uint32_t _secdesc_ptr; uint32_t status; - uint32_t priority; + uint32_t priority;/* [range(0,99)] */ uint32_t position; uint32_t start_time; uint32_t until_time; @@ -651,7 +656,7 @@ struct spoolss_SetPrinterInfo2 { const char *parameters;/* [unique,charset(UTF16)] */ struct security_descriptor *secdesc;/* [unique,subcontext(0)] */ uint32_t attributes; - uint32_t priority; + uint32_t priority;/* [range(0,99)] */ uint32_t defaultpriority; uint32_t starttime; uint32_t untiltime; @@ -1001,7 +1006,7 @@ union spoolss_DriverInfo { struct spoolss_DriverInfo6 info6;/* [case(6)] */ struct spoolss_DriverInfo8 info8;/* [case(8)] */ struct spoolss_DriverInfo101 info101;/* [case(101)] */ -}/* [relative_base,nodiscriminant,public] */; +}/* [relative_base,gensize,public,nodiscriminant] */; struct spoolss_DriverDirectoryInfo1 { const char * directory_name;/* [flag(LIBNDR_FLAG_STR_NULLTERM)] */ @@ -1013,7 +1018,7 @@ union spoolss_DriverDirectoryInfo { struct spoolss_PrintProcessorInfo1 { const char * print_processor_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ -}; +}/* [gensize,public] */; union spoolss_PrintProcessorInfo { struct spoolss_PrintProcessorInfo1 info1;/* [case] */ @@ -1057,30 +1062,11 @@ struct spoolss_OSVersionEx { uint32_t unknown3; }/* [gensize,public] */; -enum spoolss_PrinterDataType -#ifndef USE_UINT_ENUMS - { - SPOOLSS_PRINTER_DATA_TYPE_NULL=0, - SPOOLSS_PRINTER_DATA_TYPE_STRING=1, - SPOOLSS_PRINTER_DATA_TYPE_BINARY=3, - SPOOLSS_PRINTER_DATA_TYPE_UINT32=4, - SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY=7 -} -#else - { __donnot_use_enum_spoolss_PrinterDataType=0x7FFFFFFF} -#define SPOOLSS_PRINTER_DATA_TYPE_NULL ( 0 ) -#define SPOOLSS_PRINTER_DATA_TYPE_STRING ( 1 ) -#define SPOOLSS_PRINTER_DATA_TYPE_BINARY ( 3 ) -#define SPOOLSS_PRINTER_DATA_TYPE_UINT32 ( 4 ) -#define SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY ( 7 ) -#endif -; - union spoolss_PrinterData { - const char * string;/* [flag(LIBNDR_FLAG_STR_NULLTERM),case(SPOOLSS_PRINTER_DATA_TYPE_STRING)] */ - DATA_BLOB binary;/* [flag(LIBNDR_FLAG_REMAINING),case(SPOOLSS_PRINTER_DATA_TYPE_BINARY)] */ - uint32_t value;/* [case(SPOOLSS_PRINTER_DATA_TYPE_UINT32)] */ - const char ** string_array;/* [flag(LIBNDR_FLAG_STR_NULLTERM),case(SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY)] */ + const char * string;/* [flag(LIBNDR_FLAG_STR_NULLTERM),case(REG_SZ)] */ + DATA_BLOB binary;/* [flag(LIBNDR_FLAG_REMAINING),case(REG_BINARY)] */ + uint32_t value;/* [case(REG_DWORD)] */ + const char ** string_array;/* [flag(LIBNDR_FLAG_STR_NULLTERM),case(REG_MULTI_SZ)] */ DATA_BLOB data;/* [flag(LIBNDR_FLAG_REMAINING),default] */ }/* [gensize,public,nodiscriminant] */; @@ -1116,7 +1102,7 @@ struct spoolss_FormInfo1 { const char * form_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ struct spoolss_FormSize size; struct spoolss_FormArea area; -}; +}/* [gensize,public] */; /* bitmap spoolss_FormStringType */ #define SPOOLSS_FORM_STRING_TYPE_NONE ( 0x00000001 ) @@ -1134,7 +1120,7 @@ struct spoolss_FormInfo2 { uint32_t ressource_id; const char * display_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ uint32_t lang_id; -}; +}/* [gensize,public] */; union spoolss_FormInfo { struct spoolss_FormInfo1 info1;/* [case] */ @@ -1168,7 +1154,7 @@ union spoolss_AddFormInfo { struct spoolss_PortInfo1 { const char * port_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ -}; +}/* [gensize,public] */; /* bitmap spoolss_PortType */ #define SPOOLSS_PORT_TYPE_WRITE ( 0x00000001 ) @@ -1182,7 +1168,7 @@ struct spoolss_PortInfo2 { const char * description;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ uint32_t port_type; uint32_t reserved; -}; +}/* [gensize,public] */; enum spoolss_PortStatus #ifndef USE_UINT_ENUMS @@ -1238,12 +1224,12 @@ struct spoolss_PortInfo3 { enum spoolss_PortStatus status; const char * status_string;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ enum spoolss_PortSeverity severity; -}; +}/* [gensize,public] */; struct spoolss_PortInfoFF { const char * port_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ DATA_BLOB monitor_data; -}; +}/* [gensize,public] */; union spoolss_PortInfo { struct spoolss_PortInfo1 info1;/* [case] */ @@ -1254,19 +1240,27 @@ union spoolss_PortInfo { struct spoolss_MonitorInfo1 { const char * monitor_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ -}; +}/* [gensize,public] */; struct spoolss_MonitorInfo2 { const char * monitor_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * environment;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ const char * dll_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ -}; +}/* [gensize,public] */; union spoolss_MonitorInfo { struct spoolss_MonitorInfo1 info1;/* [case] */ struct spoolss_MonitorInfo2 info2;/* [case(2)] */ }/* [relative_base,nodiscriminant,public] */; +struct spoolss_PrintProcDataTypesInfo1 { + const char * name_array;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ +}/* [gensize,public] */; + +union spoolss_PrintProcDataTypesInfo { + struct spoolss_PrintProcDataTypesInfo1 info1;/* [case] */ +}/* [relative_base,nodiscriminant,public] */; + /* bitmap spoolss_PrinterChangeFlags */ #define PRINTER_CHANGE_ADD_PRINTER ( 0x00000001 ) #define PRINTER_CHANGE_SET_PRINTER ( 0x00000002 ) @@ -1290,87 +1284,152 @@ union spoolss_MonitorInfo { #define PRINTER_CHANGE_DELETE_PRINTER_DRIVER ( 0x40000000 ) #define PRINTER_CHANGE_TIMEOUT ( 0x80000000 ) -enum spoolss_Field +enum spoolss_JobNotifyField +#ifndef USE_UINT_ENUMS + { + JOB_NOTIFY_FIELD_PRINTER_NAME=0x00, + JOB_NOTIFY_FIELD_MACHINE_NAME=0x01, + JOB_NOTIFY_FIELD_PORT_NAME=0x02, + JOB_NOTIFY_FIELD_USER_NAME=0x03, + JOB_NOTIFY_FIELD_NOTIFY_NAME=0x04, + JOB_NOTIFY_FIELD_DATATYPE=0x05, + JOB_NOTIFY_FIELD_PRINT_PROCESSOR=0x06, + JOB_NOTIFY_FIELD_PARAMETERS=0x07, + JOB_NOTIFY_FIELD_DRIVER_NAME=0x08, + JOB_NOTIFY_FIELD_DEVMODE=0x09, + JOB_NOTIFY_FIELD_STATUS=0x0a, + JOB_NOTIFY_FIELD_STATUS_STRING=0x0b, + JOB_NOTIFY_FIELD_SECURITY_DESCRIPTOR=0x0c, + JOB_NOTIFY_FIELD_DOCUMENT=0x0d, + JOB_NOTIFY_FIELD_PRIORITY=0x0e, + JOB_NOTIFY_FIELD_POSITION=0x0f, + JOB_NOTIFY_FIELD_SUBMITTED=0x10, + JOB_NOTIFY_FIELD_START_TIME=0x11, + JOB_NOTIFY_FIELD_UNTIL_TIME=0x12, + JOB_NOTIFY_FIELD_TIME=0x13, + JOB_NOTIFY_FIELD_TOTAL_PAGES=0x14, + JOB_NOTIFY_FIELD_PAGES_PRINTED=0x15, + JOB_NOTIFY_FIELD_TOTAL_BYTES=0x16, + JOB_NOTIFY_FIELD_BYTES_PRINTED=0x17 +} +#else + { __donnot_use_enum_spoolss_JobNotifyField=0x7FFFFFFF} +#define JOB_NOTIFY_FIELD_PRINTER_NAME ( 0x00 ) +#define JOB_NOTIFY_FIELD_MACHINE_NAME ( 0x01 ) +#define JOB_NOTIFY_FIELD_PORT_NAME ( 0x02 ) +#define JOB_NOTIFY_FIELD_USER_NAME ( 0x03 ) +#define JOB_NOTIFY_FIELD_NOTIFY_NAME ( 0x04 ) +#define JOB_NOTIFY_FIELD_DATATYPE ( 0x05 ) +#define JOB_NOTIFY_FIELD_PRINT_PROCESSOR ( 0x06 ) +#define JOB_NOTIFY_FIELD_PARAMETERS ( 0x07 ) +#define JOB_NOTIFY_FIELD_DRIVER_NAME ( 0x08 ) +#define JOB_NOTIFY_FIELD_DEVMODE ( 0x09 ) +#define JOB_NOTIFY_FIELD_STATUS ( 0x0a ) +#define JOB_NOTIFY_FIELD_STATUS_STRING ( 0x0b ) +#define JOB_NOTIFY_FIELD_SECURITY_DESCRIPTOR ( 0x0c ) +#define JOB_NOTIFY_FIELD_DOCUMENT ( 0x0d ) +#define JOB_NOTIFY_FIELD_PRIORITY ( 0x0e ) +#define JOB_NOTIFY_FIELD_POSITION ( 0x0f ) +#define JOB_NOTIFY_FIELD_SUBMITTED ( 0x10 ) +#define JOB_NOTIFY_FIELD_START_TIME ( 0x11 ) +#define JOB_NOTIFY_FIELD_UNTIL_TIME ( 0x12 ) +#define JOB_NOTIFY_FIELD_TIME ( 0x13 ) +#define JOB_NOTIFY_FIELD_TOTAL_PAGES ( 0x14 ) +#define JOB_NOTIFY_FIELD_PAGES_PRINTED ( 0x15 ) +#define JOB_NOTIFY_FIELD_TOTAL_BYTES ( 0x16 ) +#define JOB_NOTIFY_FIELD_BYTES_PRINTED ( 0x17 ) +#endif +; + +enum spoolss_PrintNotifyField #ifndef USE_UINT_ENUMS { - SPOOLSS_FIELD_SERVER_NAME=0, - SPOOLSS_FIELD_PRINTER_NAME=1, - SPOOLSS_FIELD_SHARE_NAME=2, - SPOOLSS_FIELD_PORT_NAME=3, - SPOOLSS_FIELD_DRIVER_NAME=4, - SPOOLSS_FIELD_COMMENT=5, - SPOOLSS_FIELD_LOCATION=6, - SPOOLSS_FIELD_DEVMODE=7, - SPOOLSS_FIELD_SEPFILE=8, - SPOOLSS_FIELD_PRINT_PROCESSOR=9, - SPOOLSS_FIELD_PARAMETERS=10, - SPOOLSS_FIELD_DATATYPE=11, - SPOOLSS_FIELD_SECURITY_DESCRIPTOR=12, - SPOOLSS_FIELD_ATTRIBUTES=13, - SPOOLSS_FIELD_PRIORITY=14, - SPOOLSS_FIELD_DEFAULT_PRIORITY=15, - SPOOLSS_FIELD_START_TIME=16, - SPOOLSS_FIELD_UNTIL_TIME=17, - SPOOLSS_FIELD_STATUS=18, - SPOOLSS_FIELD_STATUS_STRING=19, - SPOOLSS_FIELD_CJOBS=20, - SPOOLSS_FIELD_AVERAGE_PPM=21, - SPOOLSS_FIELD_TOTAL_PAGES=22, - SPOOLSS_FIELD_PAGES_PRINTED=23, - SPOOLSS_FIELD_TOTAL_BYTES=24, - SPOOLSS_FIELD_BYTES_PRINTED=25 + PRINTER_NOTIFY_FIELD_SERVER_NAME=0x00, + PRINTER_NOTIFY_FIELD_PRINTER_NAME=0x01, + PRINTER_NOTIFY_FIELD_SHARE_NAME=0x02, + PRINTER_NOTIFY_FIELD_PORT_NAME=0x03, + PRINTER_NOTIFY_FIELD_DRIVER_NAME=0x04, + PRINTER_NOTIFY_FIELD_COMMENT=0x05, + PRINTER_NOTIFY_FIELD_LOCATION=0x06, + PRINTER_NOTIFY_FIELD_DEVMODE=0x07, + PRINTER_NOTIFY_FIELD_SEPFILE=0x08, + PRINTER_NOTIFY_FIELD_PRINT_PROCESSOR=0x09, + PRINTER_NOTIFY_FIELD_PARAMETERS=0x0a, + PRINTER_NOTIFY_FIELD_DATATYPE=0x0b, + PRINTER_NOTIFY_FIELD_SECURITY_DESCRIPTOR=0x0c, + PRINTER_NOTIFY_FIELD_ATTRIBUTES=0x0d, + PRINTER_NOTIFY_FIELD_PRIORITY=0x0e, + PRINTER_NOTIFY_FIELD_DEFAULT_PRIORITY=0x0f, + PRINTER_NOTIFY_FIELD_START_TIME=0x10, + PRINTER_NOTIFY_FIELD_UNTIL_TIME=0x11, + PRINTER_NOTIFY_FIELD_STATUS=0x12, + PRINTER_NOTIFY_FIELD_STATUS_STRING=0x13, + PRINTER_NOTIFY_FIELD_CJOBS=0x14, + PRINTER_NOTIFY_FIELD_AVERAGE_PPM=0x15, + PRINTER_NOTIFY_FIELD_TOTAL_PAGES=0x16, + PRINTER_NOTIFY_FIELD_PAGES_PRINTED=0x17, + PRINTER_NOTIFY_FIELD_TOTAL_BYTES=0x18, + PRINTER_NOTIFY_FIELD_BYTES_PRINTED=0x19, + PRINTER_NOTIFY_FIELD_OBJECT_GUID=0x1a, + PRINTER_NOTIFY_FIELD_FRIENDLY_NAME=0x1b } #else - { __donnot_use_enum_spoolss_Field=0x7FFFFFFF} -#define SPOOLSS_FIELD_SERVER_NAME ( 0 ) -#define SPOOLSS_FIELD_PRINTER_NAME ( 1 ) -#define SPOOLSS_FIELD_SHARE_NAME ( 2 ) -#define SPOOLSS_FIELD_PORT_NAME ( 3 ) -#define SPOOLSS_FIELD_DRIVER_NAME ( 4 ) -#define SPOOLSS_FIELD_COMMENT ( 5 ) -#define SPOOLSS_FIELD_LOCATION ( 6 ) -#define SPOOLSS_FIELD_DEVMODE ( 7 ) -#define SPOOLSS_FIELD_SEPFILE ( 8 ) -#define SPOOLSS_FIELD_PRINT_PROCESSOR ( 9 ) -#define SPOOLSS_FIELD_PARAMETERS ( 10 ) -#define SPOOLSS_FIELD_DATATYPE ( 11 ) -#define SPOOLSS_FIELD_SECURITY_DESCRIPTOR ( 12 ) -#define SPOOLSS_FIELD_ATTRIBUTES ( 13 ) -#define SPOOLSS_FIELD_PRIORITY ( 14 ) -#define SPOOLSS_FIELD_DEFAULT_PRIORITY ( 15 ) -#define SPOOLSS_FIELD_START_TIME ( 16 ) -#define SPOOLSS_FIELD_UNTIL_TIME ( 17 ) -#define SPOOLSS_FIELD_STATUS ( 18 ) -#define SPOOLSS_FIELD_STATUS_STRING ( 19 ) -#define SPOOLSS_FIELD_CJOBS ( 20 ) -#define SPOOLSS_FIELD_AVERAGE_PPM ( 21 ) -#define SPOOLSS_FIELD_TOTAL_PAGES ( 22 ) -#define SPOOLSS_FIELD_PAGES_PRINTED ( 23 ) -#define SPOOLSS_FIELD_TOTAL_BYTES ( 24 ) -#define SPOOLSS_FIELD_BYTES_PRINTED ( 25 ) + { __donnot_use_enum_spoolss_PrintNotifyField=0x7FFFFFFF} +#define PRINTER_NOTIFY_FIELD_SERVER_NAME ( 0x00 ) +#define PRINTER_NOTIFY_FIELD_PRINTER_NAME ( 0x01 ) +#define PRINTER_NOTIFY_FIELD_SHARE_NAME ( 0x02 ) +#define PRINTER_NOTIFY_FIELD_PORT_NAME ( 0x03 ) +#define PRINTER_NOTIFY_FIELD_DRIVER_NAME ( 0x04 ) +#define PRINTER_NOTIFY_FIELD_COMMENT ( 0x05 ) +#define PRINTER_NOTIFY_FIELD_LOCATION ( 0x06 ) +#define PRINTER_NOTIFY_FIELD_DEVMODE ( 0x07 ) +#define PRINTER_NOTIFY_FIELD_SEPFILE ( 0x08 ) +#define PRINTER_NOTIFY_FIELD_PRINT_PROCESSOR ( 0x09 ) +#define PRINTER_NOTIFY_FIELD_PARAMETERS ( 0x0a ) +#define PRINTER_NOTIFY_FIELD_DATATYPE ( 0x0b ) +#define PRINTER_NOTIFY_FIELD_SECURITY_DESCRIPTOR ( 0x0c ) +#define PRINTER_NOTIFY_FIELD_ATTRIBUTES ( 0x0d ) +#define PRINTER_NOTIFY_FIELD_PRIORITY ( 0x0e ) +#define PRINTER_NOTIFY_FIELD_DEFAULT_PRIORITY ( 0x0f ) +#define PRINTER_NOTIFY_FIELD_START_TIME ( 0x10 ) +#define PRINTER_NOTIFY_FIELD_UNTIL_TIME ( 0x11 ) +#define PRINTER_NOTIFY_FIELD_STATUS ( 0x12 ) +#define PRINTER_NOTIFY_FIELD_STATUS_STRING ( 0x13 ) +#define PRINTER_NOTIFY_FIELD_CJOBS ( 0x14 ) +#define PRINTER_NOTIFY_FIELD_AVERAGE_PPM ( 0x15 ) +#define PRINTER_NOTIFY_FIELD_TOTAL_PAGES ( 0x16 ) +#define PRINTER_NOTIFY_FIELD_PAGES_PRINTED ( 0x17 ) +#define PRINTER_NOTIFY_FIELD_TOTAL_BYTES ( 0x18 ) +#define PRINTER_NOTIFY_FIELD_BYTES_PRINTED ( 0x19 ) +#define PRINTER_NOTIFY_FIELD_OBJECT_GUID ( 0x1a ) +#define PRINTER_NOTIFY_FIELD_FRIENDLY_NAME ( 0x1b ) #endif ; enum spoolss_NotifyType #ifndef USE_UINT_ENUMS { - SPOOLSS_NOTIFY_PRINTER=0, - SPOOLSS_NOTIFY_JOB=1 + PRINTER_NOTIFY_TYPE=0x00, + JOB_NOTIFY_TYPE=0x01 } #else { __donnot_use_enum_spoolss_NotifyType=0x7FFFFFFF} -#define SPOOLSS_NOTIFY_PRINTER ( 0 ) -#define SPOOLSS_NOTIFY_JOB ( 1 ) +#define PRINTER_NOTIFY_TYPE ( 0x00 ) +#define JOB_NOTIFY_TYPE ( 0x01 ) #endif ; +union spoolss_Field { + uint16_t field;/* [case(PRINTER_NOTIFY_TYPE)] */ +}/* [noprint,nodiscriminant] */; + struct spoolss_NotifyOptionType { enum spoolss_NotifyType type; uint16_t u1; uint32_t u2; uint32_t u3; uint32_t count; - enum spoolss_Field *fields;/* [unique,size_is(count)] */ + union spoolss_Field *fields;/* [unique,switch_is(type),size_is(count)] */ }; /* bitmap spoolssNotifyOptionFlags */ @@ -1417,7 +1476,7 @@ union spoolss_NotifyData { struct spoolss_Notify { enum spoolss_NotifyType type; - enum spoolss_Field field; + union spoolss_Field field;/* [switch_is(type)] */ enum spoolss_NotifyTable variable_type; uint32_t job_id; union spoolss_NotifyData data;/* [switch_is(variable_type)] */ @@ -1485,6 +1544,14 @@ struct spoolss_UserLevelCtr { #define JOB_ACCESS_ADMINISTER ( 0x00000010 ) #define JOB_ACCESS_READ ( 0x00000020 ) +struct spoolss_PrinterEnumValues { + const char * value_name;/* [relative,flag(LIBNDR_FLAG_STR_NULLTERM)] */ + uint32_t value_name_len;/* [value(2*strlen_m_term(value_name))] */ + enum winreg_Type type; + union spoolss_PrinterData *data;/* [relative,subcontext_size(r->data_length),subcontext(0),switch_is(type)] */ + uint32_t data_length;/* [value(ndr_size_spoolss_PrinterData(data,type,ndr->iconv_convenience,ndr->flags))] */ +}/* [relative_base,gensize,public] */; + /* bitmap spoolss_DeleteDriverFlags */ #define DPD_DELETE_UNUSED_FILES ( 0x00000001 ) #define DPD_DELETE_SPECIFIC_VERSION ( 0x00000002 ) @@ -1596,7 +1663,7 @@ struct spoolss_EnumPrinters { struct { uint32_t *count;/* [ref] */ - union spoolss_PrinterInfo *info;/* [unique,switch_is(level),size_is(*count)] */ + union spoolss_PrinterInfo **info;/* [ref,switch_is(level),size_is(,*count)] */ uint32_t *needed;/* [ref] */ WERROR result; } out; @@ -1698,7 +1765,7 @@ struct spoolss_EnumJobs { struct { uint32_t *count;/* [ref] */ - union spoolss_JobInfo *info;/* [unique,switch_is(level),size_is(*count)] */ + union spoolss_JobInfo **info;/* [ref,switch_is(level),size_is(,*count)] */ uint32_t *needed;/* [ref] */ WERROR result; } out; @@ -1815,7 +1882,7 @@ struct spoolss_EnumPrinterDrivers { struct { uint32_t *count;/* [ref] */ - union spoolss_DriverInfo *info;/* [unique,switch_is(level),size_is(*count)] */ + union spoolss_DriverInfo **info;/* [ref,switch_is(level),size_is(,*count)] */ uint32_t *needed;/* [ref] */ WERROR result; } out; @@ -1921,7 +1988,7 @@ struct spoolss_EnumPrintProcessors { struct { uint32_t *count;/* [ref] */ - union spoolss_PrintProcessorInfo *info;/* [unique,switch_is(level),size_is(*count)] */ + union spoolss_PrintProcessorInfo **info;/* [ref,switch_is(level),size_is(,*count)] */ uint32_t *needed;/* [ref] */ WERROR result; } out; @@ -2078,8 +2145,8 @@ struct _spoolss_GetPrinterData { } in; struct { - enum spoolss_PrinterDataType *type;/* [ref] */ - DATA_BLOB data; + enum winreg_Type *type;/* [ref] */ + DATA_BLOB *data;/* [ref] */ uint32_t *needed;/* [ref] */ WERROR result; } out; @@ -2089,11 +2156,11 @@ struct _spoolss_GetPrinterData { struct __spoolss_GetPrinterData { struct { - enum spoolss_PrinterDataType type; + enum winreg_Type type; } in; struct { - union spoolss_PrinterData data;/* [switch_is(type)] */ + union spoolss_PrinterData *data;/* [ref,switch_is(type)] */ } out; }; @@ -2107,8 +2174,8 @@ struct spoolss_GetPrinterData { } in; struct { - enum spoolss_PrinterDataType *type;/* [ref] */ - union spoolss_PrinterData data;/* [subcontext_size(offered),subcontext(4),switch_is(*type)] */ + enum winreg_Type *type;/* [ref] */ + union spoolss_PrinterData *data;/* [subcontext_size(offered),ref,subcontext(4),switch_is(*type)] */ uint32_t *needed;/* [ref] */ WERROR result; } out; @@ -2120,7 +2187,7 @@ struct _spoolss_SetPrinterData { struct { struct policy_handle *handle;/* [ref] */ const char *value_name;/* [charset(UTF16)] */ - enum spoolss_PrinterDataType type; + enum winreg_Type type; DATA_BLOB data; uint32_t _offered; } in; @@ -2134,11 +2201,11 @@ struct _spoolss_SetPrinterData { struct __spoolss_SetPrinterData { struct { - enum spoolss_PrinterDataType type; + enum winreg_Type type; } in; struct { - union spoolss_PrinterData data;/* [switch_is(type)] */ + union spoolss_PrinterData *data;/* [ref,switch_is(type)] */ } out; }; @@ -2148,7 +2215,7 @@ struct spoolss_SetPrinterData { struct { struct policy_handle *handle;/* [ref] */ const char *value_name;/* [charset(UTF16)] */ - enum spoolss_PrinterDataType type; + enum winreg_Type type; union spoolss_PrinterData data;/* [subcontext(4),switch_is(type)] */ uint32_t _offered;/* [value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] */ } in; @@ -2282,7 +2349,7 @@ struct spoolss_EnumForms { struct { uint32_t *count;/* [ref] */ - union spoolss_FormInfo *info;/* [unique,switch_is(level),size_is(*count)] */ + union spoolss_FormInfo **info;/* [ref,switch_is(level),size_is(,*count)] */ uint32_t *needed;/* [ref] */ WERROR result; } out; @@ -2331,7 +2398,7 @@ struct spoolss_EnumPorts { struct { uint32_t *count;/* [ref] */ - union spoolss_PortInfo *info;/* [unique,switch_is(level),size_is(*count)] */ + union spoolss_PortInfo **info;/* [ref,switch_is(level),size_is(,*count)] */ uint32_t *needed;/* [ref] */ WERROR result; } out; @@ -2380,7 +2447,7 @@ struct spoolss_EnumMonitors { struct { uint32_t *count;/* [ref] */ - union spoolss_MonitorInfo *info;/* [unique,switch_is(level),size_is(*count)] */ + union spoolss_MonitorInfo **info;/* [ref,switch_is(level),size_is(,*count)] */ uint32_t *needed;/* [ref] */ WERROR result; } out; @@ -2506,8 +2573,51 @@ struct spoolss_DeletePrintProvidor { }; +struct _spoolss_EnumPrintProcDataTypes { + struct { + const char *servername;/* [unique,charset(UTF16)] */ + const char *print_processor_name;/* [unique,charset(UTF16)] */ + uint32_t level; + DATA_BLOB *buffer;/* [unique] */ + uint32_t offered; + } in; + + struct { + DATA_BLOB *info;/* [unique] */ + uint32_t *needed;/* [ref] */ + uint32_t *count;/* [ref] */ + WERROR result; + } out; + +}; + + +struct __spoolss_EnumPrintProcDataTypes { + struct { + uint32_t level; + uint32_t count; + } in; + + struct { + union spoolss_PrintProcDataTypesInfo *info;/* [switch_is(level)] */ + } out; + +}; + + struct spoolss_EnumPrintProcDataTypes { struct { + const char *servername;/* [unique,charset(UTF16)] */ + const char *print_processor_name;/* [unique,charset(UTF16)] */ + uint32_t level; + DATA_BLOB *buffer;/* [unique] */ + uint32_t offered; + } in; + + struct { + uint32_t *count;/* [ref] */ + union spoolss_PrintProcDataTypesInfo **info;/* [ref,switch_is(level),size_is(,*count)] */ + uint32_t *needed;/* [ref] */ WERROR result; } out; @@ -2774,8 +2884,8 @@ struct spoolss_EnumPrinterData { struct { const char *value_name;/* [charset(UTF16),size_is(value_offered/2)] */ uint32_t *value_needed;/* [ref] */ - uint32_t *printerdata_type;/* [ref] */ - DATA_BLOB *buffer;/* [ref] */ + enum winreg_Type *type;/* [ref] */ + uint8_t *data;/* [ref,flag(LIBNDR_PRINT_ARRAY_HEX),size_is(data_offered)] */ uint32_t *data_needed;/* [ref] */ WERROR result; } out; @@ -2825,7 +2935,7 @@ struct spoolss_SetPrinterDataEx { struct policy_handle *handle;/* [ref] */ const char *key_name;/* [charset(UTF16)] */ const char *value_name;/* [charset(UTF16)] */ - uint32_t type; + enum winreg_Type type; uint8_t *buffer;/* [ref,size_is(offered)] */ uint32_t offered; } in; @@ -2846,7 +2956,7 @@ struct spoolss_GetPrinterDataEx { } in; struct { - uint32_t *type;/* [ref] */ + enum winreg_Type *type;/* [ref] */ uint8_t *buffer;/* [ref,size_is(offered)] */ uint32_t *needed;/* [ref] */ WERROR result; @@ -2855,7 +2965,7 @@ struct spoolss_GetPrinterDataEx { }; -struct spoolss_EnumPrinterDataEx { +struct _spoolss_EnumPrinterDataEx { struct { struct policy_handle *handle;/* [ref] */ const char *key_name;/* [charset(UTF16)] */ @@ -2863,7 +2973,7 @@ struct spoolss_EnumPrinterDataEx { } in; struct { - uint8_t *buffer;/* [ref,size_is(offered)] */ + DATA_BLOB info; uint32_t *needed;/* [ref] */ uint32_t *count;/* [ref] */ WERROR result; @@ -2872,15 +2982,44 @@ struct spoolss_EnumPrinterDataEx { }; +struct __spoolss_EnumPrinterDataEx { + struct { + uint32_t count; + } in; + + struct { + struct spoolss_PrinterEnumValues *info; + } out; + +}; + + +struct spoolss_EnumPrinterDataEx { + struct { + struct policy_handle *handle;/* [ref] */ + const char *key_name;/* [charset(UTF16)] */ + uint32_t offered; + } in; + + struct { + uint32_t *count;/* [ref] */ + struct spoolss_PrinterEnumValues **info;/* [ref,size_is(,*count)] */ + uint32_t *needed;/* [ref] */ + WERROR result; + } out; + +}; + + struct spoolss_EnumPrinterKey { struct { struct policy_handle *handle;/* [ref] */ const char *key_name;/* [charset(UTF16)] */ - uint32_t key_buffer_size; + uint32_t offered; } in; struct { - uint16_t *key_buffer;/* [ref,size_is(key_buffer_size/2)] */ + const char ** *key_buffer;/* [subcontext_size(offered),ref,subcontext(0),flag(LIBNDR_FLAG_STR_NULLTERM)] */ uint32_t *needed;/* [ref] */ WERROR result; } out; diff --git a/librpc/gen_ndr/srv_spoolss.c b/librpc/gen_ndr/srv_spoolss.c index 891be85376..79efbb5970 100644 --- a/librpc/gen_ndr/srv_spoolss.c +++ b/librpc/gen_ndr/srv_spoolss.c @@ -51,7 +51,7 @@ static bool api_spoolss_EnumPrinters(pipes_struct *p) return false; } - r->out.info = talloc_zero_array(r, union spoolss_PrinterInfo, *r->out.count); + r->out.info = talloc_zero(r, union spoolss_PrinterInfo *); if (r->out.info == NULL) { talloc_free(r); return false; @@ -382,7 +382,7 @@ static bool api_spoolss_EnumJobs(pipes_struct *p) return false; } - r->out.info = talloc_zero_array(r, union spoolss_JobInfo, *r->out.count); + r->out.info = talloc_zero(r, union spoolss_JobInfo *); if (r->out.info == NULL) { talloc_free(r); return false; @@ -852,7 +852,7 @@ static bool api_spoolss_EnumPrinterDrivers(pipes_struct *p) return false; } - r->out.info = talloc_zero_array(r, union spoolss_DriverInfo, *r->out.count); + r->out.info = talloc_zero(r, union spoolss_DriverInfo *); if (r->out.info == NULL) { talloc_free(r); return false; @@ -1249,7 +1249,7 @@ static bool api_spoolss_EnumPrintProcessors(pipes_struct *p) return false; } - r->out.info = talloc_zero_array(r, union spoolss_PrintProcessorInfo, *r->out.count); + r->out.info = talloc_zero(r, union spoolss_PrintProcessorInfo *); if (r->out.info == NULL) { talloc_free(r); return false; @@ -2113,12 +2113,18 @@ static bool api_spoolss_GetPrinterData(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.type = talloc_zero(r, enum spoolss_PrinterDataType); + r->out.type = talloc_zero(r, enum winreg_Type); if (r->out.type == NULL) { talloc_free(r); return false; } + r->out.data = talloc_zero(r, union spoolss_PrinterData); + if (r->out.data == NULL) { + talloc_free(r); + return false; + } + r->out.needed = talloc_zero(r, uint32_t); if (r->out.needed == NULL) { talloc_free(r); @@ -2731,7 +2737,7 @@ static bool api_spoolss_EnumForms(pipes_struct *p) return false; } - r->out.info = talloc_zero_array(r, union spoolss_FormInfo, *r->out.count); + r->out.info = talloc_zero(r, union spoolss_FormInfo *); if (r->out.info == NULL) { talloc_free(r); return false; @@ -2823,7 +2829,7 @@ static bool api_spoolss_EnumPorts(pipes_struct *p) return false; } - r->out.info = talloc_zero_array(r, union spoolss_PortInfo, *r->out.count); + r->out.info = talloc_zero(r, union spoolss_PortInfo *); if (r->out.info == NULL) { talloc_free(r); return false; @@ -2915,7 +2921,7 @@ static bool api_spoolss_EnumMonitors(pipes_struct *p) return false; } - r->out.info = talloc_zero_array(r, union spoolss_MonitorInfo, *r->out.count); + r->out.info = talloc_zero(r, union spoolss_MonitorInfo *); if (r->out.info == NULL) { talloc_free(r); return false; @@ -4022,6 +4028,25 @@ static bool api_spoolss_EnumPrintProcDataTypes(pipes_struct *p) NDR_PRINT_IN_DEBUG(spoolss_EnumPrintProcDataTypes, r); } + ZERO_STRUCT(r->out); + r->out.count = talloc_zero(r, uint32_t); + if (r->out.count == NULL) { + talloc_free(r); + return false; + } + + r->out.info = talloc_zero(r, union spoolss_PrintProcDataTypesInfo *); + if (r->out.info == NULL) { + talloc_free(r); + return false; + } + + r->out.needed = talloc_zero(r, uint32_t); + if (r->out.needed == NULL) { + talloc_free(r); + return false; + } + r->out.result = _spoolss_EnumPrintProcDataTypes(p, r); if (p->rng_fault_state) { @@ -5630,14 +5655,14 @@ static bool api_spoolss_EnumPrinterData(pipes_struct *p) return false; } - r->out.printerdata_type = talloc_zero(r, uint32_t); - if (r->out.printerdata_type == NULL) { + r->out.type = talloc_zero(r, enum winreg_Type); + if (r->out.type == NULL) { talloc_free(r); return false; } - r->out.buffer = talloc_zero(r, DATA_BLOB); - if (r->out.buffer == NULL) { + r->out.data = talloc_zero_array(r, uint8_t, r->in.data_offered); + if (r->out.data == NULL) { talloc_free(r); return false; } @@ -6087,7 +6112,7 @@ static bool api_spoolss_GetPrinterDataEx(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.type = talloc_zero(r, uint32_t); + r->out.type = talloc_zero(r, enum winreg_Type); if (r->out.type == NULL) { talloc_free(r); return false; @@ -6179,20 +6204,20 @@ static bool api_spoolss_EnumPrinterDataEx(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.buffer = talloc_zero_array(r, uint8_t, r->in.offered); - if (r->out.buffer == NULL) { + r->out.count = talloc_zero(r, uint32_t); + if (r->out.count == NULL) { talloc_free(r); return false; } - r->out.needed = talloc_zero(r, uint32_t); - if (r->out.needed == NULL) { + r->out.info = talloc_zero(r, struct spoolss_PrinterEnumValues *); + if (r->out.info == NULL) { talloc_free(r); return false; } - r->out.count = talloc_zero(r, uint32_t); - if (r->out.count == NULL) { + r->out.needed = talloc_zero(r, uint32_t); + if (r->out.needed == NULL) { talloc_free(r); return false; } @@ -6271,7 +6296,7 @@ static bool api_spoolss_EnumPrinterKey(pipes_struct *p) } ZERO_STRUCT(r->out); - r->out.key_buffer = talloc_zero_array(r, uint16_t, r->in.key_buffer_size / 2); + r->out.key_buffer = talloc_zero(r, const char **); if (r->out.key_buffer == NULL) { talloc_free(r); return false; @@ -7551,7 +7576,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - r->out.info = talloc_zero_array(mem_ctx, union spoolss_PrinterInfo, *r->out.count); + r->out.info = talloc_zero(mem_ctx, union spoolss_PrinterInfo *); if (r->out.info == NULL) { return NT_STATUS_NO_MEMORY; } @@ -7608,7 +7633,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - r->out.info = talloc_zero_array(mem_ctx, union spoolss_JobInfo, *r->out.count); + r->out.info = talloc_zero(mem_ctx, union spoolss_JobInfo *); if (r->out.info == NULL) { return NT_STATUS_NO_MEMORY; } @@ -7671,7 +7696,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - r->out.info = talloc_zero_array(mem_ctx, union spoolss_DriverInfo, *r->out.count); + r->out.info = talloc_zero(mem_ctx, union spoolss_DriverInfo *); if (r->out.info == NULL) { return NT_STATUS_NO_MEMORY; } @@ -7728,7 +7753,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - r->out.info = talloc_zero_array(mem_ctx, union spoolss_PrintProcessorInfo, *r->out.count); + r->out.info = talloc_zero(mem_ctx, union spoolss_PrintProcessorInfo *); if (r->out.info == NULL) { return NT_STATUS_NO_MEMORY; } @@ -7846,11 +7871,16 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, case NDR_SPOOLSS_GETPRINTERDATA: { struct spoolss_GetPrinterData *r = (struct spoolss_GetPrinterData *)_r; ZERO_STRUCT(r->out); - r->out.type = talloc_zero(mem_ctx, enum spoolss_PrinterDataType); + r->out.type = talloc_zero(mem_ctx, enum winreg_Type); if (r->out.type == NULL) { return NT_STATUS_NO_MEMORY; } + r->out.data = talloc_zero(mem_ctx, union spoolss_PrinterData); + if (r->out.data == NULL) { + return NT_STATUS_NO_MEMORY; + } + r->out.needed = talloc_zero(mem_ctx, uint32_t); if (r->out.needed == NULL) { return NT_STATUS_NO_MEMORY; @@ -7923,7 +7953,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - r->out.info = talloc_zero_array(mem_ctx, union spoolss_FormInfo, *r->out.count); + r->out.info = talloc_zero(mem_ctx, union spoolss_FormInfo *); if (r->out.info == NULL) { return NT_STATUS_NO_MEMORY; } @@ -7945,7 +7975,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - r->out.info = talloc_zero_array(mem_ctx, union spoolss_PortInfo, *r->out.count); + r->out.info = talloc_zero(mem_ctx, union spoolss_PortInfo *); if (r->out.info == NULL) { return NT_STATUS_NO_MEMORY; } @@ -7967,7 +7997,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - r->out.info = talloc_zero_array(mem_ctx, union spoolss_MonitorInfo, *r->out.count); + r->out.info = talloc_zero(mem_ctx, union spoolss_MonitorInfo *); if (r->out.info == NULL) { return NT_STATUS_NO_MEMORY; } @@ -8067,6 +8097,22 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, case NDR_SPOOLSS_ENUMPRINTPROCDATATYPES: { struct spoolss_EnumPrintProcDataTypes *r = (struct spoolss_EnumPrintProcDataTypes *)_r; + ZERO_STRUCT(r->out); + r->out.count = talloc_zero(mem_ctx, uint32_t); + if (r->out.count == NULL) { + return NT_STATUS_NO_MEMORY; + } + + r->out.info = talloc_zero(mem_ctx, union spoolss_PrintProcDataTypesInfo *); + if (r->out.info == NULL) { + return NT_STATUS_NO_MEMORY; + } + + r->out.needed = talloc_zero(mem_ctx, uint32_t); + if (r->out.needed == NULL) { + return NT_STATUS_NO_MEMORY; + } + r->out.result = _spoolss_EnumPrintProcDataTypes(cli->pipes_struct, r); return NT_STATUS_OK; } @@ -8257,13 +8303,13 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, return NT_STATUS_NO_MEMORY; } - r->out.printerdata_type = talloc_zero(mem_ctx, uint32_t); - if (r->out.printerdata_type == NULL) { + r->out.type = talloc_zero(mem_ctx, enum winreg_Type); + if (r->out.type == NULL) { return NT_STATUS_NO_MEMORY; } - r->out.buffer = talloc_zero(mem_ctx, DATA_BLOB); - if (r->out.buffer == NULL) { + r->out.data = talloc_zero_array(mem_ctx, uint8_t, r->in.data_offered); + if (r->out.data == NULL) { return NT_STATUS_NO_MEMORY; } @@ -8309,7 +8355,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, case NDR_SPOOLSS_GETPRINTERDATAEX: { struct spoolss_GetPrinterDataEx *r = (struct spoolss_GetPrinterDataEx *)_r; ZERO_STRUCT(r->out); - r->out.type = talloc_zero(mem_ctx, uint32_t); + r->out.type = talloc_zero(mem_ctx, enum winreg_Type); if (r->out.type == NULL) { return NT_STATUS_NO_MEMORY; } @@ -8331,18 +8377,18 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, case NDR_SPOOLSS_ENUMPRINTERDATAEX: { struct spoolss_EnumPrinterDataEx *r = (struct spoolss_EnumPrinterDataEx *)_r; ZERO_STRUCT(r->out); - r->out.buffer = talloc_zero_array(mem_ctx, uint8_t, r->in.offered); - if (r->out.buffer == NULL) { + r->out.count = talloc_zero(mem_ctx, uint32_t); + if (r->out.count == NULL) { return NT_STATUS_NO_MEMORY; } - r->out.needed = talloc_zero(mem_ctx, uint32_t); - if (r->out.needed == NULL) { + r->out.info = talloc_zero(mem_ctx, struct spoolss_PrinterEnumValues *); + if (r->out.info == NULL) { return NT_STATUS_NO_MEMORY; } - r->out.count = talloc_zero(mem_ctx, uint32_t); - if (r->out.count == NULL) { + r->out.needed = talloc_zero(mem_ctx, uint32_t); + if (r->out.needed == NULL) { return NT_STATUS_NO_MEMORY; } @@ -8353,7 +8399,7 @@ NTSTATUS rpc_spoolss_dispatch(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, case NDR_SPOOLSS_ENUMPRINTERKEY: { struct spoolss_EnumPrinterKey *r = (struct spoolss_EnumPrinterKey *)_r; ZERO_STRUCT(r->out); - r->out.key_buffer = talloc_zero_array(mem_ctx, uint16_t, r->in.key_buffer_size / 2); + r->out.key_buffer = talloc_zero(mem_ctx, const char **); if (r->out.key_buffer == NULL) { return NT_STATUS_NO_MEMORY; } diff --git a/librpc/idl/spoolss.idl b/librpc/idl/spoolss.idl index f2944b0f39..a1bb95aa9f 100644 --- a/librpc/idl/spoolss.idl +++ b/librpc/idl/spoolss.idl @@ -66,7 +66,57 @@ import "misc.idl", "security.idl", "winreg.idl"; SPOOLSS_MINOR_VERSION_ME = 0x0000005a } spoolss_MinorVersion; - typedef struct { + 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 [public,gensize] struct { [relative] nstring *printername; [relative] nstring *servername; uint32 cjobs; @@ -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; @@ -198,7 +248,7 @@ import "misc.idl", "security.idl", "winreg.idl"; PRINTER_ENUM_ICON7 | PRINTER_ENUM_ICON8); /* 0x00ff0000 */ - typedef struct { + typedef [public,gensize] struct { spoolss_EnumPrinterFlags flags; [relative] nstring *name; [relative] nstring *description; @@ -224,35 +274,7 @@ 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 { + typedef [public,gensize] struct { [relative] nstring *servername; [relative] nstring *printername; [relative] nstring *sharename; @@ -267,7 +289,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [relative] nstring *parameters; [relative,subcontext(0)] security_descriptor *secdesc; spoolss_PrinterAttributes attributes; - uint32 priority; + [range(0,99)] uint32 priority; uint32 defaultpriority; uint32 starttime; uint32 untiltime; @@ -276,17 +298,17 @@ import "misc.idl", "security.idl", "winreg.idl"; uint32 averageppm; } spoolss_PrinterInfo2; - typedef struct { + typedef [public,gensize] struct { [relative,subcontext(0)] security_descriptor *secdesc; } spoolss_PrinterInfo3; - typedef struct { + typedef [public,gensize] struct { [relative] nstring *printername; [relative] nstring *servername; spoolss_PrinterAttributes attributes; } spoolss_PrinterInfo4; - typedef struct { + typedef [public,gensize] struct { [relative] nstring *printername; [relative] nstring *portname; spoolss_PrinterAttributes attributes; @@ -294,7 +316,7 @@ import "misc.idl", "security.idl", "winreg.idl"; uint32 transmission_retry_timeout; } spoolss_PrinterInfo5; - typedef struct { + typedef [public,gensize] struct { spoolss_PrinterStatus status; } spoolss_PrinterInfo6; @@ -306,7 +328,7 @@ import "misc.idl", "security.idl", "winreg.idl"; DSPRINT_PENDING = 0x80000000 } spoolss_DsPrintAction; - typedef struct { + typedef [public,gensize] struct { [relative] nstring *guid; /* text form of printer guid */ spoolss_DsPrintAction action; } spoolss_PrinterInfo7; @@ -315,7 +337,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [relative,subcontext(0)] spoolss_DeviceMode *devmode; } spoolss_DeviceModeInfo; - typedef [nodiscriminant,relative_base,public] union { + typedef [nodiscriminant,relative_base,public,gensize] union { [case(0)] spoolss_PrinterInfo0 info0; [case(1)] spoolss_PrinterInfo1 info1; [case(2)] spoolss_PrinterInfo2 info2; @@ -357,7 +379,7 @@ import "misc.idl", "security.idl", "winreg.idl"; * and the array has no size in front */ [out,ref] uint32 *count, - [out,unique,switch_is(level),size_is(*count)] spoolss_PrinterInfo *info, + [out,ref,switch_is(level),size_is(,*count)] spoolss_PrinterInfo **info, [out,ref] uint32 *needed ); @@ -379,27 +401,7 @@ import "misc.idl", "security.idl", "winreg.idl"; /******************/ /* Function: 0x02 */ - /* JOB status codes. */ - - const int JOB_STATUS_QUEUED = 0x0000; - - typedef [bitmap32bit] bitmap { - JOB_STATUS_PAUSED = 0x00000001, - JOB_STATUS_ERROR = 0x00000002, - JOB_STATUS_DELETING = 0x00000004, - JOB_STATUS_SPOOLING = 0x00000008, - JOB_STATUS_PRINTING = 0x00000010, - JOB_STATUS_OFFLINE = 0x00000020, - JOB_STATUS_PAPEROUT = 0x00000040, - JOB_STATUS_PRINTED = 0x00000080, - JOB_STATUS_DELETED = 0x00000100, - JOB_STATUS_BLOCKED_DEVQ = 0x00000200, - JOB_STATUS_USER_INTERVENTION = 0x00000400, - JOB_STATUS_RESTART = 0x00000800, - JOB_STATUS_COMPLETE = 0x00001000 - } spoolss_JobStatus; - - typedef struct { + typedef [public,gensize] struct { uint32 job_id; [relative] nstring *printer_name; [relative] nstring *server_name; @@ -408,14 +410,14 @@ import "misc.idl", "security.idl", "winreg.idl"; [relative] nstring *data_type; [relative] nstring *text_status; spoolss_JobStatus status; - uint32 priority; + [range(0,99)] uint32 priority; uint32 position; uint32 total_pages; uint32 pages_printed; spoolss_Time submitted; } spoolss_JobInfo1; - typedef struct { + typedef [public,gensize] struct { uint32 job_id; [relative] nstring *printer_name; [relative] nstring *server_name; @@ -430,7 +432,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [relative] nstring *text_status; [relative] security_descriptor *secdesc; spoolss_JobStatus status; - uint32 priority; + [range(0,99)] uint32 priority; uint32 position; uint32 start_time; uint32 until_time; @@ -441,13 +443,13 @@ import "misc.idl", "security.idl", "winreg.idl"; uint32 pages_printed; } spoolss_JobInfo2; - typedef struct { + typedef [public,gensize] struct { uint32 job_id; uint32 next_job_id; uint32 reserved; } spoolss_JobInfo3; - typedef struct { + typedef [public,gensize] struct { uint32 job_id; [relative] nstring *printer_name; [relative] nstring *server_name; @@ -462,7 +464,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [relative] nstring *text_status; [relative] security_descriptor *secdesc; spoolss_JobStatus status; - uint32 priority; + [range(0,99)] uint32 priority; uint32 position; uint32 start_time; uint32 until_time; @@ -474,7 +476,7 @@ import "misc.idl", "security.idl", "winreg.idl"; uint32 size_high; } spoolss_JobInfo4; - typedef [nodiscriminant,relative_base,public] union { + typedef [nodiscriminant,relative_base,public,gensize] union { [case(1)] spoolss_JobInfo1 info1; [case(2)] spoolss_JobInfo2 info2; [case(3)] spoolss_JobInfo3 info3; @@ -491,7 +493,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [string,charset(UTF16)] uint16 *data_type; [string,charset(UTF16)] uint16 *text_status; spoolss_JobStatus status; - uint32 priority; + [range(0,99)] uint32 priority; uint32 position; uint32 total_pages; uint32 pages_printed; @@ -509,11 +511,11 @@ import "misc.idl", "security.idl", "winreg.idl"; [string,charset(UTF16)] uint16 *print_processor; [string,charset(UTF16)] uint16 *parameters; [string,charset(UTF16)] uint16 *driver_name; - spoolss_DeviceMode *devmode; + uint32 _devmode_ptr; /* pointer to truncated devicemode */ [string,charset(UTF16)] uint16 *text_status; - security_descriptor *secdesc; + uint32 _secdesc_ptr; spoolss_JobStatus status; - uint32 priority; + [range(0,99)] uint32 priority; uint32 position; uint32 start_time; uint32 until_time; @@ -535,11 +537,11 @@ import "misc.idl", "security.idl", "winreg.idl"; [string,charset(UTF16)] uint16 *print_processor; [string,charset(UTF16)] uint16 *parameters; [string,charset(UTF16)] uint16 *driver_name; - spoolss_DeviceMode *devmode; + uint32 _devmode_ptr; /* pointer to truncated devicemode */ [string,charset(UTF16)] uint16 *text_status; - security_descriptor *secdesc; + uint32 _secdesc_ptr; spoolss_JobStatus status; - uint32 priority; + [range(0,99)] uint32 priority; uint32 position; uint32 start_time; uint32 until_time; @@ -621,7 +623,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [in,unique] DATA_BLOB *buffer, [in] uint32 offered, [out,ref] uint32 *count, - [out,unique,switch_is(level),size_is(*count)] spoolss_JobInfo *info, + [out,ref,switch_is(level),size_is(,*count)] spoolss_JobInfo **info, [out,ref] uint32 *needed ); @@ -702,7 +704,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [string,charset(UTF16)] uint16 *parameters; [subcontext(0)] security_descriptor *secdesc; spoolss_PrinterAttributes attributes; - uint32 priority; + [range(0,99)] uint32 priority; uint32 defaultpriority; uint32 starttime; uint32 untiltime; @@ -1050,7 +1052,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [relative] nstring *provider; } spoolss_DriverInfo101; - typedef [nodiscriminant,relative_base,public] union { + typedef [nodiscriminant,relative_base,public,gensize] union { [case(1)] spoolss_DriverInfo1 info1; [case(2)] spoolss_DriverInfo2 info2; [case(3)] spoolss_DriverInfo3 info3; @@ -1086,7 +1088,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [in,unique] DATA_BLOB *buffer, [in] uint32 offered, [out,ref] uint32 *count, - [out,unique,switch_is(level),size_is(*count)] spoolss_DriverInfo *info, + [out,ref,switch_is(level),size_is(,*count)] spoolss_DriverInfo **info, [out,ref] uint32 *needed ); @@ -1138,7 +1140,7 @@ import "misc.idl", "security.idl", "winreg.idl"; /******************/ /* Function: 0x0f */ - typedef struct { + typedef [public,gensize] struct { [relative] nstring *print_processor_name; } spoolss_PrintProcessorInfo1; @@ -1169,7 +1171,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [in,unique] DATA_BLOB *buffer, [in] uint32 offered, [out,ref] uint32 *count, - [out,unique,switch_is(level),size_is(*count)] spoolss_PrintProcessorInfo *info, + [out,ref,switch_is(level),size_is(,*count)] spoolss_PrintProcessorInfo **info, [out,ref] uint32 *needed ); @@ -1300,20 +1302,12 @@ import "misc.idl", "security.idl", "winreg.idl"; uint32 unknown3;/* hmm? w2k3: 131346(0x20112) winxp sp1: 503382272 0x1E010100 */ } spoolss_OSVersionEx; - typedef [v1_enum] enum { - SPOOLSS_PRINTER_DATA_TYPE_NULL = 0, - SPOOLSS_PRINTER_DATA_TYPE_STRING = 1, - SPOOLSS_PRINTER_DATA_TYPE_BINARY = 3, - SPOOLSS_PRINTER_DATA_TYPE_UINT32 = 4, - SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY = 7 - } spoolss_PrinterDataType; - typedef [nodiscriminant,public,gensize] union { - [case(SPOOLSS_PRINTER_DATA_TYPE_NULL)]; - [case(SPOOLSS_PRINTER_DATA_TYPE_STRING)] nstring string; - [case(SPOOLSS_PRINTER_DATA_TYPE_BINARY),flag(NDR_REMAINING)] DATA_BLOB binary; - [case(SPOOLSS_PRINTER_DATA_TYPE_UINT32)] uint32 value; - [case(SPOOLSS_PRINTER_DATA_TYPE_STRING_ARRAY)] nstring_array string_array; + [case(REG_NONE)]; + [case(REG_SZ)] nstring string; + [case(REG_BINARY),flag(NDR_REMAINING)] DATA_BLOB binary; + [case(REG_DWORD)] uint32 value; + [case(REG_MULTI_SZ)] nstring_array string_array; [default,flag(NDR_REMAINING)] DATA_BLOB data; } spoolss_PrinterData; @@ -1321,20 +1315,20 @@ import "misc.idl", "security.idl", "winreg.idl"; [in,ref] policy_handle *handle, [in] [string,charset(UTF16)] uint16 value_name[], [in] uint32 offered, - [out,ref] spoolss_PrinterDataType *type, - [out] DATA_BLOB data, + [out,ref] winreg_Type *type, + [out,ref] DATA_BLOB *data, [out,ref] uint32 *needed ); [noopnum,noprint,public] void __spoolss_GetPrinterData( - [in] spoolss_PrinterDataType type, - [out,switch_is(type)] spoolss_PrinterData data + [in] winreg_Type type, + [out,ref,switch_is(type)] spoolss_PrinterData *data ); [nopull,nopush,public] WERROR spoolss_GetPrinterData( [in,ref] policy_handle *handle, [in] [string,charset(UTF16)] uint16 value_name[], [in] uint32 offered, - [out,ref] spoolss_PrinterDataType *type, - [out,subcontext(4),subcontext_size(offered),switch_is(*type)] spoolss_PrinterData data, + [out,ref] winreg_Type *type, + [out,ref,subcontext(4),subcontext_size(offered),switch_is(*type)] spoolss_PrinterData *data, [out,ref] uint32 *needed ); @@ -1343,18 +1337,18 @@ import "misc.idl", "security.idl", "winreg.idl"; [noopnum,nopull,noprint,public] WERROR _spoolss_SetPrinterData( [in,ref] policy_handle *handle, [in] [string,charset(UTF16)] uint16 value_name[], - [in] spoolss_PrinterDataType type, + [in] winreg_Type type, [in] DATA_BLOB data, [in] uint32 _offered ); [noopnum,nopull,noprint,public] void __spoolss_SetPrinterData( - [in] spoolss_PrinterDataType type, - [out,switch_is(type)] spoolss_PrinterData data + [in] winreg_Type type, + [out,ref,switch_is(type)] spoolss_PrinterData *data ); [nopush] WERROR spoolss_SetPrinterData( [in,ref] policy_handle *handle, [in] [string,charset(UTF16)] uint16 value_name[], - [in] spoolss_PrinterDataType type, + [in] winreg_Type type, [in,subcontext(4),switch_is(type)] spoolss_PrinterData data, [in,value(ndr_size_spoolss_PrinterData(&data,type,ndr->iconv_convenience,flags))] uint32 _offered ); @@ -1390,7 +1384,7 @@ import "misc.idl", "security.idl", "winreg.idl"; uint32 bottom; } spoolss_FormArea; - typedef struct { + typedef [public,gensize] struct { spoolss_FormFlags flags; [relative] nstring *form_name; spoolss_FormSize size; @@ -1403,7 +1397,7 @@ import "misc.idl", "security.idl", "winreg.idl"; SPOOLSS_FORM_STRING_TYPE_LANG_PAIR = 0x00000004 } spoolss_FormStringType; - typedef struct { + typedef [public,gensize] struct { spoolss_FormFlags flags; [relative] nstring *form_name; spoolss_FormSize size; @@ -1503,11 +1497,21 @@ import "misc.idl", "security.idl", "winreg.idl"; [in,unique] DATA_BLOB *buffer, [in] uint32 offered, [out,ref] uint32 *count, - [out,unique,switch_is(level),size_is(*count)] spoolss_FormInfo *info, + [out,ref,switch_is(level),size_is(,*count)] spoolss_FormInfo **info, [out,ref] uint32 *needed ); - typedef struct { + /* + * Special strings for the OpenPrinter() call. See the MSDN DDK + * docs on the XcvDataPort() for more details. + */ + + const string SPL_LOCAL_PORT = "Local Port"; + const string SPL_TCPIP_PORT = "Standard TCP/IP Port"; + const string SPL_XCV_MONITOR_LOCALMON = ",XcvMonitor Local Port"; + const string SPL_XCV_MONITOR_TCPMON = ",XcvMonitor Standard TCP/IP Port"; + + typedef [public,gensize] struct { [relative] nstring *port_name; } spoolss_PortInfo1; @@ -1518,7 +1522,7 @@ import "misc.idl", "security.idl", "winreg.idl"; SPOOLSS_PORT_TYPE_NET_ATTACHED = 0x00000008 } spoolss_PortType; - typedef struct { + typedef [public,gensize] struct { [relative] nstring *port_name; [relative] nstring *monitor_name; [relative] nstring *description; @@ -1548,13 +1552,13 @@ import "misc.idl", "security.idl", "winreg.idl"; PORT_STATUS_TYPE_INFO = 0x00000003 } spoolss_PortSeverity; - typedef struct { + typedef [public,gensize] struct { spoolss_PortStatus status; [relative] nstring *status_string; spoolss_PortSeverity severity; } spoolss_PortInfo3; - typedef struct { + typedef [public,gensize] struct { [relative] nstring *port_name; DATA_BLOB monitor_data; /* relative ?? */ } spoolss_PortInfoFF; @@ -1589,17 +1593,17 @@ import "misc.idl", "security.idl", "winreg.idl"; [in,unique] DATA_BLOB *buffer, [in] uint32 offered, [out,ref] uint32 *count, - [out,unique,switch_is(level),size_is(*count)] spoolss_PortInfo *info, + [out,ref,switch_is(level),size_is(,*count)] spoolss_PortInfo **info, [out,ref] uint32 *needed ); /******************/ /* Function: 0x24 */ - typedef struct { + typedef [public,gensize] struct { [relative] nstring *monitor_name; } spoolss_MonitorInfo1; - typedef struct { + typedef [public,gensize] struct { [relative] nstring *monitor_name; [relative] nstring *environment; [relative] nstring *dll_name; @@ -1631,7 +1635,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [in,unique] DATA_BLOB *buffer, [in] uint32 offered, [out,ref] uint32 *count, - [out,unique,switch_is(level),size_is(*count)] spoolss_MonitorInfo *info, + [out,ref,switch_is(level),size_is(,*count)] spoolss_MonitorInfo **info, [out,ref] uint32 *needed ); @@ -1712,7 +1716,40 @@ import "misc.idl", "security.idl", "winreg.idl"; /******************/ /* Function: 0x33 */ - [todo] WERROR spoolss_EnumPrintProcDataTypes( + + typedef [public,gensize] struct { + [relative] nstring *name_array; + } spoolss_PrintProcDataTypesInfo1; + + typedef [nodiscriminant,relative_base,public] union { + [case(1)] spoolss_PrintProcDataTypesInfo1 info1; + [default]; + } spoolss_PrintProcDataTypesInfo; + + [public,noopnum,noprint] WERROR _spoolss_EnumPrintProcDataTypes( + [in,unique] [string,charset(UTF16)] uint16 *servername, + [in,unique] [string,charset(UTF16)] uint16 *print_processor_name, + [in] uint32 level, + [in,unique] DATA_BLOB *buffer, + [in] uint32 offered, + [out,unique] DATA_BLOB *info, + [out,ref] uint32 *needed, + [out,ref] uint32 *count + ); + [public,noopnum,noprint] void __spoolss_EnumPrintProcDataTypes( + [in] uint32 level, + [in] uint32 count, + [out,switch_is(level)] spoolss_PrintProcDataTypesInfo info[count] + ); + [nopull,nopush] WERROR spoolss_EnumPrintProcDataTypes( + [in,unique] [string,charset(UTF16)] uint16 *servername, + [in,unique] [string,charset(UTF16)] uint16 *print_processor_name, + [in] uint32 level, + [in,unique] DATA_BLOB *buffer, + [in] uint32 offered, + [out,ref] uint32 *count, + [out,ref,switch_is(level),size_is(,*count)] spoolss_PrintProcDataTypesInfo **info, + [out,ref] uint32 *needed ); /******************/ @@ -1855,40 +1892,75 @@ import "misc.idl", "security.idl", "winreg.idl"; [todo] WERROR spoolss_ResetPrinterEx( ); - typedef [enum16bit] enum { - SPOOLSS_FIELD_SERVER_NAME = 0, - SPOOLSS_FIELD_PRINTER_NAME = 1, - SPOOLSS_FIELD_SHARE_NAME = 2, - SPOOLSS_FIELD_PORT_NAME = 3, - SPOOLSS_FIELD_DRIVER_NAME = 4, - SPOOLSS_FIELD_COMMENT = 5, - SPOOLSS_FIELD_LOCATION = 6, - SPOOLSS_FIELD_DEVMODE = 7, - SPOOLSS_FIELD_SEPFILE = 8, - SPOOLSS_FIELD_PRINT_PROCESSOR = 9, - SPOOLSS_FIELD_PARAMETERS = 10, - SPOOLSS_FIELD_DATATYPE = 11, - SPOOLSS_FIELD_SECURITY_DESCRIPTOR=12, - SPOOLSS_FIELD_ATTRIBUTES = 13, - SPOOLSS_FIELD_PRIORITY = 14, - SPOOLSS_FIELD_DEFAULT_PRIORITY = 15, - SPOOLSS_FIELD_START_TIME = 16, - SPOOLSS_FIELD_UNTIL_TIME = 17, - SPOOLSS_FIELD_STATUS = 18, - SPOOLSS_FIELD_STATUS_STRING = 19, - SPOOLSS_FIELD_CJOBS = 20, - SPOOLSS_FIELD_AVERAGE_PPM = 21, - SPOOLSS_FIELD_TOTAL_PAGES = 22, - SPOOLSS_FIELD_PAGES_PRINTED = 23, - SPOOLSS_FIELD_TOTAL_BYTES = 24, - SPOOLSS_FIELD_BYTES_PRINTED = 25 - } spoolss_Field; + typedef [enum16bit,public] enum { + JOB_NOTIFY_FIELD_PRINTER_NAME = 0x00, + JOB_NOTIFY_FIELD_MACHINE_NAME = 0x01, + JOB_NOTIFY_FIELD_PORT_NAME = 0x02, + JOB_NOTIFY_FIELD_USER_NAME = 0x03, + JOB_NOTIFY_FIELD_NOTIFY_NAME = 0x04, + JOB_NOTIFY_FIELD_DATATYPE = 0x05, + JOB_NOTIFY_FIELD_PRINT_PROCESSOR = 0x06, + JOB_NOTIFY_FIELD_PARAMETERS = 0x07, + JOB_NOTIFY_FIELD_DRIVER_NAME = 0x08, + JOB_NOTIFY_FIELD_DEVMODE = 0x09, + JOB_NOTIFY_FIELD_STATUS = 0x0a, + JOB_NOTIFY_FIELD_STATUS_STRING = 0x0b, + JOB_NOTIFY_FIELD_SECURITY_DESCRIPTOR = 0x0c, + JOB_NOTIFY_FIELD_DOCUMENT = 0x0d, + JOB_NOTIFY_FIELD_PRIORITY = 0x0e, + JOB_NOTIFY_FIELD_POSITION = 0x0f, + JOB_NOTIFY_FIELD_SUBMITTED = 0x10, + JOB_NOTIFY_FIELD_START_TIME = 0x11, + JOB_NOTIFY_FIELD_UNTIL_TIME = 0x12, + JOB_NOTIFY_FIELD_TIME = 0x13, + JOB_NOTIFY_FIELD_TOTAL_PAGES = 0x14, + JOB_NOTIFY_FIELD_PAGES_PRINTED = 0x15, + JOB_NOTIFY_FIELD_TOTAL_BYTES = 0x16, + JOB_NOTIFY_FIELD_BYTES_PRINTED = 0x17 + } spoolss_JobNotifyField; + + typedef [enum16bit,public] enum { + PRINTER_NOTIFY_FIELD_SERVER_NAME = 0x00, + PRINTER_NOTIFY_FIELD_PRINTER_NAME = 0x01, + PRINTER_NOTIFY_FIELD_SHARE_NAME = 0x02, + PRINTER_NOTIFY_FIELD_PORT_NAME = 0x03, + PRINTER_NOTIFY_FIELD_DRIVER_NAME = 0x04, + PRINTER_NOTIFY_FIELD_COMMENT = 0x05, + PRINTER_NOTIFY_FIELD_LOCATION = 0x06, + PRINTER_NOTIFY_FIELD_DEVMODE = 0x07, + PRINTER_NOTIFY_FIELD_SEPFILE = 0x08, + PRINTER_NOTIFY_FIELD_PRINT_PROCESSOR = 0x09, + PRINTER_NOTIFY_FIELD_PARAMETERS = 0x0a, + PRINTER_NOTIFY_FIELD_DATATYPE = 0x0b, + PRINTER_NOTIFY_FIELD_SECURITY_DESCRIPTOR = 0x0c, + PRINTER_NOTIFY_FIELD_ATTRIBUTES = 0x0d, + PRINTER_NOTIFY_FIELD_PRIORITY = 0x0e, + PRINTER_NOTIFY_FIELD_DEFAULT_PRIORITY = 0x0f, + PRINTER_NOTIFY_FIELD_START_TIME = 0x10, + PRINTER_NOTIFY_FIELD_UNTIL_TIME = 0x11, + PRINTER_NOTIFY_FIELD_STATUS = 0x12, + PRINTER_NOTIFY_FIELD_STATUS_STRING = 0x13, + PRINTER_NOTIFY_FIELD_CJOBS = 0x14, + PRINTER_NOTIFY_FIELD_AVERAGE_PPM = 0x15, + PRINTER_NOTIFY_FIELD_TOTAL_PAGES = 0x16, + PRINTER_NOTIFY_FIELD_PAGES_PRINTED = 0x17, + PRINTER_NOTIFY_FIELD_TOTAL_BYTES = 0x18, + PRINTER_NOTIFY_FIELD_BYTES_PRINTED = 0x19, + PRINTER_NOTIFY_FIELD_OBJECT_GUID = 0x1a, + PRINTER_NOTIFY_FIELD_FRIENDLY_NAME = 0x1b + } spoolss_PrintNotifyField; typedef [enum16bit] enum { - SPOOLSS_NOTIFY_PRINTER = 0, - SPOOLSS_NOTIFY_JOB = 1 + PRINTER_NOTIFY_TYPE = 0x00, + JOB_NOTIFY_TYPE = 0x01 } spoolss_NotifyType; + typedef [nodiscriminant,noprint] union { + [case(PRINTER_NOTIFY_TYPE)] uint16 field; + [case(JOB_NOTIFY_TYPE)] uint16 field; + [default] uint16 field; + } spoolss_Field; + /******************/ /* Function: 0x41 */ typedef struct { @@ -1897,7 +1969,7 @@ import "misc.idl", "security.idl", "winreg.idl"; uint32 u2; uint32 u3; uint32 count; - [size_is(count)] spoolss_Field *fields; + [size_is(count),switch_is(type)] spoolss_Field *fields; } spoolss_NotifyOptionType; typedef [bitmap32bit] bitmap { @@ -1946,7 +2018,7 @@ import "misc.idl", "security.idl", "winreg.idl"; typedef struct { spoolss_NotifyType type; - spoolss_Field field; + [switch_is(type)] spoolss_Field field; spoolss_NotifyTable variable_type; uint32 job_id; [switch_is(variable_type)] spoolss_NotifyData data; @@ -2128,8 +2200,8 @@ import "misc.idl", "security.idl", "winreg.idl"; [out,size_is(value_offered/2),charset(UTF16)] uint16 value_name[], [in] uint32 value_offered, [out,ref] uint32 *value_needed, - [out,ref] uint32 *printerdata_type, - [out,ref] DATA_BLOB *buffer, + [out,ref] winreg_Type *type, + [out,ref,size_is(data_offered),flag(LIBNDR_PRINT_ARRAY_HEX)] uint8 *data, [in] uint32 data_offered, [out,ref] uint32 *data_needed ); @@ -2162,7 +2234,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [in,ref] policy_handle *handle, [in] [string,charset(UTF16)] uint16 key_name[], [in] [string,charset(UTF16)] uint16 value_name[], - [in] uint32 type, + [in] winreg_Type type, [in,ref] [size_is(offered)] uint8 *buffer, [in] uint32 offered ); @@ -2173,7 +2245,7 @@ import "misc.idl", "security.idl", "winreg.idl"; [in,ref] policy_handle *handle, [in] [string,charset(UTF16)] uint16 key_name[], [in] [string,charset(UTF16)] uint16 value_name[], - [out,ref] uint32 *type, + [out,ref] winreg_Type *type, [out,ref] [size_is(offered)] uint8 *buffer, [in] uint32 offered, [out,ref] uint32 *needed @@ -2181,22 +2253,43 @@ import "misc.idl", "security.idl", "winreg.idl"; /******************/ /* Function: 0x4f */ - [public] WERROR spoolss_EnumPrinterDataEx( + + typedef [relative_base,public,gensize] struct { + [relative] nstring *value_name; + [value(2*strlen_m_term(value_name))] uint32 value_name_len; + winreg_Type type; + [relative,switch_is(type),subcontext(0),subcontext_size(r->data_length)] spoolss_PrinterData *data; + [value(ndr_size_spoolss_PrinterData(data, type, ndr->iconv_convenience, ndr->flags))] uint32 data_length; + } spoolss_PrinterEnumValues; + + [public,noopnum,noprint] WERROR _spoolss_EnumPrinterDataEx( [in,ref] policy_handle *handle, [in] [string,charset(UTF16)] uint16 key_name[], - [out,ref] [size_is(offered)] uint8 *buffer, - [in] uint32 offered, + [out] DATA_BLOB info, + [in] uint32 offered, [out,ref] uint32 *needed, [out,ref] uint32 *count ); + [public,noopnum,noprint] void __spoolss_EnumPrinterDataEx( + [in] uint32 count, + [out] spoolss_PrinterEnumValues info[count] + ); + [nopull,nopush] WERROR spoolss_EnumPrinterDataEx( + [in,ref] policy_handle *handle, + [in] [string,charset(UTF16)] uint16 key_name[], + [in] uint32 offered, + [out,ref] uint32 *count, + [out,ref,size_is(,*count)] spoolss_PrinterEnumValues **info, + [out,ref] uint32 *needed + ); /******************/ /* Function: 0x50 */ [public] WERROR spoolss_EnumPrinterKey( [in, ref] policy_handle *handle, [in] [string,charset(UTF16)] uint16 key_name[], - [out,ref] [size_is(key_buffer_size/2)] uint16 *key_buffer, - [in] uint32 key_buffer_size, + [out,ref] [subcontext(0),subcontext_size(offered)] nstring_array **key_buffer, + [in] uint32 offered, [out,ref] uint32 *needed ); diff --git a/librpc/ndr/ndr.c b/librpc/ndr/ndr.c index 2341f51faa..8188ec998f 100644 --- a/librpc/ndr/ndr.c +++ b/librpc/ndr/ndr.c @@ -179,10 +179,10 @@ _PUBLIC_ void ndr_print_debug_helper(struct ndr_print *ndr, const char *format, } for (i=0;i<ndr->depth;i++) { - DEBUGADD(0,(" ")); + DEBUGADD(1,(" ")); } - DEBUGADD(0,("%s\n", s)); + DEBUGADD(1,("%s\n", s)); free(s); } @@ -211,7 +211,7 @@ _PUBLIC_ void ndr_print_debug(ndr_print_fn_t fn, const char *name, void *ptr) { struct ndr_print *ndr; - DEBUG(0,(" ")); + DEBUG(1,(" ")); ndr = talloc_zero(NULL, struct ndr_print); if (!ndr) return; @@ -229,7 +229,7 @@ _PUBLIC_ void ndr_print_union_debug(ndr_print_fn_t fn, const char *name, uint32_ { struct ndr_print *ndr; - DEBUG(0,(" ")); + DEBUG(1,(" ")); ndr = talloc_zero(NULL, struct ndr_print); if (!ndr) return; @@ -248,7 +248,7 @@ _PUBLIC_ void ndr_print_function_debug(ndr_print_function_t fn, const char *name { struct ndr_print *ndr; - DEBUG(0,(" ")); + DEBUG(1,(" ")); ndr = talloc_zero(NULL, struct ndr_print); if (!ndr) return; diff --git a/librpc/ndr/ndr_spoolss_buf.c b/librpc/ndr/ndr_spoolss_buf.c index afc06be4e0..0acae3dedb 100644 --- a/librpc/ndr/ndr_spoolss_buf.c +++ b/librpc/ndr/ndr_spoolss_buf.c @@ -5,6 +5,7 @@ Copyright (C) Andrew Tridgell 2003 Copyright (C) Tim Potter 2003 + Copyright (C) Guenther Deschner 2009 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -52,9 +53,9 @@ _r.out.needed = r->out.needed;\ _r.out.count = r->out.count;\ _r.out.result = r->out.result;\ - if (r->out.info && !r->in.buffer) {\ + if (r->out.info && *r->out.info && !r->in.buffer) {\ return ndr_push_error(ndr, NDR_ERR_BUFSIZE,\ - "SPOOLSS Buffer: r->out.info but there's no r->in.buffer");\ + "SPOOLSS Buffer: *r->out.info but there's no r->in.buffer");\ }\ if (r->in.buffer) {\ DATA_BLOB _data_blob_info;\ @@ -65,7 +66,7 @@ struct __##fn __r;\ __r.in.level = r->in.level;\ __r.in.count = *r->out.count;\ - __r.out.info = r->out.info;\ + __r.out.info = *r->out.info;\ NDR_CHECK(ndr_push___##fn(_ndr_info, flags, &__r)); \ }\ if (r->in.offered > _ndr_info->offset) {\ @@ -111,6 +112,8 @@ "SPOOLSS Buffer: r->in.offered[%u] doesn't match length of r->in.buffer[%u]",\ (unsigned)r->in.offered, (unsigned)r->in.buffer->length);\ }\ + NDR_PULL_ALLOC(ndr, r->out.info);\ + ZERO_STRUCTP(r->out.info);\ } while(0) #define NDR_SPOOLSS_PULL_ENUM_OUT(fn) do { \ @@ -120,12 +123,17 @@ _r.out.needed = r->out.needed;\ _r.out.count = r->out.count;\ NDR_CHECK(ndr_pull__##fn(ndr, flags, &_r));\ - r->out.info = NULL;\ + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) {\ + NDR_PULL_ALLOC(ndr, r->out.info);\ + }\ + *r->out.info = NULL;\ r->out.needed = _r.out.needed;\ r->out.count = _r.out.count;\ r->out.result = _r.out.result;\ if (_r.out.info) {\ - struct ndr_pull *_ndr_info = ndr_pull_init_blob(_r.out.info, ndr, ndr->iconv_convenience);\ + struct ndr_pull *_ndr_info;\ + NDR_PULL_ALLOC(ndr, *r->out.info);\ + _ndr_info = ndr_pull_init_blob(_r.out.info, *r->out.info, ndr->iconv_convenience);\ NDR_ERR_HAVE_NO_MEMORY(_ndr_info);\ _ndr_info->flags= ndr->flags;\ if (r->in.offered != _ndr_info->data_size) {\ @@ -139,7 +147,7 @@ __r.in.count = *r->out.count;\ __r.out.info = NULL;\ NDR_CHECK(ndr_pull___##fn(_ndr_info, flags, &__r));\ - r->out.info = __r.out.info;\ + *r->out.info = __r.out.info;\ }\ }\ } while(0) @@ -166,7 +174,7 @@ } while (0) /* TODO: set _ndr_info->flags correct */ -#define NDR_SPOOLSS_SIZE_ENUM(fn) do { \ +#define NDR_SPOOLSS_SIZE_ENUM_LEVEL(fn) do { \ struct __##fn __r;\ DATA_BLOB _data_blob_info;\ struct ndr_push *_ndr_info = ndr_push_init_ctx(mem_ctx, iconv_convenience);\ @@ -180,6 +188,21 @@ return _data_blob_info.length;\ } while(0) +/* TODO: set _ndr_info->flags correct */ +#define NDR_SPOOLSS_SIZE_ENUM(fn) do { \ + struct __##fn __r;\ + DATA_BLOB _data_blob_info;\ + struct ndr_push *_ndr_info = ndr_push_init_ctx(mem_ctx, iconv_convenience);\ + if (!_ndr_info) return 0;\ + _ndr_info->flags|=0;\ + __r.in.count = count;\ + __r.out.info = info;\ + _NDR_CHECK_UINT32(ndr_push___##fn(_ndr_info, NDR_OUT, &__r)); \ + _data_blob_info = ndr_push_blob(_ndr_info);\ + return _data_blob_info.length;\ +} while(0) + + /* spoolss_EnumPrinters */ @@ -209,7 +232,7 @@ enum ndr_err_code ndr_pull_spoolss_EnumPrinters(struct ndr_pull *ndr, int flags, uint32_t ndr_size_spoolss_EnumPrinters_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_PrinterInfo *info) { - NDR_SPOOLSS_SIZE_ENUM(spoolss_EnumPrinters); + NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumPrinters); } /* @@ -243,9 +266,9 @@ enum ndr_err_code ndr_pull_spoolss_EnumJobs(struct ndr_pull *ndr, int flags, str return NDR_ERR_SUCCESS; } -uint32_t ndr_size_spoolss_EnumJobss_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_JobInfo *info) +uint32_t ndr_size_spoolss_EnumJobs_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_JobInfo *info) { - NDR_SPOOLSS_SIZE_ENUM(spoolss_EnumJobs); + NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumJobs); } /* @@ -277,7 +300,7 @@ enum ndr_err_code ndr_pull_spoolss_EnumPrinterDrivers(struct ndr_pull *ndr, int uint32_t ndr_size_spoolss_EnumPrinterDrivers_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_DriverInfo *info) { - NDR_SPOOLSS_SIZE_ENUM(spoolss_EnumPrinterDrivers); + NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumPrinterDrivers); } /* @@ -305,7 +328,7 @@ enum ndr_err_code ndr_pull_spoolss_EnumForms(struct ndr_pull *ndr, int flags, st uint32_t ndr_size_spoolss_EnumForms_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_FormInfo *info) { - NDR_SPOOLSS_SIZE_ENUM(spoolss_EnumForms); + NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumForms); } /* @@ -333,7 +356,7 @@ enum ndr_err_code ndr_pull_spoolss_EnumPorts(struct ndr_pull *ndr, int flags, st uint32_t ndr_size_spoolss_EnumPorts_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_PortInfo *info) { - NDR_SPOOLSS_SIZE_ENUM(spoolss_EnumPorts); + NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumPorts); } /* @@ -361,7 +384,7 @@ enum ndr_err_code ndr_pull_spoolss_EnumMonitors(struct ndr_pull *ndr, int flags, uint32_t ndr_size_spoolss_EnumMonitors_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_MonitorInfo *info) { - NDR_SPOOLSS_SIZE_ENUM(spoolss_EnumMonitors); + NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumMonitors); } /* @@ -391,10 +414,143 @@ enum ndr_err_code ndr_pull_spoolss_EnumPrintProcessors(struct ndr_pull *ndr, int return NDR_ERR_SUCCESS; } -uint32_t ndr_size_spoolss_EnumPrinterProcessors_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, - uint32_t level, uint32_t count, union spoolss_PrintProcessorInfo *info) +uint32_t ndr_size_spoolss_EnumPrintProcessors_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, + uint32_t level, uint32_t count, union spoolss_PrintProcessorInfo *info) { - NDR_SPOOLSS_SIZE_ENUM(spoolss_EnumPrintProcessors); + NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumPrintProcessors); +} + +/* + spoolss_EnumPrintProcessors +*/ +enum ndr_err_code ndr_push_spoolss_EnumPrintProcDataTypes(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrintProcDataTypes *r) +{ + NDR_SPOOLSS_PUSH_ENUM(spoolss_EnumPrintProcDataTypes,{ + _r.in.servername = r->in.servername; + _r.in.print_processor_name = r->in.print_processor_name; + },{ + _r.in.servername = r->in.servername; + _r.in.print_processor_name = r->in.print_processor_name; + }); + return NDR_ERR_SUCCESS; +} + +enum ndr_err_code ndr_pull_spoolss_EnumPrintProcDataTypes(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrintProcDataTypes *r) +{ + NDR_SPOOLSS_PULL_ENUM(spoolss_EnumPrintProcDataTypes,{ + r->in.servername = _r.in.servername; + r->in.print_processor_name = _r.in.print_processor_name; + },{ + _r.in.servername = r->in.servername; + _r.in.print_processor_name = r->in.print_processor_name; + }); + return NDR_ERR_SUCCESS; +} + +uint32_t ndr_size_spoolss_EnumPrintProcDataTypes_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, + uint32_t level, uint32_t count, union spoolss_PrintProcDataTypesInfo *info) +{ + NDR_SPOOLSS_SIZE_ENUM_LEVEL(spoolss_EnumPrintProcDataTypes); +} + +/* + spoolss_EnumPrinterDataEx +*/ + +enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinterDataEx *r) +{ + struct _spoolss_EnumPrinterDataEx _r; + if (flags & NDR_IN) { + _r.in.handle = r->in.handle; + _r.in.key_name = r->in.key_name; + _r.in.offered = r->in.offered; + NDR_CHECK(ndr_push__spoolss_EnumPrinterDataEx(ndr, flags, &_r)); + } + if (flags & NDR_OUT) { + struct ndr_push *_ndr_info; + _r.in.handle = r->in.handle; + _r.in.key_name = r->in.key_name; + _r.in.offered = r->in.offered; + _r.out.count = r->out.count; + _r.out.needed = r->out.needed; + _r.out.result = r->out.result; + _r.out.info = data_blob(NULL, 0); + if (r->in.offered >= *r->out.needed) { + struct __spoolss_EnumPrinterDataEx __r; + _ndr_info = ndr_push_init_ctx(ndr, ndr->iconv_convenience); + NDR_ERR_HAVE_NO_MEMORY(_ndr_info); + _ndr_info->flags= ndr->flags; + __r.in.count = *r->out.count; + __r.out.info = *r->out.info; + NDR_CHECK(ndr_push___spoolss_EnumPrinterDataEx(_ndr_info, flags, &__r)); + if (r->in.offered > _ndr_info->offset) { + uint32_t _padding_len = r->in.offered - _ndr_info->offset; + NDR_CHECK(ndr_push_zero(_ndr_info, _padding_len)); + } + _r.out.info = ndr_push_blob(_ndr_info); + } + NDR_CHECK(ndr_push__spoolss_EnumPrinterDataEx(ndr, flags, &_r)); + } + return NDR_ERR_SUCCESS; +} + +enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterDataEx *r) +{ + struct _spoolss_EnumPrinterDataEx _r; + if (flags & NDR_IN) { + _r.in.handle = r->in.handle; + _r.in.key_name = r->in.key_name; + ZERO_STRUCT(r->out); + NDR_CHECK(ndr_pull__spoolss_EnumPrinterDataEx(ndr, flags, &_r)); + r->in.handle = _r.in.handle; + r->in.key_name = _r.in.key_name; + r->in.offered = _r.in.offered; + r->out.needed = _r.out.needed; + r->out.count = _r.out.count; + NDR_PULL_ALLOC(ndr, r->out.info); + ZERO_STRUCTP(r->out.info); + } + if (flags & NDR_OUT) { + _r.in.handle = r->in.handle; + _r.in.key_name = r->in.key_name; + _r.in.offered = r->in.offered; + _r.out.count = r->out.count; + _r.out.needed = r->out.needed; + NDR_CHECK(ndr_pull__spoolss_EnumPrinterDataEx(ndr, flags, &_r)); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.info); + } + *r->out.info = NULL; + r->out.needed = _r.out.needed; + r->out.count = _r.out.count; + r->out.result = _r.out.result; + if (_r.out.info.length) { + struct ndr_pull *_ndr_info; + NDR_PULL_ALLOC(ndr, *r->out.info); + _ndr_info = ndr_pull_init_blob(&_r.out.info, *r->out.info, ndr->iconv_convenience); + NDR_ERR_HAVE_NO_MEMORY(_ndr_info); + _ndr_info->flags= ndr->flags; + if (r->in.offered != _ndr_info->data_size) { + return ndr_pull_error(ndr, NDR_ERR_BUFSIZE, + "SPOOLSS Buffer: offered[%u] doesn't match length of buffer[%u]", + (unsigned)r->in.offered, (unsigned)_ndr_info->data_size); + } + if (*r->out.needed <= _ndr_info->data_size) { + struct __spoolss_EnumPrinterDataEx __r; + __r.in.count = *r->out.count; + __r.out.info = NULL; + NDR_CHECK(ndr_pull___spoolss_EnumPrinterDataEx(_ndr_info, flags, &__r)); + *r->out.info = __r.out.info; + } + } + } + return NDR_ERR_SUCCESS; +} + +uint32_t ndr_size_spoolss_EnumPrinterDataEx_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, + uint32_t count, struct spoolss_PrinterEnumValues *info) +{ + NDR_SPOOLSS_SIZE_ENUM(spoolss_EnumPrinterDataEx); } /* @@ -411,15 +567,17 @@ enum ndr_err_code ndr_push_spoolss_GetPrinterData(struct ndr_push *ndr, int flag } if (flags & NDR_OUT) { struct ndr_push *_ndr_info; + DATA_BLOB blob = data_blob(NULL, 0); _r.in.handle = r->in.handle; _r.in.value_name= r->in.value_name; _r.in.offered = r->in.offered; _r.out.type = r->out.type; - _r.out.data = data_blob(NULL, 0); + _r.out.data = &blob; _r.out.needed = r->out.needed; _r.out.result = r->out.result; { struct __spoolss_GetPrinterData __r; + DATA_BLOB _blob; _ndr_info = ndr_push_init_ctx(ndr, ndr->iconv_convenience); NDR_ERR_HAVE_NO_MEMORY(_ndr_info); _ndr_info->flags= ndr->flags; @@ -430,7 +588,8 @@ enum ndr_err_code ndr_push_spoolss_GetPrinterData(struct ndr_push *ndr, int flag uint32_t _padding_len = r->in.offered - _ndr_info->offset; NDR_CHECK(ndr_push_zero(_ndr_info, _padding_len)); } - _r.out.data = ndr_push_blob(_ndr_info); + _blob = ndr_push_blob(_ndr_info); + _r.out.data = &_blob; } NDR_CHECK(ndr_push__spoolss_GetPrinterData(ndr, flags, &_r)); } @@ -441,13 +600,14 @@ enum ndr_err_code ndr_pull_spoolss_GetPrinterData(struct ndr_pull *ndr, int flag { struct _spoolss_GetPrinterData _r; if (flags & NDR_IN) { + DATA_BLOB blob = data_blob(NULL,0); ZERO_STRUCT(r->out); _r.in.handle = r->in.handle; _r.in.value_name= r->in.value_name; _r.in.offered = r->in.offered; _r.out.type = r->out.type; - _r.out.data = data_blob(NULL,0), + _r.out.data = &blob; _r.out.needed = r->out.needed; NDR_CHECK(ndr_pull__spoolss_GetPrinterData(ndr, flags, &_r)); r->in.handle = _r.in.handle; @@ -456,26 +616,30 @@ enum ndr_err_code ndr_pull_spoolss_GetPrinterData(struct ndr_pull *ndr, int flag r->out.needed = _r.out.needed; } if (flags & NDR_OUT) { + DATA_BLOB blob = data_blob_talloc(ndr,NULL,0); _r.in.handle = r->in.handle; _r.in.value_name= r->in.value_name; _r.in.offered = r->in.offered; _r.out.type = r->out.type; - _r.out.data = data_blob(NULL,0), + _r.out.data = &blob; _r.out.needed = r->out.needed; _r.out.result = r->out.result; NDR_CHECK(ndr_pull__spoolss_GetPrinterData(ndr, flags, &_r)); r->out.type = _r.out.type; - ZERO_STRUCT(r->out.data); + if (ndr->flags & LIBNDR_FLAG_REF_ALLOC) { + NDR_PULL_ALLOC(ndr, r->out.data); + } + ZERO_STRUCTP(r->out.data); r->out.needed = _r.out.needed; r->out.result = _r.out.result; - if (_r.out.data.length != r->in.offered) { + if (_r.out.data && _r.out.data->length != r->in.offered) { return ndr_pull_error(ndr, NDR_ERR_BUFSIZE, "SPOOLSS Buffer: r->in.offered[%u] doesn't match length of out buffer[%u]", - (unsigned)r->in.offered, (unsigned)_r.out.data.length); + (unsigned)r->in.offered, (unsigned)_r.out.data->length); } - if (_r.out.data.length > 0 && *r->out.needed <= _r.out.data.length) { + if (_r.out.data && _r.out.data->length > 0 && *r->out.needed <= _r.out.data->length) { struct __spoolss_GetPrinterData __r; - struct ndr_pull *_ndr_data = ndr_pull_init_blob(&_r.out.data, ndr, ndr->iconv_convenience); + struct ndr_pull *_ndr_data = ndr_pull_init_blob(_r.out.data, ndr, ndr->iconv_convenience); NDR_ERR_HAVE_NO_MEMORY(_ndr_data); _ndr_data->flags= ndr->flags; __r.in.type = *r->out.type; @@ -483,7 +647,7 @@ enum ndr_err_code ndr_pull_spoolss_GetPrinterData(struct ndr_pull *ndr, int flag NDR_CHECK(ndr_pull___spoolss_GetPrinterData(_ndr_data, flags, &__r)); r->out.data = __r.out.data; } else { - *r->out.type = SPOOLSS_PRINTER_DATA_TYPE_NULL; + *r->out.type = REG_NONE; } } return NDR_ERR_SUCCESS; @@ -505,7 +669,7 @@ enum ndr_err_code ndr_push_spoolss_SetPrinterData(struct ndr_push *ndr, int flag _ndr_data->flags= ndr->flags; __r.in.type = r->in.type; - __r.out.data = r->in.data; + __r.out.data = discard_const_p(union spoolss_PrinterData, &r->in.data); NDR_CHECK(ndr_push___spoolss_SetPrinterData(_ndr_data, NDR_OUT, &__r)); _data_blob_data = ndr_push_blob(_ndr_data); @@ -1022,3 +1186,25 @@ _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo101(struct ndr_pull *ndr, } return NDR_ERR_SUCCESS; } + +void ndr_print_spoolss_Field(struct ndr_print *ndr, const char *name, const union spoolss_Field *r) +{ + int level; + level = ndr_print_get_switch_value(ndr, r); + ndr_print_union(ndr, name, level, "spoolss_Field"); + switch (level) { + case PRINTER_NOTIFY_TYPE: + ndr_print_spoolss_PrintNotifyField(ndr, "field", r->field); + break; + + case JOB_NOTIFY_TYPE: + ndr_print_spoolss_JobNotifyField(ndr, "field", r->field); + break; + + default: + ndr_print_uint16(ndr, "field", r->field); + break; + + } +} + diff --git a/librpc/ndr/ndr_spoolss_buf.h b/librpc/ndr/ndr_spoolss_buf.h index 5ed848d7e0..aa6e277c5f 100644 --- a/librpc/ndr/ndr_spoolss_buf.h +++ b/librpc/ndr/ndr_spoolss_buf.h @@ -17,7 +17,7 @@ enum ndr_err_code ndr_pull_spoolss_EnumPrinters(struct ndr_pull *ndr, int flags, uint32_t ndr_size_spoolss_EnumPrinters_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_PrinterInfo *info); enum ndr_err_code ndr_push_spoolss_EnumJobs(struct ndr_push *ndr, int flags, const struct spoolss_EnumJobs *r); enum ndr_err_code ndr_pull_spoolss_EnumJobs(struct ndr_pull *ndr, int flags, struct spoolss_EnumJobs *r); -uint32_t ndr_size_spoolss_EnumJobss_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_JobInfo *info); +uint32_t ndr_size_spoolss_EnumJobs_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_JobInfo *info); enum ndr_err_code ndr_push_spoolss_EnumPrinterDrivers(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinterDrivers *r); enum ndr_err_code ndr_pull_spoolss_EnumPrinterDrivers(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterDrivers *r); uint32_t ndr_size_spoolss_EnumPrinterDrivers_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_DriverInfo *info); @@ -32,8 +32,16 @@ enum ndr_err_code ndr_pull_spoolss_EnumMonitors(struct ndr_pull *ndr, int flags, uint32_t ndr_size_spoolss_EnumMonitors_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, uint32_t level, uint32_t count, union spoolss_MonitorInfo *info); enum ndr_err_code ndr_push_spoolss_EnumPrintProcessors(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrintProcessors *r); enum ndr_err_code ndr_pull_spoolss_EnumPrintProcessors(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrintProcessors *r); -uint32_t ndr_size_spoolss_EnumPrinterProcessors_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, - uint32_t level, uint32_t count, union spoolss_PrintProcessorInfo *info); +uint32_t ndr_size_spoolss_EnumPrintProcessors_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, + uint32_t level, uint32_t count, union spoolss_PrintProcessorInfo *info); +enum ndr_err_code ndr_push_spoolss_EnumPrintProcDataTypes(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrintProcDataTypes *r); +enum ndr_err_code ndr_pull_spoolss_EnumPrintProcDataTypes(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrintProcDataTypes *r); +uint32_t ndr_size_spoolss_EnumPrintProcDataTypes_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, + uint32_t level, uint32_t count, union spoolss_PrintProcDataTypesInfo *info); +enum ndr_err_code ndr_push_spoolss_EnumPrinterDataEx(struct ndr_push *ndr, int flags, const struct spoolss_EnumPrinterDataEx *r); +enum ndr_err_code ndr_pull_spoolss_EnumPrinterDataEx(struct ndr_pull *ndr, int flags, struct spoolss_EnumPrinterDataEx *r); +uint32_t ndr_size_spoolss_EnumPrinterDataEx_info(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *iconv_convenience, + uint32_t count, struct spoolss_PrinterEnumValues *info); enum ndr_err_code ndr_push_spoolss_GetPrinterData(struct ndr_push *ndr, int flags, const struct spoolss_GetPrinterData *r); enum ndr_err_code ndr_pull_spoolss_GetPrinterData(struct ndr_pull *ndr, int flags, struct spoolss_GetPrinterData *r); enum ndr_err_code ndr_push_spoolss_SetPrinterData(struct ndr_push *ndr, int flags, const struct spoolss_SetPrinterData *r); @@ -41,6 +49,7 @@ uint32_t _ndr_size_spoolss_DeviceMode(struct spoolss_DeviceMode *devmode, struct size_t ndr_size_spoolss_StringArray(const struct spoolss_StringArray *r, struct smb_iconv_convenience *ic, int flags); _PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo101(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo101 *r); _PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo101(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo101 *r); +void ndr_print_spoolss_Field(struct ndr_print *ndr, const char *name, const union spoolss_Field *r); #undef _PRINTF_ATTRIBUTE #define _PRINTF_ATTRIBUTE(a1, a2) |