summaryrefslogtreecommitdiff
path: root/source4/librpc/rpc
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-05-24 23:22:49 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-05-24 23:22:49 +0200
commit21b6e9ec9ea08cc5e19a068d68331c178091caa6 (patch)
treeb08abad23a8e34bb3cb6aa9ff4f3e98942149c01 /source4/librpc/rpc
parent5863864f1d8df53b32f24cf41e726e3bddb528ce (diff)
downloadsamba-21b6e9ec9ea08cc5e19a068d68331c178091caa6.tar.gz
samba-21b6e9ec9ea08cc5e19a068d68331c178091caa6.tar.bz2
samba-21b6e9ec9ea08cc5e19a068d68331c178091caa6.zip
Add convenience function for creating objects with NDR error codes.
(This used to be commit 991541a78c2428db89509081cc28072c9b542ffa)
Diffstat (limited to 'source4/librpc/rpc')
-rw-r--r--source4/librpc/rpc/pyrpc.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/librpc/rpc/pyrpc.h b/source4/librpc/rpc/pyrpc.h
index 3857f53634..65501b6b83 100644
--- a/source4/librpc/rpc/pyrpc.h
+++ b/source4/librpc/rpc/pyrpc.h
@@ -45,4 +45,10 @@ typedef struct {
PyAPI_DATA(PyTypeObject) dcerpc_InterfaceType;
+#define PyErr_FromNdrError(err) PyErr_FromNTSTATUS(ndr_map_error2ntstatus(err))
+
+#define PyErr_SetNdrError(err) \
+ PyErr_SetObject(PyExc_RuntimeError, PyErr_FromNdrError(err))
+
+
#endif /* _PYRPC_H_ */