my $env = GenerateFunctionOutEnv($fn, "r->");
my $result_size = 0;
- $self->pidl("static PyObject *$outfnname(struct $fn->{NAME} *r)");
+ $self->pidl("static PyObject *$outfnname(struct $fn->{NAME} *r, bool raise_result_exception)");
$self->pidl("{");
$self->indent;
- $self->pidl("_UNUSED_ bool raise_result_exception = true;");
foreach my $e (@{$fn->{ELEMENTS}}) {
next unless (grep(/out/,@{$e->{DIRECTION}}));
next if (($metadata_args->{in}->{$e->{NAME}} and grep(/in/, @{$e->{DIRECTION}})) or
struct dcerpc_pipe *pipe;
struct dcerpc_binding_handle *binding_handle;
struct tevent_context *ev;
+ bool raise_result_exceptions;
} dcerpc_InterfaceObject;
PyObject *py_lp_ctx = Py_None, *py_credentials = Py_None, *py_basis = Py_None;
NTSTATUS status;
unsigned int timeout = (unsigned int)-1;
+ int raise_result_exceptions = 1;
const char *kwnames[] = {
- "binding", "lp_ctx", "credentials", "timeout", "basis_connection", NULL
+ "binding",
+ "lp_ctx",
+ "credentials",
+ "timeout",
+ "basis_connection",
+ "raise_result_exceptions",
+ NULL
};
-
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|OOIO:samr", discard_const_p(char *, kwnames), &binding_string, &py_lp_ctx, &py_credentials, &timeout, &py_basis)) {
+ bool ok;
+
+ ok = PyArg_ParseTupleAndKeywords(args,
+ kwargs,
+ "s|OOIOp",
+ discard_const_p(char *, kwnames),
+ &binding_string,
+ &py_lp_ctx,
+ &py_credentials,
+ &timeout,
+ &py_basis,
+ &raise_result_exceptions);
+ if (!ok) {
return NULL;
}
return NULL;
}
+ ret->raise_result_exceptions = (raise_result_exceptions != 0);
ret->pipe = NULL;
ret->binding_handle = NULL;
ret->ev = NULL;
return NULL;
}
- result = md->unpack_out_data(r);
+ result = md->unpack_out_data(r, iface->raise_result_exceptions);
talloc_free(mem_ctx);
return result;
typedef NTSTATUS (*py_dcerpc_call_fn) (struct dcerpc_binding_handle *, TALLOC_CTX *, void *);
typedef bool (*py_data_pack_fn) (PyObject *args, PyObject *kwargs, void *r);
-typedef PyObject *(*py_data_unpack_fn) (void *r);
+typedef PyObject *(*py_data_unpack_fn) (void *r, bool raise_result_exception);
struct PyNdrRpcMethodDef {
const char *name;