* same table as the other ones. */
static const nt_err_code_struct special_errs[] =
{
- { "NT_STATUS_OK", NT_STATUS_OK },
{ "STATUS_NO_MORE_FILES", STATUS_NO_MORE_FILES },
{ "STATUS_INVALID_EA_NAME", STATUS_INVALID_EA_NAME },
{ "STATUS_BUFFER_OVERFLOW", STATUS_BUFFER_OVERFLOW },
#define NT_STATUS_SMB_NO_PREAUTH_INTEGRITY_HASH_OVERLAP NT_STATUS(0xC05D0000)
/* Other error codes that aren't in the list we use */
-#define NT_STATUS_OK NT_STATUS_SUCCESS
-
#define STATUS_MORE_ENTRIES NT_STATUS_MORE_ENTRIES
#define STATUS_BUFFER_OVERFLOW NT_STATUS_BUFFER_OVERFLOW
#define STATUS_NO_MORE_FILES NT_STATUS_NO_MORE_FILES
#
import sys, io
-from gen_error_common import parseErrorDescriptions
+from gen_error_common import ErrorDef, parseErrorDescriptions
def generateHeaderFile(out_file, errors):
out_file.write("/*\n")
with io.open(input_file, "rt", encoding='utf8') as file_contents:
errors = parseErrorDescriptions(file_contents, False, transformErrorName)
+ # NT_STATUS_OK is a synonym of NT_STATUS_SUCCESS, and is very widely used
+ # throughout Samba. It must go first in the list to ensure that to ensure
+ # that code that previously found this error code in ‘special_errs’
+ # maintains the same behaviour by falling back to ‘nt_errs’.
+ ok_status = ErrorDef()
+ ok_status.err_code = 0
+ ok_status.err_define = 'NT_STATUS_OK'
+ errors.insert(0, ok_status)
+
print("writing new header file: %s" % gen_headerfile_name)
out_file = io.open(gen_headerfile_name, "wt", encoding='utf8')
generateHeaderFile(out_file, errors)