diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-09-12 19:55:49 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-09-15 17:40:19 +0200 |
commit | 54437f1e8a9274cb7afa3b850d709568414dff71 (patch) | |
tree | 9c5aa6af128b870fd602a9f882405d035ce45148 /source4/lib/wmi/pywmi.i | |
parent | b91a7fa1661e03549c3526a408f053bd16e06afa (diff) | |
download | samba-54437f1e8a9274cb7afa3b850d709568414dff71.tar.gz samba-54437f1e8a9274cb7afa3b850d709568414dff71.tar.bz2 samba-54437f1e8a9274cb7afa3b850d709568414dff71.zip |
More improvements.
Diffstat (limited to 'source4/lib/wmi/pywmi.i')
-rw-r--r-- | source4/lib/wmi/pywmi.i | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/source4/lib/wmi/pywmi.i b/source4/lib/wmi/pywmi.i index c1114c3cee..1889e774ae 100644 --- a/source4/lib/wmi/pywmi.i +++ b/source4/lib/wmi/pywmi.i @@ -22,6 +22,8 @@ %include "typemaps.i" %import "stdint.i" +%import "libcli/util/errors.i" +%import "lib/talloc/talloc.i" %runtime %{ void push_object(PyObject **stack, PyObject *o) @@ -59,7 +61,6 @@ WERROR WBEM_ConnectServer(struct com_context *ctx, const char *server, const cha WERROR IEnumWbemClassObject_SmartNext(struct IEnumWbemClassObject *d, TALLOC_CTX *mem_ctx, int32_t lTimeout,uint32_t uCount, struct WbemClassObject **apObjects, uint32_t *puReturned); -static PyObject *PyErr_SetFromWERROR(WERROR w); static PyObject *PyObject_FromCVAR(uint32_t cimtype, union CIMVAR *cvar); static PyObject *PySWbemObject_FromWbemClassObject(struct WbemClassObject *wco); @@ -240,23 +241,10 @@ static PyObject *PySWbemObject_FromWbemClassObject(struct WbemClassObject *wco) %} -%typemap(out) WERROR { - if (!W_ERROR_IS_OK($1)) { - PyErr_SetFromWERROR($1); - return NULL; - } - $result = Py_None; - Py_INCREF(Py_None); -} - %typemap(in, numinputs=0) struct com_context *ctx { $1 = com_ctx; } -%typemap(in, numinputs=0) TALLOC_CTX *mem_ctx { - $1 = NULL; -} - %typemap(in, numinputs=0) struct IWbemServices **services (struct IWbemServices *temp) { $1 = &temp; } @@ -329,14 +317,6 @@ WERROR IEnumWbemClassObject_Reset(struct IEnumWbemClassObject *d, TALLOC_CTX *me if (error) return NULL; } -%typemap(out) WERROR { - if (!W_ERROR_IS_OK($1)) { - PyErr_SetFromWERROR($1); - talloc_free(arg5); // FIXME:avg make it properly(how???) - return NULL; - } -} - WERROR IEnumWbemClassObject_SmartNext(struct IEnumWbemClassObject *d, TALLOC_CTX *mem_ctx, int32_t lTimeout, uint32_t uCount, struct WbemClassObject **apObjects, uint32_t *puReturned); @@ -346,8 +326,6 @@ WERROR IEnumWbemClassObject_SmartNext(struct IEnumWbemClassObject *d, TALLOC_CTX mod_pywintypes = PyImport_ImportModule("pywintypes"); ComError = PyObject_GetAttrString(mod_pywintypes, "com_error"); -// talloc_enable_leak_report_full(); - lp_load(); dcerpc_init(); dcerpc_table_init(); |