diff options
author | Tim Potter <tpot@samba.org> | 2002-01-07 03:33:46 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-01-07 03:33:46 +0000 |
commit | 7bfd1f35e4e194f8a2f07046e4a6c005c256c05b (patch) | |
tree | 40f2898989ad7c3cd51cc7d46e9f96681f148ffd /source/rpcclient | |
parent | dfcc97a15837e2d13561e023ad5a7532faa441b8 (diff) | |
download | samba-7bfd1f35e4e194f8a2f07046e4a6c005c256c05b.tar.gz samba-7bfd1f35e4e194f8a2f07046e4a6c005c256c05b.tar.xz samba-7bfd1f35e4e194f8a2f07046e4a6c005c256c05b.zip |
Converted getprinterdriver to WERROR - it always returns dos error 6
(invalid handle) though. )-:
Diffstat (limited to 'source/rpcclient')
-rw-r--r-- | source/rpcclient/cmd_spoolss.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/source/rpcclient/cmd_spoolss.c b/source/rpcclient/cmd_spoolss.c index a945e117225..ed656323440 100644 --- a/source/rpcclient/cmd_spoolss.c +++ b/source/rpcclient/cmd_spoolss.c @@ -663,7 +663,7 @@ static NTSTATUS cmd_spoolss_getdriver(struct cli_state *cli, /* Open a printer handle */ werror = cli_spoolss_open_printer_ex(cli, mem_ctx, printername, "", - MAXIMUM_ALLOWED_ACCESS, + PRINTER_ACCESS_USE, servername, user, &pol); result = werror_to_ntstatus(werror); @@ -676,19 +676,25 @@ static NTSTATUS cmd_spoolss_getdriver(struct cli_state *cli, opened_hnd = True; /* loop through and print driver info level for each architecture */ - for (i=0; archi_table[i].long_archi!=NULL; i++) - { - result = cli_spoolss_getprinterdriver(cli, mem_ctx, &pol, info_level, - archi_table[i].long_archi, &ctr); - if (!NT_STATUS_IS_OK(result)) { - continue; - } + for (i=0; archi_table[i].long_archi!=NULL; i++) { + uint32 needed; + + werror = cli_spoolss_getprinterdriver( + cli, mem_ctx, 0, &needed, &pol, info_level, + archi_table[i].long_archi, &ctr); + + if (W_ERROR_V(werror) == ERRinsufficientbuffer) + werror = cli_spoolss_getprinterdriver( + cli, mem_ctx, needed, NULL, &pol, info_level, + archi_table[i].long_archi, &ctr); + + if (!W_ERROR_IS_OK(werror)) + continue; printf ("\n[%s]\n", archi_table[i].long_archi); - switch (info_level) - { - + + switch (info_level) { case 1: display_print_driver_1 (ctr.info1); break; |