diff options
Diffstat (limited to 'source3/python/py_common.c')
-rw-r--r-- | source3/python/py_common.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source3/python/py_common.c b/source3/python/py_common.c index a24a6009d3..5c2e0f896c 100644 --- a/source3/python/py_common.c +++ b/source3/python/py_common.c @@ -19,6 +19,23 @@ */ #include "includes.h" +#include "Python.h" + +/* Return a tuple of (error code, error string) from a WERROR */ + +PyObject *py_werror_tuple(WERROR werror) +{ + return Py_BuildValue("is", W_ERROR_V(werror), + dos_errstr(werror)); +} + +/* Return a tuple of (error code, error string) from a WERROR */ + +PyObject *py_ntstatus_tuple(NTSTATUS ntstatus) +{ + return Py_BuildValue("is", NT_STATUS_V(ntstatus), + nt_errstr(ntstatus)); +} /* Initialise samba client routines */ |