2 Unix SMB/CIFS implementation.
3 test suite for spoolss rpc operations
5 Copyright (C) Tim Potter 2003
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 static BOOL test_GetPrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
25 struct policy_handle *handle)
28 struct spoolss_GetPrinter r;
29 uint16_t levels[] = {1, 2, 3, 4, 5, 6, 7};
33 for (i=0;i<ARRAY_SIZE(levels);i++) {
34 uint32_t buf_size = 0;
36 r.in.level = levels[i];
38 r.in.buf_size = &buf_size;
39 r.out.buf_size = &buf_size;
41 printf("Testing GetPrinter level %u\n", r.in.level);
43 status = dcerpc_spoolss_GetPrinter(p, mem_ctx, &r);
44 if (!NT_STATUS_IS_OK(status)) {
45 printf("GetPrinter failed - %s\n", nt_errstr(status));
50 if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
51 DATA_BLOB blob = data_blob_talloc(mem_ctx, NULL, buf_size);
52 data_blob_clear(&blob);
54 status = dcerpc_spoolss_GetPrinter(p, mem_ctx, &r);
57 if (!NT_STATUS_IS_OK(status) ||
58 !W_ERROR_IS_OK(r.out.result)) {
59 printf("GetPrinter failed - %s/%s\n",
60 nt_errstr(status), win_errstr(r.out.result));
70 static BOOL test_ClosePrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
71 struct policy_handle *handle)
74 struct spoolss_ClosePrinter r;
77 r.out.handle = handle;
79 printf("Testing ClosePrinter\n");
81 status = dcerpc_spoolss_ClosePrinter(p, mem_ctx, &r);
82 if (!NT_STATUS_IS_OK(status)) {
83 printf("ClosePrinter failed - %s\n", nt_errstr(status));
90 static BOOL test_GetForm(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
91 struct policy_handle *handle, char *formname)
94 struct spoolss_GetForm r;
98 r.in.formname = formname;
102 r.in.buf_size = r.out.buf_size = &buf_size;
104 printf("Testing GetForm\n");
106 status = dcerpc_spoolss_GetForm(p, mem_ctx, &r);
108 if (!NT_STATUS_IS_OK(status)) {
109 printf("GetForm failed - %s\n", nt_errstr(status));
113 if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
114 DATA_BLOB blob = data_blob_talloc(mem_ctx, NULL, buf_size);
116 data_blob_clear(&blob);
119 status = dcerpc_spoolss_GetForm(p, mem_ctx, &r);
122 printf("No form info returned");
130 static BOOL test_EnumForms(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
131 struct policy_handle *handle)
134 struct spoolss_EnumForms r;
137 r.in.handle = handle;
141 r.in.buf_size = &buf_size;
142 r.out.buf_size = &buf_size;
144 printf("Testing EnumForms\n");
146 status = dcerpc_spoolss_EnumForms(p, mem_ctx, &r);
148 if (!NT_STATUS_IS_OK(status)) {
149 printf("EnumForms failed - %s\n", nt_errstr(status));
153 if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
154 DATA_BLOB blob = data_blob_talloc(mem_ctx, NULL, buf_size);
155 union spoolss_FormInfo *info;
158 data_blob_clear(&blob);
161 status = dcerpc_spoolss_EnumForms(p, mem_ctx, &r);
164 printf("No forms returned");
168 status = pull_spoolss_FormInfoArray(r.out.buffer, mem_ctx, r.in.level, r.out.count, &info);
169 if (!NT_STATUS_IS_OK(status)) {
170 printf("EnumFormsArray parse failed - %s\n", nt_errstr(status));
174 for (j=0;j<r.out.count;j++) {
175 printf("Form %d\n", j);
176 NDR_PRINT_UNION_DEBUG(spoolss_FormInfo, r.in.level, &info[j]);
179 for (j = 0; j < r.out.count; j++)
180 test_GetForm(p, mem_ctx, handle, info[j].info1.name);
183 if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
184 printf("EnumForms failed - %s/%s\n",
185 nt_errstr(status), win_errstr(r.out.result));
192 static BOOL test_DeleteForm(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
193 struct policy_handle *handle, char *formname)
196 struct spoolss_DeleteForm r;
198 r.in.handle = handle;
199 r.in.formname = formname;
201 status = dcerpc_spoolss_DeleteForm(p, mem_ctx, &r);
203 if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
204 printf("DeleteForm failed - %s/%s\n",
205 nt_errstr(status), win_errstr(r.out.result));
212 static BOOL test_AddForm(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
213 struct policy_handle *handle)
215 struct spoolss_AddForm r;
216 struct spoolss_AddFormInfo1 form;
218 const char *formname = "testform3";
221 r.in.handle = handle;
223 form.flags = 2; /* User form */
224 form.name = formname;
231 r.in.info.info1 = &form;
233 status = dcerpc_spoolss_AddForm(p, mem_ctx, &r);
235 if (!NT_STATUS_IS_OK(status)) {
236 printf("AddForm failed - %s\n", nt_errstr(status));
240 if (!W_ERROR_IS_OK(r.out.result)) {
241 printf("AddForm failed - %s\n", nt_errstr(status));
246 struct spoolss_SetForm sf;
248 sf.in.handle = handle;
249 sf.in.form_name = formname;
251 sf.in.info.info1 = &form;
254 status = dcerpc_spoolss_SetForm(p, mem_ctx, &sf);
256 if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
257 printf("SetForm failed - %s/%s\n",
258 nt_errstr(status), win_errstr(r.out.result));
260 /* Fall through to delete */
265 if (!test_DeleteForm(p, mem_ctx, handle, formname)) {
266 printf("DeleteForm failed\n");
273 static BOOL test_GetJob(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
274 struct policy_handle *handle, uint32_t job_id)
277 struct spoolss_GetJob r;
280 r.in.handle = handle;
281 r.in.job_id = job_id;
285 r.in.buf_size = r.out.buf_size = &buf_size;
287 printf("Testing GetJob\n");
289 status = dcerpc_spoolss_GetJob(p, mem_ctx, &r);
291 if (!NT_STATUS_IS_OK(status)) {
292 printf("GetJob failed - %s\n", nt_errstr(status));
296 if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
297 DATA_BLOB blob = data_blob_talloc(mem_ctx, NULL, buf_size);
299 data_blob_clear(&blob);
302 status = dcerpc_spoolss_GetJob(p, mem_ctx, &r);
305 printf("No job info returned");
313 static BOOL test_SetJob(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
314 struct policy_handle *handle, uint32_t job_id, uint32_t command)
317 struct spoolss_SetJob r;
319 r.in.handle = handle;
320 r.in.job_id = job_id;
322 r.in.command = command;
324 printf("Testing SetJob\n");
326 status = dcerpc_spoolss_SetJob(p, mem_ctx, &r);
328 if (!NT_STATUS_IS_OK(status)) {
329 printf("SetJob failed - %s\n", nt_errstr(status));
336 static BOOL test_EnumJobs(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
337 struct policy_handle *handle)
340 struct spoolss_EnumJobs r;
343 r.in.handle = handle;
345 r.in.numjobs = 0xffffffff;
349 r.in.buf_size = &buf_size;
350 r.out.buf_size = &buf_size;
352 printf("Testing EnumJobs\n");
354 status = dcerpc_spoolss_EnumJobs(p, mem_ctx, &r);
356 if (!NT_STATUS_IS_OK(status)) {
357 printf("EnumJobs failed - %s\n", nt_errstr(status));
361 if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
362 DATA_BLOB blob = data_blob_talloc(mem_ctx, NULL, buf_size);
363 union spoolss_JobInfo *info;
366 data_blob_clear(&blob);
369 status = dcerpc_spoolss_EnumJobs(p, mem_ctx, &r);
372 printf("No jobs returned");
376 status = pull_spoolss_JobInfoArray(
377 r.out.buffer, mem_ctx, r.in.level, r.out.count,
380 if (!NT_STATUS_IS_OK(status)) {
381 printf("EnumJobsArray parse failed - %s\n",
386 for (j = 0; j < r.out.count; j++) {
387 printf("Job %d\n", j);
388 NDR_PRINT_UNION_DEBUG(
389 spoolss_JobInfo, r.in.level, &info[j]);
392 for (j = 0; j < r.out.count; j++) {
393 test_GetJob(p, mem_ctx, handle, info[j].info1.job_id);
395 p, mem_ctx, handle, info[j].info1.job_id, 1);
398 } else if (!W_ERROR_IS_OK(r.out.result)) {
399 printf("EnumJobs failed - %s\n", win_errstr(r.out.result));
406 static BOOL test_GetPrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
407 struct policy_handle *handle, char *value_name)
410 struct spoolss_GetPrinterData r;
413 r.in.handle = handle;
414 r.in.value_name = value_name;
416 r.in.buf_size = r.out.buf_size = &buf_size;
418 printf("Testing GetPrinterData\n");
420 status = dcerpc_spoolss_GetPrinterData(p, mem_ctx, &r);
422 if (!NT_STATUS_IS_OK(status)) {
423 printf("GetPrinterData failed - %s\n", nt_errstr(status));
427 if (W_ERROR_EQUAL(r.out.result, WERR_MORE_DATA)) {
429 status = dcerpc_spoolss_GetPrinterData(p, mem_ctx, &r);
431 if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
432 printf("GetPrinterData failed - %s/%s\n",
433 nt_errstr(status), win_errstr(r.out.result));
441 static BOOL test_GetPrinterDataEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
442 struct policy_handle *handle, char *key_name,
446 struct spoolss_GetPrinterDataEx r;
449 r.in.handle = handle;
450 r.in.key_name = key_name;
451 r.in.value_name = value_name;
453 r.in.buf_size = r.out.buf_size = &buf_size;
455 printf("Testing GetPrinterDataEx\n");
457 status = dcerpc_spoolss_GetPrinterDataEx(p, mem_ctx, &r);
459 if (!NT_STATUS_IS_OK(status)) {
460 printf("GetPrinterDataEx failed - %s\n", nt_errstr(status));
464 if (W_ERROR_EQUAL(r.out.result, WERR_MORE_DATA)) {
466 status = dcerpc_spoolss_GetPrinterDataEx(p, mem_ctx, &r);
468 if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
469 printf("GetPrinterDataEx failed - %s/%s\n",
470 nt_errstr(status), win_errstr(r.out.result));
478 static BOOL test_EnumPrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
479 struct policy_handle *handle)
482 struct spoolss_EnumPrinterData r;
484 r.in.handle = handle;
490 r.in.value_offered = 0;
492 r.in.data_size = &data_size;
493 r.out.data_size = &data_size;
495 printf("Testing EnumPrinterData\n");
497 status = dcerpc_spoolss_EnumPrinterData(p, mem_ctx, &r);
499 if (!NT_STATUS_IS_OK(status)) {
500 printf("EnumPrinterData failed - %s\n", nt_errstr(status));
504 r.in.value_offered = r.out.value_needed;
506 status = dcerpc_spoolss_EnumPrinterData(p, mem_ctx, &r);
508 if (!NT_STATUS_IS_OK(status)) {
509 printf("EnumPrinterData failed - %s\n", nt_errstr(status));
513 test_GetPrinterData(p, mem_ctx, handle, r.out.value_name);
515 test_GetPrinterDataEx(
516 p, mem_ctx, handle, "PrinterDriverData",
521 } while (W_ERROR_IS_OK(r.out.result));
526 static BOOL test_DeletePrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
527 struct policy_handle *handle, char *value_name)
530 struct spoolss_DeletePrinterData r;
532 r.in.handle = handle;
533 r.in.value_name = value_name;
535 printf("Testing DeletePrinterData\n");
537 status = dcerpc_spoolss_DeletePrinterData(p, mem_ctx, &r);
539 if (!NT_STATUS_IS_OK(status)) {
540 printf("DeletePrinterData failed - %s\n", nt_errstr(status));
547 static BOOL test_SetPrinterData(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
548 struct policy_handle *handle)
551 struct spoolss_SetPrinterData r;
552 char *value_name = "spottyfoot";
554 r.in.handle = handle;
555 r.in.value_name = value_name;
557 r.in.buffer = data_blob_talloc(mem_ctx, "dog", 4);
560 printf("Testing SetPrinterData\n");
562 status = dcerpc_spoolss_SetPrinterData(p, mem_ctx, &r);
564 if (!NT_STATUS_IS_OK(status)) {
565 printf("SetPrinterData failed - %s\n", nt_errstr(status));
569 if (!test_DeletePrinterData(p, mem_ctx, handle, value_name)) {
576 static BOOL test_SecondaryClosePrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
577 struct policy_handle *handle)
580 struct dcerpc_pipe *p2;
583 /* only makes sense on SMB */
584 if (p->transport.transport != NCACN_NP) {
588 printf("testing close on secondary pipe\n");
590 status = dcerpc_secondary_smb(p, &p2,
593 DCERPC_SPOOLSS_VERSION);
594 if (!NT_STATUS_IS_OK(status)) {
595 printf("Failed to create secondary connection\n");
599 if (test_ClosePrinter(p2, mem_ctx, handle)) {
600 printf("ERROR: Allowed close on secondary connection!\n");
604 if (p2->last_fault_code != DCERPC_FAULT_CONTEXT_MISMATCH) {
605 printf("Unexpected fault code 0x%x - expected 0x%x\n",
606 p2->last_fault_code, DCERPC_FAULT_CONTEXT_MISMATCH);
610 dcerpc_pipe_close(p2);
615 static BOOL test_OpenPrinter(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
619 struct spoolss_OpenPrinter r;
620 struct policy_handle handle;
624 blob = data_blob(NULL, 0);
626 r.in.server = talloc_asprintf(mem_ctx, "\\\\%s\\%s", dcerpc_server_name(p), name);
629 r.in.access_mask = SEC_RIGHTS_MAXIMUM_ALLOWED;
630 r.out.handle = &handle;
632 printf("\nTesting OpenPrinter(\\\\%s)\n", r.in.server);
634 status = dcerpc_spoolss_OpenPrinter(p, mem_ctx, &r);
635 if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) {
636 printf("OpenPrinter failed - %s/%s\n",
637 nt_errstr(status), win_errstr(r.out.result));
638 /* don't consider failing this an error until we understand it */
643 if (!test_GetPrinter(p, mem_ctx, &handle)) {
647 if (!test_SecondaryClosePrinter(p, mem_ctx, &handle)) {
651 if (!test_ClosePrinter(p, mem_ctx, &handle)) {
658 static BOOL call_OpenPrinterEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
659 const char *name, struct policy_handle *handle)
661 struct spoolss_OpenPrinterEx r;
662 struct spoolss_UserLevel1 userlevel1;
666 r.in.printername = talloc_asprintf(mem_ctx, "\\\\%s\\%s",
667 dcerpc_server_name(p), name);
669 r.in.printername = talloc_asprintf(mem_ctx, "\\\\%s",
670 dcerpc_server_name(p));
672 r.in.datatype = NULL;
673 r.in.devmode_ctr.size = 0;
674 r.in.devmode_ctr.devmode = NULL;
675 r.in.access_required = 0x02000000;
677 r.out.handle = handle;
679 userlevel1.size = 1234;
680 userlevel1.client = "hello";
681 userlevel1.user = "spottyfoot!";
682 userlevel1.build = 1;
683 userlevel1.major = 2;
684 userlevel1.minor = 3;
685 userlevel1.processor = 4;
686 r.in.userlevel.level1 = &userlevel1;
688 printf("Testing OpenPrinterEx(%s)\n", r.in.printername);
690 status = dcerpc_spoolss_OpenPrinterEx(p, mem_ctx, &r);
692 if (!NT_STATUS_IS_OK(status)) {
693 printf("OpenPrinterEx failed - %s\n", nt_errstr(status));
697 if (!W_ERROR_IS_OK(r.out.result)) {
698 printf("OpenPrinterEx failed - %s\n", win_errstr(r.out.result));
705 static BOOL test_OpenPrinterEx(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
708 struct policy_handle handle;
711 if (!call_OpenPrinterEx(p, mem_ctx, name, &handle)) {
715 if (!test_GetPrinter(p, mem_ctx, &handle)) {
719 if (!test_EnumForms(p, mem_ctx, &handle)) {
723 if (!test_AddForm(p, mem_ctx, &handle)) {
727 if (!test_EnumPrinterData(p, mem_ctx, &handle)) {
731 if (!test_EnumJobs(p, mem_ctx, &handle)) {
735 if (!test_SetPrinterData(p, mem_ctx, &handle)) {
739 if (!test_SecondaryClosePrinter(p, mem_ctx, &handle)) {
743 if (!test_ClosePrinter(p, mem_ctx, &handle)) {
750 static BOOL test_EnumPrinters(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
752 struct spoolss_EnumPrinters r;
754 uint16_t levels[] = {1, 2, 4, 5};
758 for (i=0;i<ARRAY_SIZE(levels);i++) {
759 uint32_t buf_size = 0;
760 union spoolss_PrinterInfo *info;
765 r.in.level = levels[i];
767 r.in.buf_size = &buf_size;
768 r.out.buf_size = &buf_size;
770 printf("\nTesting EnumPrinters level %u\n", r.in.level);
772 status = dcerpc_spoolss_EnumPrinters(p, mem_ctx, &r);
773 if (!NT_STATUS_IS_OK(status)) {
774 printf("EnumPrinters failed - %s\n", nt_errstr(status));
779 if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
780 DATA_BLOB blob = data_blob_talloc(mem_ctx, NULL, buf_size);
781 data_blob_clear(&blob);
783 status = dcerpc_spoolss_EnumPrinters(p, mem_ctx, &r);
786 if (!NT_STATUS_IS_OK(status) ||
787 !W_ERROR_IS_OK(r.out.result)) {
788 printf("EnumPrinters failed - %s/%s\n",
789 nt_errstr(status), win_errstr(r.out.result));
794 printf("No printers returned");
798 status = pull_spoolss_PrinterInfoArray(r.out.buffer, mem_ctx, r.in.level, r.out.count, &info);
799 if (!NT_STATUS_IS_OK(status)) {
800 printf("EnumPrintersArray parse failed - %s\n", nt_errstr(status));
804 for (j=0;j<r.out.count;j++) {
805 printf("Printer %d\n", j);
806 NDR_PRINT_UNION_DEBUG(spoolss_PrinterInfo, r.in.level, &info[j]);
809 for (j=0;j<r.out.count;j++) {
810 if (r.in.level == 1) {
811 /* the names appear to be comma-separated name lists? */
812 char *name = talloc_strdup(mem_ctx, info[j].info1.name);
813 char *comma = strchr(name, ',');
814 if (comma) *comma = 0;
815 if (!test_OpenPrinter(p, mem_ctx, name)) {
818 if (!test_OpenPrinterEx(p, mem_ctx, name)) {
828 static BOOL test_GetPrinterDriver2(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
829 struct policy_handle *handle, char *driver_name)
832 struct spoolss_GetPrinterDriver2 r;
835 r.in.handle = handle;
836 r.in.architecture = "W32X86";
839 r.in.buf_size = r.out.buf_size = &buf_size;
840 r.in.client_major_version = 0;
841 r.in.client_minor_version = 0;
843 printf("Testing GetPrinterDriver2\n");
845 status = dcerpc_spoolss_GetPrinterDriver2(p, mem_ctx, &r);
847 if (!NT_STATUS_IS_OK(status)) {
848 printf("GetPrinterDriver2 failed - %s\n", nt_errstr(status));
852 if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
853 status = dcerpc_spoolss_GetPrinterDriver2(p, mem_ctx, &r);
856 if (!NT_STATUS_IS_OK(status) ||
857 !W_ERROR_IS_OK(r.out.result)) {
858 printf("GetPrinterDriver2 failed - %s/%s\n",
859 nt_errstr(status), win_errstr(r.out.result));
866 static BOOL test_EnumPrinterDrivers(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
868 struct spoolss_EnumPrinterDrivers r;
870 uint16_t levels[] = {1, 2, 3};
874 for (i=0;i<ARRAY_SIZE(levels);i++) {
877 union spoolss_DriverInfo *info;
880 asprintf(&server, "\\\\%s", dcerpc_server_name(p));
881 r.in.server = server;
882 r.in.environment = "Windows NT x86";
883 r.in.level = levels[i];
886 r.in.buf_size = &buf_size;
887 r.out.buf_size = &buf_size;
889 printf("\nTesting EnumPrinterDrivers level %u\n", r.in.level);
891 status = dcerpc_spoolss_EnumPrinterDrivers(p, mem_ctx, &r);
893 if (!NT_STATUS_IS_OK(status)) {
894 printf("EnumPrinterDrivers failed - %s\n",
900 if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
901 DATA_BLOB blob = data_blob_talloc(
902 mem_ctx, NULL, buf_size);
904 data_blob_clear(&blob);
906 status = dcerpc_spoolss_EnumPrinterDrivers(
910 if (!NT_STATUS_IS_OK(status) ||
911 !W_ERROR_IS_OK(r.out.result)) {
912 printf("EnumPrinterDrivers failed - %s/%s\n",
913 nt_errstr(status), win_errstr(r.out.result));
918 printf("No printer drivers returned");
922 status = pull_spoolss_DriverInfoArray(
923 r.out.buffer, mem_ctx, r.in.level, r.out.count, &info);
925 if (!NT_STATUS_IS_OK(status)) {
926 printf("EnumPrinterDriverArray parse failed - %s\n",
931 for (j=0;j<r.out.count;j++) {
932 printf("Printer driver %d\n", j);
933 NDR_PRINT_UNION_DEBUG(
934 spoolss_DriverInfo, r.in.level,
937 if (r.in.level == 1) {
938 struct policy_handle handle;
940 if (!call_OpenPrinterEx(
945 test_GetPrinterDriver2(
947 info[j].info1.driver_name);
958 BOOL torture_rpc_spoolss(int dummy)
961 struct dcerpc_pipe *p;
965 mem_ctx = talloc_init("torture_rpc_spoolss");
967 status = torture_rpc_connection(&p,
970 DCERPC_SPOOLSS_VERSION);
971 if (!NT_STATUS_IS_OK(status)) {
975 if (!test_EnumPrinters(p, mem_ctx)) {
979 if (!test_EnumPrinterDrivers(p, mem_ctx)) {
983 talloc_destroy(mem_ctx);
985 torture_rpc_close(p);