summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2002-01-07 03:33:46 +0000
committerTim Potter <tpot@samba.org>2002-01-07 03:33:46 +0000
commit9a02c6b4e8dcdd8bb6f2d394b1c5e9110c11a7a9 (patch)
treed2644bb8f7e680d7645577121df8cca6d9984e2e /source3/rpcclient
parent0094af05edc7a2fcfd672f6fb0d930b5906482a0 (diff)
downloadsamba-9a02c6b4e8dcdd8bb6f2d394b1c5e9110c11a7a9.tar.gz
samba-9a02c6b4e8dcdd8bb6f2d394b1c5e9110c11a7a9.tar.bz2
samba-9a02c6b4e8dcdd8bb6f2d394b1c5e9110c11a7a9.zip
Converted getprinterdriver to WERROR - it always returns dos error 6
(invalid handle) though. )-: (This used to be commit 7bfd1f35e4e194f8a2f07046e4a6c005c256c05b)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_spoolss.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/source3/rpcclient/cmd_spoolss.c b/source3/rpcclient/cmd_spoolss.c
index a945e11722..ed65632344 100644
--- a/source3/rpcclient/cmd_spoolss.c
+++ b/source3/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;