1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-16 00:23:52 +03:00

Added functions to return Python tuples (error code, error string)

corresponding to NT and DOS errors.
This commit is contained in:
Tim Potter
-
parent f2a0e56b3c
commit cb243e2766
2 changed files with 19 additions and 0 deletions

View File

@@ -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 */

View File

@@ -24,5 +24,7 @@
/* Function prototypes */
void py_samba_init(void);
PyObject *py_werror_tuple(WERROR werror);
PyObject *py_ntstatus_tuple(NTSTATUS ntstatus);
#endif /* _PY_COMMON_H */