486
468
tmp_ctx = talloc_zero(tctx, struct test_spoolss_win_context);
488
470
ret &= test_OpenPrinterSequence(tctx, p, &handle01);
489
ret &= test_GetPrinterData(tctx, p, &handle01,"UISingleJobStatusString",
471
ret &= test_GetPrinterData(tctx, b, &handle01,"UISingleJobStatusString",
490
472
WERR_INVALID_PARAM, 0);
491
473
torture_comment(tctx, "Skip RemoteFindNextPrinterChangeNotifyEx test\n");
493
475
server_name = talloc_asprintf(ctx, "\\\\%s", dcerpc_server_name(p));
494
ret &= test_OpenPrinterEx(tctx, p, &unused_handle1, server_name, 0);
476
ret &= test_OpenPrinterEx(tctx, b, &unused_handle1, server_name, 0);
496
478
ret &= test_EnumPrinters(tctx, p, ctx, 1024);
498
ret &= test_OpenPrinterEx(tctx, p, &handle02, server_name, 0);
499
ret &= test_GetPrinterData(tctx, p, &handle02, "MajorVersion", WERR_OK,
480
ret &= test_OpenPrinterEx(tctx, b, &handle02, server_name, 0);
481
ret &= test_GetPrinterData(tctx, b, &handle02, "MajorVersion", WERR_OK,
501
ret &= test_ClosePrinter(tctx, p, &handle02);
483
ret &= test_ClosePrinter(tctx, b, &handle02);
503
485
/* If no printers were found, skip all tests that need a printer */
504
486
if (ctx->printer_count == 0) {
505
487
goto end_testWinXP;
508
ret &= test_OpenPrinterEx(tctx, p, &handle02,
490
ret &= test_OpenPrinterEx(tctx, b, &handle02,
509
491
ctx->printer_info[0].info2.printername,
510
492
PRINTER_ACCESS_USE);
511
ret &= test_GetPrinter(tctx, p, &handle02, ctx, 2, 0);
493
ret &= test_GetPrinter(tctx, b, &handle02, ctx, 2, 0);
513
495
torture_assert_str_equal(tctx, ctx->current_info->info2.printername,
514
496
ctx->printer_info[0].info2.printername,
515
497
"GetPrinter returned unexpected printername");
516
498
/*FIXME: Test more components of the PrinterInfo2 struct */
518
ret &= test_OpenPrinterEx(tctx, p, &handle03,
519
ctx->printer_info[0].info2.printername, 0);
520
ret &= test_GetPrinter(tctx, p, &handle03, ctx, 0, 1164);
521
ret &= test_GetPrinter(tctx, p, &handle03, ctx, 2, 0);
523
ret &= test_OpenPrinterEx(tctx, p, &handle04,
524
ctx->printer_info[0].info2.printername, 0);
525
ret &= test_GetPrinter(tctx, p, &handle04, ctx, 2, 0);
526
ret &= test_ClosePrinter(tctx, p, &handle04);
528
ret &= test_OpenPrinterEx(tctx, p, &handle04,
529
ctx->printer_info[0].info2.printername, 0);
530
ret &= test_GetPrinter(tctx, p, &handle04, ctx, 2, 4096);
531
ret &= test_ClosePrinter(tctx, p, &handle04);
533
ret &= test_OpenPrinterAsAdmin(tctx, p,
500
ret &= test_OpenPrinterEx(tctx, b, &handle03,
501
ctx->printer_info[0].info2.printername, 0);
502
ret &= test_GetPrinter(tctx, b, &handle03, ctx, 0, 1164);
503
ret &= test_GetPrinter(tctx, b, &handle03, ctx, 2, 0);
505
ret &= test_OpenPrinterEx(tctx, b, &handle04,
506
ctx->printer_info[0].info2.printername, 0);
507
ret &= test_GetPrinter(tctx, b, &handle04, ctx, 2, 0);
508
ret &= test_ClosePrinter(tctx, b, &handle04);
510
ret &= test_OpenPrinterEx(tctx, b, &handle04,
511
ctx->printer_info[0].info2.printername, 0);
512
ret &= test_GetPrinter(tctx, b, &handle04, ctx, 2, 4096);
513
ret &= test_ClosePrinter(tctx, b, &handle04);
515
ret &= test_OpenPrinterAsAdmin(tctx, b,
534
516
ctx->printer_info[0].info2.printername);
536
ret &= test_OpenPrinterEx(tctx, p, &handle04,
518
ret &= test_OpenPrinterEx(tctx, b, &handle04,
537
519
ctx->printer_info[0].info2.printername, PRINTER_READ);
538
ret &= test_GetPrinterData(tctx, p, &handle04,"UISingleJobStatusString",
520
ret &= test_GetPrinterData(tctx, b, &handle04,"UISingleJobStatusString",
539
521
WERR_BADFILE, 0);
540
522
torture_comment(tctx, "Skip RemoteFindNextPrinterChangeNotifyEx test\n");
542
ret &= test_OpenPrinterEx(tctx, p, &unused_handle2,
524
ret &= test_OpenPrinterEx(tctx, b, &unused_handle2,
543
525
ctx->printer_info[0].info2.printername, 0);
545
ret &= test_EnumJobs(tctx, p, &handle04);
546
ret &= test_GetPrinter(tctx, p, &handle04, ctx, 2, 4096);
527
ret &= test_EnumJobs(tctx, b, &handle04);
528
ret &= test_GetPrinter(tctx, b, &handle04, ctx, 2, 4096);
548
ret &= test_ClosePrinter(tctx, p, &unused_handle2);
549
ret &= test_ClosePrinter(tctx, p, &handle04);
530
ret &= test_ClosePrinter(tctx, b, &unused_handle2);
531
ret &= test_ClosePrinter(tctx, b, &handle04);
551
533
ret &= test_EnumPrinters(tctx, p, ctx, 1556);
552
ret &= test_GetPrinterDriver2(tctx, p, ctx, &handle03);
553
ret &= test_EnumForms(tctx, p, &handle03, 0);
534
ret &= test_GetPrinterDriver2(tctx, b, ctx, &handle03);
535
ret &= test_EnumForms(tctx, b, &handle03, 0);
555
ret &= test_EnumPrinterKey(tctx, p, &handle03, "", ctx);
537
ret &= test_EnumPrinterKey(tctx, b, &handle03, "", ctx);
557
539
for (i=0; ctx->printer_keys && ctx->printer_keys[i] != NULL; i++) {
559
ret &= test_EnumPrinterKey(tctx, p, &handle03,
541
ret &= test_EnumPrinterKey(tctx, b, &handle03,
560
542
ctx->printer_keys[i],
562
ret &= test_EnumPrinterDataEx(tctx, p, &handle03,
544
ret &= test_EnumPrinterDataEx(tctx, b, &handle03,
563
545
ctx->printer_keys[i], 0,
567
ret &= test_EnumPrinterDataEx(tctx, p, &handle03, "", 0,
549
ret &= test_EnumPrinterDataEx(tctx, b, &handle03, "", 0,
568
550
WERR_INVALID_PARAM);
570
ret &= test_GetPrinter(tctx, p, &handle03, tmp_ctx, 2, 0);
572
ret &= test_OpenPrinterEx(tctx, p, &unused_handle2,
573
ctx->printer_info[0].info2.printername, 0);
574
ret &= test_ClosePrinter(tctx, p, &unused_handle2);
576
ret &= test_GetPrinter(tctx, p, &handle03, tmp_ctx, 2, 2556);
578
ret &= test_OpenPrinterEx(tctx, p, &unused_handle2,
579
ctx->printer_info[0].info2.printername, 0);
580
ret &= test_ClosePrinter(tctx, p, &unused_handle2);
582
ret &= test_OpenPrinterEx(tctx, p, &unused_handle2,
583
ctx->printer_info[0].info2.printername, 0);
584
ret &= test_ClosePrinter(tctx, p, &unused_handle2);
586
ret &= test_GetPrinter(tctx, p, &handle03, tmp_ctx, 7, 0);
588
ret &= test_OpenPrinterEx(tctx, p, &unused_handle2,
589
ctx->printer_info[0].info2.printername, 0);
590
ret &= test_ClosePrinter(tctx, p, &unused_handle2);
592
ret &= test_ClosePrinter(tctx, p, &handle03);
594
ret &= test_OpenPrinterEx(tctx, p, &unused_handle2,
595
ctx->printer_info[0].info2.printername, 0);
596
ret &= test_ClosePrinter(tctx, p, &unused_handle2);
598
ret &= test_OpenPrinterEx(tctx, p, &handle03, server_name, 0);
599
ret &= test_GetPrinterData(tctx, p, &handle03, "W3SvcInstalled",
552
ret &= test_GetPrinter(tctx, b, &handle03, tmp_ctx, 2, 0);
554
ret &= test_OpenPrinterEx(tctx, b, &unused_handle2,
555
ctx->printer_info[0].info2.printername, 0);
556
ret &= test_ClosePrinter(tctx, b, &unused_handle2);
558
ret &= test_GetPrinter(tctx, b, &handle03, tmp_ctx, 2, 2556);
560
ret &= test_OpenPrinterEx(tctx, b, &unused_handle2,
561
ctx->printer_info[0].info2.printername, 0);
562
ret &= test_ClosePrinter(tctx, b, &unused_handle2);
564
ret &= test_OpenPrinterEx(tctx, b, &unused_handle2,
565
ctx->printer_info[0].info2.printername, 0);
566
ret &= test_ClosePrinter(tctx, b, &unused_handle2);
568
ret &= test_GetPrinter(tctx, b, &handle03, tmp_ctx, 7, 0);
570
ret &= test_OpenPrinterEx(tctx, b, &unused_handle2,
571
ctx->printer_info[0].info2.printername, 0);
572
ret &= test_ClosePrinter(tctx, b, &unused_handle2);
574
ret &= test_ClosePrinter(tctx, b, &handle03);
576
ret &= test_OpenPrinterEx(tctx, b, &unused_handle2,
577
ctx->printer_info[0].info2.printername, 0);
578
ret &= test_ClosePrinter(tctx, b, &unused_handle2);
580
ret &= test_OpenPrinterEx(tctx, b, &handle03, server_name, 0);
581
ret &= test_GetPrinterData(tctx, b, &handle03, "W3SvcInstalled",
601
ret &= test_ClosePrinter(tctx, p, &handle03);
603
ret &= test_ClosePrinter(tctx, p, &unused_handle1);
604
ret &= test_ClosePrinter(tctx, p, &handle02);
606
ret &= test_OpenPrinterEx(tctx, p, &handle02,
583
ret &= test_ClosePrinter(tctx, b, &handle03);
585
ret &= test_ClosePrinter(tctx, b, &unused_handle1);
586
ret &= test_ClosePrinter(tctx, b, &handle02);
588
ret &= test_OpenPrinterEx(tctx, b, &handle02,
607
589
ctx->printer_info[0].info2.sharename, 0);
608
ret &= test_GetPrinter(tctx, p, &handle02, tmp_ctx, 2, 0);
609
ret &= test_ClosePrinter(tctx, p, &handle02);
590
ret &= test_GetPrinter(tctx, b, &handle02, tmp_ctx, 2, 0);
591
ret &= test_ClosePrinter(tctx, b, &handle02);
612
ret &= test_ClosePrinter(tctx, p, &handle01);
594
ret &= test_ClosePrinter(tctx, b, &handle01);
614
596
talloc_free(tmp_ctx);
615
597
talloc_free(ctx);