summaryrefslogtreecommitdiff
path: root/source/libads/ldap_printer.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/libads/ldap_printer.c')
-rw-r--r--source/libads/ldap_printer.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/source/libads/ldap_printer.c b/source/libads/ldap_printer.c
index 68e67358910..9773296ae08 100644
--- a/source/libads/ldap_printer.c
+++ b/source/libads/ldap_printer.c
@@ -55,7 +55,7 @@ ADS_STATUS ads_find_printer_on_server(ADS_STRUCT *ads, void **res,
ADS_STATUS ads_find_printers(ADS_STRUCT *ads, void **res)
{
- char *ldap_expr;
+ const char *ldap_expr;
const char *attrs[] = { "objectClass", "printerName", "location", "driverName",
"serverName", "description", NULL };
@@ -267,7 +267,7 @@ WERROR get_remote_printer_publishing_data(struct cli_state *cli,
char *printername, *servername;
REGVAL_CTR dsdriver_ctr, dsspooler_ctr;
BOOL got_dsdriver = False, got_dsspooler = False;
- uint32 needed, i;
+ uint32 i;
POLICY_HND pol;
asprintf(&servername, "\\\\%s", cli->desthost);
@@ -286,14 +286,7 @@ WERROR get_remote_printer_publishing_data(struct cli_state *cli,
return result;
}
- result = cli_spoolss_enumprinterdataex(cli, mem_ctx, 0, &needed,
- &pol, SPOOL_DSDRIVER_KEY, NULL);
-
- if (W_ERROR_V(result) == ERRmoredata)
- result = cli_spoolss_enumprinterdataex(cli, mem_ctx, needed,
- NULL, &pol,
- SPOOL_DSDRIVER_KEY,
- &dsdriver_ctr);
+ result = cli_spoolss_enumprinterdataex(cli, mem_ctx, &pol, SPOOL_DSDRIVER_KEY, NULL);
if (!W_ERROR_IS_OK(result)) {
DEBUG(3, ("Unable to do enumdataex on %s, error is %s.\n",
@@ -307,15 +300,7 @@ WERROR get_remote_printer_publishing_data(struct cli_state *cli,
dsdriver_ctr.values[i]);
}
- result = cli_spoolss_enumprinterdataex(cli, mem_ctx, 0, &needed,
- &pol, SPOOL_DSSPOOLER_KEY,
- NULL);
-
- if (W_ERROR_V(result) == ERRmoredata)
- result = cli_spoolss_enumprinterdataex(cli, mem_ctx, needed,
- NULL, &pol,
- SPOOL_DSSPOOLER_KEY,
- &dsspooler_ctr);
+ result = cli_spoolss_enumprinterdataex(cli, mem_ctx, &pol, SPOOL_DSSPOOLER_KEY, NULL);
if (!W_ERROR_IS_OK(result)) {
DEBUG(3, ("Unable to do enumdataex on %s, error is %s.\n",