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_printerdata.c | 35 ++++++--------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) (limited to 'source3/python/py_spoolss_printerdata.c') diff --git a/source3/python/py_spoolss_printerdata.c b/source3/python/py_spoolss_printerdata.c index f165475b08..6fc4227ad2 100644 --- a/source3/python/py_spoolss_printerdata.c +++ b/source3/python/py_spoolss_printerdata.c @@ -112,7 +112,6 @@ PyObject *spoolss_hnd_getprinterdata(PyObject *self, PyObject *args, PyObject *k static char *kwlist[] = { "value", NULL }; char *valuename; WERROR werror; - uint32 needed; PyObject *result; REGISTRY_VALUE value; @@ -124,14 +123,9 @@ PyObject *spoolss_hnd_getprinterdata(PyObject *self, PyObject *args, PyObject *k /* Call rpc function */ werror = cli_spoolss_getprinterdata( - hnd->cli, hnd->mem_ctx, 0, &needed, &hnd->pol, valuename, + hnd->cli, hnd->mem_ctx, &hnd->pol, valuename, &value); - if (W_ERROR_V(werror) == ERRmoredata) - werror = cli_spoolss_getprinterdata( - hnd->cli, hnd->mem_ctx, needed, NULL, &hnd->pol, - valuename, &value); - if (!W_ERROR_IS_OK(werror)) { PyErr_SetObject(spoolss_werror, py_werror_tuple(werror)); return NULL; @@ -255,7 +249,6 @@ PyObject *spoolss_hnd_getprinterdataex(PyObject *self, PyObject *args, PyObject static char *kwlist[] = { "key", "value", NULL }; char *key, *valuename; WERROR werror; - uint32 needed; PyObject *result; REGISTRY_VALUE value; @@ -267,14 +260,9 @@ PyObject *spoolss_hnd_getprinterdataex(PyObject *self, PyObject *args, PyObject /* Call rpc function */ werror = cli_spoolss_getprinterdataex( - hnd->cli, hnd->mem_ctx, 0, &needed, &hnd->pol, key, + hnd->cli, hnd->mem_ctx, &hnd->pol, key, valuename, &value); - if (W_ERROR_V(werror) == ERRmoredata) - werror = cli_spoolss_getprinterdataex( - hnd->cli, hnd->mem_ctx, needed, NULL, &hnd->pol, key, - valuename, &value); - if (!W_ERROR_IS_OK(werror)) { PyErr_SetObject(spoolss_werror, py_werror_tuple(werror)); return NULL; @@ -323,7 +311,7 @@ PyObject *spoolss_hnd_enumprinterdataex(PyObject *self, PyObject *args, PyObject { spoolss_policy_hnd_object *hnd = (spoolss_policy_hnd_object *)self; static char *kwlist[] = { "key", NULL }; - uint32 needed, i; + uint32 i; char *key; WERROR werror; PyObject *result; @@ -334,13 +322,7 @@ PyObject *spoolss_hnd_enumprinterdataex(PyObject *self, PyObject *args, PyObject /* Get max buffer sizes for value and data */ - werror = cli_spoolss_enumprinterdataex( - hnd->cli, hnd->mem_ctx, 0, &needed, &hnd->pol, key, &ctr); - - if (W_ERROR_V(werror) == ERRmoredata) - werror = cli_spoolss_enumprinterdataex( - hnd->cli, hnd->mem_ctx, needed, NULL, &hnd->pol, key, - &ctr); + werror = cli_spoolss_enumprinterdataex(hnd->cli, hnd->mem_ctx, &hnd->pol, key, &ctr); if (!W_ERROR_IS_OK(werror)) { PyErr_SetObject(spoolss_werror, py_werror_tuple(werror)); @@ -400,7 +382,7 @@ PyObject *spoolss_hnd_enumprinterkey(PyObject *self, PyObject *args, static char *kwlist[] = { "key", NULL }; char *keyname; WERROR werror; - uint32 needed, keylist_len; + uint32 keylist_len; uint16 *keylist; PyObject *result; @@ -412,14 +394,9 @@ PyObject *spoolss_hnd_enumprinterkey(PyObject *self, PyObject *args, /* Call rpc function */ werror = cli_spoolss_enumprinterkey( - hnd->cli, hnd->mem_ctx, 0, &needed, &hnd->pol, + hnd->cli, hnd->mem_ctx, &hnd->pol, keyname, &keylist, &keylist_len); - if (W_ERROR_V(werror) == ERRmoredata) - werror = cli_spoolss_enumprinterkey( - hnd->cli, hnd->mem_ctx, needed, NULL, &hnd->pol, - keyname, &keylist, &keylist_len); - if (!W_ERROR_IS_OK(werror)) { PyErr_SetObject(spoolss_werror, py_werror_tuple(werror)); return NULL; -- cgit