summaryrefslogtreecommitdiff
path: root/pidl
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-09-30 06:05:05 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-09-30 06:05:05 +0200
commit454122ab091715edf02c26e0a408141c7374b693 (patch)
tree300b636b3ec0bffd859974ae0f266fb0d587386b /pidl
parent2400b1fea2a07ad3972ee8133e37eaf2f91499d0 (diff)
downloadsamba-454122ab091715edf02c26e0a408141c7374b693.tar.gz
samba-454122ab091715edf02c26e0a408141c7374b693.tar.bz2
samba-454122ab091715edf02c26e0a408141c7374b693.zip
make sure dcerpc is always initialized.
Diffstat (limited to 'pidl')
-rw-r--r--pidl/lib/Parse/Pidl/Samba4/Python.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 74cec5a827..fc64c35fca 100644
--- a/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -1173,6 +1173,7 @@ sub Parse($$$$$)
$self->pidl("{");
$self->indent;
$self->pidl("PyObject *m;");
+ $self->pidl("NTSTATUS status;");
$self->pidl("");
foreach (@{$self->{ready_types}}) {
@@ -1208,6 +1209,15 @@ sub Parse($$$$$)
$self->pidl("PyModule_AddObject(m, \"$object_name\", $c_name);");
}
+ $self->pidl("");
+ $self->pidl("status = dcerpc_init();");
+ $self->pidl("if (!NT_STATUS_IS_OK(status)) {");
+ $self->indent;
+ $self->pidl("PyErr_SetNTSTATUS(status);");
+ $self->pidl("return;");
+ $self->deindent;
+ $self->pidl("}");
+
$self->deindent;
$self->pidl("}");
return ($self->{res_hdr}, $self->{res});