From 22e2f220be4ac05aead7ba7a893904299c5bbfd8 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 6 Feb 2009 12:18:06 +0100 Subject: s4-smbtorture: fix test_GetJob. Guenther --- source4/torture/rpc/spoolss.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4/torture/rpc/spoolss.c') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 4a6ff480c4..7a64d9abcb 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -888,12 +888,14 @@ static bool test_GetJob(struct torture_context *tctx, { NTSTATUS status; struct spoolss_GetJob r; + uint32_t needed; r.in.handle = handle; r.in.job_id = job_id; r.in.level = 1; r.in.buffer = NULL; r.in.offered = 0; + r.out.needed = &needed; torture_comment(tctx, "Testing GetJob\n"); @@ -901,10 +903,10 @@ static bool test_GetJob(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "GetJob failed"); if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) { - DATA_BLOB blob = data_blob_talloc(tctx, NULL, r.out.needed); + DATA_BLOB blob = data_blob_talloc(tctx, NULL, needed); data_blob_clear(&blob); r.in.buffer = &blob; - r.in.offered = r.out.needed; + r.in.offered = needed; status = dcerpc_spoolss_GetJob(p, tctx, &r); -- cgit From 8153916f4aad1482351719ed2f1d91d48fe89197 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 6 Feb 2009 12:22:35 +0100 Subject: s4-smbtorture: fix test_GetPrinter. Guenther --- source4/torture/rpc/spoolss.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4/torture/rpc/spoolss.c') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 7a64d9abcb..a2965ad05f 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -605,12 +605,14 @@ static bool test_GetPrinter(struct torture_context *tctx, struct spoolss_GetPrinter r; uint16_t levels[] = {0, 1, 2, 3, 4, 5, 6, 7, 8}; int i; + uint32_t needed; for (i=0;i Date: Fri, 6 Feb 2009 12:32:57 +0100 Subject: s4-smbtorture: fix test_GetPrinterDriverDirectory. Guenther --- source4/torture/rpc/spoolss.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4/torture/rpc/spoolss.c') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index a2965ad05f..3c5fcabbd2 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -191,6 +191,7 @@ static bool test_GetPrinterDriverDirectory(struct torture_context *tctx, } }; int i; + uint32_t needed; for (i=0;i Date: Fri, 6 Feb 2009 12:42:13 +0100 Subject: s4-smbtorture: fix test_DoPrintTest. Guenther --- source4/torture/rpc/spoolss.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'source4/torture/rpc/spoolss.c') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 3c5fcabbd2..c06262eab6 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -1009,6 +1009,7 @@ static bool test_DoPrintTest(struct torture_context *tctx, s.in.handle = handle; s.in.level = 1; s.in.info.info1 = &info1; + s.out.job_id = &job_id; info1.document_name = "TorturePrintJob"; info1.output_file = NULL; info1.datatype = "RAW"; @@ -1017,8 +1018,6 @@ static bool test_DoPrintTest(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "dcerpc_spoolss_StartDocPrinter failed"); torture_assert_werr_ok(tctx, s.out.result, "StartDocPrinter failed"); - job_id = s.out.job_id; - for (i=1; i < 4; i++) { torture_comment(tctx, "Testing StartPagePrinter: Page[%d]\n", i); -- cgit From d400de2ffa53bebe13cba0d2d3c18dcc05bc37bd Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 6 Feb 2009 12:44:57 +0100 Subject: s4-smbtorture: fix test_DoPrintTest. Guenther --- source4/torture/rpc/spoolss.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/torture/rpc/spoolss.c') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index c06262eab6..707f3496b6 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -1003,6 +1003,7 @@ static bool test_DoPrintTest(struct torture_context *tctx, struct spoolss_EndDocPrinter e; int i; uint32_t job_id; + uint32_t num_written; torture_comment(tctx, "Testing StartDocPrinter\n"); @@ -1032,6 +1033,7 @@ static bool test_DoPrintTest(struct torture_context *tctx, w.in.handle = handle; w.in.data = data_blob_string_const(talloc_asprintf(tctx,"TortureTestPage: %d\nData\n",i)); + w.out.num_written = &num_written; status = dcerpc_spoolss_WritePrinter(p, tctx, &w); torture_assert_ntstatus_ok(tctx, status, "dcerpc_spoolss_WritePrinter failed"); -- cgit From 99398e8768f308f01b3298bfbc3bb783f6ea8c2f Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 6 Feb 2009 13:09:22 +0100 Subject: s4-smbtorture: fix test_GetForm. Guenther --- source4/torture/rpc/spoolss.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4/torture/rpc/spoolss.c') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 707f3496b6..70c4acb025 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -663,12 +663,14 @@ static bool test_GetForm(struct torture_context *tctx, { NTSTATUS status; struct spoolss_GetForm r; + uint32_t needed; r.in.handle = handle; r.in.form_name = form_name; r.in.level = 1; r.in.buffer = NULL; r.in.offered = 0; + r.out.needed = &needed; torture_comment(tctx, "Testing GetForm\n"); @@ -676,10 +678,10 @@ static bool test_GetForm(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "GetForm failed"); if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) { - DATA_BLOB blob = data_blob_talloc(tctx, NULL, r.out.needed); + DATA_BLOB blob = data_blob_talloc(tctx, NULL, needed); data_blob_clear(&blob); r.in.buffer = &blob; - r.in.offered = r.out.needed; + r.in.offered = needed; status = dcerpc_spoolss_GetForm(p, tctx, &r); torture_assert_ntstatus_ok(tctx, status, "GetForm failed"); -- cgit From 3954cd83aa6976ef8c799eeee00f81fefb693934 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 6 Feb 2009 13:28:48 +0100 Subject: s4-smbtorture: fix test_GetPrinterDriver2. Guenther --- source4/torture/rpc/spoolss.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source4/torture/rpc/spoolss.c') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 70c4acb025..d9080b92ae 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -1605,6 +1605,9 @@ static bool test_GetPrinterDriver2(struct dcerpc_pipe *p, { NTSTATUS status; struct spoolss_GetPrinterDriver2 r; + uint32_t needed; + uint32_t server_major_version; + uint32_t server_minor_version; r.in.handle = handle; r.in.architecture = "W32X86"; @@ -1613,6 +1616,9 @@ static bool test_GetPrinterDriver2(struct dcerpc_pipe *p, r.in.offered = 0; r.in.client_major_version = 0; r.in.client_minor_version = 0; + r.out.needed = &needed; + r.out.server_major_version = &server_major_version; + r.out.server_minor_version = &server_minor_version; printf("Testing GetPrinterDriver2\n"); @@ -1623,7 +1629,7 @@ static bool test_GetPrinterDriver2(struct dcerpc_pipe *p, } if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) { - r.in.offered = r.out.needed; + r.in.offered = needed; status = dcerpc_spoolss_GetPrinterDriver2(p, tctx, &r); } -- cgit From 8ddb81ca0addf1c9bad4f624e55ee5679aa3fe4c Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 6 Feb 2009 13:38:59 +0100 Subject: s4-smbtorture: fix test_GetPrinterDataEx. Guenther --- source4/torture/rpc/spoolss.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source4/torture/rpc/spoolss.c') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index d9080b92ae..6c0126ed7b 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -1152,11 +1152,15 @@ static bool test_GetPrinterDataEx(struct torture_context *tctx, { NTSTATUS status; struct spoolss_GetPrinterDataEx r; + uint32_t type; + uint32_t needed; r.in.handle = handle; r.in.key_name = key_name; r.in.value_name = value_name; r.in.offered = 0; + r.out.type = &type; + r.out.needed = &needed; torture_comment(tctx, "Testing GetPrinterDataEx\n"); @@ -1170,7 +1174,8 @@ static bool test_GetPrinterDataEx(struct torture_context *tctx, } if (W_ERROR_EQUAL(r.out.result, WERR_MORE_DATA)) { - r.in.offered = r.out.needed; + r.in.offered = needed; + r.out.buffer = talloc_array(tctx, uint8_t, needed); status = dcerpc_spoolss_GetPrinterDataEx(p, tctx, &r); torture_assert_ntstatus_ok(tctx, status, "GetPrinterDataEx failed"); -- cgit From 88aaac39fa2a38997c11d4f545f3e223129a5a6a Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 6 Feb 2009 13:44:44 +0100 Subject: s4-smbtorture: fix test_EnumPrinterDataEx. Guenther --- source4/torture/rpc/spoolss.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source4/torture/rpc/spoolss.c') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 6c0126ed7b..d0252d8d69 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -1242,17 +1242,22 @@ static bool test_EnumPrinterDataEx(struct torture_context *tctx, { NTSTATUS status; struct spoolss_EnumPrinterDataEx r; + uint32_t needed; + uint32_t count; r.in.handle = handle; r.in.key_name = "PrinterDriverData"; r.in.offered = 0; + r.out.needed = &needed; + r.out.count = &count; torture_comment(tctx, "Testing EnumPrinterDataEx\n"); status = dcerpc_spoolss_EnumPrinterDataEx(p, tctx, &r); torture_assert_ntstatus_ok(tctx, status, "EnumPrinterDataEx failed"); - r.in.offered = r.out.needed; + r.in.offered = needed; + r.out.buffer = talloc_array(tctx, uint8_t, needed); status = dcerpc_spoolss_EnumPrinterDataEx(p, tctx, &r); -- cgit From afe300cb527c19cffa8667db4772d0d5812c342b Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 6 Feb 2009 17:09:30 +0100 Subject: s4-smbtorture: fix spoolss enum tests. Guenther --- source4/torture/rpc/spoolss.c | 65 +++++++++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 21 deletions(-) (limited to 'source4/torture/rpc/spoolss.c') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index d0252d8d69..2592cc310d 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -106,11 +106,13 @@ static bool test_EnumPorts(struct torture_context *tctx, for (i=0;i Date: Fri, 6 Feb 2009 18:32:24 +0100 Subject: s4-smbtorture: fix test_GetPrinterData. Guenther --- source4/torture/rpc/spoolss.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source4/torture/rpc/spoolss.c') diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c index 2592cc310d..7da3209eb3 100644 --- a/source4/torture/rpc/spoolss.c +++ b/source4/torture/rpc/spoolss.c @@ -1139,11 +1139,13 @@ static bool test_GetPrinterData(struct torture_context *tctx, NTSTATUS status; struct spoolss_GetPrinterData r; uint32_t needed; + enum spoolss_PrinterDataType type; r.in.handle = handle; r.in.value_name = value_name; r.in.offered = 0; r.out.needed = &needed; + r.out.type = &type; torture_comment(tctx, "Testing GetPrinterData\n"); -- cgit