summaryrefslogtreecommitdiff
path: root/source3/libsmb/nterr.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-08-27 17:52:23 +0000
committerAndrew Tridgell <tridge@samba.org>2001-08-27 17:52:23 +0000
commitee5f7237decfe446f4fdb08422beb2e6cb43af7f (patch)
tree80b217a2938d7e0d46a5d20517c9adb0807ecd1a /source3/libsmb/nterr.c
parente8e98c9ea0690e3acf1126b50882e59e1056c7b3 (diff)
downloadsamba-ee5f7237decfe446f4fdb08422beb2e6cb43af7f.tar.gz
samba-ee5f7237decfe446f4fdb08422beb2e6cb43af7f.tar.bz2
samba-ee5f7237decfe446f4fdb08422beb2e6cb43af7f.zip
started converting NTSTATUS to be a structure on systems with gcc in order to make it type incompatible with BOOL so we catch errors sooner. This has already found a number of bugs
(This used to be commit 1b778bc7d22efff3f90dc450eb12baa1241cf68f)
Diffstat (limited to 'source3/libsmb/nterr.c')
-rw-r--r--source3/libsmb/nterr.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/source3/libsmb/nterr.c b/source3/libsmb/nterr.c
index 1b8e8737f7..7fdeb4e5a7 100644
--- a/source3/libsmb/nterr.c
+++ b/source3/libsmb/nterr.c
@@ -26,8 +26,7 @@
typedef struct
{
char *nt_errstr;
- uint32 nt_errcode;
-
+ NTSTATUS nt_errcode;
} nt_err_code_struct;
nt_err_code_struct nt_errs[] =
@@ -534,22 +533,22 @@ nt_err_code_struct nt_errs[] =
{ "NT_STATUS_TOO_MANY_LINKS", NT_STATUS_TOO_MANY_LINKS },
{ "NT_STATUS_QUOTA_LIST_INCONSISTENT", NT_STATUS_QUOTA_LIST_INCONSISTENT },
{ "NT_STATUS_FILE_IS_OFFLINE", NT_STATUS_FILE_IS_OFFLINE },
- { NULL, 0 }
+ { NULL, NT_STATUS(0) }
};
/*****************************************************************************
returns an NT error message. not amazingly helpful, but better than a number.
*****************************************************************************/
-char *get_nt_error_msg(uint32 nt_code)
+char *get_nt_error_msg(NTSTATUS nt_code)
{
static pstring msg;
int idx = 0;
- slprintf(msg, sizeof(msg), "NT code 0x%08x", nt_code);
+ slprintf(msg, sizeof(msg), "NT code 0x%08x", NT_STATUS_V(nt_code));
while (nt_errs[idx].nt_errstr != NULL) {
- if ((nt_errs[idx].nt_errcode & 0xFFFFFF) ==
- (nt_code & 0xFFFFFF)) {
+ if ((NT_STATUS_V(nt_errs[idx].nt_errcode) & 0xFFFFFF) ==
+ (NT_STATUS_V(nt_code) & 0xFFFFFF)) {
return nt_errs[idx].nt_errstr;
}
idx++;