%include "typemaps.i"
%import "stdint.i"
+%import "libcli/util/errors.i"
+%import "lib/talloc/talloc.i"
%runtime %{
void push_object(PyObject **stack, PyObject *o)
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);
%}
-%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;
}
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);
mod_pywintypes = PyImport_ImportModule("pywintypes");
ComError = PyObject_GetAttrString(mod_pywintypes, "com_error");
-// talloc_enable_leak_report_full();
-
lp_load();
dcerpc_init();
dcerpc_table_init();
+/*
+ WMI Sample client
+ 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.
+*/
+
#include "includes.h"
#include "auth/credentials/credentials.h"
#include "librpc/gen_ndr/com_dcom.h"
#include "lib/com/dcom/dcom.h"
+#include "librpc/gen_ndr/wmi.h"
+#include "librpc/gen_ndr/com_wmi.h"
struct IWbemServices;
struct IWbemContext;
} else { \
DEBUG(1, ("OK : %s\n", msg)); \
}
-
-WERROR WBEM_ConnectServer(struct com_context *ctx, const char *server, const char *nspace, const char *user, const char *password,
- const char *locale, uint32_t flags, const char *authority, struct IWbemContext* wbem_ctx, struct IWbemServices** services)
+/** FIXME: Use credentials struct rather than user/password here */
+WERROR WBEM_ConnectServer(struct com_context *ctx, const char *server, const char *nspace,
+ const char *user, const char *password,
+ const char *locale, uint32_t flags, const char *authority,
+ struct IWbemContext* wbem_ctx, struct IWbemServices** services)
{
struct GUID clsid;
struct GUID iid;