summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-04-23 22:08:39 +0000
committerJeremy Allison <jra@samba.org>1998-04-23 22:08:39 +0000
commit5baa991aef0088a1e0f5d0e9350f3fd3168b13fb (patch)
tree985cbf75e62d862671406d7a9ab4a262341c6083 /source3
parent002a47de8e0cf03c79cedbed2db52f391001f459 (diff)
downloadsamba-5baa991aef0088a1e0f5d0e9350f3fd3168b13fb.tar.gz
samba-5baa991aef0088a1e0f5d0e9350f3fd3168b13fb.tar.bz2
samba-5baa991aef0088a1e0f5d0e9350f3fd3168b13fb.zip
We will need this new nterr.c for the DOMAIN_CLIENT code.
Jeremy. (This used to be commit 932b22cd495b9ce1ba03e5b91a50b314167255d7)
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/nterr.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c
index bda0f882a6..dca97ab923 100644
--- a/source3/libsmb/nterr.c
+++ b/source3/libsmb/nterr.c
@@ -1,18 +1,23 @@
+/* NT error codes. please read nterr.h */
+#include "includes.h"
#include "nterr.h"
-static struct
+typedef struct
{
char *nt_errstr;
- uint16 nt_errcode;
+ uint32 nt_errcode;
-} nt_errs[] =
+} nt_err_code_struct;
+
+nt_err_code_struct nt_errs[] =
{
{ "NT_STATUS_UNSUCCESSFUL", NT_STATUS_UNSUCCESSFUL },
{ "NT_STATUS_NOT_IMPLEMENTED", NT_STATUS_NOT_IMPLEMENTED },
{ "NT_STATUS_INVALID_INFO_CLASS", NT_STATUS_INVALID_INFO_CLASS },
{ "NT_STATUS_INFO_LENGTH_MISMATCH", NT_STATUS_INFO_LENGTH_MISMATCH },
{ "NT_STATUS_ACCESS_VIOLATION", NT_STATUS_ACCESS_VIOLATION },
+ { "STATUS_BUFFER_OVERFLOW", STATUS_BUFFER_OVERFLOW },
{ "NT_STATUS_IN_PAGE_ERROR", NT_STATUS_IN_PAGE_ERROR },
{ "NT_STATUS_PAGEFILE_QUOTA", NT_STATUS_PAGEFILE_QUOTA },
{ "NT_STATUS_INVALID_HANDLE", NT_STATUS_INVALID_HANDLE },
@@ -512,3 +517,25 @@ static struct
{ NULL, 0 }
};
+/*****************************************************************************
+ returns an NT error message. not amazingly helpful, but better than a number.
+ *****************************************************************************/
+char *get_nt_error_msg(uint32 nt_code)
+{
+ static pstring msg;
+ int idx = 0;
+
+ strcpy(msg, "Unknown NT error");
+
+ while (nt_errs[idx].nt_errstr != NULL)
+ {
+ if (nt_errs[idx].nt_errcode == nt_code)
+ {
+ strcpy(msg, nt_errs[idx].nt_errstr);
+ return msg;
+ }
+ idx++;
+ }
+ return NULL;
+}
+