summaryrefslogtreecommitdiff
path: root/source3/python/py_spoolss_printers.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/python/py_spoolss_printers.c')
-rw-r--r--source3/python/py_spoolss_printers.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/source3/python/py_spoolss_printers.c b/source3/python/py_spoolss_printers.c
index 7446e2d282..aab2d634a3 100644
--- a/source3/python/py_spoolss_printers.c
+++ b/source3/python/py_spoolss_printers.c
@@ -127,7 +127,6 @@ PyObject *spoolss_hnd_getprinter(PyObject *self, PyObject *args, PyObject *kw)
PyObject *result = NULL;
PRINTER_INFO_CTR ctr;
int level = 1;
- uint32 needed;
static char *kwlist[] = {"level", NULL};
/* Parse parameters */
@@ -140,12 +139,7 @@ PyObject *spoolss_hnd_getprinter(PyObject *self, PyObject *args, PyObject *kw)
/* Call rpc function */
werror = cli_spoolss_getprinter(
- hnd->cli, hnd->mem_ctx, 0, &needed, &hnd->pol, level, &ctr);
-
- if (W_ERROR_V(werror) == ERRinsufficientbuffer)
- werror = cli_spoolss_getprinter(
- hnd->cli, hnd->mem_ctx, needed, NULL, &hnd->pol,
- level, &ctr);
+ hnd->cli, hnd->mem_ctx, &hnd->pol, level, &ctr);
/* Return value */
@@ -277,7 +271,7 @@ PyObject *spoolss_enumprinters(PyObject *self, PyObject *args, PyObject *kw)
PyObject *result = NULL, *creds = NULL;
PRINTER_INFO_CTR ctr;
int level = 1, flags = PRINTER_ENUM_LOCAL, i;
- uint32 needed, num_printers;
+ uint32 num_printers;
static char *kwlist[] = {"server", "name", "level", "flags",
"creds", NULL};
TALLOC_CTX *mem_ctx = NULL;
@@ -331,15 +325,9 @@ PyObject *spoolss_enumprinters(PyObject *self, PyObject *args, PyObject *kw)
/* Call rpc function */
- werror = cli_spoolss_enum_printers(
- cli, mem_ctx, 0, &needed, name, flags, level,
+ werror = cli_spoolss_enum_printers(cli, mem_ctx, name, flags, level,
&num_printers, &ctr);
- if (W_ERROR_V(werror) == ERRinsufficientbuffer)
- werror = cli_spoolss_enum_printers(
- cli, mem_ctx, needed, NULL, name, flags,
- level, &num_printers, &ctr);
-
if (!W_ERROR_IS_OK(werror)) {
PyErr_SetObject(spoolss_werror, py_werror_tuple(werror));
goto done;