diff options
author | Gerald Carter <jerry@samba.org> | 2005-07-20 15:35:29 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:00:14 -0500 |
commit | ecafd3754f35a2109a3a1eecbbdd72ade06b8502 (patch) | |
tree | d442ae80d7f93acd21ae2a4d35fcfc3c0f80f3e6 /source3/utils | |
parent | b0f1c8df1641bf0e1c53750f4cc126d7b1e21159 (diff) | |
download | samba-ecafd3754f35a2109a3a1eecbbdd72ade06b8502.tar.gz samba-ecafd3754f35a2109a3a1eecbbdd72ade06b8502.tar.bz2 samba-ecafd3754f35a2109a3a1eecbbdd72ade06b8502.zip |
r8654: merging cli_spoolss_XX() updates from trunk
(This used to be commit cd961e50a3029898868d21263ccacb7d5f1f07b9)
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_rpc_printer.c | 60 |
1 files changed, 7 insertions, 53 deletions
diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index 4185f805ee..e2080cdc28 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -817,19 +817,11 @@ net_spoolss_enum_printers(struct cli_state *cli, TALLOC_CTX *mem_ctx, { WERROR result; - uint32 needed; /* enum printers */ - result = cli_spoolss_enum_printers( - cli, mem_ctx, 0, &needed, name, flags, + result = cli_spoolss_enum_printers(cli, mem_ctx, name, flags, level, num_printers, ctr); - if (W_ERROR_V(result) == W_ERROR_V(WERR_INSUFFICIENT_BUFFER)) - result = cli_spoolss_enum_printers( - cli, mem_ctx, needed, NULL, name, flags, - level, num_printers, ctr); - - if (!W_ERROR_IS_OK(result)) { printf("cannot enum printers: %s\n", dos_errstr(result)); return False; @@ -887,16 +879,10 @@ net_spoolss_getprinter(struct cli_state *cli, TALLOC_CTX *mem_ctx, PRINTER_INFO_CTR *ctr) { WERROR result; - uint32 needed; /* getprinter call */ - result = cli_spoolss_getprinter(cli, - mem_ctx, 0, &needed, hnd, level, ctr); + result = cli_spoolss_getprinter(cli, mem_ctx, hnd, level, ctr); - if (W_ERROR_V(result) == W_ERROR_V(WERR_INSUFFICIENT_BUFFER)) - result = cli_spoolss_getprinter(cli, - mem_ctx, needed, NULL, hnd, level, ctr); - if (!W_ERROR_IS_OK(result)) { printf("cannot get printer-info: %s\n", dos_errstr(result)); return False; @@ -949,17 +935,10 @@ net_spoolss_enumprinterkey(struct cli_state *cli, TALLOC_CTX *mem_ctx, uint16 **keylist) { WERROR result; - uint32 needed, len; /* enumprinterkey call */ - result = cli_spoolss_enumprinterkey( - cli, mem_ctx, 0, &needed, hnd, keyname, NULL, NULL); + result = cli_spoolss_enumprinterkey(cli, mem_ctx, hnd, keyname, NULL, NULL); - if (W_ERROR_V(result) == W_ERROR_V(WERR_MORE_DATA)) - result = cli_spoolss_enumprinterkey( - cli, mem_ctx, needed, NULL, hnd, keyname, keylist, - &len); - if (!W_ERROR_IS_OK(result)) { printf("enumprinterkey failed: %s\n", dos_errstr(result)); return False; @@ -976,16 +955,10 @@ net_spoolss_enumprinterdataex(struct cli_state *cli, TALLOC_CTX *mem_ctx, REGVAL_CTR *ctr) { WERROR result; - uint32 needed; /* enumprinterdataex call */ - result = cli_spoolss_enumprinterdataex( - cli, mem_ctx, 0, &needed, hnd, keyname, ctr); + result = cli_spoolss_enumprinterdataex(cli, mem_ctx, hnd, keyname, ctr); - if (W_ERROR_V(result) == W_ERROR_V(WERR_MORE_DATA)) - result = cli_spoolss_enumprinterdataex( - cli, mem_ctx, needed, NULL, hnd, keyname, ctr); - if (!W_ERROR_IS_OK(result)) { printf("enumprinterdataex failed: %s\n", dos_errstr(result)); return False; @@ -1022,16 +995,9 @@ net_spoolss_enumforms(struct cli_state *cli, TALLOC_CTX *mem_ctx, { WERROR result; - uint32 needed; /* enumforms call */ - result = cli_spoolss_enumforms( - cli, mem_ctx, 0, &needed, hnd, level, num_forms, forms); - - if (W_ERROR_V(result) == W_ERROR_V(WERR_INSUFFICIENT_BUFFER)) - result = cli_spoolss_enumforms( - cli, mem_ctx, needed, NULL, hnd, level, - num_forms, forms); + result = cli_spoolss_enumforms(cli, mem_ctx, hnd, level, num_forms, forms); if (!W_ERROR_IS_OK(result)) { printf("could not enum forms: %s\n", dos_errstr(result)); @@ -1049,18 +1015,12 @@ net_spoolss_enumprinterdrivers (struct cli_state *cli, TALLOC_CTX *mem_ctx, PRINTER_DRIVER_CTR *ctr) { WERROR result; - uint32 needed; /* enumprinterdrivers call */ result = cli_spoolss_enumprinterdrivers( - cli, mem_ctx, 0, &needed, level, + cli, mem_ctx, level, env, num_drivers, ctr); - if (W_ERROR_V(result) == W_ERROR_V(WERR_INSUFFICIENT_BUFFER)) - result = cli_spoolss_enumprinterdrivers( - cli, mem_ctx, needed, NULL, level, - env, num_drivers, ctr); - if (!W_ERROR_IS_OK(result)) { printf("cannot enum drivers: %s\n", dos_errstr(result)); return False; @@ -1078,18 +1038,12 @@ net_spoolss_getprinterdriver(struct cli_state *cli, PRINTER_DRIVER_CTR *ctr) { WERROR result; - uint32 needed; /* getprinterdriver call */ result = cli_spoolss_getprinterdriver( - cli, mem_ctx, 0, &needed, hnd, level, + cli, mem_ctx, hnd, level, env, version, ctr); - if (W_ERROR_V(result) == W_ERROR_V(WERR_INSUFFICIENT_BUFFER)) - result = cli_spoolss_getprinterdriver( - cli, mem_ctx, needed, NULL, hnd, level, - env, version, ctr); - if (!W_ERROR_IS_OK(result)) { DEBUG(1,("cannot get driver (for architecture: %s): %s\n", env, dos_errstr(result))); |