From 30daed2f7cc4baa69a31f139aaa5b5b260febc15 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Tue, 18 Nov 2003 05:54:14 +0000 Subject: Working on EnumPrinterData. There appears to be an alignment problem after reading a non-empty DATA_BLOB in the reply. (This used to be commit 3165bf532f6b5a074f20f38a9af56325eedbb1c2) --- source4/torture/rpc/spoolss.c | 45 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'source4/torture') 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; } -- cgit