From b66111f9ba0c1286725a591e7584acc9805b5081 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Wed, 27 Mar 2002 05:28:42 +0000 Subject: Moved pyconv definitions across. Fixed misc compile problems. (This used to be commit 723bfa1a857b4c3e114b7e510c8f991ba73c1ba1) --- source3/python/py_spoolss_ports.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/source3/python/py_spoolss_ports.c b/source3/python/py_spoolss_ports.c index c6cd14279e..1064f3f3d2 100644 --- a/source3/python/py_spoolss_ports.c +++ b/source3/python/py_spoolss_ports.c @@ -24,14 +24,29 @@ #include "python/py_conv.h" #include "python/py_spoolss.h" +struct pyconv py_PORT_INFO_1[] = { + { "name", PY_UNISTR, offsetof(PORT_INFO_1, port_name) }, + { NULL } +}; + +struct pyconv py_PORT_INFO_2[] = { + { "name", PY_UNISTR, offsetof(PORT_INFO_2, port_name) }, + { "monitor_name", PY_UNISTR, offsetof(PORT_INFO_2, monitor_name) }, + { "description", PY_UNISTR, offsetof(PORT_INFO_2, description) }, + { "reserved", PY_UINT32, offsetof(PORT_INFO_2, reserved) }, + { "type", PY_UINT32, offsetof(PORT_INFO_2, port_type) }, + { NULL } +}; + /* Enumerate ports */ -PyObject *spoolss_enumports(PyObject *self, PyObject *args, PyObject *kw) +static PyObject *spoolss_enumports(PyObject *self, PyObject *args, + PyObject *kw) { WERROR werror; PyObject *result, *creds = NULL; int level = 1; - uint32 needed; + uint32 i, needed, num_ports; static char *kwlist[] = {"server", "level", "creds", NULL}; TALLOC_CTX *mem_ctx = NULL; struct cli_state *cli = NULL; @@ -76,7 +91,7 @@ PyObject *spoolss_enumports(PyObject *self, PyObject *args, PyObject *kw) PyObject *value; value = from_struct ( - &ctr.port.info_1[i], py_PORT_INFO_0); + &ctr.port.info_1[i], py_PORT_INFO_1); PyList_SetItem(result, i, value); } @@ -87,7 +102,7 @@ PyObject *spoolss_enumports(PyObject *self, PyObject *args, PyObject *kw) PyObject *value; value = from_struct( - &ctr.port.info_2[i], py_PORT_INFO_1); + &ctr.port.info_2[i], py_PORT_INFO_2); PyList_SetItem(result, i, value); } -- cgit