mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
Add a function to convert 'NT_STATUS...' strings back into their actual error
code.
Andrew Bartlett
(This used to be commit f0089b089b
)
This commit is contained in:
parent
03aea8fc90
commit
02ad29785b
@ -579,3 +579,19 @@ char *get_nt_error_c_code(NTSTATUS nt_code)
|
|||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
returns the NT_STATUS constant matching the string supplied (as an NTSTATUS)
|
||||||
|
*****************************************************************************/
|
||||||
|
NTSTATUS nt_status_string_to_code(char *nt_status_str)
|
||||||
|
{
|
||||||
|
int idx = 0;
|
||||||
|
|
||||||
|
while (nt_errs[idx].nt_errstr != NULL) {
|
||||||
|
if (strcmp(nt_errs[idx].nt_errstr, nt_status_str) == 0) {
|
||||||
|
return nt_errs[idx].nt_errcode;
|
||||||
|
}
|
||||||
|
idx++;
|
||||||
|
}
|
||||||
|
return NT_STATUS_UNSUCCESSFUL;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user