From ecafd3754f35a2109a3a1eecbbdd72ade06b8502 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 20 Jul 2005 15:35:29 +0000 Subject: r8654: merging cli_spoolss_XX() updates from trunk (This used to be commit cd961e50a3029898868d21263ccacb7d5f1f07b9) --- source3/python/py_spoolss_printers.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'source3/python/py_spoolss_printers.c') 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; -- cgit