diff options
author | Tim Potter <tpot@samba.org> | 2002-11-07 01:12:24 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2002-11-07 01:12:24 +0000 |
commit | 3955716f90c317684093b43065c73167382137d4 (patch) | |
tree | 268de5b76a46687ab8e1549d0be185fde30475cb /source3/python/py_spoolss_printerdata.c | |
parent | ab1cf8d1cf447e85063b43b65fa05c8b4bfde2a9 (diff) | |
download | samba-3955716f90c317684093b43065c73167382137d4.tar.gz samba-3955716f90c317684093b43065c73167382137d4.tar.bz2 samba-3955716f90c317684093b43065c73167382137d4.zip |
Sync up python stuff from HEAD.
(This used to be commit 92c76e16fa40adc6148b9c11b3e377f35c464975)
Diffstat (limited to 'source3/python/py_spoolss_printerdata.c')
-rw-r--r-- | source3/python/py_spoolss_printerdata.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/source3/python/py_spoolss_printerdata.c b/source3/python/py_spoolss_printerdata.c index bacc870d9d..583d097e84 100644 --- a/source3/python/py_spoolss_printerdata.c +++ b/source3/python/py_spoolss_printerdata.c @@ -391,3 +391,59 @@ PyObject *spoolss_hnd_deleteprinterdataex(PyObject *self, PyObject *args, PyObje Py_INCREF(Py_None); return Py_None; } + +PyObject *spoolss_hnd_enumprinterkey(PyObject *self, PyObject *args, + PyObject *kw) +{ + spoolss_policy_hnd_object *hnd = (spoolss_policy_hnd_object *)self; + static char *kwlist[] = { "key", NULL }; + char *keyname; + WERROR werror; + uint32 needed, keylist_len; + uint16 *keylist; + PyObject *result; + + /* Parse parameters */ + + if (!PyArg_ParseTupleAndKeywords(args, kw, "s", kwlist, &keyname)) + return NULL; + + /* Call rpc function */ + + werror = cli_spoolss_enumprinterkey( + hnd->cli, hnd->mem_ctx, 0, &needed, &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; + } + + result = from_unistr_list(keylist); + + return result; +} + +#if 0 + +PyObject *spoolss_hnd_deleteprinterkey(PyObject *self, PyObject *args, + PyObject *kw) +{ + spoolss_policy_hnd_object *hnd = (spoolss_policy_hnd_object *)self; + static char *kwlist[] = { "key", NULL }; + char *keyname; + WERROR werror; + + if (!PyArg_ParseTupleAndKeywords(args, kw, "s", kwlist, &keyname)) + return NULL; + + Py_INCREF(Py_None); + return Py_None; +} + +#endif |