Use other utility typemaps inside wmi python functions.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 17 Jun 2008 12:14:51 +0000 (14:14 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Mon, 15 Sep 2008 15:39:18 +0000 (17:39 +0200)
source4/lib/wmi/pywmi.i
source4/main.mk

index 1361ab00401cd3be118ee30b7c763057f3932a3b..c1114c3cee43eac70e712ef47395dd693727c7de 100644 (file)
@@ -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();
index d44716e4c0e6c9404412809b1b89eed536a2c1a4..28db54c10f78035cd27bc868cbf1bb0373538f24 100644 (file)
@@ -47,4 +47,3 @@ mkinclude libcli/config.mk
 mkinclude scripting/ejs/config.mk
 mkinclude scripting/python/config.mk
 mkinclude kdc/config.mk
-mkinclude lib/wmi/config.mk