diff options
-rw-r--r-- | source4/librpc/idl/spoolss.idl | 9 | ||||
-rw-r--r-- | source4/torture/rpc/spoolss.c | 45 |
2 files changed, 49 insertions, 5 deletions
diff --git a/source4/librpc/idl/spoolss.idl b/source4/librpc/idl/spoolss.idl index 1d33274f93..362e692aaf 100644 --- a/source4/librpc/idl/spoolss.idl +++ b/source4/librpc/idl/spoolss.idl @@ -533,16 +533,15 @@ /******************/ /* Function: 0x48 */ - NTSTATUS spoolss_EnumPrinterData( + WERROR spoolss_EnumPrinterData( [in,ref] policy_handle *handle, [in] uint32 enum_index, [in] uint32 value_offered, - [out] uint32 value_len, - [out] unistr *value_name, + [out] DATA_BLOB value, [out] uint32 value_needed, [out] uint32 printerdata_type, - [in,out] DATA_BLOB *buffer, - [in,out,ref] uint32 *buf_size + [out] DATA_BLOB data, + [in,out,ref] uint32 *data_size ); /******************/ diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 53e25a3e14..9009c8e99a 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -87,6 +87,47 @@ BOOL test_ClosePrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, return True; } +BOOL test_EnumPrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, + struct policy_handle *handle) +{ + NTSTATUS status; + struct spoolss_EnumPrinterData r; + + r.in.handle = handle; + r.in.enum_index = 0; + + do { + uint32 data_size; + + r.in.value_offered = 0; + data_size = 0; + r.in.data_size = &data_size; + r.out.data_size = &data_size; + + printf("Testing EnumPrinterData\n"); + + status = dcerpc_spoolss_EnumPrinterData(p, mem_ctx, &r); + + if (!NT_STATUS_IS_OK(status)) { + printf("EnumPrinterData failed - %s\n", nt_errstr(status)); + return False; + } + + r.in.value_offered = r.out.value_needed; + + status = dcerpc_spoolss_EnumPrinterData(p, mem_ctx, &r); + + if (!NT_STATUS_IS_OK(status)) { + printf("EnumPrinterData failed - %s\n", nt_errstr(status)); + return False; + } + + r.in.enum_index++; + } while (1); + + return True; +} + static BOOL test_OpenPrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, const char *name) { @@ -170,6 +211,10 @@ static BOOL test_OpenPrinterEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, ret = False; } + if (!test_EnumPrinterData(p, mem_ctx, &handle)) { + ret = False; + } + if (!test_ClosePrinter(p, mem_ctx, &handle)) { ret = False; } |