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/python/py_spoolss_printerdata.c | |
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/python/py_spoolss_printerdata.c')
-rw-r--r-- | source3/python/py_spoolss_printerdata.c | 35 |
1 files changed, 6 insertions, 29 deletions
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; |