diff options
-rw-r--r-- | source4/torture/rpc/spoolss.c | 48 |
1 files changed, 30 insertions, 18 deletions
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 9d8bc4b186..7e8461ef83 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -108,6 +108,7 @@ static bool test_EnumPorts(struct torture_context *tctx, DATA_BLOB blob; uint32_t needed; uint32_t count; + union spoolss_PortInfo *info; r.in.servername = ""; r.in.level = level; @@ -115,6 +116,7 @@ static bool test_EnumPorts(struct torture_context *tctx, r.in.offered = 0; r.out.needed = &needed; r.out.count = &count; + r.out.info = &info; torture_comment(tctx, "Testing EnumPorts level %u\n", r.in.level); @@ -138,7 +140,7 @@ static bool test_EnumPorts(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, "EnumPorts failed"); ctx->port_count[level] = count; - ctx->ports[level] = r.out.info; + ctx->ports[level] = info; } for (i=1;i<ARRAY_SIZE(levels);i++) { @@ -307,6 +309,7 @@ static bool test_EnumPrinterDrivers(struct torture_context *tctx, DATA_BLOB blob; uint32_t needed; uint32_t count; + union spoolss_DriverInfo *info; r.in.server = ""; r.in.environment = SPOOLSS_ARCHITECTURE_NT_X86; @@ -315,6 +318,7 @@ static bool test_EnumPrinterDrivers(struct torture_context *tctx, r.in.offered = 0; r.out.needed = &needed; r.out.count = &count; + r.out.info = &info; torture_comment(tctx, "Testing EnumPrinterDrivers level %u\n", r.in.level); @@ -339,7 +343,7 @@ static bool test_EnumPrinterDrivers(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, "EnumPrinterDrivers failed"); ctx->driver_count[level] = count; - ctx->drivers[level] = r.out.info; + ctx->drivers[level] = info; } for (i=1;i<ARRAY_SIZE(levels);i++) { @@ -426,6 +430,7 @@ static bool test_EnumMonitors(struct torture_context *tctx, DATA_BLOB blob; uint32_t needed; uint32_t count; + union spoolss_MonitorInfo *info; r.in.servername = ""; r.in.level = level; @@ -433,6 +438,7 @@ static bool test_EnumMonitors(struct torture_context *tctx, r.in.offered = 0; r.out.needed = &needed; r.out.count = &count; + r.out.info = &info; torture_comment(tctx, "Testing EnumMonitors level %u\n", r.in.level); @@ -456,7 +462,7 @@ static bool test_EnumMonitors(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, "EnumMonitors failed"); ctx->monitor_count[level] = count; - ctx->monitors[level] = r.out.info; + ctx->monitors[level] = info; } for (i=1;i<ARRAY_SIZE(levels);i++) { @@ -499,6 +505,7 @@ static bool test_EnumPrintProcessors(struct torture_context *tctx, DATA_BLOB blob; uint32_t needed; uint32_t count; + union spoolss_PrintProcessorInfo *info; r.in.servername = ""; r.in.environment = "Windows NT x86"; @@ -507,6 +514,7 @@ static bool test_EnumPrintProcessors(struct torture_context *tctx, r.in.offered = 0; r.out.needed = &needed; r.out.count = &count; + r.out.info = &info; torture_comment(tctx, "Testing EnumPrintProcessors level %u\n", r.in.level); @@ -530,7 +538,7 @@ static bool test_EnumPrintProcessors(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, "EnumPrintProcessors failed"); ctx->print_processor_count[level] = count; - ctx->print_processors[level] = r.out.info; + ctx->print_processors[level] = info; } for (i=1;i<ARRAY_SIZE(levels);i++) { @@ -572,6 +580,7 @@ static bool test_EnumPrinters(struct torture_context *tctx, DATA_BLOB blob; uint32_t needed; uint32_t count; + union spoolss_PrinterInfo *info; r.in.flags = PRINTER_ENUM_LOCAL; r.in.server = ""; @@ -580,6 +589,7 @@ static bool test_EnumPrinters(struct torture_context *tctx, r.in.offered = 0; r.out.needed = &needed; r.out.count = &count; + r.out.info = &info; torture_comment(tctx, "Testing EnumPrinters level %u\n", r.in.level); @@ -603,7 +613,7 @@ static bool test_EnumPrinters(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, "EnumPrinters failed"); ctx->printer_count[level] = count; - ctx->printers[level] = r.out.info; + ctx->printers[level] = info; } for (i=1;i<ARRAY_SIZE(levels);i++) { @@ -793,12 +803,15 @@ static bool test_EnumForms(struct torture_context *tctx, for (i=0; i<ARRAY_SIZE(levels); i++) { + union spoolss_FormInfo *info; + r.in.handle = handle; r.in.level = levels[i]; r.in.buffer = NULL; r.in.offered = 0; r.out.needed = &needed; r.out.count = &count; + r.out.info = &info; torture_comment(tctx, "Testing EnumForms level %d\n", levels[i]); @@ -813,7 +826,6 @@ static bool test_EnumForms(struct torture_context *tctx, torture_fail(tctx, "EnumForms on the PrintServer isn't supported by test server (NT4)"); if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) { - union spoolss_FormInfo *info; int j; DATA_BLOB blob = data_blob_talloc(tctx, NULL, needed); data_blob_clear(&blob); @@ -822,9 +834,7 @@ static bool test_EnumForms(struct torture_context *tctx, status = dcerpc_spoolss_EnumForms(p, tctx, &r); - torture_assert(tctx, r.out.info, "No forms returned"); - - info = r.out.info; + torture_assert(tctx, info, "No forms returned"); for (j = 0; j < count; j++) { if (!print_server) @@ -928,6 +938,7 @@ static bool test_EnumPorts_old(struct torture_context *tctx, struct spoolss_EnumPorts r; uint32_t needed; uint32_t count; + union spoolss_PortInfo *info; r.in.servername = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); @@ -936,6 +947,7 @@ static bool test_EnumPorts_old(struct torture_context *tctx, r.in.offered = 0; r.out.needed = &needed; r.out.count = &count; + r.out.info = &info; torture_comment(tctx, "Testing EnumPorts\n"); @@ -952,7 +964,7 @@ static bool test_EnumPorts_old(struct torture_context *tctx, status = dcerpc_spoolss_EnumPorts(p, tctx, &r); torture_assert_ntstatus_ok(tctx, status, "EnumPorts failed"); - torture_assert(tctx, r.out.info, "No ports returned"); + torture_assert(tctx, info, "No ports returned"); } return true; @@ -1080,6 +1092,7 @@ static bool test_EnumJobs(struct torture_context *tctx, struct spoolss_EnumJobs r; uint32_t needed; uint32_t count; + union spoolss_JobInfo *info; r.in.handle = handle; r.in.firstjob = 0; @@ -1089,6 +1102,7 @@ static bool test_EnumJobs(struct torture_context *tctx, r.in.offered = 0; r.out.needed = &needed; r.out.count = &count; + r.out.info = &info; torture_comment(tctx, "Testing EnumJobs\n"); @@ -1097,7 +1111,6 @@ static bool test_EnumJobs(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "EnumJobs failed"); if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) { - union spoolss_JobInfo *info; int j; DATA_BLOB blob = data_blob_talloc(tctx, NULL, needed); data_blob_clear(&blob); @@ -1106,9 +1119,7 @@ static bool test_EnumJobs(struct torture_context *tctx, status = dcerpc_spoolss_EnumJobs(p, tctx, &r); - torture_assert(tctx, r.out.info, "No jobs returned"); - - info = r.out.info; + torture_assert(tctx, info, "No jobs returned"); for (j = 0; j < count; j++) { @@ -1722,6 +1733,7 @@ static bool test_EnumPrinters_old(struct torture_context *tctx, struct dcerpc_pi r.in.offered = 0; r.out.needed = &needed; r.out.count = &count; + r.out.info = &info; torture_comment(tctx, "Testing EnumPrinters level %u\n", r.in.level); @@ -1740,13 +1752,11 @@ static bool test_EnumPrinters_old(struct torture_context *tctx, struct dcerpc_pi torture_assert_werr_ok(tctx, r.out.result, "EnumPrinters failed"); - if (!r.out.info) { + if (!info) { torture_comment(tctx, "No printers returned\n"); return true; } - info = r.out.info; - for (j=0;j<count;j++) { if (r.in.level == 1) { /* the names appear to be comma-separated name lists? */ @@ -1829,6 +1839,7 @@ static bool test_EnumPrinterDrivers_old(struct torture_context *tctx, uint32_t needed; uint32_t count; + union spoolss_DriverInfo *info; r.in.server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p)); r.in.environment = "Windows NT x86"; @@ -1837,6 +1848,7 @@ static bool test_EnumPrinterDrivers_old(struct torture_context *tctx, r.in.offered = 0; r.out.needed = &needed; r.out.count = &count; + r.out.info = &info; torture_comment(tctx, "Testing EnumPrinterDrivers level %u\n", r.in.level); @@ -1856,7 +1868,7 @@ static bool test_EnumPrinterDrivers_old(struct torture_context *tctx, torture_assert_werr_ok(tctx, r.out.result, "EnumPrinterDrivers failed"); - if (!r.out.info) { + if (!info) { torture_comment(tctx, "No printer drivers returned\n"); break; } |