2
/* Python wrapper functions auto-generated by pidl */
6
#include "librpc/rpc/pyrpc.h"
7
#include "librpc/rpc/pyrpc_util.h"
8
#include "librpc/gen_ndr/ndr_remact.h"
9
#include "librpc/gen_ndr/ndr_remact_c.h"
11
#include "librpc/gen_ndr/misc.h"
12
#include "librpc/gen_ndr/orpc.h"
13
staticforward PyTypeObject IRemoteActivation_InterfaceType;
15
void initremact(void);static PyTypeObject *MInterfacePointer_Type;
16
static PyTypeObject *DUALSTRINGARRAY_Type;
17
static PyTypeObject *ORPCTHAT_Type;
18
static PyTypeObject *GUID_Type;
19
static PyTypeObject *ClientConnection_Type;
20
static PyTypeObject *COMVERSION_Type;
21
static PyTypeObject *ORPCTHIS_Type;
23
static bool pack_py_RemoteActivation_args_in(PyObject *args, PyObject *kwargs, struct RemoteActivation *r)
25
PyObject *py_this_object;
27
PyObject *py_pwszObjectName;
28
PyObject *py_pObjectStorage;
29
PyObject *py_ClientImpLevel;
33
const char *kwnames[] = {
34
"this_object", "Clsid", "pwszObjectName", "pObjectStorage", "ClientImpLevel", "Mode", "pIIDs", "protseq", NULL
37
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OOOOOOOO:RemoteActivation", discard_const_p(char *, kwnames), &py_this_object, &py_Clsid, &py_pwszObjectName, &py_pObjectStorage, &py_ClientImpLevel, &py_Mode, &py_pIIDs, &py_protseq)) {
41
PY_CHECK_TYPE(ORPCTHIS_Type, py_this_object, return false;);
42
if (talloc_reference(r, py_talloc_get_mem_ctx(py_this_object)) == NULL) {
46
r->in.this_object = *(struct ORPCTHIS *)py_talloc_get_ptr(py_this_object);
47
PY_CHECK_TYPE(GUID_Type, py_Clsid, return false;);
48
if (talloc_reference(r, py_talloc_get_mem_ctx(py_Clsid)) == NULL) {
52
r->in.Clsid = *(struct GUID *)py_talloc_get_ptr(py_Clsid);
53
r->in.pwszObjectName = talloc_ptrtype(r, r->in.pwszObjectName);
54
if (PyUnicode_Check(py_pwszObjectName)) {
55
r->in.pwszObjectName = PyString_AS_STRING(PyUnicode_AsEncodedString(py_pwszObjectName, "utf-8", "ignore"));
56
} else if (PyString_Check(py_pwszObjectName)) {
57
r->in.pwszObjectName = PyString_AS_STRING(py_pwszObjectName);
59
PyErr_Format(PyExc_TypeError, "Expected string or unicode object, got %s", Py_TYPE(py_pwszObjectName)->tp_name);
62
r->in.pObjectStorage = talloc_ptrtype(r, r->in.pObjectStorage);
63
PY_CHECK_TYPE(MInterfacePointer_Type, py_pObjectStorage, return false;);
64
if (talloc_reference(r, py_talloc_get_mem_ctx(py_pObjectStorage)) == NULL) {
68
r->in.pObjectStorage = (struct MInterfacePointer *)py_talloc_get_ptr(py_pObjectStorage);
69
PY_CHECK_TYPE(&PyInt_Type, py_ClientImpLevel, return false;);
70
r->in.ClientImpLevel = PyInt_AsLong(py_ClientImpLevel);
71
PY_CHECK_TYPE(&PyInt_Type, py_Mode, return false;);
72
r->in.Mode = PyInt_AsLong(py_Mode);
73
PY_CHECK_TYPE(&PyList_Type, py_pIIDs, return false;);
74
r->in.Interfaces = PyList_GET_SIZE(py_pIIDs);
75
r->in.pIIDs = talloc_ptrtype(r, r->in.pIIDs);
76
PY_CHECK_TYPE(&PyList_Type, py_pIIDs, return false;);
79
r->in.pIIDs = talloc_array_ptrtype(r, r->in.pIIDs, PyList_GET_SIZE(py_pIIDs));
80
if (!r->in.pIIDs) { return false;; }
81
talloc_set_name_const(r->in.pIIDs, "ARRAY: r->in.pIIDs");
82
for (pIIDs_cntr_1 = 0; pIIDs_cntr_1 < PyList_GET_SIZE(py_pIIDs); pIIDs_cntr_1++) {
83
PY_CHECK_TYPE(GUID_Type, PyList_GET_ITEM(py_pIIDs, pIIDs_cntr_1), return false;);
84
if (talloc_reference(r->in.pIIDs, py_talloc_get_mem_ctx(PyList_GET_ITEM(py_pIIDs, pIIDs_cntr_1))) == NULL) {
88
r->in.pIIDs[pIIDs_cntr_1] = *(struct GUID *)py_talloc_get_ptr(PyList_GET_ITEM(py_pIIDs, pIIDs_cntr_1));
91
PY_CHECK_TYPE(&PyList_Type, py_protseq, return false;);
92
r->in.num_protseqs = PyList_GET_SIZE(py_protseq);
93
PY_CHECK_TYPE(&PyList_Type, py_protseq, return false;);
96
r->in.protseq = talloc_array_ptrtype(r, r->in.protseq, PyList_GET_SIZE(py_protseq));
97
if (!r->in.protseq) { return false;; }
98
talloc_set_name_const(r->in.protseq, "ARRAY: r->in.protseq");
99
for (protseq_cntr_0 = 0; protseq_cntr_0 < PyList_GET_SIZE(py_protseq); protseq_cntr_0++) {
100
PY_CHECK_TYPE(&PyInt_Type, PyList_GET_ITEM(py_protseq, protseq_cntr_0), return false;);
101
r->in.protseq[protseq_cntr_0] = PyInt_AsLong(PyList_GET_ITEM(py_protseq, protseq_cntr_0));
107
static PyObject *unpack_py_RemoteActivation_args_out(struct RemoteActivation *r)
112
PyObject *py_pdsaOxidBindings;
113
PyObject *py_ipidRemUnknown;
114
PyObject *py_AuthnHint;
115
PyObject *py_ServerVersion;
118
PyObject *py_results;
119
result = PyTuple_New(9);
120
py_that = py_talloc_reference_ex(ORPCTHAT_Type, r->out.that, r->out.that);
121
PyTuple_SetItem(result, 0, py_that);
122
py_pOxid = PyLong_FromLongLong(*r->out.pOxid);
123
PyTuple_SetItem(result, 1, py_pOxid);
124
py_pdsaOxidBindings = py_talloc_reference_ex(DUALSTRINGARRAY_Type, r->out.pdsaOxidBindings, r->out.pdsaOxidBindings);
125
PyTuple_SetItem(result, 2, py_pdsaOxidBindings);
126
py_ipidRemUnknown = py_talloc_reference_ex(GUID_Type, r->out.ipidRemUnknown, r->out.ipidRemUnknown);
127
PyTuple_SetItem(result, 3, py_ipidRemUnknown);
128
py_AuthnHint = PyInt_FromLong(*r->out.AuthnHint);
129
PyTuple_SetItem(result, 4, py_AuthnHint);
130
py_ServerVersion = py_talloc_reference_ex(COMVERSION_Type, r->out.ServerVersion, r->out.ServerVersion);
131
PyTuple_SetItem(result, 5, py_ServerVersion);
132
py_hr = PyErr_FromWERROR(*r->out.hr);
133
PyTuple_SetItem(result, 6, py_hr);
134
py_ifaces = PyList_New(r->in.Interfaces);
135
if (py_ifaces == NULL) {
140
for (ifaces_cntr_0 = 0; ifaces_cntr_0 < r->in.Interfaces; ifaces_cntr_0++) {
141
PyObject *py_ifaces_0;
142
py_ifaces_0 = py_talloc_reference_ex(MInterfacePointer_Type, r->out.ifaces[ifaces_cntr_0], r->out.ifaces[ifaces_cntr_0]);
143
PyList_SetItem(py_ifaces, ifaces_cntr_0, py_ifaces_0);
146
PyTuple_SetItem(result, 7, py_ifaces);
147
py_results = PyList_New(r->in.Interfaces);
148
if (py_results == NULL) {
153
for (results_cntr_0 = 0; results_cntr_0 < r->in.Interfaces; results_cntr_0++) {
154
PyObject *py_results_0;
155
py_results_0 = PyErr_FromWERROR(r->out.results[results_cntr_0]);
156
PyList_SetItem(py_results, results_cntr_0, py_results_0);
159
PyTuple_SetItem(result, 8, py_results);
160
if (!W_ERROR_IS_OK(r->out.result)) {
161
PyErr_SetWERROR(r->out.result);
168
const struct PyNdrRpcMethodDef py_ndr_IRemoteActivation_methods[] = {
169
{ "RemoteActivation", "S.RemoteActivation(this_object, Clsid, pwszObjectName, pObjectStorage, ClientImpLevel, Mode, pIIDs, protseq) -> (that, pOxid, pdsaOxidBindings, ipidRemUnknown, AuthnHint, ServerVersion, hr, ifaces, results)", (py_dcerpc_call_fn)dcerpc_RemoteActivation_r, (py_data_pack_fn)pack_py_RemoteActivation_args_in, (py_data_unpack_fn)unpack_py_RemoteActivation_args_out, 0, &ndr_table_IRemoteActivation },
173
static PyObject *interface_IRemoteActivation_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
175
return py_dcerpc_interface_init_helper(type, args, kwargs, &ndr_table_IRemoteActivation);
178
static PyTypeObject IRemoteActivation_InterfaceType = {
179
PyObject_HEAD_INIT(NULL) 0,
180
.tp_name = "remact.IRemoteActivation",
181
.tp_basicsize = sizeof(dcerpc_InterfaceObject),
182
.tp_doc = "IRemoteActivation(binding, lp_ctx=None, credentials=None) -> connection\n"
184
"binding should be a DCE/RPC binding string (for example: ncacn_ip_tcp:127.0.0.1)\n"
185
"lp_ctx should be a path to a smb.conf file or a param.LoadParm object\n"
186
"credentials should be a credentials.Credentials object.\n\n",
187
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
188
.tp_new = interface_IRemoteActivation_new,
191
static PyMethodDef remact_methods[] = {
192
{ NULL, NULL, 0, NULL }
195
void initremact(void)
198
PyObject *dep_samba_dcerpc_misc;
199
PyObject *dep_samba_dcerpc_base;
200
PyObject *dep_samba_dcerpc_orpc;
202
dep_samba_dcerpc_misc = PyImport_ImportModule("samba.dcerpc.misc");
203
if (dep_samba_dcerpc_misc == NULL)
206
dep_samba_dcerpc_base = PyImport_ImportModule("samba.dcerpc.base");
207
if (dep_samba_dcerpc_base == NULL)
210
dep_samba_dcerpc_orpc = PyImport_ImportModule("samba.dcerpc.orpc");
211
if (dep_samba_dcerpc_orpc == NULL)
214
MInterfacePointer_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_orpc, "MInterfacePointer");
215
if (MInterfacePointer_Type == NULL)
218
DUALSTRINGARRAY_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_orpc, "DUALSTRINGARRAY");
219
if (DUALSTRINGARRAY_Type == NULL)
222
ORPCTHAT_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_orpc, "ORPCTHAT");
223
if (ORPCTHAT_Type == NULL)
226
GUID_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_misc, "GUID");
227
if (GUID_Type == NULL)
230
ClientConnection_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_base, "ClientConnection");
231
if (ClientConnection_Type == NULL)
234
COMVERSION_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_orpc, "COMVERSION");
235
if (COMVERSION_Type == NULL)
238
ORPCTHIS_Type = (PyTypeObject *)PyObject_GetAttrString(dep_samba_dcerpc_orpc, "ORPCTHIS");
239
if (ORPCTHIS_Type == NULL)
242
IRemoteActivation_InterfaceType.tp_base = ClientConnection_Type;
244
if (PyType_Ready(&IRemoteActivation_InterfaceType) < 0)
246
if (!PyInterface_AddNdrRpcMethods(&IRemoteActivation_InterfaceType, py_ndr_IRemoteActivation_methods))
249
#ifdef PY_IREMOTEACTIVATION_PATCH
250
PY_IREMOTEACTIVATION_PATCH(&IRemoteActivation_InterfaceType);
253
m = Py_InitModule3("remact", remact_methods, "remact DCE/RPC");
257
PyModule_AddObject(m, "RPC_C_IMP_LEVEL_DEFAULT", PyInt_FromLong(RPC_C_IMP_LEVEL_DEFAULT));
258
PyModule_AddObject(m, "RPC_C_IMP_LEVEL_IMPERSONATE", PyInt_FromLong(RPC_C_IMP_LEVEL_IMPERSONATE));
259
PyModule_AddObject(m, "RPC_C_IMP_LEVEL_ANONYMOUS", PyInt_FromLong(RPC_C_IMP_LEVEL_ANONYMOUS));
260
PyModule_AddObject(m, "RPC_C_IMP_LEVEL_IDENTIFY", PyInt_FromLong(RPC_C_IMP_LEVEL_IDENTIFY));
261
PyModule_AddObject(m, "MODE_GET_CLASS_OBJECT", PyInt_FromLong(0xffffffff));
262
PyModule_AddObject(m, "RPC_C_IMP_LEVEL_DELEGATE", PyInt_FromLong(RPC_C_IMP_LEVEL_DELEGATE));
263
Py_INCREF((PyObject *)(void *)&IRemoteActivation_InterfaceType);
264
PyModule_AddObject(m, "IRemoteActivation", (PyObject *)(void *)&IRemoteActivation_InterfaceType);
265
#ifdef PY_MOD_REMACT_PATCH
266
PY_MOD_REMACT_PATCH(m);