diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-06-17 14:14:51 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-09-15 17:39:18 +0200 |
commit | 09f789152251c27806c8931e14cb7fbf17887ad5 (patch) | |
tree | d5380254f72da73ee1f4c4a39dd55c7a6e8978e7 /source4/lib/wmi | |
parent | a82c89e882ed687bacc1f7c945387a4172790471 (diff) | |
download | samba-09f789152251c27806c8931e14cb7fbf17887ad5.tar.gz samba-09f789152251c27806c8931e14cb7fbf17887ad5.tar.bz2 samba-09f789152251c27806c8931e14cb7fbf17887ad5.zip |
Use other utility typemaps inside wmi python functions.
Diffstat (limited to 'source4/lib/wmi')
-rw-r--r-- | source4/lib/wmi/pywmi.i | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/source4/lib/wmi/pywmi.i b/source4/lib/wmi/pywmi.i index 1361ab0040..c1114c3cee 100644 --- a/source4/lib/wmi/pywmi.i +++ b/source4/lib/wmi/pywmi.i @@ -1,8 +1,27 @@ +/* + WMI Implementation + Copyright (C) 2006 Andrzej Hajda <andrzej.hajda@wp.pl> + Copyright (C) 2008 Jelmer Vernooij <jelmer@samba.org> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + %module pywmi %include "typemaps.i" -%include "scripting/swig/samba.i" -//%include "librpc/gen_ndr/winreg.i" +%import "stdint.i" %runtime %{ void push_object(PyObject **stack, PyObject *o) @@ -30,8 +49,6 @@ void push_object(PyObject **stack, PyObject *o) #include "includes.h" #include "librpc/gen_ndr/misc.h" #include "librpc/rpc/dcerpc.h" -#include "librpc/rpc/dcerpc_table.h" -#include "libcli/util/nt_status.h" #include "lib/com/dcom/dcom.h" #include "librpc/gen_ndr/com_dcom.h" #include "wmi/proto.h" @@ -52,22 +69,7 @@ static PyObject *mod_win32_client; static PyObject *mod_pywintypes; %} -%apply uint32_t { int32_t }; - -extern int DEBUGLEVEL; - %wrapper %{ -static PyObject *PyErr_SetFromWERROR(WERROR w) -{ - PyObject *v; - - v = Py_BuildValue("(is)", W_ERROR_V(w), wmi_errstr(w)); - if (v != NULL) { - PyErr_SetObject(ComError, v); - Py_DECREF(v); - } - return NULL; -} #define RETURN_CVAR_ARRAY(fmt, arr) {\ PyObject *l, *o;\ @@ -344,7 +346,6 @@ WERROR IEnumWbemClassObject_SmartNext(struct IEnumWbemClassObject *d, TALLOC_CTX mod_pywintypes = PyImport_ImportModule("pywintypes"); ComError = PyObject_GetAttrString(mod_pywintypes, "com_error"); - DEBUGLEVEL = 0; // talloc_enable_leak_report_full(); lp_load(); |