linux-cifs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/30] smb: improve search speed of SMB1 maperror
@ 2025-12-08  6:20 chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 01/30] smb/client: fix NT_STATUS_NO_DATA_DETECTED value chenxiaosong.chenxiaosong
                   ` (31 more replies)
  0 siblings, 32 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

Before applying this patchset, the patchset ("smb: improve search speed of SMB2 maperror") must
be applied first, which introduces `CONFIG_SMB_KUNIT_TESTS` and avoids some conflicts in `fs/smb/client/cifsfs.c`:
https://chenxiaosong.com/lkml-improve-search-speed-of-smb2-maperror.html (Redirect to the LKML link)

When searching for the last element, the comparison counts are shown in the table below:

+--------------------+--------+--------+
|                    |Before  |After   |
|                    |Patchset|Patchset|
+--------------------+--------+--------+
| ntstatus_to_dos_map|   525  |    9   |
+--------------------+--------+--------+
|             nt_errs|   516  |    9   |
+--------------------+--------+--------+
|mapping_table_ERRDOS|    39  |    5   |
+--------------------+--------+--------+
|mapping_table_ERRSRV|    37  |    5   |
+--------------------+--------+--------+

ChenXiaoSong (30):
  smb/client: fix NT_STATUS_NO_DATA_DETECTED value
  smb/client: fix NT_STATUS_DEVICE_DOOR_OPEN value
  smb/client: fix NT_STATUS_UNABLE_TO_FREE_VM value
  smb/server: remove unused nterr.h
  smb/client: add 4 NT error code definitions
  smb/client: add parentheses to NT error code definitions containing
    bitwise OR operator
  smb/client: introduce DEFINE_CMP_FUNC()
  smb/client: sort ntstatus_to_dos_map array
  smb/client: create netmisc_test.c and introduce
    DEFINE_CHECK_SORT_FUNC()
  smb/client: introduce KUnit test to check sort result of
    ntstatus_to_dos_map array
  smb/client: introduce DEFINE_SEARCH_FUNC()
  smb/client: use bsearch() to find target in ntstatus_to_dos_map array
  smb/client: remove useless elements from ntstatus_to_dos_map array
  smb/client: introduce DEFINE_CHECK_SEARCH_FUNC()
  smb/client: introduce KUnit test to check search result of
    ntstatus_to_dos_map array
  smb/client: sort nt_errs array
  smb/client: introduce KUnit test to check sort result of nt_errs array
  smb/client: use bsearch() to find target in nt_errs array
  smb/client: remove useless elements from nt_errs array
  smb/client: introduce KUnit test to check search result of nt_errs
    array
  smb/client: sort mapping_table_ERRDOS array
  smb/client: introduce KUnit test to check sort result of
    mapping_table_ERRDOS array
  smb/client: use bsearch() to find target in mapping_table_ERRDOS array
  smb/client: remove useless elements from mapping_table_ERRDOS array
  smb/client: introduce KUnit test to check search result of
    mapping_table_ERRDOS array
  smb/client: sort mapping_table_ERRSRV array
  smb/client: introduce KUnit test to check sort result of
    mapping_table_ERRSRV array
  smb/client: use bsearch() to find target in mapping_table_ERRSRV array
  smb/client: remove useless elements from mapping_table_ERRSRV array
  smb/client: introduce KUnit test to check search result of
    mapping_table_ERRSRV array

 fs/smb/client/cifsfs.c       |    2 +
 fs/smb/client/cifsproto.h    |    1 +
 fs/smb/client/netmisc.c      |  155 ++++--
 fs/smb/client/netmisc_test.c |  114 ++++
 fs/smb/client/nterr.c        |   12 +-
 fs/smb/client/nterr.h        | 1017 +++++++++++++++++-----------------
 fs/smb/server/nterr.h        |  543 ------------------
 fs/smb/server/smb2misc.c     |    1 -
 fs/smb/server/smb_common.h   |    1 -
 9 files changed, 739 insertions(+), 1107 deletions(-)
 create mode 100644 fs/smb/client/netmisc_test.c
 delete mode 100644 fs/smb/server/nterr.h

-- 
2.43.0


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [PATCH 01/30] smb/client: fix NT_STATUS_NO_DATA_DETECTED value
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-09  0:17   ` ChenXiaoSong
  2025-12-08  6:20 ` [PATCH 02/30] smb/client: fix NT_STATUS_DEVICE_DOOR_OPEN value chenxiaosong.chenxiaosong
                   ` (30 subsequent siblings)
  31 siblings, 1 reply; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

This was reported by the KUnit tests in the later patches.

See MS-ERREF 2.3.1 STATUS_NO_DATA_DETECTED. Keep it consistent with the
value in the documentation.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/nterr.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/smb/client/nterr.h b/fs/smb/client/nterr.h
index 180602c22355..4fd79a82c817 100644
--- a/fs/smb/client/nterr.h
+++ b/fs/smb/client/nterr.h
@@ -41,7 +41,7 @@ extern const struct nt_err_code_struct nt_errs[];
 #define NT_STATUS_MEDIA_CHANGED    0x8000001c
 #define NT_STATUS_END_OF_MEDIA     0x8000001e
 #define NT_STATUS_MEDIA_CHECK      0x80000020
-#define NT_STATUS_NO_DATA_DETECTED 0x8000001c
+#define NT_STATUS_NO_DATA_DETECTED 0x80000022
 #define NT_STATUS_STOPPED_ON_SYMLINK 0x8000002d
 #define NT_STATUS_DEVICE_REQUIRES_CLEANING 0x80000288
 #define NT_STATUS_DEVICE_DOOR_OPEN 0x80000288
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 02/30] smb/client: fix NT_STATUS_DEVICE_DOOR_OPEN value
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 01/30] smb/client: fix NT_STATUS_NO_DATA_DETECTED value chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 03/30] smb/client: fix NT_STATUS_UNABLE_TO_FREE_VM value chenxiaosong.chenxiaosong
                   ` (29 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

This was reported by the KUnit tests in the later patches.

See MS-ERREF 2.3.1 STATUS_DEVICE_DOOR_OPEN. Keep it consistent with the
value in the documentation.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/nterr.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/smb/client/nterr.h b/fs/smb/client/nterr.h
index 4fd79a82c817..90a5eee157ea 100644
--- a/fs/smb/client/nterr.h
+++ b/fs/smb/client/nterr.h
@@ -44,7 +44,7 @@ extern const struct nt_err_code_struct nt_errs[];
 #define NT_STATUS_NO_DATA_DETECTED 0x80000022
 #define NT_STATUS_STOPPED_ON_SYMLINK 0x8000002d
 #define NT_STATUS_DEVICE_REQUIRES_CLEANING 0x80000288
-#define NT_STATUS_DEVICE_DOOR_OPEN 0x80000288
+#define NT_STATUS_DEVICE_DOOR_OPEN 0x80000289
 #define NT_STATUS_UNSUCCESSFUL 0xC0000000 | 0x0001
 #define NT_STATUS_NOT_IMPLEMENTED 0xC0000000 | 0x0002
 #define NT_STATUS_INVALID_INFO_CLASS 0xC0000000 | 0x0003
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 03/30] smb/client: fix NT_STATUS_UNABLE_TO_FREE_VM value
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 01/30] smb/client: fix NT_STATUS_NO_DATA_DETECTED value chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 02/30] smb/client: fix NT_STATUS_DEVICE_DOOR_OPEN value chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 04/30] smb/server: remove unused nterr.h chenxiaosong.chenxiaosong
                   ` (28 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

This was reported by the KUnit tests in the later patches.

See MS-ERREF 2.3.1 STATUS_UNABLE_TO_FREE_VM. Keep it consistent with the
value in the documentation.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/nterr.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/smb/client/nterr.h b/fs/smb/client/nterr.h
index 90a5eee157ea..09263c91d07a 100644
--- a/fs/smb/client/nterr.h
+++ b/fs/smb/client/nterr.h
@@ -70,7 +70,7 @@ extern const struct nt_err_code_struct nt_errs[];
 #define NT_STATUS_NO_MEMORY 0xC0000000 | 0x0017
 #define NT_STATUS_CONFLICTING_ADDRESSES 0xC0000000 | 0x0018
 #define NT_STATUS_NOT_MAPPED_VIEW 0xC0000000 | 0x0019
-#define NT_STATUS_UNABLE_TO_FREE_VM 0x80000000 | 0x001a
+#define NT_STATUS_UNABLE_TO_FREE_VM 0xC0000000 | 0x001a
 #define NT_STATUS_UNABLE_TO_DELETE_SECTION 0xC0000000 | 0x001b
 #define NT_STATUS_INVALID_SYSTEM_SERVICE 0xC0000000 | 0x001c
 #define NT_STATUS_ILLEGAL_INSTRUCTION 0xC0000000 | 0x001d
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 04/30] smb/server: remove unused nterr.h
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (2 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 03/30] smb/client: fix NT_STATUS_UNABLE_TO_FREE_VM value chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 05/30] smb/client: add 4 NT error code definitions chenxiaosong.chenxiaosong
                   ` (27 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

KSMBD does not use these NT error code definitions. Instead, it uses the
SMB2 status code definitions defined in common/smb2status.h.

By the way, server/nterr.h contains the following additional definitions
compared to client/nterr.h:

  - NT_STATUS_PENDING
  - NT_STATUS_INVALID_LOCK_RANGE
  - NT_STATUS_NETWORK_SESSION_EXPIRED
  - NT_STATUS_NO_PREAUTH_INTEGRITY_HASH_OVERLAP

We can add them to client/nterr.h in the next patch.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/server/nterr.h      | 543 -------------------------------------
 fs/smb/server/smb2misc.c   |   1 -
 fs/smb/server/smb_common.h |   1 -
 3 files changed, 545 deletions(-)
 delete mode 100644 fs/smb/server/nterr.h

diff --git a/fs/smb/server/nterr.h b/fs/smb/server/nterr.h
deleted file mode 100644
index 2f358f88a018..000000000000
--- a/fs/smb/server/nterr.h
+++ /dev/null
@@ -1,543 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- * Unix SMB/Netbios implementation.
- * Version 1.9.
- * NT error code constants
- * Copyright (C) Andrew Tridgell              1992-2000
- * Copyright (C) John H Terpstra              1996-2000
- * Copyright (C) Luke Kenneth Casson Leighton 1996-2000
- * Copyright (C) Paul Ashton                  1998-2000
- */
-
-#ifndef _NTERR_H
-#define _NTERR_H
-
-/* Win32 Status codes. */
-#define NT_STATUS_MORE_ENTRIES         0x0105
-#define NT_ERROR_INVALID_PARAMETER     0x0057
-#define NT_ERROR_INSUFFICIENT_BUFFER   0x007a
-#define NT_STATUS_1804                 0x070c
-#define NT_STATUS_NOTIFY_ENUM_DIR      0x010c
-#define NT_STATUS_INVALID_LOCK_RANGE   (0xC0000000 | 0x01a1)
-/*
- * Win32 Error codes extracted using a loop in smbclient then printing a netmon
- * sniff to a file.
- */
-
-#define NT_STATUS_OK                   0x0000
-#define NT_STATUS_SOME_UNMAPPED        0x0107
-#define NT_STATUS_BUFFER_OVERFLOW  0x80000005
-#define NT_STATUS_NO_MORE_ENTRIES  0x8000001a
-#define NT_STATUS_MEDIA_CHANGED    0x8000001c
-#define NT_STATUS_END_OF_MEDIA     0x8000001e
-#define NT_STATUS_MEDIA_CHECK      0x80000020
-#define NT_STATUS_NO_DATA_DETECTED 0x8000001c
-#define NT_STATUS_STOPPED_ON_SYMLINK 0x8000002d
-#define NT_STATUS_DEVICE_REQUIRES_CLEANING 0x80000288
-#define NT_STATUS_DEVICE_DOOR_OPEN 0x80000288
-#define NT_STATUS_UNSUCCESSFUL (0xC0000000 | 0x0001)
-#define NT_STATUS_NOT_IMPLEMENTED (0xC0000000 | 0x0002)
-#define NT_STATUS_INVALID_INFO_CLASS (0xC0000000 | 0x0003)
-#define NT_STATUS_INFO_LENGTH_MISMATCH (0xC0000000 | 0x0004)
-#define NT_STATUS_ACCESS_VIOLATION (0xC0000000 | 0x0005)
-#define NT_STATUS_IN_PAGE_ERROR (0xC0000000 | 0x0006)
-#define NT_STATUS_PAGEFILE_QUOTA (0xC0000000 | 0x0007)
-#define NT_STATUS_INVALID_HANDLE (0xC0000000 | 0x0008)
-#define NT_STATUS_BAD_INITIAL_STACK (0xC0000000 | 0x0009)
-#define NT_STATUS_BAD_INITIAL_PC (0xC0000000 | 0x000a)
-#define NT_STATUS_INVALID_CID (0xC0000000 | 0x000b)
-#define NT_STATUS_TIMER_NOT_CANCELED (0xC0000000 | 0x000c)
-#define NT_STATUS_INVALID_PARAMETER (0xC0000000 | 0x000d)
-#define NT_STATUS_NO_SUCH_DEVICE (0xC0000000 | 0x000e)
-#define NT_STATUS_NO_SUCH_FILE (0xC0000000 | 0x000f)
-#define NT_STATUS_INVALID_DEVICE_REQUEST (0xC0000000 | 0x0010)
-#define NT_STATUS_END_OF_FILE (0xC0000000 | 0x0011)
-#define NT_STATUS_WRONG_VOLUME (0xC0000000 | 0x0012)
-#define NT_STATUS_NO_MEDIA_IN_DEVICE (0xC0000000 | 0x0013)
-#define NT_STATUS_UNRECOGNIZED_MEDIA (0xC0000000 | 0x0014)
-#define NT_STATUS_NONEXISTENT_SECTOR (0xC0000000 | 0x0015)
-#define NT_STATUS_MORE_PROCESSING_REQUIRED (0xC0000000 | 0x0016)
-#define NT_STATUS_NO_MEMORY (0xC0000000 | 0x0017)
-#define NT_STATUS_CONFLICTING_ADDRESSES (0xC0000000 | 0x0018)
-#define NT_STATUS_NOT_MAPPED_VIEW (0xC0000000 | 0x0019)
-#define NT_STATUS_UNABLE_TO_FREE_VM (0x80000000 | 0x001a)
-#define NT_STATUS_UNABLE_TO_DELETE_SECTION (0xC0000000 | 0x001b)
-#define NT_STATUS_INVALID_SYSTEM_SERVICE (0xC0000000 | 0x001c)
-#define NT_STATUS_ILLEGAL_INSTRUCTION (0xC0000000 | 0x001d)
-#define NT_STATUS_INVALID_LOCK_SEQUENCE (0xC0000000 | 0x001e)
-#define NT_STATUS_INVALID_VIEW_SIZE (0xC0000000 | 0x001f)
-#define NT_STATUS_INVALID_FILE_FOR_SECTION (0xC0000000 | 0x0020)
-#define NT_STATUS_ALREADY_COMMITTED (0xC0000000 | 0x0021)
-#define NT_STATUS_ACCESS_DENIED (0xC0000000 | 0x0022)
-#define NT_STATUS_BUFFER_TOO_SMALL (0xC0000000 | 0x0023)
-#define NT_STATUS_OBJECT_TYPE_MISMATCH (0xC0000000 | 0x0024)
-#define NT_STATUS_NONCONTINUABLE_EXCEPTION (0xC0000000 | 0x0025)
-#define NT_STATUS_INVALID_DISPOSITION (0xC0000000 | 0x0026)
-#define NT_STATUS_UNWIND (0xC0000000 | 0x0027)
-#define NT_STATUS_BAD_STACK (0xC0000000 | 0x0028)
-#define NT_STATUS_INVALID_UNWIND_TARGET (0xC0000000 | 0x0029)
-#define NT_STATUS_NOT_LOCKED (0xC0000000 | 0x002a)
-#define NT_STATUS_PARITY_ERROR (0xC0000000 | 0x002b)
-#define NT_STATUS_UNABLE_TO_DECOMMIT_VM (0xC0000000 | 0x002c)
-#define NT_STATUS_NOT_COMMITTED (0xC0000000 | 0x002d)
-#define NT_STATUS_INVALID_PORT_ATTRIBUTES (0xC0000000 | 0x002e)
-#define NT_STATUS_PORT_MESSAGE_TOO_LONG (0xC0000000 | 0x002f)
-#define NT_STATUS_INVALID_PARAMETER_MIX (0xC0000000 | 0x0030)
-#define NT_STATUS_INVALID_QUOTA_LOWER (0xC0000000 | 0x0031)
-#define NT_STATUS_DISK_CORRUPT_ERROR (0xC0000000 | 0x0032)
-#define NT_STATUS_OBJECT_NAME_INVALID (0xC0000000 | 0x0033)
-#define NT_STATUS_OBJECT_NAME_NOT_FOUND (0xC0000000 | 0x0034)
-#define NT_STATUS_OBJECT_NAME_COLLISION (0xC0000000 | 0x0035)
-#define NT_STATUS_HANDLE_NOT_WAITABLE (0xC0000000 | 0x0036)
-#define NT_STATUS_PORT_DISCONNECTED (0xC0000000 | 0x0037)
-#define NT_STATUS_DEVICE_ALREADY_ATTACHED (0xC0000000 | 0x0038)
-#define NT_STATUS_OBJECT_PATH_INVALID (0xC0000000 | 0x0039)
-#define NT_STATUS_OBJECT_PATH_NOT_FOUND (0xC0000000 | 0x003a)
-#define NT_STATUS_OBJECT_PATH_SYNTAX_BAD (0xC0000000 | 0x003b)
-#define NT_STATUS_DATA_OVERRUN (0xC0000000 | 0x003c)
-#define NT_STATUS_DATA_LATE_ERROR (0xC0000000 | 0x003d)
-#define NT_STATUS_DATA_ERROR (0xC0000000 | 0x003e)
-#define NT_STATUS_CRC_ERROR (0xC0000000 | 0x003f)
-#define NT_STATUS_SECTION_TOO_BIG (0xC0000000 | 0x0040)
-#define NT_STATUS_PORT_CONNECTION_REFUSED (0xC0000000 | 0x0041)
-#define NT_STATUS_INVALID_PORT_HANDLE (0xC0000000 | 0x0042)
-#define NT_STATUS_SHARING_VIOLATION (0xC0000000 | 0x0043)
-#define NT_STATUS_QUOTA_EXCEEDED (0xC0000000 | 0x0044)
-#define NT_STATUS_INVALID_PAGE_PROTECTION (0xC0000000 | 0x0045)
-#define NT_STATUS_MUTANT_NOT_OWNED (0xC0000000 | 0x0046)
-#define NT_STATUS_SEMAPHORE_LIMIT_EXCEEDED (0xC0000000 | 0x0047)
-#define NT_STATUS_PORT_ALREADY_SET (0xC0000000 | 0x0048)
-#define NT_STATUS_SECTION_NOT_IMAGE (0xC0000000 | 0x0049)
-#define NT_STATUS_SUSPEND_COUNT_EXCEEDED (0xC0000000 | 0x004a)
-#define NT_STATUS_THREAD_IS_TERMINATING (0xC0000000 | 0x004b)
-#define NT_STATUS_BAD_WORKING_SET_LIMIT (0xC0000000 | 0x004c)
-#define NT_STATUS_INCOMPATIBLE_FILE_MAP (0xC0000000 | 0x004d)
-#define NT_STATUS_SECTION_PROTECTION (0xC0000000 | 0x004e)
-#define NT_STATUS_EAS_NOT_SUPPORTED (0xC0000000 | 0x004f)
-#define NT_STATUS_EA_TOO_LARGE (0xC0000000 | 0x0050)
-#define NT_STATUS_NONEXISTENT_EA_ENTRY (0xC0000000 | 0x0051)
-#define NT_STATUS_NO_EAS_ON_FILE (0xC0000000 | 0x0052)
-#define NT_STATUS_EA_CORRUPT_ERROR (0xC0000000 | 0x0053)
-#define NT_STATUS_FILE_LOCK_CONFLICT (0xC0000000 | 0x0054)
-#define NT_STATUS_LOCK_NOT_GRANTED (0xC0000000 | 0x0055)
-#define NT_STATUS_DELETE_PENDING (0xC0000000 | 0x0056)
-#define NT_STATUS_CTL_FILE_NOT_SUPPORTED (0xC0000000 | 0x0057)
-#define NT_STATUS_UNKNOWN_REVISION (0xC0000000 | 0x0058)
-#define NT_STATUS_REVISION_MISMATCH (0xC0000000 | 0x0059)
-#define NT_STATUS_INVALID_OWNER (0xC0000000 | 0x005a)
-#define NT_STATUS_INVALID_PRIMARY_GROUP (0xC0000000 | 0x005b)
-#define NT_STATUS_NO_IMPERSONATION_TOKEN (0xC0000000 | 0x005c)
-#define NT_STATUS_CANT_DISABLE_MANDATORY (0xC0000000 | 0x005d)
-#define NT_STATUS_NO_LOGON_SERVERS (0xC0000000 | 0x005e)
-#define NT_STATUS_NO_SUCH_LOGON_SESSION (0xC0000000 | 0x005f)
-#define NT_STATUS_NO_SUCH_PRIVILEGE (0xC0000000 | 0x0060)
-#define NT_STATUS_PRIVILEGE_NOT_HELD (0xC0000000 | 0x0061)
-#define NT_STATUS_INVALID_ACCOUNT_NAME (0xC0000000 | 0x0062)
-#define NT_STATUS_USER_EXISTS (0xC0000000 | 0x0063)
-#define NT_STATUS_NO_SUCH_USER (0xC0000000 | 0x0064)
-#define NT_STATUS_GROUP_EXISTS (0xC0000000 | 0x0065)
-#define NT_STATUS_NO_SUCH_GROUP (0xC0000000 | 0x0066)
-#define NT_STATUS_MEMBER_IN_GROUP (0xC0000000 | 0x0067)
-#define NT_STATUS_MEMBER_NOT_IN_GROUP (0xC0000000 | 0x0068)
-#define NT_STATUS_LAST_ADMIN (0xC0000000 | 0x0069)
-#define NT_STATUS_WRONG_PASSWORD (0xC0000000 | 0x006a)
-#define NT_STATUS_ILL_FORMED_PASSWORD (0xC0000000 | 0x006b)
-#define NT_STATUS_PASSWORD_RESTRICTION (0xC0000000 | 0x006c)
-#define NT_STATUS_LOGON_FAILURE (0xC0000000 | 0x006d)
-#define NT_STATUS_ACCOUNT_RESTRICTION (0xC0000000 | 0x006e)
-#define NT_STATUS_INVALID_LOGON_HOURS (0xC0000000 | 0x006f)
-#define NT_STATUS_INVALID_WORKSTATION (0xC0000000 | 0x0070)
-#define NT_STATUS_PASSWORD_EXPIRED (0xC0000000 | 0x0071)
-#define NT_STATUS_ACCOUNT_DISABLED (0xC0000000 | 0x0072)
-#define NT_STATUS_NONE_MAPPED (0xC0000000 | 0x0073)
-#define NT_STATUS_TOO_MANY_LUIDS_REQUESTED (0xC0000000 | 0x0074)
-#define NT_STATUS_LUIDS_EXHAUSTED (0xC0000000 | 0x0075)
-#define NT_STATUS_INVALID_SUB_AUTHORITY (0xC0000000 | 0x0076)
-#define NT_STATUS_INVALID_ACL (0xC0000000 | 0x0077)
-#define NT_STATUS_INVALID_SID (0xC0000000 | 0x0078)
-#define NT_STATUS_INVALID_SECURITY_DESCR (0xC0000000 | 0x0079)
-#define NT_STATUS_PROCEDURE_NOT_FOUND (0xC0000000 | 0x007a)
-#define NT_STATUS_INVALID_IMAGE_FORMAT (0xC0000000 | 0x007b)
-#define NT_STATUS_NO_TOKEN (0xC0000000 | 0x007c)
-#define NT_STATUS_BAD_INHERITANCE_ACL (0xC0000000 | 0x007d)
-#define NT_STATUS_RANGE_NOT_LOCKED (0xC0000000 | 0x007e)
-#define NT_STATUS_DISK_FULL (0xC0000000 | 0x007f)
-#define NT_STATUS_SERVER_DISABLED (0xC0000000 | 0x0080)
-#define NT_STATUS_SERVER_NOT_DISABLED (0xC0000000 | 0x0081)
-#define NT_STATUS_TOO_MANY_GUIDS_REQUESTED (0xC0000000 | 0x0082)
-#define NT_STATUS_GUIDS_EXHAUSTED (0xC0000000 | 0x0083)
-#define NT_STATUS_INVALID_ID_AUTHORITY (0xC0000000 | 0x0084)
-#define NT_STATUS_AGENTS_EXHAUSTED (0xC0000000 | 0x0085)
-#define NT_STATUS_INVALID_VOLUME_LABEL (0xC0000000 | 0x0086)
-#define NT_STATUS_SECTION_NOT_EXTENDED (0xC0000000 | 0x0087)
-#define NT_STATUS_NOT_MAPPED_DATA (0xC0000000 | 0x0088)
-#define NT_STATUS_RESOURCE_DATA_NOT_FOUND (0xC0000000 | 0x0089)
-#define NT_STATUS_RESOURCE_TYPE_NOT_FOUND (0xC0000000 | 0x008a)
-#define NT_STATUS_RESOURCE_NAME_NOT_FOUND (0xC0000000 | 0x008b)
-#define NT_STATUS_ARRAY_BOUNDS_EXCEEDED (0xC0000000 | 0x008c)
-#define NT_STATUS_FLOAT_DENORMAL_OPERAND (0xC0000000 | 0x008d)
-#define NT_STATUS_FLOAT_DIVIDE_BY_ZERO (0xC0000000 | 0x008e)
-#define NT_STATUS_FLOAT_INEXACT_RESULT (0xC0000000 | 0x008f)
-#define NT_STATUS_FLOAT_INVALID_OPERATION (0xC0000000 | 0x0090)
-#define NT_STATUS_FLOAT_OVERFLOW (0xC0000000 | 0x0091)
-#define NT_STATUS_FLOAT_STACK_CHECK (0xC0000000 | 0x0092)
-#define NT_STATUS_FLOAT_UNDERFLOW (0xC0000000 | 0x0093)
-#define NT_STATUS_INTEGER_DIVIDE_BY_ZERO (0xC0000000 | 0x0094)
-#define NT_STATUS_INTEGER_OVERFLOW (0xC0000000 | 0x0095)
-#define NT_STATUS_PRIVILEGED_INSTRUCTION (0xC0000000 | 0x0096)
-#define NT_STATUS_TOO_MANY_PAGING_FILES (0xC0000000 | 0x0097)
-#define NT_STATUS_FILE_INVALID (0xC0000000 | 0x0098)
-#define NT_STATUS_ALLOTTED_SPACE_EXCEEDED (0xC0000000 | 0x0099)
-#define NT_STATUS_INSUFFICIENT_RESOURCES (0xC0000000 | 0x009a)
-#define NT_STATUS_DFS_EXIT_PATH_FOUND (0xC0000000 | 0x009b)
-#define NT_STATUS_DEVICE_DATA_ERROR (0xC0000000 | 0x009c)
-#define NT_STATUS_DEVICE_NOT_CONNECTED (0xC0000000 | 0x009d)
-#define NT_STATUS_DEVICE_POWER_FAILURE (0xC0000000 | 0x009e)
-#define NT_STATUS_FREE_VM_NOT_AT_BASE (0xC0000000 | 0x009f)
-#define NT_STATUS_MEMORY_NOT_ALLOCATED (0xC0000000 | 0x00a0)
-#define NT_STATUS_WORKING_SET_QUOTA (0xC0000000 | 0x00a1)
-#define NT_STATUS_MEDIA_WRITE_PROTECTED (0xC0000000 | 0x00a2)
-#define NT_STATUS_DEVICE_NOT_READY (0xC0000000 | 0x00a3)
-#define NT_STATUS_INVALID_GROUP_ATTRIBUTES (0xC0000000 | 0x00a4)
-#define NT_STATUS_BAD_IMPERSONATION_LEVEL (0xC0000000 | 0x00a5)
-#define NT_STATUS_CANT_OPEN_ANONYMOUS (0xC0000000 | 0x00a6)
-#define NT_STATUS_BAD_VALIDATION_CLASS (0xC0000000 | 0x00a7)
-#define NT_STATUS_BAD_TOKEN_TYPE (0xC0000000 | 0x00a8)
-#define NT_STATUS_BAD_MASTER_BOOT_RECORD (0xC0000000 | 0x00a9)
-#define NT_STATUS_INSTRUCTION_MISALIGNMENT (0xC0000000 | 0x00aa)
-#define NT_STATUS_INSTANCE_NOT_AVAILABLE (0xC0000000 | 0x00ab)
-#define NT_STATUS_PIPE_NOT_AVAILABLE (0xC0000000 | 0x00ac)
-#define NT_STATUS_INVALID_PIPE_STATE (0xC0000000 | 0x00ad)
-#define NT_STATUS_PIPE_BUSY (0xC0000000 | 0x00ae)
-#define NT_STATUS_ILLEGAL_FUNCTION (0xC0000000 | 0x00af)
-#define NT_STATUS_PIPE_DISCONNECTED (0xC0000000 | 0x00b0)
-#define NT_STATUS_PIPE_CLOSING (0xC0000000 | 0x00b1)
-#define NT_STATUS_PIPE_CONNECTED (0xC0000000 | 0x00b2)
-#define NT_STATUS_PIPE_LISTENING (0xC0000000 | 0x00b3)
-#define NT_STATUS_INVALID_READ_MODE (0xC0000000 | 0x00b4)
-#define NT_STATUS_IO_TIMEOUT (0xC0000000 | 0x00b5)
-#define NT_STATUS_FILE_FORCED_CLOSED (0xC0000000 | 0x00b6)
-#define NT_STATUS_PROFILING_NOT_STARTED (0xC0000000 | 0x00b7)
-#define NT_STATUS_PROFILING_NOT_STOPPED (0xC0000000 | 0x00b8)
-#define NT_STATUS_COULD_NOT_INTERPRET (0xC0000000 | 0x00b9)
-#define NT_STATUS_FILE_IS_A_DIRECTORY (0xC0000000 | 0x00ba)
-#define NT_STATUS_NOT_SUPPORTED (0xC0000000 | 0x00bb)
-#define NT_STATUS_REMOTE_NOT_LISTENING (0xC0000000 | 0x00bc)
-#define NT_STATUS_DUPLICATE_NAME (0xC0000000 | 0x00bd)
-#define NT_STATUS_BAD_NETWORK_PATH (0xC0000000 | 0x00be)
-#define NT_STATUS_NETWORK_BUSY (0xC0000000 | 0x00bf)
-#define NT_STATUS_DEVICE_DOES_NOT_EXIST (0xC0000000 | 0x00c0)
-#define NT_STATUS_TOO_MANY_COMMANDS (0xC0000000 | 0x00c1)
-#define NT_STATUS_ADAPTER_HARDWARE_ERROR (0xC0000000 | 0x00c2)
-#define NT_STATUS_INVALID_NETWORK_RESPONSE (0xC0000000 | 0x00c3)
-#define NT_STATUS_UNEXPECTED_NETWORK_ERROR (0xC0000000 | 0x00c4)
-#define NT_STATUS_BAD_REMOTE_ADAPTER (0xC0000000 | 0x00c5)
-#define NT_STATUS_PRINT_QUEUE_FULL (0xC0000000 | 0x00c6)
-#define NT_STATUS_NO_SPOOL_SPACE (0xC0000000 | 0x00c7)
-#define NT_STATUS_PRINT_CANCELLED (0xC0000000 | 0x00c8)
-#define NT_STATUS_NETWORK_NAME_DELETED (0xC0000000 | 0x00c9)
-#define NT_STATUS_NETWORK_ACCESS_DENIED (0xC0000000 | 0x00ca)
-#define NT_STATUS_BAD_DEVICE_TYPE (0xC0000000 | 0x00cb)
-#define NT_STATUS_BAD_NETWORK_NAME (0xC0000000 | 0x00cc)
-#define NT_STATUS_TOO_MANY_NAMES (0xC0000000 | 0x00cd)
-#define NT_STATUS_TOO_MANY_SESSIONS (0xC0000000 | 0x00ce)
-#define NT_STATUS_SHARING_PAUSED (0xC0000000 | 0x00cf)
-#define NT_STATUS_REQUEST_NOT_ACCEPTED (0xC0000000 | 0x00d0)
-#define NT_STATUS_REDIRECTOR_PAUSED (0xC0000000 | 0x00d1)
-#define NT_STATUS_NET_WRITE_FAULT (0xC0000000 | 0x00d2)
-#define NT_STATUS_PROFILING_AT_LIMIT (0xC0000000 | 0x00d3)
-#define NT_STATUS_NOT_SAME_DEVICE (0xC0000000 | 0x00d4)
-#define NT_STATUS_FILE_RENAMED (0xC0000000 | 0x00d5)
-#define NT_STATUS_VIRTUAL_CIRCUIT_CLOSED (0xC0000000 | 0x00d6)
-#define NT_STATUS_NO_SECURITY_ON_OBJECT (0xC0000000 | 0x00d7)
-#define NT_STATUS_CANT_WAIT (0xC0000000 | 0x00d8)
-#define NT_STATUS_PIPE_EMPTY (0xC0000000 | 0x00d9)
-#define NT_STATUS_CANT_ACCESS_DOMAIN_INFO (0xC0000000 | 0x00da)
-#define NT_STATUS_CANT_TERMINATE_SELF (0xC0000000 | 0x00db)
-#define NT_STATUS_INVALID_SERVER_STATE (0xC0000000 | 0x00dc)
-#define NT_STATUS_INVALID_DOMAIN_STATE (0xC0000000 | 0x00dd)
-#define NT_STATUS_INVALID_DOMAIN_ROLE (0xC0000000 | 0x00de)
-#define NT_STATUS_NO_SUCH_DOMAIN (0xC0000000 | 0x00df)
-#define NT_STATUS_DOMAIN_EXISTS (0xC0000000 | 0x00e0)
-#define NT_STATUS_DOMAIN_LIMIT_EXCEEDED (0xC0000000 | 0x00e1)
-#define NT_STATUS_OPLOCK_NOT_GRANTED (0xC0000000 | 0x00e2)
-#define NT_STATUS_INVALID_OPLOCK_PROTOCOL (0xC0000000 | 0x00e3)
-#define NT_STATUS_INTERNAL_DB_CORRUPTION (0xC0000000 | 0x00e4)
-#define NT_STATUS_INTERNAL_ERROR (0xC0000000 | 0x00e5)
-#define NT_STATUS_GENERIC_NOT_MAPPED (0xC0000000 | 0x00e6)
-#define NT_STATUS_BAD_DESCRIPTOR_FORMAT (0xC0000000 | 0x00e7)
-#define NT_STATUS_INVALID_USER_BUFFER (0xC0000000 | 0x00e8)
-#define NT_STATUS_UNEXPECTED_IO_ERROR (0xC0000000 | 0x00e9)
-#define NT_STATUS_UNEXPECTED_MM_CREATE_ERR (0xC0000000 | 0x00ea)
-#define NT_STATUS_UNEXPECTED_MM_MAP_ERROR (0xC0000000 | 0x00eb)
-#define NT_STATUS_UNEXPECTED_MM_EXTEND_ERR (0xC0000000 | 0x00ec)
-#define NT_STATUS_NOT_LOGON_PROCESS (0xC0000000 | 0x00ed)
-#define NT_STATUS_LOGON_SESSION_EXISTS (0xC0000000 | 0x00ee)
-#define NT_STATUS_INVALID_PARAMETER_1 (0xC0000000 | 0x00ef)
-#define NT_STATUS_INVALID_PARAMETER_2 (0xC0000000 | 0x00f0)
-#define NT_STATUS_INVALID_PARAMETER_3 (0xC0000000 | 0x00f1)
-#define NT_STATUS_INVALID_PARAMETER_4 (0xC0000000 | 0x00f2)
-#define NT_STATUS_INVALID_PARAMETER_5 (0xC0000000 | 0x00f3)
-#define NT_STATUS_INVALID_PARAMETER_6 (0xC0000000 | 0x00f4)
-#define NT_STATUS_INVALID_PARAMETER_7 (0xC0000000 | 0x00f5)
-#define NT_STATUS_INVALID_PARAMETER_8 (0xC0000000 | 0x00f6)
-#define NT_STATUS_INVALID_PARAMETER_9 (0xC0000000 | 0x00f7)
-#define NT_STATUS_INVALID_PARAMETER_10 (0xC0000000 | 0x00f8)
-#define NT_STATUS_INVALID_PARAMETER_11 (0xC0000000 | 0x00f9)
-#define NT_STATUS_INVALID_PARAMETER_12 (0xC0000000 | 0x00fa)
-#define NT_STATUS_REDIRECTOR_NOT_STARTED (0xC0000000 | 0x00fb)
-#define NT_STATUS_REDIRECTOR_STARTED (0xC0000000 | 0x00fc)
-#define NT_STATUS_STACK_OVERFLOW (0xC0000000 | 0x00fd)
-#define NT_STATUS_NO_SUCH_PACKAGE (0xC0000000 | 0x00fe)
-#define NT_STATUS_BAD_FUNCTION_TABLE (0xC0000000 | 0x00ff)
-#define NT_STATUS_DIRECTORY_NOT_EMPTY (0xC0000000 | 0x0101)
-#define NT_STATUS_FILE_CORRUPT_ERROR (0xC0000000 | 0x0102)
-#define NT_STATUS_NOT_A_DIRECTORY (0xC0000000 | 0x0103)
-#define NT_STATUS_BAD_LOGON_SESSION_STATE (0xC0000000 | 0x0104)
-#define NT_STATUS_LOGON_SESSION_COLLISION (0xC0000000 | 0x0105)
-#define NT_STATUS_NAME_TOO_LONG (0xC0000000 | 0x0106)
-#define NT_STATUS_FILES_OPEN (0xC0000000 | 0x0107)
-#define NT_STATUS_CONNECTION_IN_USE (0xC0000000 | 0x0108)
-#define NT_STATUS_MESSAGE_NOT_FOUND (0xC0000000 | 0x0109)
-#define NT_STATUS_PROCESS_IS_TERMINATING (0xC0000000 | 0x010a)
-#define NT_STATUS_INVALID_LOGON_TYPE (0xC0000000 | 0x010b)
-#define NT_STATUS_NO_GUID_TRANSLATION (0xC0000000 | 0x010c)
-#define NT_STATUS_CANNOT_IMPERSONATE (0xC0000000 | 0x010d)
-#define NT_STATUS_IMAGE_ALREADY_LOADED (0xC0000000 | 0x010e)
-#define NT_STATUS_ABIOS_NOT_PRESENT (0xC0000000 | 0x010f)
-#define NT_STATUS_ABIOS_LID_NOT_EXIST (0xC0000000 | 0x0110)
-#define NT_STATUS_ABIOS_LID_ALREADY_OWNED (0xC0000000 | 0x0111)
-#define NT_STATUS_ABIOS_NOT_LID_OWNER (0xC0000000 | 0x0112)
-#define NT_STATUS_ABIOS_INVALID_COMMAND (0xC0000000 | 0x0113)
-#define NT_STATUS_ABIOS_INVALID_LID (0xC0000000 | 0x0114)
-#define NT_STATUS_ABIOS_SELECTOR_NOT_AVAILABLE (0xC0000000 | 0x0115)
-#define NT_STATUS_ABIOS_INVALID_SELECTOR (0xC0000000 | 0x0116)
-#define NT_STATUS_NO_LDT (0xC0000000 | 0x0117)
-#define NT_STATUS_INVALID_LDT_SIZE (0xC0000000 | 0x0118)
-#define NT_STATUS_INVALID_LDT_OFFSET (0xC0000000 | 0x0119)
-#define NT_STATUS_INVALID_LDT_DESCRIPTOR (0xC0000000 | 0x011a)
-#define NT_STATUS_INVALID_IMAGE_NE_FORMAT (0xC0000000 | 0x011b)
-#define NT_STATUS_RXACT_INVALID_STATE (0xC0000000 | 0x011c)
-#define NT_STATUS_RXACT_COMMIT_FAILURE (0xC0000000 | 0x011d)
-#define NT_STATUS_MAPPED_FILE_SIZE_ZERO (0xC0000000 | 0x011e)
-#define NT_STATUS_TOO_MANY_OPENED_FILES (0xC0000000 | 0x011f)
-#define NT_STATUS_CANCELLED (0xC0000000 | 0x0120)
-#define NT_STATUS_CANNOT_DELETE (0xC0000000 | 0x0121)
-#define NT_STATUS_INVALID_COMPUTER_NAME (0xC0000000 | 0x0122)
-#define NT_STATUS_FILE_DELETED (0xC0000000 | 0x0123)
-#define NT_STATUS_SPECIAL_ACCOUNT (0xC0000000 | 0x0124)
-#define NT_STATUS_SPECIAL_GROUP (0xC0000000 | 0x0125)
-#define NT_STATUS_SPECIAL_USER (0xC0000000 | 0x0126)
-#define NT_STATUS_MEMBERS_PRIMARY_GROUP (0xC0000000 | 0x0127)
-#define NT_STATUS_FILE_CLOSED (0xC0000000 | 0x0128)
-#define NT_STATUS_TOO_MANY_THREADS (0xC0000000 | 0x0129)
-#define NT_STATUS_THREAD_NOT_IN_PROCESS (0xC0000000 | 0x012a)
-#define NT_STATUS_TOKEN_ALREADY_IN_USE (0xC0000000 | 0x012b)
-#define NT_STATUS_PAGEFILE_QUOTA_EXCEEDED (0xC0000000 | 0x012c)
-#define NT_STATUS_COMMITMENT_LIMIT (0xC0000000 | 0x012d)
-#define NT_STATUS_INVALID_IMAGE_LE_FORMAT (0xC0000000 | 0x012e)
-#define NT_STATUS_INVALID_IMAGE_NOT_MZ (0xC0000000 | 0x012f)
-#define NT_STATUS_INVALID_IMAGE_PROTECT (0xC0000000 | 0x0130)
-#define NT_STATUS_INVALID_IMAGE_WIN_16 (0xC0000000 | 0x0131)
-#define NT_STATUS_LOGON_SERVER_CONFLICT (0xC0000000 | 0x0132)
-#define NT_STATUS_TIME_DIFFERENCE_AT_DC (0xC0000000 | 0x0133)
-#define NT_STATUS_SYNCHRONIZATION_REQUIRED (0xC0000000 | 0x0134)
-#define NT_STATUS_DLL_NOT_FOUND (0xC0000000 | 0x0135)
-#define NT_STATUS_OPEN_FAILED (0xC0000000 | 0x0136)
-#define NT_STATUS_IO_PRIVILEGE_FAILED (0xC0000000 | 0x0137)
-#define NT_STATUS_ORDINAL_NOT_FOUND (0xC0000000 | 0x0138)
-#define NT_STATUS_ENTRYPOINT_NOT_FOUND (0xC0000000 | 0x0139)
-#define NT_STATUS_CONTROL_C_EXIT (0xC0000000 | 0x013a)
-#define NT_STATUS_LOCAL_DISCONNECT (0xC0000000 | 0x013b)
-#define NT_STATUS_REMOTE_DISCONNECT (0xC0000000 | 0x013c)
-#define NT_STATUS_REMOTE_RESOURCES (0xC0000000 | 0x013d)
-#define NT_STATUS_LINK_FAILED (0xC0000000 | 0x013e)
-#define NT_STATUS_LINK_TIMEOUT (0xC0000000 | 0x013f)
-#define NT_STATUS_INVALID_CONNECTION (0xC0000000 | 0x0140)
-#define NT_STATUS_INVALID_ADDRESS (0xC0000000 | 0x0141)
-#define NT_STATUS_DLL_INIT_FAILED (0xC0000000 | 0x0142)
-#define NT_STATUS_MISSING_SYSTEMFILE (0xC0000000 | 0x0143)
-#define NT_STATUS_UNHANDLED_EXCEPTION (0xC0000000 | 0x0144)
-#define NT_STATUS_APP_INIT_FAILURE (0xC0000000 | 0x0145)
-#define NT_STATUS_PAGEFILE_CREATE_FAILED (0xC0000000 | 0x0146)
-#define NT_STATUS_NO_PAGEFILE (0xC0000000 | 0x0147)
-#define NT_STATUS_INVALID_LEVEL (0xC0000000 | 0x0148)
-#define NT_STATUS_WRONG_PASSWORD_CORE (0xC0000000 | 0x0149)
-#define NT_STATUS_ILLEGAL_FLOAT_CONTEXT (0xC0000000 | 0x014a)
-#define NT_STATUS_PIPE_BROKEN (0xC0000000 | 0x014b)
-#define NT_STATUS_REGISTRY_CORRUPT (0xC0000000 | 0x014c)
-#define NT_STATUS_REGISTRY_IO_FAILED (0xC0000000 | 0x014d)
-#define NT_STATUS_NO_EVENT_PAIR (0xC0000000 | 0x014e)
-#define NT_STATUS_UNRECOGNIZED_VOLUME (0xC0000000 | 0x014f)
-#define NT_STATUS_SERIAL_NO_DEVICE_INITED (0xC0000000 | 0x0150)
-#define NT_STATUS_NO_SUCH_ALIAS (0xC0000000 | 0x0151)
-#define NT_STATUS_MEMBER_NOT_IN_ALIAS (0xC0000000 | 0x0152)
-#define NT_STATUS_MEMBER_IN_ALIAS (0xC0000000 | 0x0153)
-#define NT_STATUS_ALIAS_EXISTS (0xC0000000 | 0x0154)
-#define NT_STATUS_LOGON_NOT_GRANTED (0xC0000000 | 0x0155)
-#define NT_STATUS_TOO_MANY_SECRETS (0xC0000000 | 0x0156)
-#define NT_STATUS_SECRET_TOO_LONG (0xC0000000 | 0x0157)
-#define NT_STATUS_INTERNAL_DB_ERROR (0xC0000000 | 0x0158)
-#define NT_STATUS_FULLSCREEN_MODE (0xC0000000 | 0x0159)
-#define NT_STATUS_TOO_MANY_CONTEXT_IDS (0xC0000000 | 0x015a)
-#define NT_STATUS_LOGON_TYPE_NOT_GRANTED (0xC0000000 | 0x015b)
-#define NT_STATUS_NOT_REGISTRY_FILE (0xC0000000 | 0x015c)
-#define NT_STATUS_NT_CROSS_ENCRYPTION_REQUIRED (0xC0000000 | 0x015d)
-#define NT_STATUS_DOMAIN_CTRLR_CONFIG_ERROR (0xC0000000 | 0x015e)
-#define NT_STATUS_FT_MISSING_MEMBER (0xC0000000 | 0x015f)
-#define NT_STATUS_ILL_FORMED_SERVICE_ENTRY (0xC0000000 | 0x0160)
-#define NT_STATUS_ILLEGAL_CHARACTER (0xC0000000 | 0x0161)
-#define NT_STATUS_UNMAPPABLE_CHARACTER (0xC0000000 | 0x0162)
-#define NT_STATUS_UNDEFINED_CHARACTER (0xC0000000 | 0x0163)
-#define NT_STATUS_FLOPPY_VOLUME (0xC0000000 | 0x0164)
-#define NT_STATUS_FLOPPY_ID_MARK_NOT_FOUND (0xC0000000 | 0x0165)
-#define NT_STATUS_FLOPPY_WRONG_CYLINDER (0xC0000000 | 0x0166)
-#define NT_STATUS_FLOPPY_UNKNOWN_ERROR (0xC0000000 | 0x0167)
-#define NT_STATUS_FLOPPY_BAD_REGISTERS (0xC0000000 | 0x0168)
-#define NT_STATUS_DISK_RECALIBRATE_FAILED (0xC0000000 | 0x0169)
-#define NT_STATUS_DISK_OPERATION_FAILED (0xC0000000 | 0x016a)
-#define NT_STATUS_DISK_RESET_FAILED (0xC0000000 | 0x016b)
-#define NT_STATUS_SHARED_IRQ_BUSY (0xC0000000 | 0x016c)
-#define NT_STATUS_FT_ORPHANING (0xC0000000 | 0x016d)
-#define NT_STATUS_PARTITION_FAILURE (0xC0000000 | 0x0172)
-#define NT_STATUS_INVALID_BLOCK_LENGTH (0xC0000000 | 0x0173)
-#define NT_STATUS_DEVICE_NOT_PARTITIONED (0xC0000000 | 0x0174)
-#define NT_STATUS_UNABLE_TO_LOCK_MEDIA (0xC0000000 | 0x0175)
-#define NT_STATUS_UNABLE_TO_UNLOAD_MEDIA (0xC0000000 | 0x0176)
-#define NT_STATUS_EOM_OVERFLOW (0xC0000000 | 0x0177)
-#define NT_STATUS_NO_MEDIA (0xC0000000 | 0x0178)
-#define NT_STATUS_NO_SUCH_MEMBER (0xC0000000 | 0x017a)
-#define NT_STATUS_INVALID_MEMBER (0xC0000000 | 0x017b)
-#define NT_STATUS_KEY_DELETED (0xC0000000 | 0x017c)
-#define NT_STATUS_NO_LOG_SPACE (0xC0000000 | 0x017d)
-#define NT_STATUS_TOO_MANY_SIDS (0xC0000000 | 0x017e)
-#define NT_STATUS_LM_CROSS_ENCRYPTION_REQUIRED (0xC0000000 | 0x017f)
-#define NT_STATUS_KEY_HAS_CHILDREN (0xC0000000 | 0x0180)
-#define NT_STATUS_CHILD_MUST_BE_VOLATILE (0xC0000000 | 0x0181)
-#define NT_STATUS_DEVICE_CONFIGURATION_ERROR (0xC0000000 | 0x0182)
-#define NT_STATUS_DRIVER_INTERNAL_ERROR (0xC0000000 | 0x0183)
-#define NT_STATUS_INVALID_DEVICE_STATE (0xC0000000 | 0x0184)
-#define NT_STATUS_IO_DEVICE_ERROR (0xC0000000 | 0x0185)
-#define NT_STATUS_DEVICE_PROTOCOL_ERROR (0xC0000000 | 0x0186)
-#define NT_STATUS_BACKUP_CONTROLLER (0xC0000000 | 0x0187)
-#define NT_STATUS_LOG_FILE_FULL (0xC0000000 | 0x0188)
-#define NT_STATUS_TOO_LATE (0xC0000000 | 0x0189)
-#define NT_STATUS_NO_TRUST_LSA_SECRET (0xC0000000 | 0x018a)
-#define NT_STATUS_NO_TRUST_SAM_ACCOUNT (0xC0000000 | 0x018b)
-#define NT_STATUS_TRUSTED_DOMAIN_FAILURE (0xC0000000 | 0x018c)
-#define NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE (0xC0000000 | 0x018d)
-#define NT_STATUS_EVENTLOG_FILE_CORRUPT (0xC0000000 | 0x018e)
-#define NT_STATUS_EVENTLOG_CANT_START (0xC0000000 | 0x018f)
-#define NT_STATUS_TRUST_FAILURE (0xC0000000 | 0x0190)
-#define NT_STATUS_MUTANT_LIMIT_EXCEEDED (0xC0000000 | 0x0191)
-#define NT_STATUS_NETLOGON_NOT_STARTED (0xC0000000 | 0x0192)
-#define NT_STATUS_ACCOUNT_EXPIRED (0xC0000000 | 0x0193)
-#define NT_STATUS_POSSIBLE_DEADLOCK (0xC0000000 | 0x0194)
-#define NT_STATUS_NETWORK_CREDENTIAL_CONFLICT (0xC0000000 | 0x0195)
-#define NT_STATUS_REMOTE_SESSION_LIMIT (0xC0000000 | 0x0196)
-#define NT_STATUS_EVENTLOG_FILE_CHANGED (0xC0000000 | 0x0197)
-#define NT_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT (0xC0000000 | 0x0198)
-#define NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT (0xC0000000 | 0x0199)
-#define NT_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT (0xC0000000 | 0x019a)
-#define NT_STATUS_DOMAIN_TRUST_INCONSISTENT (0xC0000000 | 0x019b)
-#define NT_STATUS_FS_DRIVER_REQUIRED (0xC0000000 | 0x019c)
-#define NT_STATUS_NO_USER_SESSION_KEY (0xC0000000 | 0x0202)
-#define NT_STATUS_USER_SESSION_DELETED (0xC0000000 | 0x0203)
-#define NT_STATUS_RESOURCE_LANG_NOT_FOUND (0xC0000000 | 0x0204)
-#define NT_STATUS_INSUFF_SERVER_RESOURCES (0xC0000000 | 0x0205)
-#define NT_STATUS_INVALID_BUFFER_SIZE (0xC0000000 | 0x0206)
-#define NT_STATUS_INVALID_ADDRESS_COMPONENT (0xC0000000 | 0x0207)
-#define NT_STATUS_INVALID_ADDRESS_WILDCARD (0xC0000000 | 0x0208)
-#define NT_STATUS_TOO_MANY_ADDRESSES (0xC0000000 | 0x0209)
-#define NT_STATUS_ADDRESS_ALREADY_EXISTS (0xC0000000 | 0x020a)
-#define NT_STATUS_ADDRESS_CLOSED (0xC0000000 | 0x020b)
-#define NT_STATUS_CONNECTION_DISCONNECTED (0xC0000000 | 0x020c)
-#define NT_STATUS_CONNECTION_RESET (0xC0000000 | 0x020d)
-#define NT_STATUS_TOO_MANY_NODES (0xC0000000 | 0x020e)
-#define NT_STATUS_TRANSACTION_ABORTED (0xC0000000 | 0x020f)
-#define NT_STATUS_TRANSACTION_TIMED_OUT (0xC0000000 | 0x0210)
-#define NT_STATUS_TRANSACTION_NO_RELEASE (0xC0000000 | 0x0211)
-#define NT_STATUS_TRANSACTION_NO_MATCH (0xC0000000 | 0x0212)
-#define NT_STATUS_TRANSACTION_RESPONDED (0xC0000000 | 0x0213)
-#define NT_STATUS_TRANSACTION_INVALID_ID (0xC0000000 | 0x0214)
-#define NT_STATUS_TRANSACTION_INVALID_TYPE (0xC0000000 | 0x0215)
-#define NT_STATUS_NOT_SERVER_SESSION (0xC0000000 | 0x0216)
-#define NT_STATUS_NOT_CLIENT_SESSION (0xC0000000 | 0x0217)
-#define NT_STATUS_CANNOT_LOAD_REGISTRY_FILE (0xC0000000 | 0x0218)
-#define NT_STATUS_DEBUG_ATTACH_FAILED (0xC0000000 | 0x0219)
-#define NT_STATUS_SYSTEM_PROCESS_TERMINATED (0xC0000000 | 0x021a)
-#define NT_STATUS_DATA_NOT_ACCEPTED (0xC0000000 | 0x021b)
-#define NT_STATUS_NO_BROWSER_SERVERS_FOUND (0xC0000000 | 0x021c)
-#define NT_STATUS_VDM_HARD_ERROR (0xC0000000 | 0x021d)
-#define NT_STATUS_DRIVER_CANCEL_TIMEOUT (0xC0000000 | 0x021e)
-#define NT_STATUS_REPLY_MESSAGE_MISMATCH (0xC0000000 | 0x021f)
-#define NT_STATUS_MAPPED_ALIGNMENT (0xC0000000 | 0x0220)
-#define NT_STATUS_IMAGE_CHECKSUM_MISMATCH (0xC0000000 | 0x0221)
-#define NT_STATUS_LOST_WRITEBEHIND_DATA (0xC0000000 | 0x0222)
-#define NT_STATUS_CLIENT_SERVER_PARAMETERS_INVALID (0xC0000000 | 0x0223)
-#define NT_STATUS_PASSWORD_MUST_CHANGE (0xC0000000 | 0x0224)
-#define NT_STATUS_NOT_FOUND (0xC0000000 | 0x0225)
-#define NT_STATUS_NOT_TINY_STREAM (0xC0000000 | 0x0226)
-#define NT_STATUS_RECOVERY_FAILURE (0xC0000000 | 0x0227)
-#define NT_STATUS_STACK_OVERFLOW_READ (0xC0000000 | 0x0228)
-#define NT_STATUS_FAIL_CHECK (0xC0000000 | 0x0229)
-#define NT_STATUS_DUPLICATE_OBJECTID (0xC0000000 | 0x022a)
-#define NT_STATUS_OBJECTID_EXISTS (0xC0000000 | 0x022b)
-#define NT_STATUS_CONVERT_TO_LARGE (0xC0000000 | 0x022c)
-#define NT_STATUS_RETRY (0xC0000000 | 0x022d)
-#define NT_STATUS_FOUND_OUT_OF_SCOPE (0xC0000000 | 0x022e)
-#define NT_STATUS_ALLOCATE_BUCKET (0xC0000000 | 0x022f)
-#define NT_STATUS_PROPSET_NOT_FOUND (0xC0000000 | 0x0230)
-#define NT_STATUS_MARSHALL_OVERFLOW (0xC0000000 | 0x0231)
-#define NT_STATUS_INVALID_VARIANT (0xC0000000 | 0x0232)
-#define NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND (0xC0000000 | 0x0233)
-#define NT_STATUS_ACCOUNT_LOCKED_OUT (0xC0000000 | 0x0234)
-#define NT_STATUS_HANDLE_NOT_CLOSABLE (0xC0000000 | 0x0235)
-#define NT_STATUS_CONNECTION_REFUSED (0xC0000000 | 0x0236)
-#define NT_STATUS_GRACEFUL_DISCONNECT (0xC0000000 | 0x0237)
-#define NT_STATUS_ADDRESS_ALREADY_ASSOCIATED (0xC0000000 | 0x0238)
-#define NT_STATUS_ADDRESS_NOT_ASSOCIATED (0xC0000000 | 0x0239)
-#define NT_STATUS_CONNECTION_INVALID (0xC0000000 | 0x023a)
-#define NT_STATUS_CONNECTION_ACTIVE (0xC0000000 | 0x023b)
-#define NT_STATUS_NETWORK_UNREACHABLE (0xC0000000 | 0x023c)
-#define NT_STATUS_HOST_UNREACHABLE (0xC0000000 | 0x023d)
-#define NT_STATUS_PROTOCOL_UNREACHABLE (0xC0000000 | 0x023e)
-#define NT_STATUS_PORT_UNREACHABLE (0xC0000000 | 0x023f)
-#define NT_STATUS_REQUEST_ABORTED (0xC0000000 | 0x0240)
-#define NT_STATUS_CONNECTION_ABORTED (0xC0000000 | 0x0241)
-#define NT_STATUS_BAD_COMPRESSION_BUFFER (0xC0000000 | 0x0242)
-#define NT_STATUS_USER_MAPPED_FILE (0xC0000000 | 0x0243)
-#define NT_STATUS_AUDIT_FAILED (0xC0000000 | 0x0244)
-#define NT_STATUS_TIMER_RESOLUTION_NOT_SET (0xC0000000 | 0x0245)
-#define NT_STATUS_CONNECTION_COUNT_LIMIT (0xC0000000 | 0x0246)
-#define NT_STATUS_LOGIN_TIME_RESTRICTION (0xC0000000 | 0x0247)
-#define NT_STATUS_LOGIN_WKSTA_RESTRICTION (0xC0000000 | 0x0248)
-#define NT_STATUS_IMAGE_MP_UP_MISMATCH (0xC0000000 | 0x0249)
-#define NT_STATUS_INSUFFICIENT_LOGON_INFO (0xC0000000 | 0x0250)
-#define NT_STATUS_BAD_DLL_ENTRYPOINT (0xC0000000 | 0x0251)
-#define NT_STATUS_BAD_SERVICE_ENTRYPOINT (0xC0000000 | 0x0252)
-#define NT_STATUS_LPC_REPLY_LOST (0xC0000000 | 0x0253)
-#define NT_STATUS_IP_ADDRESS_CONFLICT1 (0xC0000000 | 0x0254)
-#define NT_STATUS_IP_ADDRESS_CONFLICT2 (0xC0000000 | 0x0255)
-#define NT_STATUS_REGISTRY_QUOTA_LIMIT (0xC0000000 | 0x0256)
-#define NT_STATUS_PATH_NOT_COVERED (0xC0000000 | 0x0257)
-#define NT_STATUS_NO_CALLBACK_ACTIVE (0xC0000000 | 0x0258)
-#define NT_STATUS_LICENSE_QUOTA_EXCEEDED (0xC0000000 | 0x0259)
-#define NT_STATUS_PWD_TOO_SHORT (0xC0000000 | 0x025a)
-#define NT_STATUS_PWD_TOO_RECENT (0xC0000000 | 0x025b)
-#define NT_STATUS_PWD_HISTORY_CONFLICT (0xC0000000 | 0x025c)
-#define NT_STATUS_PLUGPLAY_NO_DEVICE (0xC0000000 | 0x025e)
-#define NT_STATUS_UNSUPPORTED_COMPRESSION (0xC0000000 | 0x025f)
-#define NT_STATUS_INVALID_HW_PROFILE (0xC0000000 | 0x0260)
-#define NT_STATUS_INVALID_PLUGPLAY_DEVICE_PATH (0xC0000000 | 0x0261)
-#define NT_STATUS_DRIVER_ORDINAL_NOT_FOUND (0xC0000000 | 0x0262)
-#define NT_STATUS_DRIVER_ENTRYPOINT_NOT_FOUND (0xC0000000 | 0x0263)
-#define NT_STATUS_RESOURCE_NOT_OWNED (0xC0000000 | 0x0264)
-#define NT_STATUS_TOO_MANY_LINKS (0xC0000000 | 0x0265)
-#define NT_STATUS_QUOTA_LIST_INCONSISTENT (0xC0000000 | 0x0266)
-#define NT_STATUS_FILE_IS_OFFLINE (0xC0000000 | 0x0267)
-#define NT_STATUS_NETWORK_SESSION_EXPIRED  (0xC0000000 | 0x035c)
-#define NT_STATUS_NO_SUCH_JOB (0xC0000000 | 0xEDE)     /* scheduler */
-#define NT_STATUS_NO_PREAUTH_INTEGRITY_HASH_OVERLAP (0xC0000000 | 0x5D0000)
-#define NT_STATUS_PENDING 0x00000103
-#endif				/* _NTERR_H */
diff --git a/fs/smb/server/smb2misc.c b/fs/smb/server/smb2misc.c
index 67a2d7a793f6..a1ddca21c47b 100644
--- a/fs/smb/server/smb2misc.c
+++ b/fs/smb/server/smb2misc.c
@@ -5,7 +5,6 @@
  */
 
 #include "glob.h"
-#include "nterr.h"
 #include "smb_common.h"
 #include "../common/smb2status.h"
 #include "mgmt/user_session.h"
diff --git a/fs/smb/server/smb_common.h b/fs/smb/server/smb_common.h
index 43970e99cbce..067b45048c73 100644
--- a/fs/smb/server/smb_common.h
+++ b/fs/smb/server/smb_common.h
@@ -9,7 +9,6 @@
 #include <linux/kernel.h>
 
 #include "glob.h"
-#include "nterr.h"
 #include "../common/smbglob.h"
 #include "../common/smb2pdu.h"
 #include "../common/fscc.h"
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 05/30] smb/client: add 4 NT error code definitions
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (3 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 04/30] smb/server: remove unused nterr.h chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 06/30] smb/client: add parentheses to NT error code definitions containing bitwise OR operator chenxiaosong.chenxiaosong
                   ` (26 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

From server/nterr.h that has been removed.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/nterr.c | 5 +++++
 fs/smb/client/nterr.h | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/fs/smb/client/nterr.c b/fs/smb/client/nterr.c
index 8f0bc441295e..77f84767b7df 100644
--- a/fs/smb/client/nterr.c
+++ b/fs/smb/client/nterr.c
@@ -13,6 +13,7 @@
 
 const struct nt_err_code_struct nt_errs[] = {
 	{"NT_STATUS_OK", NT_STATUS_OK},
+	{"NT_STATUS_PENDING", NT_STATUS_PENDING},
 	{"NT_STATUS_MEDIA_CHANGED", NT_STATUS_MEDIA_CHANGED},
 	{"NT_STATUS_END_OF_MEDIA", NT_STATUS_END_OF_MEDIA},
 	{"NT_STATUS_MEDIA_CHECK", NT_STATUS_MEDIA_CHECK},
@@ -544,6 +545,7 @@ const struct nt_err_code_struct nt_errs[] = {
 	{"NT_STATUS_DOMAIN_TRUST_INCONSISTENT",
 	 NT_STATUS_DOMAIN_TRUST_INCONSISTENT},
 	{"NT_STATUS_FS_DRIVER_REQUIRED", NT_STATUS_FS_DRIVER_REQUIRED},
+	{"NT_STATUS_INVALID_LOCK_RANGE", NT_STATUS_INVALID_LOCK_RANGE},
 	{"NT_STATUS_NO_USER_SESSION_KEY", NT_STATUS_NO_USER_SESSION_KEY},
 	{"NT_STATUS_USER_SESSION_DELETED", NT_STATUS_USER_SESSION_DELETED},
 	{"NT_STATUS_RESOURCE_LANG_NOT_FOUND",
@@ -675,9 +677,12 @@ const struct nt_err_code_struct nt_errs[] = {
 	 NT_STATUS_QUOTA_LIST_INCONSISTENT},
 	{"NT_STATUS_FILE_IS_OFFLINE", NT_STATUS_FILE_IS_OFFLINE},
 	{"NT_STATUS_NOT_A_REPARSE_POINT", NT_STATUS_NOT_A_REPARSE_POINT},
+	{"NT_STATUS_NETWORK_SESSION_EXPIRED", NT_STATUS_NETWORK_SESSION_EXPIRED},
 	{"NT_STATUS_NO_MORE_ENTRIES", NT_STATUS_NO_MORE_ENTRIES},
 	{"NT_STATUS_MORE_ENTRIES", NT_STATUS_MORE_ENTRIES},
 	{"NT_STATUS_SOME_UNMAPPED", NT_STATUS_SOME_UNMAPPED},
 	{"NT_STATUS_NO_SUCH_JOB", NT_STATUS_NO_SUCH_JOB},
+	{"NT_STATUS_NO_PREAUTH_INTEGRITY_HASH_OVERLAP",
+	 NT_STATUS_NO_PREAUTH_INTEGRITY_HASH_OVERLAP},
 	{NULL, 0}
 };
diff --git a/fs/smb/client/nterr.h b/fs/smb/client/nterr.h
index 09263c91d07a..4bc20c7bfe72 100644
--- a/fs/smb/client/nterr.h
+++ b/fs/smb/client/nterr.h
@@ -35,6 +35,7 @@ extern const struct nt_err_code_struct nt_errs[];
  */
 
 #define NT_STATUS_OK                   0x0000
+#define NT_STATUS_PENDING              0x0103
 #define NT_STATUS_SOME_UNMAPPED        0x0107
 #define NT_STATUS_BUFFER_OVERFLOW  0x80000005
 #define NT_STATUS_NO_MORE_ENTRIES  0x8000001a
@@ -451,6 +452,7 @@ extern const struct nt_err_code_struct nt_errs[];
 #define NT_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT 0xC0000000 | 0x019a
 #define NT_STATUS_DOMAIN_TRUST_INCONSISTENT 0xC0000000 | 0x019b
 #define NT_STATUS_FS_DRIVER_REQUIRED 0xC0000000 | 0x019c
+#define NT_STATUS_INVALID_LOCK_RANGE 0xC0000000 | 0x01a1
 #define NT_STATUS_NO_USER_SESSION_KEY 0xC0000000 | 0x0202
 #define NT_STATUS_USER_SESSION_DELETED 0xC0000000 | 0x0203
 #define NT_STATUS_RESOURCE_LANG_NOT_FOUND 0xC0000000 | 0x0204
@@ -547,6 +549,8 @@ extern const struct nt_err_code_struct nt_errs[];
 #define NT_STATUS_QUOTA_LIST_INCONSISTENT 0xC0000000 | 0x0266
 #define NT_STATUS_FILE_IS_OFFLINE 0xC0000000 | 0x0267
 #define NT_STATUS_NOT_A_REPARSE_POINT 0xC0000000 | 0x0275
+#define NT_STATUS_NETWORK_SESSION_EXPIRED  0xC0000000 | 0x035c
 #define NT_STATUS_NO_SUCH_JOB 0xC0000000 | 0xEDE	/* scheduler */
+#define NT_STATUS_NO_PREAUTH_INTEGRITY_HASH_OVERLAP 0xC0000000 | 0x5D0000
 
 #endif				/* _NTERR_H */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 06/30] smb/client: add parentheses to NT error code definitions containing bitwise OR operator
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (4 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 05/30] smb/client: add 4 NT error code definitions chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 07/30] smb/client: introduce DEFINE_CMP_FUNC() chenxiaosong.chenxiaosong
                   ` (25 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

Use the following shell commands:

  # Add "("
  sed -i '/|/s/ 0x/ (0x/' fs/smb/client/nterr.h
  # Add ")" if line does not end with a comment
  sed -i '/|/ { /.*\*\/$/! s/$/)/ }' fs/smb/client/nterr.h
  # Add ")" if line end with a comment
  sed -i '/|/ s/[[:space:]]*\/\*/)&/' fs/smb/client/nterr.h

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/nterr.h | 1012 ++++++++++++++++++++---------------------
 1 file changed, 506 insertions(+), 506 deletions(-)

diff --git a/fs/smb/client/nterr.h b/fs/smb/client/nterr.h
index 4bc20c7bfe72..81f1a78cf41f 100644
--- a/fs/smb/client/nterr.h
+++ b/fs/smb/client/nterr.h
@@ -46,511 +46,511 @@ extern const struct nt_err_code_struct nt_errs[];
 #define NT_STATUS_STOPPED_ON_SYMLINK 0x8000002d
 #define NT_STATUS_DEVICE_REQUIRES_CLEANING 0x80000288
 #define NT_STATUS_DEVICE_DOOR_OPEN 0x80000289
-#define NT_STATUS_UNSUCCESSFUL 0xC0000000 | 0x0001
-#define NT_STATUS_NOT_IMPLEMENTED 0xC0000000 | 0x0002
-#define NT_STATUS_INVALID_INFO_CLASS 0xC0000000 | 0x0003
-#define NT_STATUS_INFO_LENGTH_MISMATCH 0xC0000000 | 0x0004
-#define NT_STATUS_ACCESS_VIOLATION 0xC0000000 | 0x0005
-#define NT_STATUS_IN_PAGE_ERROR 0xC0000000 | 0x0006
-#define NT_STATUS_PAGEFILE_QUOTA 0xC0000000 | 0x0007
-#define NT_STATUS_INVALID_HANDLE 0xC0000000 | 0x0008
-#define NT_STATUS_BAD_INITIAL_STACK 0xC0000000 | 0x0009
-#define NT_STATUS_BAD_INITIAL_PC 0xC0000000 | 0x000a
-#define NT_STATUS_INVALID_CID 0xC0000000 | 0x000b
-#define NT_STATUS_TIMER_NOT_CANCELED 0xC0000000 | 0x000c
-#define NT_STATUS_INVALID_PARAMETER 0xC0000000 | 0x000d
-#define NT_STATUS_NO_SUCH_DEVICE 0xC0000000 | 0x000e
-#define NT_STATUS_NO_SUCH_FILE 0xC0000000 | 0x000f
-#define NT_STATUS_INVALID_DEVICE_REQUEST 0xC0000000 | 0x0010
-#define NT_STATUS_END_OF_FILE 0xC0000000 | 0x0011
-#define NT_STATUS_WRONG_VOLUME 0xC0000000 | 0x0012
-#define NT_STATUS_NO_MEDIA_IN_DEVICE 0xC0000000 | 0x0013
-#define NT_STATUS_UNRECOGNIZED_MEDIA 0xC0000000 | 0x0014
-#define NT_STATUS_NONEXISTENT_SECTOR 0xC0000000 | 0x0015
-#define NT_STATUS_MORE_PROCESSING_REQUIRED 0xC0000000 | 0x0016
-#define NT_STATUS_NO_MEMORY 0xC0000000 | 0x0017
-#define NT_STATUS_CONFLICTING_ADDRESSES 0xC0000000 | 0x0018
-#define NT_STATUS_NOT_MAPPED_VIEW 0xC0000000 | 0x0019
-#define NT_STATUS_UNABLE_TO_FREE_VM 0xC0000000 | 0x001a
-#define NT_STATUS_UNABLE_TO_DELETE_SECTION 0xC0000000 | 0x001b
-#define NT_STATUS_INVALID_SYSTEM_SERVICE 0xC0000000 | 0x001c
-#define NT_STATUS_ILLEGAL_INSTRUCTION 0xC0000000 | 0x001d
-#define NT_STATUS_INVALID_LOCK_SEQUENCE 0xC0000000 | 0x001e
-#define NT_STATUS_INVALID_VIEW_SIZE 0xC0000000 | 0x001f
-#define NT_STATUS_INVALID_FILE_FOR_SECTION 0xC0000000 | 0x0020
-#define NT_STATUS_ALREADY_COMMITTED 0xC0000000 | 0x0021
-#define NT_STATUS_ACCESS_DENIED 0xC0000000 | 0x0022
-#define NT_STATUS_BUFFER_TOO_SMALL 0xC0000000 | 0x0023
-#define NT_STATUS_OBJECT_TYPE_MISMATCH 0xC0000000 | 0x0024
-#define NT_STATUS_NONCONTINUABLE_EXCEPTION 0xC0000000 | 0x0025
-#define NT_STATUS_INVALID_DISPOSITION 0xC0000000 | 0x0026
-#define NT_STATUS_UNWIND 0xC0000000 | 0x0027
-#define NT_STATUS_BAD_STACK 0xC0000000 | 0x0028
-#define NT_STATUS_INVALID_UNWIND_TARGET 0xC0000000 | 0x0029
-#define NT_STATUS_NOT_LOCKED 0xC0000000 | 0x002a
-#define NT_STATUS_PARITY_ERROR 0xC0000000 | 0x002b
-#define NT_STATUS_UNABLE_TO_DECOMMIT_VM 0xC0000000 | 0x002c
-#define NT_STATUS_NOT_COMMITTED 0xC0000000 | 0x002d
-#define NT_STATUS_INVALID_PORT_ATTRIBUTES 0xC0000000 | 0x002e
-#define NT_STATUS_PORT_MESSAGE_TOO_LONG 0xC0000000 | 0x002f
-#define NT_STATUS_INVALID_PARAMETER_MIX 0xC0000000 | 0x0030
-#define NT_STATUS_INVALID_QUOTA_LOWER 0xC0000000 | 0x0031
-#define NT_STATUS_DISK_CORRUPT_ERROR 0xC0000000 | 0x0032
-#define NT_STATUS_OBJECT_NAME_INVALID 0xC0000000 | 0x0033
-#define NT_STATUS_OBJECT_NAME_NOT_FOUND 0xC0000000 | 0x0034
-#define NT_STATUS_OBJECT_NAME_COLLISION 0xC0000000 | 0x0035
-#define NT_STATUS_HANDLE_NOT_WAITABLE 0xC0000000 | 0x0036
-#define NT_STATUS_PORT_DISCONNECTED 0xC0000000 | 0x0037
-#define NT_STATUS_DEVICE_ALREADY_ATTACHED 0xC0000000 | 0x0038
-#define NT_STATUS_OBJECT_PATH_INVALID 0xC0000000 | 0x0039
-#define NT_STATUS_OBJECT_PATH_NOT_FOUND 0xC0000000 | 0x003a
-#define NT_STATUS_OBJECT_PATH_SYNTAX_BAD 0xC0000000 | 0x003b
-#define NT_STATUS_DATA_OVERRUN 0xC0000000 | 0x003c
-#define NT_STATUS_DATA_LATE_ERROR 0xC0000000 | 0x003d
-#define NT_STATUS_DATA_ERROR 0xC0000000 | 0x003e
-#define NT_STATUS_CRC_ERROR 0xC0000000 | 0x003f
-#define NT_STATUS_SECTION_TOO_BIG 0xC0000000 | 0x0040
-#define NT_STATUS_PORT_CONNECTION_REFUSED 0xC0000000 | 0x0041
-#define NT_STATUS_INVALID_PORT_HANDLE 0xC0000000 | 0x0042
-#define NT_STATUS_SHARING_VIOLATION 0xC0000000 | 0x0043
-#define NT_STATUS_QUOTA_EXCEEDED 0xC0000000 | 0x0044
-#define NT_STATUS_INVALID_PAGE_PROTECTION 0xC0000000 | 0x0045
-#define NT_STATUS_MUTANT_NOT_OWNED 0xC0000000 | 0x0046
-#define NT_STATUS_SEMAPHORE_LIMIT_EXCEEDED 0xC0000000 | 0x0047
-#define NT_STATUS_PORT_ALREADY_SET 0xC0000000 | 0x0048
-#define NT_STATUS_SECTION_NOT_IMAGE 0xC0000000 | 0x0049
-#define NT_STATUS_SUSPEND_COUNT_EXCEEDED 0xC0000000 | 0x004a
-#define NT_STATUS_THREAD_IS_TERMINATING 0xC0000000 | 0x004b
-#define NT_STATUS_BAD_WORKING_SET_LIMIT 0xC0000000 | 0x004c
-#define NT_STATUS_INCOMPATIBLE_FILE_MAP 0xC0000000 | 0x004d
-#define NT_STATUS_SECTION_PROTECTION 0xC0000000 | 0x004e
-#define NT_STATUS_EAS_NOT_SUPPORTED 0xC0000000 | 0x004f
-#define NT_STATUS_EA_TOO_LARGE 0xC0000000 | 0x0050
-#define NT_STATUS_NONEXISTENT_EA_ENTRY 0xC0000000 | 0x0051
-#define NT_STATUS_NO_EAS_ON_FILE 0xC0000000 | 0x0052
-#define NT_STATUS_EA_CORRUPT_ERROR 0xC0000000 | 0x0053
-#define NT_STATUS_FILE_LOCK_CONFLICT 0xC0000000 | 0x0054
-#define NT_STATUS_LOCK_NOT_GRANTED 0xC0000000 | 0x0055
-#define NT_STATUS_DELETE_PENDING 0xC0000000 | 0x0056
-#define NT_STATUS_CTL_FILE_NOT_SUPPORTED 0xC0000000 | 0x0057
-#define NT_STATUS_UNKNOWN_REVISION 0xC0000000 | 0x0058
-#define NT_STATUS_REVISION_MISMATCH 0xC0000000 | 0x0059
-#define NT_STATUS_INVALID_OWNER 0xC0000000 | 0x005a
-#define NT_STATUS_INVALID_PRIMARY_GROUP 0xC0000000 | 0x005b
-#define NT_STATUS_NO_IMPERSONATION_TOKEN 0xC0000000 | 0x005c
-#define NT_STATUS_CANT_DISABLE_MANDATORY 0xC0000000 | 0x005d
-#define NT_STATUS_NO_LOGON_SERVERS 0xC0000000 | 0x005e
-#define NT_STATUS_NO_SUCH_LOGON_SESSION 0xC0000000 | 0x005f
-#define NT_STATUS_NO_SUCH_PRIVILEGE 0xC0000000 | 0x0060
-#define NT_STATUS_PRIVILEGE_NOT_HELD 0xC0000000 | 0x0061
-#define NT_STATUS_INVALID_ACCOUNT_NAME 0xC0000000 | 0x0062
-#define NT_STATUS_USER_EXISTS 0xC0000000 | 0x0063
-#define NT_STATUS_NO_SUCH_USER 0xC0000000 | 0x0064
-#define NT_STATUS_GROUP_EXISTS 0xC0000000 | 0x0065
-#define NT_STATUS_NO_SUCH_GROUP 0xC0000000 | 0x0066
-#define NT_STATUS_MEMBER_IN_GROUP 0xC0000000 | 0x0067
-#define NT_STATUS_MEMBER_NOT_IN_GROUP 0xC0000000 | 0x0068
-#define NT_STATUS_LAST_ADMIN 0xC0000000 | 0x0069
-#define NT_STATUS_WRONG_PASSWORD 0xC0000000 | 0x006a
-#define NT_STATUS_ILL_FORMED_PASSWORD 0xC0000000 | 0x006b
-#define NT_STATUS_PASSWORD_RESTRICTION 0xC0000000 | 0x006c
-#define NT_STATUS_LOGON_FAILURE 0xC0000000 | 0x006d
-#define NT_STATUS_ACCOUNT_RESTRICTION 0xC0000000 | 0x006e
-#define NT_STATUS_INVALID_LOGON_HOURS 0xC0000000 | 0x006f
-#define NT_STATUS_INVALID_WORKSTATION 0xC0000000 | 0x0070
-#define NT_STATUS_PASSWORD_EXPIRED 0xC0000000 | 0x0071
-#define NT_STATUS_ACCOUNT_DISABLED 0xC0000000 | 0x0072
-#define NT_STATUS_NONE_MAPPED 0xC0000000 | 0x0073
-#define NT_STATUS_TOO_MANY_LUIDS_REQUESTED 0xC0000000 | 0x0074
-#define NT_STATUS_LUIDS_EXHAUSTED 0xC0000000 | 0x0075
-#define NT_STATUS_INVALID_SUB_AUTHORITY 0xC0000000 | 0x0076
-#define NT_STATUS_INVALID_ACL 0xC0000000 | 0x0077
-#define NT_STATUS_INVALID_SID 0xC0000000 | 0x0078
-#define NT_STATUS_INVALID_SECURITY_DESCR 0xC0000000 | 0x0079
-#define NT_STATUS_PROCEDURE_NOT_FOUND 0xC0000000 | 0x007a
-#define NT_STATUS_INVALID_IMAGE_FORMAT 0xC0000000 | 0x007b
-#define NT_STATUS_NO_TOKEN 0xC0000000 | 0x007c
-#define NT_STATUS_BAD_INHERITANCE_ACL 0xC0000000 | 0x007d
-#define NT_STATUS_RANGE_NOT_LOCKED 0xC0000000 | 0x007e
-#define NT_STATUS_DISK_FULL 0xC0000000 | 0x007f
-#define NT_STATUS_SERVER_DISABLED 0xC0000000 | 0x0080
-#define NT_STATUS_SERVER_NOT_DISABLED 0xC0000000 | 0x0081
-#define NT_STATUS_TOO_MANY_GUIDS_REQUESTED 0xC0000000 | 0x0082
-#define NT_STATUS_GUIDS_EXHAUSTED 0xC0000000 | 0x0083
-#define NT_STATUS_INVALID_ID_AUTHORITY 0xC0000000 | 0x0084
-#define NT_STATUS_AGENTS_EXHAUSTED 0xC0000000 | 0x0085
-#define NT_STATUS_INVALID_VOLUME_LABEL 0xC0000000 | 0x0086
-#define NT_STATUS_SECTION_NOT_EXTENDED 0xC0000000 | 0x0087
-#define NT_STATUS_NOT_MAPPED_DATA 0xC0000000 | 0x0088
-#define NT_STATUS_RESOURCE_DATA_NOT_FOUND 0xC0000000 | 0x0089
-#define NT_STATUS_RESOURCE_TYPE_NOT_FOUND 0xC0000000 | 0x008a
-#define NT_STATUS_RESOURCE_NAME_NOT_FOUND 0xC0000000 | 0x008b
-#define NT_STATUS_ARRAY_BOUNDS_EXCEEDED 0xC0000000 | 0x008c
-#define NT_STATUS_FLOAT_DENORMAL_OPERAND 0xC0000000 | 0x008d
-#define NT_STATUS_FLOAT_DIVIDE_BY_ZERO 0xC0000000 | 0x008e
-#define NT_STATUS_FLOAT_INEXACT_RESULT 0xC0000000 | 0x008f
-#define NT_STATUS_FLOAT_INVALID_OPERATION 0xC0000000 | 0x0090
-#define NT_STATUS_FLOAT_OVERFLOW 0xC0000000 | 0x0091
-#define NT_STATUS_FLOAT_STACK_CHECK 0xC0000000 | 0x0092
-#define NT_STATUS_FLOAT_UNDERFLOW 0xC0000000 | 0x0093
-#define NT_STATUS_INTEGER_DIVIDE_BY_ZERO 0xC0000000 | 0x0094
-#define NT_STATUS_INTEGER_OVERFLOW 0xC0000000 | 0x0095
-#define NT_STATUS_PRIVILEGED_INSTRUCTION 0xC0000000 | 0x0096
-#define NT_STATUS_TOO_MANY_PAGING_FILES 0xC0000000 | 0x0097
-#define NT_STATUS_FILE_INVALID 0xC0000000 | 0x0098
-#define NT_STATUS_ALLOTTED_SPACE_EXCEEDED 0xC0000000 | 0x0099
-#define NT_STATUS_INSUFFICIENT_RESOURCES 0xC0000000 | 0x009a
-#define NT_STATUS_DFS_EXIT_PATH_FOUND 0xC0000000 | 0x009b
-#define NT_STATUS_DEVICE_DATA_ERROR 0xC0000000 | 0x009c
-#define NT_STATUS_DEVICE_NOT_CONNECTED 0xC0000000 | 0x009d
-#define NT_STATUS_DEVICE_POWER_FAILURE 0xC0000000 | 0x009e
-#define NT_STATUS_FREE_VM_NOT_AT_BASE 0xC0000000 | 0x009f
-#define NT_STATUS_MEMORY_NOT_ALLOCATED 0xC0000000 | 0x00a0
-#define NT_STATUS_WORKING_SET_QUOTA 0xC0000000 | 0x00a1
-#define NT_STATUS_MEDIA_WRITE_PROTECTED 0xC0000000 | 0x00a2
-#define NT_STATUS_DEVICE_NOT_READY 0xC0000000 | 0x00a3
-#define NT_STATUS_INVALID_GROUP_ATTRIBUTES 0xC0000000 | 0x00a4
-#define NT_STATUS_BAD_IMPERSONATION_LEVEL 0xC0000000 | 0x00a5
-#define NT_STATUS_CANT_OPEN_ANONYMOUS 0xC0000000 | 0x00a6
-#define NT_STATUS_BAD_VALIDATION_CLASS 0xC0000000 | 0x00a7
-#define NT_STATUS_BAD_TOKEN_TYPE 0xC0000000 | 0x00a8
-#define NT_STATUS_BAD_MASTER_BOOT_RECORD 0xC0000000 | 0x00a9
-#define NT_STATUS_INSTRUCTION_MISALIGNMENT 0xC0000000 | 0x00aa
-#define NT_STATUS_INSTANCE_NOT_AVAILABLE 0xC0000000 | 0x00ab
-#define NT_STATUS_PIPE_NOT_AVAILABLE 0xC0000000 | 0x00ac
-#define NT_STATUS_INVALID_PIPE_STATE 0xC0000000 | 0x00ad
-#define NT_STATUS_PIPE_BUSY 0xC0000000 | 0x00ae
-#define NT_STATUS_ILLEGAL_FUNCTION 0xC0000000 | 0x00af
-#define NT_STATUS_PIPE_DISCONNECTED 0xC0000000 | 0x00b0
-#define NT_STATUS_PIPE_CLOSING 0xC0000000 | 0x00b1
-#define NT_STATUS_PIPE_CONNECTED 0xC0000000 | 0x00b2
-#define NT_STATUS_PIPE_LISTENING 0xC0000000 | 0x00b3
-#define NT_STATUS_INVALID_READ_MODE 0xC0000000 | 0x00b4
-#define NT_STATUS_IO_TIMEOUT 0xC0000000 | 0x00b5
-#define NT_STATUS_FILE_FORCED_CLOSED 0xC0000000 | 0x00b6
-#define NT_STATUS_PROFILING_NOT_STARTED 0xC0000000 | 0x00b7
-#define NT_STATUS_PROFILING_NOT_STOPPED 0xC0000000 | 0x00b8
-#define NT_STATUS_COULD_NOT_INTERPRET 0xC0000000 | 0x00b9
-#define NT_STATUS_FILE_IS_A_DIRECTORY 0xC0000000 | 0x00ba
-#define NT_STATUS_NOT_SUPPORTED 0xC0000000 | 0x00bb
-#define NT_STATUS_REMOTE_NOT_LISTENING 0xC0000000 | 0x00bc
-#define NT_STATUS_DUPLICATE_NAME 0xC0000000 | 0x00bd
-#define NT_STATUS_BAD_NETWORK_PATH 0xC0000000 | 0x00be
-#define NT_STATUS_NETWORK_BUSY 0xC0000000 | 0x00bf
-#define NT_STATUS_DEVICE_DOES_NOT_EXIST 0xC0000000 | 0x00c0
-#define NT_STATUS_TOO_MANY_COMMANDS 0xC0000000 | 0x00c1
-#define NT_STATUS_ADAPTER_HARDWARE_ERROR 0xC0000000 | 0x00c2
-#define NT_STATUS_INVALID_NETWORK_RESPONSE 0xC0000000 | 0x00c3
-#define NT_STATUS_UNEXPECTED_NETWORK_ERROR 0xC0000000 | 0x00c4
-#define NT_STATUS_BAD_REMOTE_ADAPTER 0xC0000000 | 0x00c5
-#define NT_STATUS_PRINT_QUEUE_FULL 0xC0000000 | 0x00c6
-#define NT_STATUS_NO_SPOOL_SPACE 0xC0000000 | 0x00c7
-#define NT_STATUS_PRINT_CANCELLED 0xC0000000 | 0x00c8
-#define NT_STATUS_NETWORK_NAME_DELETED 0xC0000000 | 0x00c9
-#define NT_STATUS_NETWORK_ACCESS_DENIED 0xC0000000 | 0x00ca
-#define NT_STATUS_BAD_DEVICE_TYPE 0xC0000000 | 0x00cb
-#define NT_STATUS_BAD_NETWORK_NAME 0xC0000000 | 0x00cc
-#define NT_STATUS_TOO_MANY_NAMES 0xC0000000 | 0x00cd
-#define NT_STATUS_TOO_MANY_SESSIONS 0xC0000000 | 0x00ce
-#define NT_STATUS_SHARING_PAUSED 0xC0000000 | 0x00cf
-#define NT_STATUS_REQUEST_NOT_ACCEPTED 0xC0000000 | 0x00d0
-#define NT_STATUS_REDIRECTOR_PAUSED 0xC0000000 | 0x00d1
-#define NT_STATUS_NET_WRITE_FAULT 0xC0000000 | 0x00d2
-#define NT_STATUS_PROFILING_AT_LIMIT 0xC0000000 | 0x00d3
-#define NT_STATUS_NOT_SAME_DEVICE 0xC0000000 | 0x00d4
-#define NT_STATUS_FILE_RENAMED 0xC0000000 | 0x00d5
-#define NT_STATUS_VIRTUAL_CIRCUIT_CLOSED 0xC0000000 | 0x00d6
-#define NT_STATUS_NO_SECURITY_ON_OBJECT 0xC0000000 | 0x00d7
-#define NT_STATUS_CANT_WAIT 0xC0000000 | 0x00d8
-#define NT_STATUS_PIPE_EMPTY 0xC0000000 | 0x00d9
-#define NT_STATUS_CANT_ACCESS_DOMAIN_INFO 0xC0000000 | 0x00da
-#define NT_STATUS_CANT_TERMINATE_SELF 0xC0000000 | 0x00db
-#define NT_STATUS_INVALID_SERVER_STATE 0xC0000000 | 0x00dc
-#define NT_STATUS_INVALID_DOMAIN_STATE 0xC0000000 | 0x00dd
-#define NT_STATUS_INVALID_DOMAIN_ROLE 0xC0000000 | 0x00de
-#define NT_STATUS_NO_SUCH_DOMAIN 0xC0000000 | 0x00df
-#define NT_STATUS_DOMAIN_EXISTS 0xC0000000 | 0x00e0
-#define NT_STATUS_DOMAIN_LIMIT_EXCEEDED 0xC0000000 | 0x00e1
-#define NT_STATUS_OPLOCK_NOT_GRANTED 0xC0000000 | 0x00e2
-#define NT_STATUS_INVALID_OPLOCK_PROTOCOL 0xC0000000 | 0x00e3
-#define NT_STATUS_INTERNAL_DB_CORRUPTION 0xC0000000 | 0x00e4
-#define NT_STATUS_INTERNAL_ERROR 0xC0000000 | 0x00e5
-#define NT_STATUS_GENERIC_NOT_MAPPED 0xC0000000 | 0x00e6
-#define NT_STATUS_BAD_DESCRIPTOR_FORMAT 0xC0000000 | 0x00e7
-#define NT_STATUS_INVALID_USER_BUFFER 0xC0000000 | 0x00e8
-#define NT_STATUS_UNEXPECTED_IO_ERROR 0xC0000000 | 0x00e9
-#define NT_STATUS_UNEXPECTED_MM_CREATE_ERR 0xC0000000 | 0x00ea
-#define NT_STATUS_UNEXPECTED_MM_MAP_ERROR 0xC0000000 | 0x00eb
-#define NT_STATUS_UNEXPECTED_MM_EXTEND_ERR 0xC0000000 | 0x00ec
-#define NT_STATUS_NOT_LOGON_PROCESS 0xC0000000 | 0x00ed
-#define NT_STATUS_LOGON_SESSION_EXISTS 0xC0000000 | 0x00ee
-#define NT_STATUS_INVALID_PARAMETER_1 0xC0000000 | 0x00ef
-#define NT_STATUS_INVALID_PARAMETER_2 0xC0000000 | 0x00f0
-#define NT_STATUS_INVALID_PARAMETER_3 0xC0000000 | 0x00f1
-#define NT_STATUS_INVALID_PARAMETER_4 0xC0000000 | 0x00f2
-#define NT_STATUS_INVALID_PARAMETER_5 0xC0000000 | 0x00f3
-#define NT_STATUS_INVALID_PARAMETER_6 0xC0000000 | 0x00f4
-#define NT_STATUS_INVALID_PARAMETER_7 0xC0000000 | 0x00f5
-#define NT_STATUS_INVALID_PARAMETER_8 0xC0000000 | 0x00f6
-#define NT_STATUS_INVALID_PARAMETER_9 0xC0000000 | 0x00f7
-#define NT_STATUS_INVALID_PARAMETER_10 0xC0000000 | 0x00f8
-#define NT_STATUS_INVALID_PARAMETER_11 0xC0000000 | 0x00f9
-#define NT_STATUS_INVALID_PARAMETER_12 0xC0000000 | 0x00fa
-#define NT_STATUS_REDIRECTOR_NOT_STARTED 0xC0000000 | 0x00fb
-#define NT_STATUS_REDIRECTOR_STARTED 0xC0000000 | 0x00fc
-#define NT_STATUS_STACK_OVERFLOW 0xC0000000 | 0x00fd
-#define NT_STATUS_NO_SUCH_PACKAGE 0xC0000000 | 0x00fe
-#define NT_STATUS_BAD_FUNCTION_TABLE 0xC0000000 | 0x00ff
-#define NT_STATUS_DIRECTORY_NOT_EMPTY 0xC0000000 | 0x0101
-#define NT_STATUS_FILE_CORRUPT_ERROR 0xC0000000 | 0x0102
-#define NT_STATUS_NOT_A_DIRECTORY 0xC0000000 | 0x0103
-#define NT_STATUS_BAD_LOGON_SESSION_STATE 0xC0000000 | 0x0104
-#define NT_STATUS_LOGON_SESSION_COLLISION 0xC0000000 | 0x0105
-#define NT_STATUS_NAME_TOO_LONG 0xC0000000 | 0x0106
-#define NT_STATUS_FILES_OPEN 0xC0000000 | 0x0107
-#define NT_STATUS_CONNECTION_IN_USE 0xC0000000 | 0x0108
-#define NT_STATUS_MESSAGE_NOT_FOUND 0xC0000000 | 0x0109
-#define NT_STATUS_PROCESS_IS_TERMINATING 0xC0000000 | 0x010a
-#define NT_STATUS_INVALID_LOGON_TYPE 0xC0000000 | 0x010b
-#define NT_STATUS_NO_GUID_TRANSLATION 0xC0000000 | 0x010c
-#define NT_STATUS_CANNOT_IMPERSONATE 0xC0000000 | 0x010d
-#define NT_STATUS_IMAGE_ALREADY_LOADED 0xC0000000 | 0x010e
-#define NT_STATUS_ABIOS_NOT_PRESENT 0xC0000000 | 0x010f
-#define NT_STATUS_ABIOS_LID_NOT_EXIST 0xC0000000 | 0x0110
-#define NT_STATUS_ABIOS_LID_ALREADY_OWNED 0xC0000000 | 0x0111
-#define NT_STATUS_ABIOS_NOT_LID_OWNER 0xC0000000 | 0x0112
-#define NT_STATUS_ABIOS_INVALID_COMMAND 0xC0000000 | 0x0113
-#define NT_STATUS_ABIOS_INVALID_LID 0xC0000000 | 0x0114
-#define NT_STATUS_ABIOS_SELECTOR_NOT_AVAILABLE 0xC0000000 | 0x0115
-#define NT_STATUS_ABIOS_INVALID_SELECTOR 0xC0000000 | 0x0116
-#define NT_STATUS_NO_LDT 0xC0000000 | 0x0117
-#define NT_STATUS_INVALID_LDT_SIZE 0xC0000000 | 0x0118
-#define NT_STATUS_INVALID_LDT_OFFSET 0xC0000000 | 0x0119
-#define NT_STATUS_INVALID_LDT_DESCRIPTOR 0xC0000000 | 0x011a
-#define NT_STATUS_INVALID_IMAGE_NE_FORMAT 0xC0000000 | 0x011b
-#define NT_STATUS_RXACT_INVALID_STATE 0xC0000000 | 0x011c
-#define NT_STATUS_RXACT_COMMIT_FAILURE 0xC0000000 | 0x011d
-#define NT_STATUS_MAPPED_FILE_SIZE_ZERO 0xC0000000 | 0x011e
-#define NT_STATUS_TOO_MANY_OPENED_FILES 0xC0000000 | 0x011f
-#define NT_STATUS_CANCELLED 0xC0000000 | 0x0120
-#define NT_STATUS_CANNOT_DELETE 0xC0000000 | 0x0121
-#define NT_STATUS_INVALID_COMPUTER_NAME 0xC0000000 | 0x0122
-#define NT_STATUS_FILE_DELETED 0xC0000000 | 0x0123
-#define NT_STATUS_SPECIAL_ACCOUNT 0xC0000000 | 0x0124
-#define NT_STATUS_SPECIAL_GROUP 0xC0000000 | 0x0125
-#define NT_STATUS_SPECIAL_USER 0xC0000000 | 0x0126
-#define NT_STATUS_MEMBERS_PRIMARY_GROUP 0xC0000000 | 0x0127
-#define NT_STATUS_FILE_CLOSED 0xC0000000 | 0x0128
-#define NT_STATUS_TOO_MANY_THREADS 0xC0000000 | 0x0129
-#define NT_STATUS_THREAD_NOT_IN_PROCESS 0xC0000000 | 0x012a
-#define NT_STATUS_TOKEN_ALREADY_IN_USE 0xC0000000 | 0x012b
-#define NT_STATUS_PAGEFILE_QUOTA_EXCEEDED 0xC0000000 | 0x012c
-#define NT_STATUS_COMMITMENT_LIMIT 0xC0000000 | 0x012d
-#define NT_STATUS_INVALID_IMAGE_LE_FORMAT 0xC0000000 | 0x012e
-#define NT_STATUS_INVALID_IMAGE_NOT_MZ 0xC0000000 | 0x012f
-#define NT_STATUS_INVALID_IMAGE_PROTECT 0xC0000000 | 0x0130
-#define NT_STATUS_INVALID_IMAGE_WIN_16 0xC0000000 | 0x0131
-#define NT_STATUS_LOGON_SERVER_CONFLICT 0xC0000000 | 0x0132
-#define NT_STATUS_TIME_DIFFERENCE_AT_DC 0xC0000000 | 0x0133
-#define NT_STATUS_SYNCHRONIZATION_REQUIRED 0xC0000000 | 0x0134
-#define NT_STATUS_DLL_NOT_FOUND 0xC0000000 | 0x0135
-#define NT_STATUS_OPEN_FAILED 0xC0000000 | 0x0136
-#define NT_STATUS_IO_PRIVILEGE_FAILED 0xC0000000 | 0x0137
-#define NT_STATUS_ORDINAL_NOT_FOUND 0xC0000000 | 0x0138
-#define NT_STATUS_ENTRYPOINT_NOT_FOUND 0xC0000000 | 0x0139
-#define NT_STATUS_CONTROL_C_EXIT 0xC0000000 | 0x013a
-#define NT_STATUS_LOCAL_DISCONNECT 0xC0000000 | 0x013b
-#define NT_STATUS_REMOTE_DISCONNECT 0xC0000000 | 0x013c
-#define NT_STATUS_REMOTE_RESOURCES 0xC0000000 | 0x013d
-#define NT_STATUS_LINK_FAILED 0xC0000000 | 0x013e
-#define NT_STATUS_LINK_TIMEOUT 0xC0000000 | 0x013f
-#define NT_STATUS_INVALID_CONNECTION 0xC0000000 | 0x0140
-#define NT_STATUS_INVALID_ADDRESS 0xC0000000 | 0x0141
-#define NT_STATUS_DLL_INIT_FAILED 0xC0000000 | 0x0142
-#define NT_STATUS_MISSING_SYSTEMFILE 0xC0000000 | 0x0143
-#define NT_STATUS_UNHANDLED_EXCEPTION 0xC0000000 | 0x0144
-#define NT_STATUS_APP_INIT_FAILURE 0xC0000000 | 0x0145
-#define NT_STATUS_PAGEFILE_CREATE_FAILED 0xC0000000 | 0x0146
-#define NT_STATUS_NO_PAGEFILE 0xC0000000 | 0x0147
-#define NT_STATUS_INVALID_LEVEL 0xC0000000 | 0x0148
-#define NT_STATUS_WRONG_PASSWORD_CORE 0xC0000000 | 0x0149
-#define NT_STATUS_ILLEGAL_FLOAT_CONTEXT 0xC0000000 | 0x014a
-#define NT_STATUS_PIPE_BROKEN 0xC0000000 | 0x014b
-#define NT_STATUS_REGISTRY_CORRUPT 0xC0000000 | 0x014c
-#define NT_STATUS_REGISTRY_IO_FAILED 0xC0000000 | 0x014d
-#define NT_STATUS_NO_EVENT_PAIR 0xC0000000 | 0x014e
-#define NT_STATUS_UNRECOGNIZED_VOLUME 0xC0000000 | 0x014f
-#define NT_STATUS_SERIAL_NO_DEVICE_INITED 0xC0000000 | 0x0150
-#define NT_STATUS_NO_SUCH_ALIAS 0xC0000000 | 0x0151
-#define NT_STATUS_MEMBER_NOT_IN_ALIAS 0xC0000000 | 0x0152
-#define NT_STATUS_MEMBER_IN_ALIAS 0xC0000000 | 0x0153
-#define NT_STATUS_ALIAS_EXISTS 0xC0000000 | 0x0154
-#define NT_STATUS_LOGON_NOT_GRANTED 0xC0000000 | 0x0155
-#define NT_STATUS_TOO_MANY_SECRETS 0xC0000000 | 0x0156
-#define NT_STATUS_SECRET_TOO_LONG 0xC0000000 | 0x0157
-#define NT_STATUS_INTERNAL_DB_ERROR 0xC0000000 | 0x0158
-#define NT_STATUS_FULLSCREEN_MODE 0xC0000000 | 0x0159
-#define NT_STATUS_TOO_MANY_CONTEXT_IDS 0xC0000000 | 0x015a
-#define NT_STATUS_LOGON_TYPE_NOT_GRANTED 0xC0000000 | 0x015b
-#define NT_STATUS_NOT_REGISTRY_FILE 0xC0000000 | 0x015c
-#define NT_STATUS_NT_CROSS_ENCRYPTION_REQUIRED 0xC0000000 | 0x015d
-#define NT_STATUS_DOMAIN_CTRLR_CONFIG_ERROR 0xC0000000 | 0x015e
-#define NT_STATUS_FT_MISSING_MEMBER 0xC0000000 | 0x015f
-#define NT_STATUS_ILL_FORMED_SERVICE_ENTRY 0xC0000000 | 0x0160
-#define NT_STATUS_ILLEGAL_CHARACTER 0xC0000000 | 0x0161
-#define NT_STATUS_UNMAPPABLE_CHARACTER 0xC0000000 | 0x0162
-#define NT_STATUS_UNDEFINED_CHARACTER 0xC0000000 | 0x0163
-#define NT_STATUS_FLOPPY_VOLUME 0xC0000000 | 0x0164
-#define NT_STATUS_FLOPPY_ID_MARK_NOT_FOUND 0xC0000000 | 0x0165
-#define NT_STATUS_FLOPPY_WRONG_CYLINDER 0xC0000000 | 0x0166
-#define NT_STATUS_FLOPPY_UNKNOWN_ERROR 0xC0000000 | 0x0167
-#define NT_STATUS_FLOPPY_BAD_REGISTERS 0xC0000000 | 0x0168
-#define NT_STATUS_DISK_RECALIBRATE_FAILED 0xC0000000 | 0x0169
-#define NT_STATUS_DISK_OPERATION_FAILED 0xC0000000 | 0x016a
-#define NT_STATUS_DISK_RESET_FAILED 0xC0000000 | 0x016b
-#define NT_STATUS_SHARED_IRQ_BUSY 0xC0000000 | 0x016c
-#define NT_STATUS_FT_ORPHANING 0xC0000000 | 0x016d
-#define NT_STATUS_PARTITION_FAILURE 0xC0000000 | 0x0172
-#define NT_STATUS_INVALID_BLOCK_LENGTH 0xC0000000 | 0x0173
-#define NT_STATUS_DEVICE_NOT_PARTITIONED 0xC0000000 | 0x0174
-#define NT_STATUS_UNABLE_TO_LOCK_MEDIA 0xC0000000 | 0x0175
-#define NT_STATUS_UNABLE_TO_UNLOAD_MEDIA 0xC0000000 | 0x0176
-#define NT_STATUS_EOM_OVERFLOW 0xC0000000 | 0x0177
-#define NT_STATUS_NO_MEDIA 0xC0000000 | 0x0178
-#define NT_STATUS_NO_SUCH_MEMBER 0xC0000000 | 0x017a
-#define NT_STATUS_INVALID_MEMBER 0xC0000000 | 0x017b
-#define NT_STATUS_KEY_DELETED 0xC0000000 | 0x017c
-#define NT_STATUS_NO_LOG_SPACE 0xC0000000 | 0x017d
-#define NT_STATUS_TOO_MANY_SIDS 0xC0000000 | 0x017e
-#define NT_STATUS_LM_CROSS_ENCRYPTION_REQUIRED 0xC0000000 | 0x017f
-#define NT_STATUS_KEY_HAS_CHILDREN 0xC0000000 | 0x0180
-#define NT_STATUS_CHILD_MUST_BE_VOLATILE 0xC0000000 | 0x0181
-#define NT_STATUS_DEVICE_CONFIGURATION_ERROR 0xC0000000 | 0x0182
-#define NT_STATUS_DRIVER_INTERNAL_ERROR 0xC0000000 | 0x0183
-#define NT_STATUS_INVALID_DEVICE_STATE 0xC0000000 | 0x0184
-#define NT_STATUS_IO_DEVICE_ERROR 0xC0000000 | 0x0185
-#define NT_STATUS_DEVICE_PROTOCOL_ERROR 0xC0000000 | 0x0186
-#define NT_STATUS_BACKUP_CONTROLLER 0xC0000000 | 0x0187
-#define NT_STATUS_LOG_FILE_FULL 0xC0000000 | 0x0188
-#define NT_STATUS_TOO_LATE 0xC0000000 | 0x0189
-#define NT_STATUS_NO_TRUST_LSA_SECRET 0xC0000000 | 0x018a
-#define NT_STATUS_NO_TRUST_SAM_ACCOUNT 0xC0000000 | 0x018b
-#define NT_STATUS_TRUSTED_DOMAIN_FAILURE 0xC0000000 | 0x018c
-#define NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE 0xC0000000 | 0x018d
-#define NT_STATUS_EVENTLOG_FILE_CORRUPT 0xC0000000 | 0x018e
-#define NT_STATUS_EVENTLOG_CANT_START 0xC0000000 | 0x018f
-#define NT_STATUS_TRUST_FAILURE 0xC0000000 | 0x0190
-#define NT_STATUS_MUTANT_LIMIT_EXCEEDED 0xC0000000 | 0x0191
-#define NT_STATUS_NETLOGON_NOT_STARTED 0xC0000000 | 0x0192
-#define NT_STATUS_ACCOUNT_EXPIRED 0xC0000000 | 0x0193
-#define NT_STATUS_POSSIBLE_DEADLOCK 0xC0000000 | 0x0194
-#define NT_STATUS_NETWORK_CREDENTIAL_CONFLICT 0xC0000000 | 0x0195
-#define NT_STATUS_REMOTE_SESSION_LIMIT 0xC0000000 | 0x0196
-#define NT_STATUS_EVENTLOG_FILE_CHANGED 0xC0000000 | 0x0197
-#define NT_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT 0xC0000000 | 0x0198
-#define NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT 0xC0000000 | 0x0199
-#define NT_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT 0xC0000000 | 0x019a
-#define NT_STATUS_DOMAIN_TRUST_INCONSISTENT 0xC0000000 | 0x019b
-#define NT_STATUS_FS_DRIVER_REQUIRED 0xC0000000 | 0x019c
-#define NT_STATUS_INVALID_LOCK_RANGE 0xC0000000 | 0x01a1
-#define NT_STATUS_NO_USER_SESSION_KEY 0xC0000000 | 0x0202
-#define NT_STATUS_USER_SESSION_DELETED 0xC0000000 | 0x0203
-#define NT_STATUS_RESOURCE_LANG_NOT_FOUND 0xC0000000 | 0x0204
-#define NT_STATUS_INSUFF_SERVER_RESOURCES 0xC0000000 | 0x0205
-#define NT_STATUS_INVALID_BUFFER_SIZE 0xC0000000 | 0x0206
-#define NT_STATUS_INVALID_ADDRESS_COMPONENT 0xC0000000 | 0x0207
-#define NT_STATUS_INVALID_ADDRESS_WILDCARD 0xC0000000 | 0x0208
-#define NT_STATUS_TOO_MANY_ADDRESSES 0xC0000000 | 0x0209
-#define NT_STATUS_ADDRESS_ALREADY_EXISTS 0xC0000000 | 0x020a
-#define NT_STATUS_ADDRESS_CLOSED 0xC0000000 | 0x020b
-#define NT_STATUS_CONNECTION_DISCONNECTED 0xC0000000 | 0x020c
-#define NT_STATUS_CONNECTION_RESET 0xC0000000 | 0x020d
-#define NT_STATUS_TOO_MANY_NODES 0xC0000000 | 0x020e
-#define NT_STATUS_TRANSACTION_ABORTED 0xC0000000 | 0x020f
-#define NT_STATUS_TRANSACTION_TIMED_OUT 0xC0000000 | 0x0210
-#define NT_STATUS_TRANSACTION_NO_RELEASE 0xC0000000 | 0x0211
-#define NT_STATUS_TRANSACTION_NO_MATCH 0xC0000000 | 0x0212
-#define NT_STATUS_TRANSACTION_RESPONDED 0xC0000000 | 0x0213
-#define NT_STATUS_TRANSACTION_INVALID_ID 0xC0000000 | 0x0214
-#define NT_STATUS_TRANSACTION_INVALID_TYPE 0xC0000000 | 0x0215
-#define NT_STATUS_NOT_SERVER_SESSION 0xC0000000 | 0x0216
-#define NT_STATUS_NOT_CLIENT_SESSION 0xC0000000 | 0x0217
-#define NT_STATUS_CANNOT_LOAD_REGISTRY_FILE 0xC0000000 | 0x0218
-#define NT_STATUS_DEBUG_ATTACH_FAILED 0xC0000000 | 0x0219
-#define NT_STATUS_SYSTEM_PROCESS_TERMINATED 0xC0000000 | 0x021a
-#define NT_STATUS_DATA_NOT_ACCEPTED 0xC0000000 | 0x021b
-#define NT_STATUS_NO_BROWSER_SERVERS_FOUND 0xC0000000 | 0x021c
-#define NT_STATUS_VDM_HARD_ERROR 0xC0000000 | 0x021d
-#define NT_STATUS_DRIVER_CANCEL_TIMEOUT 0xC0000000 | 0x021e
-#define NT_STATUS_REPLY_MESSAGE_MISMATCH 0xC0000000 | 0x021f
-#define NT_STATUS_MAPPED_ALIGNMENT 0xC0000000 | 0x0220
-#define NT_STATUS_IMAGE_CHECKSUM_MISMATCH 0xC0000000 | 0x0221
-#define NT_STATUS_LOST_WRITEBEHIND_DATA 0xC0000000 | 0x0222
-#define NT_STATUS_CLIENT_SERVER_PARAMETERS_INVALID 0xC0000000 | 0x0223
-#define NT_STATUS_PASSWORD_MUST_CHANGE 0xC0000000 | 0x0224
-#define NT_STATUS_NOT_FOUND 0xC0000000 | 0x0225
-#define NT_STATUS_NOT_TINY_STREAM 0xC0000000 | 0x0226
-#define NT_STATUS_RECOVERY_FAILURE 0xC0000000 | 0x0227
-#define NT_STATUS_STACK_OVERFLOW_READ 0xC0000000 | 0x0228
-#define NT_STATUS_FAIL_CHECK 0xC0000000 | 0x0229
-#define NT_STATUS_DUPLICATE_OBJECTID 0xC0000000 | 0x022a
-#define NT_STATUS_OBJECTID_EXISTS 0xC0000000 | 0x022b
-#define NT_STATUS_CONVERT_TO_LARGE 0xC0000000 | 0x022c
-#define NT_STATUS_RETRY 0xC0000000 | 0x022d
-#define NT_STATUS_FOUND_OUT_OF_SCOPE 0xC0000000 | 0x022e
-#define NT_STATUS_ALLOCATE_BUCKET 0xC0000000 | 0x022f
-#define NT_STATUS_PROPSET_NOT_FOUND 0xC0000000 | 0x0230
-#define NT_STATUS_MARSHALL_OVERFLOW 0xC0000000 | 0x0231
-#define NT_STATUS_INVALID_VARIANT 0xC0000000 | 0x0232
-#define NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND 0xC0000000 | 0x0233
-#define NT_STATUS_ACCOUNT_LOCKED_OUT 0xC0000000 | 0x0234
-#define NT_STATUS_HANDLE_NOT_CLOSABLE 0xC0000000 | 0x0235
-#define NT_STATUS_CONNECTION_REFUSED 0xC0000000 | 0x0236
-#define NT_STATUS_GRACEFUL_DISCONNECT 0xC0000000 | 0x0237
-#define NT_STATUS_ADDRESS_ALREADY_ASSOCIATED 0xC0000000 | 0x0238
-#define NT_STATUS_ADDRESS_NOT_ASSOCIATED 0xC0000000 | 0x0239
-#define NT_STATUS_CONNECTION_INVALID 0xC0000000 | 0x023a
-#define NT_STATUS_CONNECTION_ACTIVE 0xC0000000 | 0x023b
-#define NT_STATUS_NETWORK_UNREACHABLE 0xC0000000 | 0x023c
-#define NT_STATUS_HOST_UNREACHABLE 0xC0000000 | 0x023d
-#define NT_STATUS_PROTOCOL_UNREACHABLE 0xC0000000 | 0x023e
-#define NT_STATUS_PORT_UNREACHABLE 0xC0000000 | 0x023f
-#define NT_STATUS_REQUEST_ABORTED 0xC0000000 | 0x0240
-#define NT_STATUS_CONNECTION_ABORTED 0xC0000000 | 0x0241
-#define NT_STATUS_BAD_COMPRESSION_BUFFER 0xC0000000 | 0x0242
-#define NT_STATUS_USER_MAPPED_FILE 0xC0000000 | 0x0243
-#define NT_STATUS_AUDIT_FAILED 0xC0000000 | 0x0244
-#define NT_STATUS_TIMER_RESOLUTION_NOT_SET 0xC0000000 | 0x0245
-#define NT_STATUS_CONNECTION_COUNT_LIMIT 0xC0000000 | 0x0246
-#define NT_STATUS_LOGIN_TIME_RESTRICTION 0xC0000000 | 0x0247
-#define NT_STATUS_LOGIN_WKSTA_RESTRICTION 0xC0000000 | 0x0248
-#define NT_STATUS_IMAGE_MP_UP_MISMATCH 0xC0000000 | 0x0249
-#define NT_STATUS_INSUFFICIENT_LOGON_INFO 0xC0000000 | 0x0250
-#define NT_STATUS_BAD_DLL_ENTRYPOINT 0xC0000000 | 0x0251
-#define NT_STATUS_BAD_SERVICE_ENTRYPOINT 0xC0000000 | 0x0252
-#define NT_STATUS_LPC_REPLY_LOST 0xC0000000 | 0x0253
-#define NT_STATUS_IP_ADDRESS_CONFLICT1 0xC0000000 | 0x0254
-#define NT_STATUS_IP_ADDRESS_CONFLICT2 0xC0000000 | 0x0255
-#define NT_STATUS_REGISTRY_QUOTA_LIMIT 0xC0000000 | 0x0256
-#define NT_STATUS_PATH_NOT_COVERED 0xC0000000 | 0x0257
-#define NT_STATUS_NO_CALLBACK_ACTIVE 0xC0000000 | 0x0258
-#define NT_STATUS_LICENSE_QUOTA_EXCEEDED 0xC0000000 | 0x0259
-#define NT_STATUS_PWD_TOO_SHORT 0xC0000000 | 0x025a
-#define NT_STATUS_PWD_TOO_RECENT 0xC0000000 | 0x025b
-#define NT_STATUS_PWD_HISTORY_CONFLICT 0xC0000000 | 0x025c
-#define NT_STATUS_PLUGPLAY_NO_DEVICE 0xC0000000 | 0x025e
-#define NT_STATUS_UNSUPPORTED_COMPRESSION 0xC0000000 | 0x025f
-#define NT_STATUS_INVALID_HW_PROFILE 0xC0000000 | 0x0260
-#define NT_STATUS_INVALID_PLUGPLAY_DEVICE_PATH 0xC0000000 | 0x0261
-#define NT_STATUS_DRIVER_ORDINAL_NOT_FOUND 0xC0000000 | 0x0262
-#define NT_STATUS_DRIVER_ENTRYPOINT_NOT_FOUND 0xC0000000 | 0x0263
-#define NT_STATUS_RESOURCE_NOT_OWNED 0xC0000000 | 0x0264
-#define NT_STATUS_TOO_MANY_LINKS 0xC0000000 | 0x0265
-#define NT_STATUS_QUOTA_LIST_INCONSISTENT 0xC0000000 | 0x0266
-#define NT_STATUS_FILE_IS_OFFLINE 0xC0000000 | 0x0267
-#define NT_STATUS_NOT_A_REPARSE_POINT 0xC0000000 | 0x0275
-#define NT_STATUS_NETWORK_SESSION_EXPIRED  0xC0000000 | 0x035c
-#define NT_STATUS_NO_SUCH_JOB 0xC0000000 | 0xEDE	/* scheduler */
-#define NT_STATUS_NO_PREAUTH_INTEGRITY_HASH_OVERLAP 0xC0000000 | 0x5D0000
+#define NT_STATUS_UNSUCCESSFUL (0xC0000000 | 0x0001)
+#define NT_STATUS_NOT_IMPLEMENTED (0xC0000000 | 0x0002)
+#define NT_STATUS_INVALID_INFO_CLASS (0xC0000000 | 0x0003)
+#define NT_STATUS_INFO_LENGTH_MISMATCH (0xC0000000 | 0x0004)
+#define NT_STATUS_ACCESS_VIOLATION (0xC0000000 | 0x0005)
+#define NT_STATUS_IN_PAGE_ERROR (0xC0000000 | 0x0006)
+#define NT_STATUS_PAGEFILE_QUOTA (0xC0000000 | 0x0007)
+#define NT_STATUS_INVALID_HANDLE (0xC0000000 | 0x0008)
+#define NT_STATUS_BAD_INITIAL_STACK (0xC0000000 | 0x0009)
+#define NT_STATUS_BAD_INITIAL_PC (0xC0000000 | 0x000a)
+#define NT_STATUS_INVALID_CID (0xC0000000 | 0x000b)
+#define NT_STATUS_TIMER_NOT_CANCELED (0xC0000000 | 0x000c)
+#define NT_STATUS_INVALID_PARAMETER (0xC0000000 | 0x000d)
+#define NT_STATUS_NO_SUCH_DEVICE (0xC0000000 | 0x000e)
+#define NT_STATUS_NO_SUCH_FILE (0xC0000000 | 0x000f)
+#define NT_STATUS_INVALID_DEVICE_REQUEST (0xC0000000 | 0x0010)
+#define NT_STATUS_END_OF_FILE (0xC0000000 | 0x0011)
+#define NT_STATUS_WRONG_VOLUME (0xC0000000 | 0x0012)
+#define NT_STATUS_NO_MEDIA_IN_DEVICE (0xC0000000 | 0x0013)
+#define NT_STATUS_UNRECOGNIZED_MEDIA (0xC0000000 | 0x0014)
+#define NT_STATUS_NONEXISTENT_SECTOR (0xC0000000 | 0x0015)
+#define NT_STATUS_MORE_PROCESSING_REQUIRED (0xC0000000 | 0x0016)
+#define NT_STATUS_NO_MEMORY (0xC0000000 | 0x0017)
+#define NT_STATUS_CONFLICTING_ADDRESSES (0xC0000000 | 0x0018)
+#define NT_STATUS_NOT_MAPPED_VIEW (0xC0000000 | 0x0019)
+#define NT_STATUS_UNABLE_TO_FREE_VM (0xC0000000 | 0x001a)
+#define NT_STATUS_UNABLE_TO_DELETE_SECTION (0xC0000000 | 0x001b)
+#define NT_STATUS_INVALID_SYSTEM_SERVICE (0xC0000000 | 0x001c)
+#define NT_STATUS_ILLEGAL_INSTRUCTION (0xC0000000 | 0x001d)
+#define NT_STATUS_INVALID_LOCK_SEQUENCE (0xC0000000 | 0x001e)
+#define NT_STATUS_INVALID_VIEW_SIZE (0xC0000000 | 0x001f)
+#define NT_STATUS_INVALID_FILE_FOR_SECTION (0xC0000000 | 0x0020)
+#define NT_STATUS_ALREADY_COMMITTED (0xC0000000 | 0x0021)
+#define NT_STATUS_ACCESS_DENIED (0xC0000000 | 0x0022)
+#define NT_STATUS_BUFFER_TOO_SMALL (0xC0000000 | 0x0023)
+#define NT_STATUS_OBJECT_TYPE_MISMATCH (0xC0000000 | 0x0024)
+#define NT_STATUS_NONCONTINUABLE_EXCEPTION (0xC0000000 | 0x0025)
+#define NT_STATUS_INVALID_DISPOSITION (0xC0000000 | 0x0026)
+#define NT_STATUS_UNWIND (0xC0000000 | 0x0027)
+#define NT_STATUS_BAD_STACK (0xC0000000 | 0x0028)
+#define NT_STATUS_INVALID_UNWIND_TARGET (0xC0000000 | 0x0029)
+#define NT_STATUS_NOT_LOCKED (0xC0000000 | 0x002a)
+#define NT_STATUS_PARITY_ERROR (0xC0000000 | 0x002b)
+#define NT_STATUS_UNABLE_TO_DECOMMIT_VM (0xC0000000 | 0x002c)
+#define NT_STATUS_NOT_COMMITTED (0xC0000000 | 0x002d)
+#define NT_STATUS_INVALID_PORT_ATTRIBUTES (0xC0000000 | 0x002e)
+#define NT_STATUS_PORT_MESSAGE_TOO_LONG (0xC0000000 | 0x002f)
+#define NT_STATUS_INVALID_PARAMETER_MIX (0xC0000000 | 0x0030)
+#define NT_STATUS_INVALID_QUOTA_LOWER (0xC0000000 | 0x0031)
+#define NT_STATUS_DISK_CORRUPT_ERROR (0xC0000000 | 0x0032)
+#define NT_STATUS_OBJECT_NAME_INVALID (0xC0000000 | 0x0033)
+#define NT_STATUS_OBJECT_NAME_NOT_FOUND (0xC0000000 | 0x0034)
+#define NT_STATUS_OBJECT_NAME_COLLISION (0xC0000000 | 0x0035)
+#define NT_STATUS_HANDLE_NOT_WAITABLE (0xC0000000 | 0x0036)
+#define NT_STATUS_PORT_DISCONNECTED (0xC0000000 | 0x0037)
+#define NT_STATUS_DEVICE_ALREADY_ATTACHED (0xC0000000 | 0x0038)
+#define NT_STATUS_OBJECT_PATH_INVALID (0xC0000000 | 0x0039)
+#define NT_STATUS_OBJECT_PATH_NOT_FOUND (0xC0000000 | 0x003a)
+#define NT_STATUS_OBJECT_PATH_SYNTAX_BAD (0xC0000000 | 0x003b)
+#define NT_STATUS_DATA_OVERRUN (0xC0000000 | 0x003c)
+#define NT_STATUS_DATA_LATE_ERROR (0xC0000000 | 0x003d)
+#define NT_STATUS_DATA_ERROR (0xC0000000 | 0x003e)
+#define NT_STATUS_CRC_ERROR (0xC0000000 | 0x003f)
+#define NT_STATUS_SECTION_TOO_BIG (0xC0000000 | 0x0040)
+#define NT_STATUS_PORT_CONNECTION_REFUSED (0xC0000000 | 0x0041)
+#define NT_STATUS_INVALID_PORT_HANDLE (0xC0000000 | 0x0042)
+#define NT_STATUS_SHARING_VIOLATION (0xC0000000 | 0x0043)
+#define NT_STATUS_QUOTA_EXCEEDED (0xC0000000 | 0x0044)
+#define NT_STATUS_INVALID_PAGE_PROTECTION (0xC0000000 | 0x0045)
+#define NT_STATUS_MUTANT_NOT_OWNED (0xC0000000 | 0x0046)
+#define NT_STATUS_SEMAPHORE_LIMIT_EXCEEDED (0xC0000000 | 0x0047)
+#define NT_STATUS_PORT_ALREADY_SET (0xC0000000 | 0x0048)
+#define NT_STATUS_SECTION_NOT_IMAGE (0xC0000000 | 0x0049)
+#define NT_STATUS_SUSPEND_COUNT_EXCEEDED (0xC0000000 | 0x004a)
+#define NT_STATUS_THREAD_IS_TERMINATING (0xC0000000 | 0x004b)
+#define NT_STATUS_BAD_WORKING_SET_LIMIT (0xC0000000 | 0x004c)
+#define NT_STATUS_INCOMPATIBLE_FILE_MAP (0xC0000000 | 0x004d)
+#define NT_STATUS_SECTION_PROTECTION (0xC0000000 | 0x004e)
+#define NT_STATUS_EAS_NOT_SUPPORTED (0xC0000000 | 0x004f)
+#define NT_STATUS_EA_TOO_LARGE (0xC0000000 | 0x0050)
+#define NT_STATUS_NONEXISTENT_EA_ENTRY (0xC0000000 | 0x0051)
+#define NT_STATUS_NO_EAS_ON_FILE (0xC0000000 | 0x0052)
+#define NT_STATUS_EA_CORRUPT_ERROR (0xC0000000 | 0x0053)
+#define NT_STATUS_FILE_LOCK_CONFLICT (0xC0000000 | 0x0054)
+#define NT_STATUS_LOCK_NOT_GRANTED (0xC0000000 | 0x0055)
+#define NT_STATUS_DELETE_PENDING (0xC0000000 | 0x0056)
+#define NT_STATUS_CTL_FILE_NOT_SUPPORTED (0xC0000000 | 0x0057)
+#define NT_STATUS_UNKNOWN_REVISION (0xC0000000 | 0x0058)
+#define NT_STATUS_REVISION_MISMATCH (0xC0000000 | 0x0059)
+#define NT_STATUS_INVALID_OWNER (0xC0000000 | 0x005a)
+#define NT_STATUS_INVALID_PRIMARY_GROUP (0xC0000000 | 0x005b)
+#define NT_STATUS_NO_IMPERSONATION_TOKEN (0xC0000000 | 0x005c)
+#define NT_STATUS_CANT_DISABLE_MANDATORY (0xC0000000 | 0x005d)
+#define NT_STATUS_NO_LOGON_SERVERS (0xC0000000 | 0x005e)
+#define NT_STATUS_NO_SUCH_LOGON_SESSION (0xC0000000 | 0x005f)
+#define NT_STATUS_NO_SUCH_PRIVILEGE (0xC0000000 | 0x0060)
+#define NT_STATUS_PRIVILEGE_NOT_HELD (0xC0000000 | 0x0061)
+#define NT_STATUS_INVALID_ACCOUNT_NAME (0xC0000000 | 0x0062)
+#define NT_STATUS_USER_EXISTS (0xC0000000 | 0x0063)
+#define NT_STATUS_NO_SUCH_USER (0xC0000000 | 0x0064)
+#define NT_STATUS_GROUP_EXISTS (0xC0000000 | 0x0065)
+#define NT_STATUS_NO_SUCH_GROUP (0xC0000000 | 0x0066)
+#define NT_STATUS_MEMBER_IN_GROUP (0xC0000000 | 0x0067)
+#define NT_STATUS_MEMBER_NOT_IN_GROUP (0xC0000000 | 0x0068)
+#define NT_STATUS_LAST_ADMIN (0xC0000000 | 0x0069)
+#define NT_STATUS_WRONG_PASSWORD (0xC0000000 | 0x006a)
+#define NT_STATUS_ILL_FORMED_PASSWORD (0xC0000000 | 0x006b)
+#define NT_STATUS_PASSWORD_RESTRICTION (0xC0000000 | 0x006c)
+#define NT_STATUS_LOGON_FAILURE (0xC0000000 | 0x006d)
+#define NT_STATUS_ACCOUNT_RESTRICTION (0xC0000000 | 0x006e)
+#define NT_STATUS_INVALID_LOGON_HOURS (0xC0000000 | 0x006f)
+#define NT_STATUS_INVALID_WORKSTATION (0xC0000000 | 0x0070)
+#define NT_STATUS_PASSWORD_EXPIRED (0xC0000000 | 0x0071)
+#define NT_STATUS_ACCOUNT_DISABLED (0xC0000000 | 0x0072)
+#define NT_STATUS_NONE_MAPPED (0xC0000000 | 0x0073)
+#define NT_STATUS_TOO_MANY_LUIDS_REQUESTED (0xC0000000 | 0x0074)
+#define NT_STATUS_LUIDS_EXHAUSTED (0xC0000000 | 0x0075)
+#define NT_STATUS_INVALID_SUB_AUTHORITY (0xC0000000 | 0x0076)
+#define NT_STATUS_INVALID_ACL (0xC0000000 | 0x0077)
+#define NT_STATUS_INVALID_SID (0xC0000000 | 0x0078)
+#define NT_STATUS_INVALID_SECURITY_DESCR (0xC0000000 | 0x0079)
+#define NT_STATUS_PROCEDURE_NOT_FOUND (0xC0000000 | 0x007a)
+#define NT_STATUS_INVALID_IMAGE_FORMAT (0xC0000000 | 0x007b)
+#define NT_STATUS_NO_TOKEN (0xC0000000 | 0x007c)
+#define NT_STATUS_BAD_INHERITANCE_ACL (0xC0000000 | 0x007d)
+#define NT_STATUS_RANGE_NOT_LOCKED (0xC0000000 | 0x007e)
+#define NT_STATUS_DISK_FULL (0xC0000000 | 0x007f)
+#define NT_STATUS_SERVER_DISABLED (0xC0000000 | 0x0080)
+#define NT_STATUS_SERVER_NOT_DISABLED (0xC0000000 | 0x0081)
+#define NT_STATUS_TOO_MANY_GUIDS_REQUESTED (0xC0000000 | 0x0082)
+#define NT_STATUS_GUIDS_EXHAUSTED (0xC0000000 | 0x0083)
+#define NT_STATUS_INVALID_ID_AUTHORITY (0xC0000000 | 0x0084)
+#define NT_STATUS_AGENTS_EXHAUSTED (0xC0000000 | 0x0085)
+#define NT_STATUS_INVALID_VOLUME_LABEL (0xC0000000 | 0x0086)
+#define NT_STATUS_SECTION_NOT_EXTENDED (0xC0000000 | 0x0087)
+#define NT_STATUS_NOT_MAPPED_DATA (0xC0000000 | 0x0088)
+#define NT_STATUS_RESOURCE_DATA_NOT_FOUND (0xC0000000 | 0x0089)
+#define NT_STATUS_RESOURCE_TYPE_NOT_FOUND (0xC0000000 | 0x008a)
+#define NT_STATUS_RESOURCE_NAME_NOT_FOUND (0xC0000000 | 0x008b)
+#define NT_STATUS_ARRAY_BOUNDS_EXCEEDED (0xC0000000 | 0x008c)
+#define NT_STATUS_FLOAT_DENORMAL_OPERAND (0xC0000000 | 0x008d)
+#define NT_STATUS_FLOAT_DIVIDE_BY_ZERO (0xC0000000 | 0x008e)
+#define NT_STATUS_FLOAT_INEXACT_RESULT (0xC0000000 | 0x008f)
+#define NT_STATUS_FLOAT_INVALID_OPERATION (0xC0000000 | 0x0090)
+#define NT_STATUS_FLOAT_OVERFLOW (0xC0000000 | 0x0091)
+#define NT_STATUS_FLOAT_STACK_CHECK (0xC0000000 | 0x0092)
+#define NT_STATUS_FLOAT_UNDERFLOW (0xC0000000 | 0x0093)
+#define NT_STATUS_INTEGER_DIVIDE_BY_ZERO (0xC0000000 | 0x0094)
+#define NT_STATUS_INTEGER_OVERFLOW (0xC0000000 | 0x0095)
+#define NT_STATUS_PRIVILEGED_INSTRUCTION (0xC0000000 | 0x0096)
+#define NT_STATUS_TOO_MANY_PAGING_FILES (0xC0000000 | 0x0097)
+#define NT_STATUS_FILE_INVALID (0xC0000000 | 0x0098)
+#define NT_STATUS_ALLOTTED_SPACE_EXCEEDED (0xC0000000 | 0x0099)
+#define NT_STATUS_INSUFFICIENT_RESOURCES (0xC0000000 | 0x009a)
+#define NT_STATUS_DFS_EXIT_PATH_FOUND (0xC0000000 | 0x009b)
+#define NT_STATUS_DEVICE_DATA_ERROR (0xC0000000 | 0x009c)
+#define NT_STATUS_DEVICE_NOT_CONNECTED (0xC0000000 | 0x009d)
+#define NT_STATUS_DEVICE_POWER_FAILURE (0xC0000000 | 0x009e)
+#define NT_STATUS_FREE_VM_NOT_AT_BASE (0xC0000000 | 0x009f)
+#define NT_STATUS_MEMORY_NOT_ALLOCATED (0xC0000000 | 0x00a0)
+#define NT_STATUS_WORKING_SET_QUOTA (0xC0000000 | 0x00a1)
+#define NT_STATUS_MEDIA_WRITE_PROTECTED (0xC0000000 | 0x00a2)
+#define NT_STATUS_DEVICE_NOT_READY (0xC0000000 | 0x00a3)
+#define NT_STATUS_INVALID_GROUP_ATTRIBUTES (0xC0000000 | 0x00a4)
+#define NT_STATUS_BAD_IMPERSONATION_LEVEL (0xC0000000 | 0x00a5)
+#define NT_STATUS_CANT_OPEN_ANONYMOUS (0xC0000000 | 0x00a6)
+#define NT_STATUS_BAD_VALIDATION_CLASS (0xC0000000 | 0x00a7)
+#define NT_STATUS_BAD_TOKEN_TYPE (0xC0000000 | 0x00a8)
+#define NT_STATUS_BAD_MASTER_BOOT_RECORD (0xC0000000 | 0x00a9)
+#define NT_STATUS_INSTRUCTION_MISALIGNMENT (0xC0000000 | 0x00aa)
+#define NT_STATUS_INSTANCE_NOT_AVAILABLE (0xC0000000 | 0x00ab)
+#define NT_STATUS_PIPE_NOT_AVAILABLE (0xC0000000 | 0x00ac)
+#define NT_STATUS_INVALID_PIPE_STATE (0xC0000000 | 0x00ad)
+#define NT_STATUS_PIPE_BUSY (0xC0000000 | 0x00ae)
+#define NT_STATUS_ILLEGAL_FUNCTION (0xC0000000 | 0x00af)
+#define NT_STATUS_PIPE_DISCONNECTED (0xC0000000 | 0x00b0)
+#define NT_STATUS_PIPE_CLOSING (0xC0000000 | 0x00b1)
+#define NT_STATUS_PIPE_CONNECTED (0xC0000000 | 0x00b2)
+#define NT_STATUS_PIPE_LISTENING (0xC0000000 | 0x00b3)
+#define NT_STATUS_INVALID_READ_MODE (0xC0000000 | 0x00b4)
+#define NT_STATUS_IO_TIMEOUT (0xC0000000 | 0x00b5)
+#define NT_STATUS_FILE_FORCED_CLOSED (0xC0000000 | 0x00b6)
+#define NT_STATUS_PROFILING_NOT_STARTED (0xC0000000 | 0x00b7)
+#define NT_STATUS_PROFILING_NOT_STOPPED (0xC0000000 | 0x00b8)
+#define NT_STATUS_COULD_NOT_INTERPRET (0xC0000000 | 0x00b9)
+#define NT_STATUS_FILE_IS_A_DIRECTORY (0xC0000000 | 0x00ba)
+#define NT_STATUS_NOT_SUPPORTED (0xC0000000 | 0x00bb)
+#define NT_STATUS_REMOTE_NOT_LISTENING (0xC0000000 | 0x00bc)
+#define NT_STATUS_DUPLICATE_NAME (0xC0000000 | 0x00bd)
+#define NT_STATUS_BAD_NETWORK_PATH (0xC0000000 | 0x00be)
+#define NT_STATUS_NETWORK_BUSY (0xC0000000 | 0x00bf)
+#define NT_STATUS_DEVICE_DOES_NOT_EXIST (0xC0000000 | 0x00c0)
+#define NT_STATUS_TOO_MANY_COMMANDS (0xC0000000 | 0x00c1)
+#define NT_STATUS_ADAPTER_HARDWARE_ERROR (0xC0000000 | 0x00c2)
+#define NT_STATUS_INVALID_NETWORK_RESPONSE (0xC0000000 | 0x00c3)
+#define NT_STATUS_UNEXPECTED_NETWORK_ERROR (0xC0000000 | 0x00c4)
+#define NT_STATUS_BAD_REMOTE_ADAPTER (0xC0000000 | 0x00c5)
+#define NT_STATUS_PRINT_QUEUE_FULL (0xC0000000 | 0x00c6)
+#define NT_STATUS_NO_SPOOL_SPACE (0xC0000000 | 0x00c7)
+#define NT_STATUS_PRINT_CANCELLED (0xC0000000 | 0x00c8)
+#define NT_STATUS_NETWORK_NAME_DELETED (0xC0000000 | 0x00c9)
+#define NT_STATUS_NETWORK_ACCESS_DENIED (0xC0000000 | 0x00ca)
+#define NT_STATUS_BAD_DEVICE_TYPE (0xC0000000 | 0x00cb)
+#define NT_STATUS_BAD_NETWORK_NAME (0xC0000000 | 0x00cc)
+#define NT_STATUS_TOO_MANY_NAMES (0xC0000000 | 0x00cd)
+#define NT_STATUS_TOO_MANY_SESSIONS (0xC0000000 | 0x00ce)
+#define NT_STATUS_SHARING_PAUSED (0xC0000000 | 0x00cf)
+#define NT_STATUS_REQUEST_NOT_ACCEPTED (0xC0000000 | 0x00d0)
+#define NT_STATUS_REDIRECTOR_PAUSED (0xC0000000 | 0x00d1)
+#define NT_STATUS_NET_WRITE_FAULT (0xC0000000 | 0x00d2)
+#define NT_STATUS_PROFILING_AT_LIMIT (0xC0000000 | 0x00d3)
+#define NT_STATUS_NOT_SAME_DEVICE (0xC0000000 | 0x00d4)
+#define NT_STATUS_FILE_RENAMED (0xC0000000 | 0x00d5)
+#define NT_STATUS_VIRTUAL_CIRCUIT_CLOSED (0xC0000000 | 0x00d6)
+#define NT_STATUS_NO_SECURITY_ON_OBJECT (0xC0000000 | 0x00d7)
+#define NT_STATUS_CANT_WAIT (0xC0000000 | 0x00d8)
+#define NT_STATUS_PIPE_EMPTY (0xC0000000 | 0x00d9)
+#define NT_STATUS_CANT_ACCESS_DOMAIN_INFO (0xC0000000 | 0x00da)
+#define NT_STATUS_CANT_TERMINATE_SELF (0xC0000000 | 0x00db)
+#define NT_STATUS_INVALID_SERVER_STATE (0xC0000000 | 0x00dc)
+#define NT_STATUS_INVALID_DOMAIN_STATE (0xC0000000 | 0x00dd)
+#define NT_STATUS_INVALID_DOMAIN_ROLE (0xC0000000 | 0x00de)
+#define NT_STATUS_NO_SUCH_DOMAIN (0xC0000000 | 0x00df)
+#define NT_STATUS_DOMAIN_EXISTS (0xC0000000 | 0x00e0)
+#define NT_STATUS_DOMAIN_LIMIT_EXCEEDED (0xC0000000 | 0x00e1)
+#define NT_STATUS_OPLOCK_NOT_GRANTED (0xC0000000 | 0x00e2)
+#define NT_STATUS_INVALID_OPLOCK_PROTOCOL (0xC0000000 | 0x00e3)
+#define NT_STATUS_INTERNAL_DB_CORRUPTION (0xC0000000 | 0x00e4)
+#define NT_STATUS_INTERNAL_ERROR (0xC0000000 | 0x00e5)
+#define NT_STATUS_GENERIC_NOT_MAPPED (0xC0000000 | 0x00e6)
+#define NT_STATUS_BAD_DESCRIPTOR_FORMAT (0xC0000000 | 0x00e7)
+#define NT_STATUS_INVALID_USER_BUFFER (0xC0000000 | 0x00e8)
+#define NT_STATUS_UNEXPECTED_IO_ERROR (0xC0000000 | 0x00e9)
+#define NT_STATUS_UNEXPECTED_MM_CREATE_ERR (0xC0000000 | 0x00ea)
+#define NT_STATUS_UNEXPECTED_MM_MAP_ERROR (0xC0000000 | 0x00eb)
+#define NT_STATUS_UNEXPECTED_MM_EXTEND_ERR (0xC0000000 | 0x00ec)
+#define NT_STATUS_NOT_LOGON_PROCESS (0xC0000000 | 0x00ed)
+#define NT_STATUS_LOGON_SESSION_EXISTS (0xC0000000 | 0x00ee)
+#define NT_STATUS_INVALID_PARAMETER_1 (0xC0000000 | 0x00ef)
+#define NT_STATUS_INVALID_PARAMETER_2 (0xC0000000 | 0x00f0)
+#define NT_STATUS_INVALID_PARAMETER_3 (0xC0000000 | 0x00f1)
+#define NT_STATUS_INVALID_PARAMETER_4 (0xC0000000 | 0x00f2)
+#define NT_STATUS_INVALID_PARAMETER_5 (0xC0000000 | 0x00f3)
+#define NT_STATUS_INVALID_PARAMETER_6 (0xC0000000 | 0x00f4)
+#define NT_STATUS_INVALID_PARAMETER_7 (0xC0000000 | 0x00f5)
+#define NT_STATUS_INVALID_PARAMETER_8 (0xC0000000 | 0x00f6)
+#define NT_STATUS_INVALID_PARAMETER_9 (0xC0000000 | 0x00f7)
+#define NT_STATUS_INVALID_PARAMETER_10 (0xC0000000 | 0x00f8)
+#define NT_STATUS_INVALID_PARAMETER_11 (0xC0000000 | 0x00f9)
+#define NT_STATUS_INVALID_PARAMETER_12 (0xC0000000 | 0x00fa)
+#define NT_STATUS_REDIRECTOR_NOT_STARTED (0xC0000000 | 0x00fb)
+#define NT_STATUS_REDIRECTOR_STARTED (0xC0000000 | 0x00fc)
+#define NT_STATUS_STACK_OVERFLOW (0xC0000000 | 0x00fd)
+#define NT_STATUS_NO_SUCH_PACKAGE (0xC0000000 | 0x00fe)
+#define NT_STATUS_BAD_FUNCTION_TABLE (0xC0000000 | 0x00ff)
+#define NT_STATUS_DIRECTORY_NOT_EMPTY (0xC0000000 | 0x0101)
+#define NT_STATUS_FILE_CORRUPT_ERROR (0xC0000000 | 0x0102)
+#define NT_STATUS_NOT_A_DIRECTORY (0xC0000000 | 0x0103)
+#define NT_STATUS_BAD_LOGON_SESSION_STATE (0xC0000000 | 0x0104)
+#define NT_STATUS_LOGON_SESSION_COLLISION (0xC0000000 | 0x0105)
+#define NT_STATUS_NAME_TOO_LONG (0xC0000000 | 0x0106)
+#define NT_STATUS_FILES_OPEN (0xC0000000 | 0x0107)
+#define NT_STATUS_CONNECTION_IN_USE (0xC0000000 | 0x0108)
+#define NT_STATUS_MESSAGE_NOT_FOUND (0xC0000000 | 0x0109)
+#define NT_STATUS_PROCESS_IS_TERMINATING (0xC0000000 | 0x010a)
+#define NT_STATUS_INVALID_LOGON_TYPE (0xC0000000 | 0x010b)
+#define NT_STATUS_NO_GUID_TRANSLATION (0xC0000000 | 0x010c)
+#define NT_STATUS_CANNOT_IMPERSONATE (0xC0000000 | 0x010d)
+#define NT_STATUS_IMAGE_ALREADY_LOADED (0xC0000000 | 0x010e)
+#define NT_STATUS_ABIOS_NOT_PRESENT (0xC0000000 | 0x010f)
+#define NT_STATUS_ABIOS_LID_NOT_EXIST (0xC0000000 | 0x0110)
+#define NT_STATUS_ABIOS_LID_ALREADY_OWNED (0xC0000000 | 0x0111)
+#define NT_STATUS_ABIOS_NOT_LID_OWNER (0xC0000000 | 0x0112)
+#define NT_STATUS_ABIOS_INVALID_COMMAND (0xC0000000 | 0x0113)
+#define NT_STATUS_ABIOS_INVALID_LID (0xC0000000 | 0x0114)
+#define NT_STATUS_ABIOS_SELECTOR_NOT_AVAILABLE (0xC0000000 | 0x0115)
+#define NT_STATUS_ABIOS_INVALID_SELECTOR (0xC0000000 | 0x0116)
+#define NT_STATUS_NO_LDT (0xC0000000 | 0x0117)
+#define NT_STATUS_INVALID_LDT_SIZE (0xC0000000 | 0x0118)
+#define NT_STATUS_INVALID_LDT_OFFSET (0xC0000000 | 0x0119)
+#define NT_STATUS_INVALID_LDT_DESCRIPTOR (0xC0000000 | 0x011a)
+#define NT_STATUS_INVALID_IMAGE_NE_FORMAT (0xC0000000 | 0x011b)
+#define NT_STATUS_RXACT_INVALID_STATE (0xC0000000 | 0x011c)
+#define NT_STATUS_RXACT_COMMIT_FAILURE (0xC0000000 | 0x011d)
+#define NT_STATUS_MAPPED_FILE_SIZE_ZERO (0xC0000000 | 0x011e)
+#define NT_STATUS_TOO_MANY_OPENED_FILES (0xC0000000 | 0x011f)
+#define NT_STATUS_CANCELLED (0xC0000000 | 0x0120)
+#define NT_STATUS_CANNOT_DELETE (0xC0000000 | 0x0121)
+#define NT_STATUS_INVALID_COMPUTER_NAME (0xC0000000 | 0x0122)
+#define NT_STATUS_FILE_DELETED (0xC0000000 | 0x0123)
+#define NT_STATUS_SPECIAL_ACCOUNT (0xC0000000 | 0x0124)
+#define NT_STATUS_SPECIAL_GROUP (0xC0000000 | 0x0125)
+#define NT_STATUS_SPECIAL_USER (0xC0000000 | 0x0126)
+#define NT_STATUS_MEMBERS_PRIMARY_GROUP (0xC0000000 | 0x0127)
+#define NT_STATUS_FILE_CLOSED (0xC0000000 | 0x0128)
+#define NT_STATUS_TOO_MANY_THREADS (0xC0000000 | 0x0129)
+#define NT_STATUS_THREAD_NOT_IN_PROCESS (0xC0000000 | 0x012a)
+#define NT_STATUS_TOKEN_ALREADY_IN_USE (0xC0000000 | 0x012b)
+#define NT_STATUS_PAGEFILE_QUOTA_EXCEEDED (0xC0000000 | 0x012c)
+#define NT_STATUS_COMMITMENT_LIMIT (0xC0000000 | 0x012d)
+#define NT_STATUS_INVALID_IMAGE_LE_FORMAT (0xC0000000 | 0x012e)
+#define NT_STATUS_INVALID_IMAGE_NOT_MZ (0xC0000000 | 0x012f)
+#define NT_STATUS_INVALID_IMAGE_PROTECT (0xC0000000 | 0x0130)
+#define NT_STATUS_INVALID_IMAGE_WIN_16 (0xC0000000 | 0x0131)
+#define NT_STATUS_LOGON_SERVER_CONFLICT (0xC0000000 | 0x0132)
+#define NT_STATUS_TIME_DIFFERENCE_AT_DC (0xC0000000 | 0x0133)
+#define NT_STATUS_SYNCHRONIZATION_REQUIRED (0xC0000000 | 0x0134)
+#define NT_STATUS_DLL_NOT_FOUND (0xC0000000 | 0x0135)
+#define NT_STATUS_OPEN_FAILED (0xC0000000 | 0x0136)
+#define NT_STATUS_IO_PRIVILEGE_FAILED (0xC0000000 | 0x0137)
+#define NT_STATUS_ORDINAL_NOT_FOUND (0xC0000000 | 0x0138)
+#define NT_STATUS_ENTRYPOINT_NOT_FOUND (0xC0000000 | 0x0139)
+#define NT_STATUS_CONTROL_C_EXIT (0xC0000000 | 0x013a)
+#define NT_STATUS_LOCAL_DISCONNECT (0xC0000000 | 0x013b)
+#define NT_STATUS_REMOTE_DISCONNECT (0xC0000000 | 0x013c)
+#define NT_STATUS_REMOTE_RESOURCES (0xC0000000 | 0x013d)
+#define NT_STATUS_LINK_FAILED (0xC0000000 | 0x013e)
+#define NT_STATUS_LINK_TIMEOUT (0xC0000000 | 0x013f)
+#define NT_STATUS_INVALID_CONNECTION (0xC0000000 | 0x0140)
+#define NT_STATUS_INVALID_ADDRESS (0xC0000000 | 0x0141)
+#define NT_STATUS_DLL_INIT_FAILED (0xC0000000 | 0x0142)
+#define NT_STATUS_MISSING_SYSTEMFILE (0xC0000000 | 0x0143)
+#define NT_STATUS_UNHANDLED_EXCEPTION (0xC0000000 | 0x0144)
+#define NT_STATUS_APP_INIT_FAILURE (0xC0000000 | 0x0145)
+#define NT_STATUS_PAGEFILE_CREATE_FAILED (0xC0000000 | 0x0146)
+#define NT_STATUS_NO_PAGEFILE (0xC0000000 | 0x0147)
+#define NT_STATUS_INVALID_LEVEL (0xC0000000 | 0x0148)
+#define NT_STATUS_WRONG_PASSWORD_CORE (0xC0000000 | 0x0149)
+#define NT_STATUS_ILLEGAL_FLOAT_CONTEXT (0xC0000000 | 0x014a)
+#define NT_STATUS_PIPE_BROKEN (0xC0000000 | 0x014b)
+#define NT_STATUS_REGISTRY_CORRUPT (0xC0000000 | 0x014c)
+#define NT_STATUS_REGISTRY_IO_FAILED (0xC0000000 | 0x014d)
+#define NT_STATUS_NO_EVENT_PAIR (0xC0000000 | 0x014e)
+#define NT_STATUS_UNRECOGNIZED_VOLUME (0xC0000000 | 0x014f)
+#define NT_STATUS_SERIAL_NO_DEVICE_INITED (0xC0000000 | 0x0150)
+#define NT_STATUS_NO_SUCH_ALIAS (0xC0000000 | 0x0151)
+#define NT_STATUS_MEMBER_NOT_IN_ALIAS (0xC0000000 | 0x0152)
+#define NT_STATUS_MEMBER_IN_ALIAS (0xC0000000 | 0x0153)
+#define NT_STATUS_ALIAS_EXISTS (0xC0000000 | 0x0154)
+#define NT_STATUS_LOGON_NOT_GRANTED (0xC0000000 | 0x0155)
+#define NT_STATUS_TOO_MANY_SECRETS (0xC0000000 | 0x0156)
+#define NT_STATUS_SECRET_TOO_LONG (0xC0000000 | 0x0157)
+#define NT_STATUS_INTERNAL_DB_ERROR (0xC0000000 | 0x0158)
+#define NT_STATUS_FULLSCREEN_MODE (0xC0000000 | 0x0159)
+#define NT_STATUS_TOO_MANY_CONTEXT_IDS (0xC0000000 | 0x015a)
+#define NT_STATUS_LOGON_TYPE_NOT_GRANTED (0xC0000000 | 0x015b)
+#define NT_STATUS_NOT_REGISTRY_FILE (0xC0000000 | 0x015c)
+#define NT_STATUS_NT_CROSS_ENCRYPTION_REQUIRED (0xC0000000 | 0x015d)
+#define NT_STATUS_DOMAIN_CTRLR_CONFIG_ERROR (0xC0000000 | 0x015e)
+#define NT_STATUS_FT_MISSING_MEMBER (0xC0000000 | 0x015f)
+#define NT_STATUS_ILL_FORMED_SERVICE_ENTRY (0xC0000000 | 0x0160)
+#define NT_STATUS_ILLEGAL_CHARACTER (0xC0000000 | 0x0161)
+#define NT_STATUS_UNMAPPABLE_CHARACTER (0xC0000000 | 0x0162)
+#define NT_STATUS_UNDEFINED_CHARACTER (0xC0000000 | 0x0163)
+#define NT_STATUS_FLOPPY_VOLUME (0xC0000000 | 0x0164)
+#define NT_STATUS_FLOPPY_ID_MARK_NOT_FOUND (0xC0000000 | 0x0165)
+#define NT_STATUS_FLOPPY_WRONG_CYLINDER (0xC0000000 | 0x0166)
+#define NT_STATUS_FLOPPY_UNKNOWN_ERROR (0xC0000000 | 0x0167)
+#define NT_STATUS_FLOPPY_BAD_REGISTERS (0xC0000000 | 0x0168)
+#define NT_STATUS_DISK_RECALIBRATE_FAILED (0xC0000000 | 0x0169)
+#define NT_STATUS_DISK_OPERATION_FAILED (0xC0000000 | 0x016a)
+#define NT_STATUS_DISK_RESET_FAILED (0xC0000000 | 0x016b)
+#define NT_STATUS_SHARED_IRQ_BUSY (0xC0000000 | 0x016c)
+#define NT_STATUS_FT_ORPHANING (0xC0000000 | 0x016d)
+#define NT_STATUS_PARTITION_FAILURE (0xC0000000 | 0x0172)
+#define NT_STATUS_INVALID_BLOCK_LENGTH (0xC0000000 | 0x0173)
+#define NT_STATUS_DEVICE_NOT_PARTITIONED (0xC0000000 | 0x0174)
+#define NT_STATUS_UNABLE_TO_LOCK_MEDIA (0xC0000000 | 0x0175)
+#define NT_STATUS_UNABLE_TO_UNLOAD_MEDIA (0xC0000000 | 0x0176)
+#define NT_STATUS_EOM_OVERFLOW (0xC0000000 | 0x0177)
+#define NT_STATUS_NO_MEDIA (0xC0000000 | 0x0178)
+#define NT_STATUS_NO_SUCH_MEMBER (0xC0000000 | 0x017a)
+#define NT_STATUS_INVALID_MEMBER (0xC0000000 | 0x017b)
+#define NT_STATUS_KEY_DELETED (0xC0000000 | 0x017c)
+#define NT_STATUS_NO_LOG_SPACE (0xC0000000 | 0x017d)
+#define NT_STATUS_TOO_MANY_SIDS (0xC0000000 | 0x017e)
+#define NT_STATUS_LM_CROSS_ENCRYPTION_REQUIRED (0xC0000000 | 0x017f)
+#define NT_STATUS_KEY_HAS_CHILDREN (0xC0000000 | 0x0180)
+#define NT_STATUS_CHILD_MUST_BE_VOLATILE (0xC0000000 | 0x0181)
+#define NT_STATUS_DEVICE_CONFIGURATION_ERROR (0xC0000000 | 0x0182)
+#define NT_STATUS_DRIVER_INTERNAL_ERROR (0xC0000000 | 0x0183)
+#define NT_STATUS_INVALID_DEVICE_STATE (0xC0000000 | 0x0184)
+#define NT_STATUS_IO_DEVICE_ERROR (0xC0000000 | 0x0185)
+#define NT_STATUS_DEVICE_PROTOCOL_ERROR (0xC0000000 | 0x0186)
+#define NT_STATUS_BACKUP_CONTROLLER (0xC0000000 | 0x0187)
+#define NT_STATUS_LOG_FILE_FULL (0xC0000000 | 0x0188)
+#define NT_STATUS_TOO_LATE (0xC0000000 | 0x0189)
+#define NT_STATUS_NO_TRUST_LSA_SECRET (0xC0000000 | 0x018a)
+#define NT_STATUS_NO_TRUST_SAM_ACCOUNT (0xC0000000 | 0x018b)
+#define NT_STATUS_TRUSTED_DOMAIN_FAILURE (0xC0000000 | 0x018c)
+#define NT_STATUS_TRUSTED_RELATIONSHIP_FAILURE (0xC0000000 | 0x018d)
+#define NT_STATUS_EVENTLOG_FILE_CORRUPT (0xC0000000 | 0x018e)
+#define NT_STATUS_EVENTLOG_CANT_START (0xC0000000 | 0x018f)
+#define NT_STATUS_TRUST_FAILURE (0xC0000000 | 0x0190)
+#define NT_STATUS_MUTANT_LIMIT_EXCEEDED (0xC0000000 | 0x0191)
+#define NT_STATUS_NETLOGON_NOT_STARTED (0xC0000000 | 0x0192)
+#define NT_STATUS_ACCOUNT_EXPIRED (0xC0000000 | 0x0193)
+#define NT_STATUS_POSSIBLE_DEADLOCK (0xC0000000 | 0x0194)
+#define NT_STATUS_NETWORK_CREDENTIAL_CONFLICT (0xC0000000 | 0x0195)
+#define NT_STATUS_REMOTE_SESSION_LIMIT (0xC0000000 | 0x0196)
+#define NT_STATUS_EVENTLOG_FILE_CHANGED (0xC0000000 | 0x0197)
+#define NT_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT (0xC0000000 | 0x0198)
+#define NT_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT (0xC0000000 | 0x0199)
+#define NT_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT (0xC0000000 | 0x019a)
+#define NT_STATUS_DOMAIN_TRUST_INCONSISTENT (0xC0000000 | 0x019b)
+#define NT_STATUS_FS_DRIVER_REQUIRED (0xC0000000 | 0x019c)
+#define NT_STATUS_INVALID_LOCK_RANGE (0xC0000000 | 0x01a1)
+#define NT_STATUS_NO_USER_SESSION_KEY (0xC0000000 | 0x0202)
+#define NT_STATUS_USER_SESSION_DELETED (0xC0000000 | 0x0203)
+#define NT_STATUS_RESOURCE_LANG_NOT_FOUND (0xC0000000 | 0x0204)
+#define NT_STATUS_INSUFF_SERVER_RESOURCES (0xC0000000 | 0x0205)
+#define NT_STATUS_INVALID_BUFFER_SIZE (0xC0000000 | 0x0206)
+#define NT_STATUS_INVALID_ADDRESS_COMPONENT (0xC0000000 | 0x0207)
+#define NT_STATUS_INVALID_ADDRESS_WILDCARD (0xC0000000 | 0x0208)
+#define NT_STATUS_TOO_MANY_ADDRESSES (0xC0000000 | 0x0209)
+#define NT_STATUS_ADDRESS_ALREADY_EXISTS (0xC0000000 | 0x020a)
+#define NT_STATUS_ADDRESS_CLOSED (0xC0000000 | 0x020b)
+#define NT_STATUS_CONNECTION_DISCONNECTED (0xC0000000 | 0x020c)
+#define NT_STATUS_CONNECTION_RESET (0xC0000000 | 0x020d)
+#define NT_STATUS_TOO_MANY_NODES (0xC0000000 | 0x020e)
+#define NT_STATUS_TRANSACTION_ABORTED (0xC0000000 | 0x020f)
+#define NT_STATUS_TRANSACTION_TIMED_OUT (0xC0000000 | 0x0210)
+#define NT_STATUS_TRANSACTION_NO_RELEASE (0xC0000000 | 0x0211)
+#define NT_STATUS_TRANSACTION_NO_MATCH (0xC0000000 | 0x0212)
+#define NT_STATUS_TRANSACTION_RESPONDED (0xC0000000 | 0x0213)
+#define NT_STATUS_TRANSACTION_INVALID_ID (0xC0000000 | 0x0214)
+#define NT_STATUS_TRANSACTION_INVALID_TYPE (0xC0000000 | 0x0215)
+#define NT_STATUS_NOT_SERVER_SESSION (0xC0000000 | 0x0216)
+#define NT_STATUS_NOT_CLIENT_SESSION (0xC0000000 | 0x0217)
+#define NT_STATUS_CANNOT_LOAD_REGISTRY_FILE (0xC0000000 | 0x0218)
+#define NT_STATUS_DEBUG_ATTACH_FAILED (0xC0000000 | 0x0219)
+#define NT_STATUS_SYSTEM_PROCESS_TERMINATED (0xC0000000 | 0x021a)
+#define NT_STATUS_DATA_NOT_ACCEPTED (0xC0000000 | 0x021b)
+#define NT_STATUS_NO_BROWSER_SERVERS_FOUND (0xC0000000 | 0x021c)
+#define NT_STATUS_VDM_HARD_ERROR (0xC0000000 | 0x021d)
+#define NT_STATUS_DRIVER_CANCEL_TIMEOUT (0xC0000000 | 0x021e)
+#define NT_STATUS_REPLY_MESSAGE_MISMATCH (0xC0000000 | 0x021f)
+#define NT_STATUS_MAPPED_ALIGNMENT (0xC0000000 | 0x0220)
+#define NT_STATUS_IMAGE_CHECKSUM_MISMATCH (0xC0000000 | 0x0221)
+#define NT_STATUS_LOST_WRITEBEHIND_DATA (0xC0000000 | 0x0222)
+#define NT_STATUS_CLIENT_SERVER_PARAMETERS_INVALID (0xC0000000 | 0x0223)
+#define NT_STATUS_PASSWORD_MUST_CHANGE (0xC0000000 | 0x0224)
+#define NT_STATUS_NOT_FOUND (0xC0000000 | 0x0225)
+#define NT_STATUS_NOT_TINY_STREAM (0xC0000000 | 0x0226)
+#define NT_STATUS_RECOVERY_FAILURE (0xC0000000 | 0x0227)
+#define NT_STATUS_STACK_OVERFLOW_READ (0xC0000000 | 0x0228)
+#define NT_STATUS_FAIL_CHECK (0xC0000000 | 0x0229)
+#define NT_STATUS_DUPLICATE_OBJECTID (0xC0000000 | 0x022a)
+#define NT_STATUS_OBJECTID_EXISTS (0xC0000000 | 0x022b)
+#define NT_STATUS_CONVERT_TO_LARGE (0xC0000000 | 0x022c)
+#define NT_STATUS_RETRY (0xC0000000 | 0x022d)
+#define NT_STATUS_FOUND_OUT_OF_SCOPE (0xC0000000 | 0x022e)
+#define NT_STATUS_ALLOCATE_BUCKET (0xC0000000 | 0x022f)
+#define NT_STATUS_PROPSET_NOT_FOUND (0xC0000000 | 0x0230)
+#define NT_STATUS_MARSHALL_OVERFLOW (0xC0000000 | 0x0231)
+#define NT_STATUS_INVALID_VARIANT (0xC0000000 | 0x0232)
+#define NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND (0xC0000000 | 0x0233)
+#define NT_STATUS_ACCOUNT_LOCKED_OUT (0xC0000000 | 0x0234)
+#define NT_STATUS_HANDLE_NOT_CLOSABLE (0xC0000000 | 0x0235)
+#define NT_STATUS_CONNECTION_REFUSED (0xC0000000 | 0x0236)
+#define NT_STATUS_GRACEFUL_DISCONNECT (0xC0000000 | 0x0237)
+#define NT_STATUS_ADDRESS_ALREADY_ASSOCIATED (0xC0000000 | 0x0238)
+#define NT_STATUS_ADDRESS_NOT_ASSOCIATED (0xC0000000 | 0x0239)
+#define NT_STATUS_CONNECTION_INVALID (0xC0000000 | 0x023a)
+#define NT_STATUS_CONNECTION_ACTIVE (0xC0000000 | 0x023b)
+#define NT_STATUS_NETWORK_UNREACHABLE (0xC0000000 | 0x023c)
+#define NT_STATUS_HOST_UNREACHABLE (0xC0000000 | 0x023d)
+#define NT_STATUS_PROTOCOL_UNREACHABLE (0xC0000000 | 0x023e)
+#define NT_STATUS_PORT_UNREACHABLE (0xC0000000 | 0x023f)
+#define NT_STATUS_REQUEST_ABORTED (0xC0000000 | 0x0240)
+#define NT_STATUS_CONNECTION_ABORTED (0xC0000000 | 0x0241)
+#define NT_STATUS_BAD_COMPRESSION_BUFFER (0xC0000000 | 0x0242)
+#define NT_STATUS_USER_MAPPED_FILE (0xC0000000 | 0x0243)
+#define NT_STATUS_AUDIT_FAILED (0xC0000000 | 0x0244)
+#define NT_STATUS_TIMER_RESOLUTION_NOT_SET (0xC0000000 | 0x0245)
+#define NT_STATUS_CONNECTION_COUNT_LIMIT (0xC0000000 | 0x0246)
+#define NT_STATUS_LOGIN_TIME_RESTRICTION (0xC0000000 | 0x0247)
+#define NT_STATUS_LOGIN_WKSTA_RESTRICTION (0xC0000000 | 0x0248)
+#define NT_STATUS_IMAGE_MP_UP_MISMATCH (0xC0000000 | 0x0249)
+#define NT_STATUS_INSUFFICIENT_LOGON_INFO (0xC0000000 | 0x0250)
+#define NT_STATUS_BAD_DLL_ENTRYPOINT (0xC0000000 | 0x0251)
+#define NT_STATUS_BAD_SERVICE_ENTRYPOINT (0xC0000000 | 0x0252)
+#define NT_STATUS_LPC_REPLY_LOST (0xC0000000 | 0x0253)
+#define NT_STATUS_IP_ADDRESS_CONFLICT1 (0xC0000000 | 0x0254)
+#define NT_STATUS_IP_ADDRESS_CONFLICT2 (0xC0000000 | 0x0255)
+#define NT_STATUS_REGISTRY_QUOTA_LIMIT (0xC0000000 | 0x0256)
+#define NT_STATUS_PATH_NOT_COVERED (0xC0000000 | 0x0257)
+#define NT_STATUS_NO_CALLBACK_ACTIVE (0xC0000000 | 0x0258)
+#define NT_STATUS_LICENSE_QUOTA_EXCEEDED (0xC0000000 | 0x0259)
+#define NT_STATUS_PWD_TOO_SHORT (0xC0000000 | 0x025a)
+#define NT_STATUS_PWD_TOO_RECENT (0xC0000000 | 0x025b)
+#define NT_STATUS_PWD_HISTORY_CONFLICT (0xC0000000 | 0x025c)
+#define NT_STATUS_PLUGPLAY_NO_DEVICE (0xC0000000 | 0x025e)
+#define NT_STATUS_UNSUPPORTED_COMPRESSION (0xC0000000 | 0x025f)
+#define NT_STATUS_INVALID_HW_PROFILE (0xC0000000 | 0x0260)
+#define NT_STATUS_INVALID_PLUGPLAY_DEVICE_PATH (0xC0000000 | 0x0261)
+#define NT_STATUS_DRIVER_ORDINAL_NOT_FOUND (0xC0000000 | 0x0262)
+#define NT_STATUS_DRIVER_ENTRYPOINT_NOT_FOUND (0xC0000000 | 0x0263)
+#define NT_STATUS_RESOURCE_NOT_OWNED (0xC0000000 | 0x0264)
+#define NT_STATUS_TOO_MANY_LINKS (0xC0000000 | 0x0265)
+#define NT_STATUS_QUOTA_LIST_INCONSISTENT (0xC0000000 | 0x0266)
+#define NT_STATUS_FILE_IS_OFFLINE (0xC0000000 | 0x0267)
+#define NT_STATUS_NOT_A_REPARSE_POINT (0xC0000000 | 0x0275)
+#define NT_STATUS_NETWORK_SESSION_EXPIRED  (0xC0000000 | 0x035c)
+#define NT_STATUS_NO_SUCH_JOB (0xC0000000 | 0xEDE)	/* scheduler */
+#define NT_STATUS_NO_PREAUTH_INTEGRITY_HASH_OVERLAP (0xC0000000 | 0x5D0000)
 
 #endif				/* _NTERR_H */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 07/30] smb/client: introduce DEFINE_CMP_FUNC()
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (5 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 06/30] smb/client: add parentheses to NT error code definitions containing bitwise OR operator chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 08/30] smb/client: sort ntstatus_to_dos_map array chenxiaosong.chenxiaosong
                   ` (24 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

We are going to define 3 comparison functions, introduce this macro to
reduce duplicate code.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/netmisc.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/fs/smb/client/netmisc.c b/fs/smb/client/netmisc.c
index 9ec20601cee2..73c40ae91607 100644
--- a/fs/smb/client/netmisc.c
+++ b/fs/smb/client/netmisc.c
@@ -24,6 +24,19 @@
 #include "cifs_debug.h"
 #include "nterr.h"
 
+/* Define a comparison function for ascending order. */
+#define DEFINE_CMP_FUNC(__struct_name, __field)				\
+static int cmp_ ## __struct_name(const void *_a, const void *_b)	\
+{									\
+	const struct __struct_name *a = _a, *b = _b;			\
+									\
+	if (a->__field < b->__field)					\
+		return -1;						\
+	if (a->__field > b->__field)					\
+		return 1;						\
+	return 0;							\
+}
+
 struct smb_to_posix_error {
 	__u16 smb_err;
 	int posix_code;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 08/30] smb/client: sort ntstatus_to_dos_map array
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (6 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 07/30] smb/client: introduce DEFINE_CMP_FUNC() chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 09/30] smb/client: create netmisc_test.c and introduce DEFINE_CHECK_SORT_FUNC() chenxiaosong.chenxiaosong
                   ` (23 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

Sort the array in ascending order, and then we can use binary search
algorithm to quickly find the target NT error code.

The array is sorted only once in smb1_init_maperror() when cifs.ko
is loaded.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/cifsfs.c    |  2 ++
 fs/smb/client/cifsproto.h |  1 +
 fs/smb/client/netmisc.c   | 20 ++++++++++++++++++--
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/fs/smb/client/cifsfs.c b/fs/smb/client/cifsfs.c
index 77d14b3dd650..3e3affce585e 100644
--- a/fs/smb/client/cifsfs.c
+++ b/fs/smb/client/cifsfs.c
@@ -49,6 +49,7 @@
 #endif
 #include "fs_context.h"
 #include "cached_dir.h"
+#include "cifsproto.h"
 #include "smb2proto.h"
 
 /*
@@ -1909,6 +1910,7 @@ static int __init
 init_cifs(void)
 {
 	int rc = 0;
+	smb_init_maperror();
 	smb2_init_maperror();
 	cifs_proc_init();
 	INIT_LIST_HEAD(&cifs_tcp_ses_list);
diff --git a/fs/smb/client/cifsproto.h b/fs/smb/client/cifsproto.h
index 3528c365a452..675413d701b3 100644
--- a/fs/smb/client/cifsproto.h
+++ b/fs/smb/client/cifsproto.h
@@ -188,6 +188,7 @@ extern int cifs_convert_address(struct sockaddr *dst, const char *src, int len);
 extern void cifs_set_port(struct sockaddr *addr, const unsigned short int port);
 extern int map_smb_to_linux_error(char *buf, bool logErr);
 extern int map_and_check_smb_error(struct mid_q_entry *mid, bool logErr);
+extern void smb_init_maperror(void);
 extern void header_assemble(struct smb_hdr *, char /* command */ ,
 			    const struct cifs_tcon *, int /* length of
 			    fixed section (word count) in two byte units */);
diff --git a/fs/smb/client/netmisc.c b/fs/smb/client/netmisc.c
index 73c40ae91607..54ede1db2c7f 100644
--- a/fs/smb/client/netmisc.c
+++ b/fs/smb/client/netmisc.c
@@ -16,6 +16,7 @@
 #include <asm/div64.h>
 #include <asm/byteorder.h>
 #include <linux/inet.h>
+#include <linux/sort.h>
 #include "cifsfs.h"
 #include "cifspdu.h"
 #include "cifsglob.h"
@@ -216,11 +217,13 @@ cifs_set_port(struct sockaddr *addr, const unsigned short int port)
 convert a NT status code to a dos class/code
  *****************************************************************************/
 /* NT status -> dos error map */
-static const struct {
+struct ntstatus_to_dos {
 	__u8 dos_class;
 	__u16 dos_code;
 	__u32 ntstatus;
-} ntstatus_to_dos_map[] = {
+};
+
+static struct ntstatus_to_dos ntstatus_to_dos_map[] = {
 	{
 	ERRDOS, ERRgeneral, NT_STATUS_UNSUCCESSFUL}, {
 	ERRDOS, ERRbadfunc, NT_STATUS_NOT_IMPLEMENTED}, {
@@ -778,6 +781,12 @@ static const struct {
 	0, 0, 0 }
 };
 
+static unsigned int ntstatus_to_dos_num = sizeof(ntstatus_to_dos_map) /
+					  sizeof(struct ntstatus_to_dos);
+
+/* cmp_ntstatus_to_dos */
+DEFINE_CMP_FUNC(ntstatus_to_dos, ntstatus);
+
 /*****************************************************************************
  Print an error message from the status code
  *****************************************************************************/
@@ -1040,3 +1049,10 @@ struct timespec64 cnvrtDosUnixTm(__le16 le_date, __le16 le_time, int offset)
 	ts.tv_nsec = 0;
 	return ts;
 }
+
+void smb_init_maperror(void)
+{
+	/* Sort in ascending order */
+	sort(ntstatus_to_dos_map, ntstatus_to_dos_num,
+	     sizeof(struct ntstatus_to_dos), cmp_ntstatus_to_dos, NULL);
+}
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 09/30] smb/client: create netmisc_test.c and introduce DEFINE_CHECK_SORT_FUNC()
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (7 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 08/30] smb/client: sort ntstatus_to_dos_map array chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 10/30] smb/client: introduce KUnit test to check sort result of ntstatus_to_dos_map array chenxiaosong.chenxiaosong
                   ` (22 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

We are going to define 4 functions to check the sort results, introduce the
macro DEFINE_CHECK_SORT_FUNC() to reduce duplicate code.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/netmisc.c      |  4 ++++
 fs/smb/client/netmisc_test.c | 46 ++++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+)
 create mode 100644 fs/smb/client/netmisc_test.c

diff --git a/fs/smb/client/netmisc.c b/fs/smb/client/netmisc.c
index 54ede1db2c7f..32197a3a4e81 100644
--- a/fs/smb/client/netmisc.c
+++ b/fs/smb/client/netmisc.c
@@ -1056,3 +1056,7 @@ void smb_init_maperror(void)
 	sort(ntstatus_to_dos_map, ntstatus_to_dos_num,
 	     sizeof(struct ntstatus_to_dos), cmp_ntstatus_to_dos, NULL);
 }
+
+#if IS_ENABLED(CONFIG_SMB_KUNIT_TESTS)
+#include "netmisc_test.c"
+#endif /* CONFIG_SMB_KUNIT_TESTS */
diff --git a/fs/smb/client/netmisc_test.c b/fs/smb/client/netmisc_test.c
new file mode 100644
index 000000000000..f937b7b3d3f2
--- /dev/null
+++ b/fs/smb/client/netmisc_test.c
@@ -0,0 +1,46 @@
+// SPDX-License-Identifier: LGPL-2.1
+/*
+ *
+ *   KUnit tests of SMB1 maperror
+ *
+ *   Copyright (C) 2025 KylinSoft Co., Ltd. All rights reserved.
+ *   Author(s): ChenXiaoSong <chenxiaosong@kylinos.cn>
+ *
+ */
+
+#include <kunit/test.h>
+
+#define DEFINE_CHECK_SORT_FUNC(__array, __num, __field)			\
+static void __array ## _check_sort(struct kunit *test)			\
+{									\
+	bool is_sorted = true;						\
+	unsigned int i;							\
+									\
+	for (i = 1; i < __num; i++) {					\
+		if (__array[i].__field >= __array[i - 1].__field)	\
+			continue;					\
+									\
+		pr_err("%s array order is incorrect\n", #__array);	\
+		is_sorted = false;					\
+		break;							\
+	}								\
+									\
+	KUNIT_EXPECT_EQ(test, true, is_sorted);				\
+}
+
+/*
+ * Before running these test cases, the smb_init_maperror()
+ * function is called first.
+ */
+static struct kunit_case maperror_test_cases[] = {
+	{}
+};
+
+static struct kunit_suite maperror_suite = {
+	.name = "smb1_maperror",
+	.test_cases = maperror_test_cases,
+};
+
+kunit_test_suite(maperror_suite);
+
+MODULE_LICENSE("GPL");
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 10/30] smb/client: introduce KUnit test to check sort result of ntstatus_to_dos_map array
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (8 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 09/30] smb/client: create netmisc_test.c and introduce DEFINE_CHECK_SORT_FUNC() chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 11/30] smb/client: introduce DEFINE_SEARCH_FUNC() chenxiaosong.chenxiaosong
                   ` (21 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

The KUnit test are executed when cifs.ko is loaded.

The ntstatus_to_dos_map_check_sort() checks whether the array is properly
sorted.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/netmisc_test.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/smb/client/netmisc_test.c b/fs/smb/client/netmisc_test.c
index f937b7b3d3f2..a08011621742 100644
--- a/fs/smb/client/netmisc_test.c
+++ b/fs/smb/client/netmisc_test.c
@@ -28,11 +28,16 @@ static void __array ## _check_sort(struct kunit *test)			\
 	KUNIT_EXPECT_EQ(test, true, is_sorted);				\
 }
 
+/* ntstatus_to_dos_map_check_sort */
+DEFINE_CHECK_SORT_FUNC(ntstatus_to_dos_map, ntstatus_to_dos_num, ntstatus);
+
 /*
  * Before running these test cases, the smb_init_maperror()
  * function is called first.
  */
 static struct kunit_case maperror_test_cases[] = {
+	/* check sort */
+	KUNIT_CASE(ntstatus_to_dos_map_check_sort),
 	{}
 };
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 11/30] smb/client: introduce DEFINE_SEARCH_FUNC()
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (9 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 10/30] smb/client: introduce KUnit test to check sort result of ntstatus_to_dos_map array chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 12/30] smb/client: use bsearch() to find target in ntstatus_to_dos_map array chenxiaosong.chenxiaosong
                   ` (20 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

We are going to define 4 search functions, introduce this macro to
reduce duplicate code.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/netmisc.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/fs/smb/client/netmisc.c b/fs/smb/client/netmisc.c
index 32197a3a4e81..8a84f826d486 100644
--- a/fs/smb/client/netmisc.c
+++ b/fs/smb/client/netmisc.c
@@ -38,6 +38,22 @@ static int cmp_ ## __struct_name(const void *_a, const void *_b)	\
 	return 0;							\
 }
 
+/* Define a function for searching the target error map. */
+#define DEFINE_SEARCH_FUNC(__struct_name, __field, __array, __num)	\
+static struct __struct_name *search_in_ ## __array(__le32 error)	\
+{									\
+	struct __struct_name *err_map, key;				\
+									\
+	key = (struct __struct_name) {					\
+		.__field = error,					\
+	};								\
+	err_map = bsearch(&key, __array, __num,				\
+			  sizeof(struct __struct_name),			\
+			  cmp_ ## __struct_name);			\
+									\
+	return err_map;							\
+}
+
 struct smb_to_posix_error {
 	__u16 smb_err;
 	int posix_code;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 12/30] smb/client: use bsearch() to find target in ntstatus_to_dos_map array
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (10 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 11/30] smb/client: introduce DEFINE_SEARCH_FUNC() chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 13/30] smb/client: remove useless elements from " chenxiaosong.chenxiaosong
                   ` (19 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

The array currently has 525 elements. When searching for the last element,
the original loop-based search method requires 525 comparisons, while
binary search algorithm requires only 9 comparisons.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/netmisc.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/fs/smb/client/netmisc.c b/fs/smb/client/netmisc.c
index 8a84f826d486..55100c2c14cf 100644
--- a/fs/smb/client/netmisc.c
+++ b/fs/smb/client/netmisc.c
@@ -803,6 +803,9 @@ static unsigned int ntstatus_to_dos_num = sizeof(ntstatus_to_dos_map) /
 /* cmp_ntstatus_to_dos */
 DEFINE_CMP_FUNC(ntstatus_to_dos, ntstatus);
 
+/* search_in_ntstatus_to_dos_map */
+DEFINE_SEARCH_FUNC(ntstatus_to_dos, ntstatus, ntstatus_to_dos_map, ntstatus_to_dos_num);
+
 /*****************************************************************************
  Print an error message from the status code
  *****************************************************************************/
@@ -826,19 +829,21 @@ cifs_print_status(__u32 status_code)
 static void
 ntstatus_to_dos(__u32 ntstatus, __u8 *eclass, __u16 *ecode)
 {
-	int i;
+	struct ntstatus_to_dos *err_map;
+
 	if (ntstatus == 0) {
 		*eclass = 0;
 		*ecode = 0;
 		return;
 	}
-	for (i = 0; ntstatus_to_dos_map[i].ntstatus; i++) {
-		if (ntstatus == ntstatus_to_dos_map[i].ntstatus) {
-			*eclass = ntstatus_to_dos_map[i].dos_class;
-			*ecode = ntstatus_to_dos_map[i].dos_code;
-			return;
-		}
+
+	err_map = search_in_ntstatus_to_dos_map(ntstatus);
+	if (err_map) {
+		*eclass = err_map->dos_class;
+		*ecode = err_map->dos_code;
+		return;
 	}
+
 	*eclass = ERRHRD;
 	*ecode = ERRgeneral;
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 13/30] smb/client: remove useless elements from ntstatus_to_dos_map array
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (11 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 12/30] smb/client: use bsearch() to find target in ntstatus_to_dos_map array chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 14/30] smb/client: introduce DEFINE_CHECK_SEARCH_FUNC() chenxiaosong.chenxiaosong
                   ` (18 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

The last element in the array is no longer needed.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/netmisc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/smb/client/netmisc.c b/fs/smb/client/netmisc.c
index 55100c2c14cf..4e6312593d6f 100644
--- a/fs/smb/client/netmisc.c
+++ b/fs/smb/client/netmisc.c
@@ -793,8 +793,7 @@ static struct ntstatus_to_dos ntstatus_to_dos_map[] = {
 	ERRDOS, ERRnoaccess, 0xc0000290}, {
 	ERRDOS, ERRbadfunc, 0xc000029c}, {
 	ERRDOS, ERRsymlink, NT_STATUS_STOPPED_ON_SYMLINK}, {
-	ERRDOS, ERRinvlevel, 0x007c0001}, {
-	0, 0, 0 }
+	ERRDOS, ERRinvlevel, 0x007c0001},
 };
 
 static unsigned int ntstatus_to_dos_num = sizeof(ntstatus_to_dos_map) /
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 14/30] smb/client: introduce DEFINE_CHECK_SEARCH_FUNC()
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (12 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 13/30] smb/client: remove useless elements from " chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 15/30] smb/client: introduce KUnit test to check search result of ntstatus_to_dos_map array chenxiaosong.chenxiaosong
                   ` (17 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

We are going to define 4 functions to check the search results, introduce
the macro DEFINE_CHECK_SEARCH_FUNC() to reduce duplicate code.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/netmisc_test.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/fs/smb/client/netmisc_test.c b/fs/smb/client/netmisc_test.c
index a08011621742..b682098d2fc5 100644
--- a/fs/smb/client/netmisc_test.c
+++ b/fs/smb/client/netmisc_test.c
@@ -31,6 +31,21 @@ static void __array ## _check_sort(struct kunit *test)			\
 /* ntstatus_to_dos_map_check_sort */
 DEFINE_CHECK_SORT_FUNC(ntstatus_to_dos_map, ntstatus_to_dos_num, ntstatus);
 
+#define DEFINE_CHECK_SEARCH_FUNC(__struct_name, __field,		\
+				 __array, __num)			\
+static void __array ## _check_search(struct kunit *test)		\
+{									\
+	unsigned int i;							\
+	struct __struct_name expect, *result;				\
+									\
+	for (i = 0; i < __num; i++) {					\
+		expect = __array[i];					\
+		result = search_in_ ## __array(expect.__field);		\
+		KUNIT_EXPECT_PTR_NE(test, NULL, result);		\
+		test_cmp_ ## __struct_name(test, &expect, result);	\
+	}								\
+}
+
 /*
  * Before running these test cases, the smb_init_maperror()
  * function is called first.
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 15/30] smb/client: introduce KUnit test to check search result of ntstatus_to_dos_map array
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (13 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 14/30] smb/client: introduce DEFINE_CHECK_SEARCH_FUNC() chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 16/30] smb/client: sort nt_errs array chenxiaosong.chenxiaosong
                   ` (16 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

The KUnit test are executed when cifs.ko is loaded.

The ntstatus_to_dos_map_check_search() checks whether all elements can be
correctly found in the array.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/netmisc_test.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/fs/smb/client/netmisc_test.c b/fs/smb/client/netmisc_test.c
index b682098d2fc5..ade5005fecb7 100644
--- a/fs/smb/client/netmisc_test.c
+++ b/fs/smb/client/netmisc_test.c
@@ -46,6 +46,18 @@ static void __array ## _check_search(struct kunit *test)		\
 	}								\
 }
 
+static void test_cmp_ntstatus_to_dos(struct kunit *test,
+				     struct ntstatus_to_dos *expect,
+				     struct ntstatus_to_dos *result)
+{
+	KUNIT_EXPECT_EQ(test, expect->dos_class, result->dos_class);
+	KUNIT_EXPECT_EQ(test, expect->dos_code, result->dos_code);
+	KUNIT_EXPECT_EQ(test, expect->ntstatus, result->ntstatus);
+}
+
+/* ntstatus_to_dos_map_check_search */
+DEFINE_CHECK_SEARCH_FUNC(ntstatus_to_dos, ntstatus, ntstatus_to_dos_map, ntstatus_to_dos_num);
+
 /*
  * Before running these test cases, the smb_init_maperror()
  * function is called first.
@@ -53,6 +65,8 @@ static void __array ## _check_search(struct kunit *test)		\
 static struct kunit_case maperror_test_cases[] = {
 	/* check sort */
 	KUNIT_CASE(ntstatus_to_dos_map_check_sort),
+	/* check search */
+	KUNIT_CASE(ntstatus_to_dos_map_check_search),
 	{}
 };
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 16/30] smb/client: sort nt_errs array
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (14 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 15/30] smb/client: introduce KUnit test to check search result of ntstatus_to_dos_map array chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 17/30] smb/client: introduce KUnit test to check sort result of " chenxiaosong.chenxiaosong
                   ` (15 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

Sort the array in ascending order, and then we can use binary search
algorithm to quickly find the target NT error code.

The array is sorted only once when cifs.ko is loaded.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/netmisc.c | 4 ++++
 fs/smb/client/nterr.c   | 5 ++++-
 fs/smb/client/nterr.h   | 3 ++-
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/fs/smb/client/netmisc.c b/fs/smb/client/netmisc.c
index 4e6312593d6f..c6fa1389683b 100644
--- a/fs/smb/client/netmisc.c
+++ b/fs/smb/client/netmisc.c
@@ -801,6 +801,8 @@ static unsigned int ntstatus_to_dos_num = sizeof(ntstatus_to_dos_map) /
 
 /* cmp_ntstatus_to_dos */
 DEFINE_CMP_FUNC(ntstatus_to_dos, ntstatus);
+/* cmp_nt_err_code_struct */
+DEFINE_CMP_FUNC(nt_err_code_struct, nt_errcode);
 
 /* search_in_ntstatus_to_dos_map */
 DEFINE_SEARCH_FUNC(ntstatus_to_dos, ntstatus, ntstatus_to_dos_map, ntstatus_to_dos_num);
@@ -1075,6 +1077,8 @@ void smb_init_maperror(void)
 	/* Sort in ascending order */
 	sort(ntstatus_to_dos_map, ntstatus_to_dos_num,
 	     sizeof(struct ntstatus_to_dos), cmp_ntstatus_to_dos, NULL);
+	sort(nt_errs, nt_err_num, sizeof(struct nt_err_code_struct),
+	     cmp_nt_err_code_struct, NULL);
 }
 
 #if IS_ENABLED(CONFIG_SMB_KUNIT_TESTS)
diff --git a/fs/smb/client/nterr.c b/fs/smb/client/nterr.c
index 77f84767b7df..8d0007db6af9 100644
--- a/fs/smb/client/nterr.c
+++ b/fs/smb/client/nterr.c
@@ -11,7 +11,7 @@
 #include <linux/fs.h>
 #include "nterr.h"
 
-const struct nt_err_code_struct nt_errs[] = {
+struct nt_err_code_struct nt_errs[] = {
 	{"NT_STATUS_OK", NT_STATUS_OK},
 	{"NT_STATUS_PENDING", NT_STATUS_PENDING},
 	{"NT_STATUS_MEDIA_CHANGED", NT_STATUS_MEDIA_CHANGED},
@@ -686,3 +686,6 @@ const struct nt_err_code_struct nt_errs[] = {
 	 NT_STATUS_NO_PREAUTH_INTEGRITY_HASH_OVERLAP},
 	{NULL, 0}
 };
+
+unsigned int nt_err_num = sizeof(nt_errs) /
+			  sizeof(struct nt_err_code_struct);
diff --git a/fs/smb/client/nterr.h b/fs/smb/client/nterr.h
index 81f1a78cf41f..e85e65278fb5 100644
--- a/fs/smb/client/nterr.h
+++ b/fs/smb/client/nterr.h
@@ -20,7 +20,8 @@ struct nt_err_code_struct {
 	__u32 nt_errcode;
 };
 
-extern const struct nt_err_code_struct nt_errs[];
+extern struct nt_err_code_struct nt_errs[];
+extern unsigned int nt_err_num;
 
 /* Win32 Status codes. */
 #define NT_STATUS_MORE_ENTRIES         0x0105
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 17/30] smb/client: introduce KUnit test to check sort result of nt_errs array
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (15 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 16/30] smb/client: sort nt_errs array chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 18/30] smb/client: use bsearch() to find target in " chenxiaosong.chenxiaosong
                   ` (14 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

The KUnit test are executed when cifs.ko is loaded.

The nt_errs_check_sort() checks whether the array is properly sorted.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/netmisc_test.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/smb/client/netmisc_test.c b/fs/smb/client/netmisc_test.c
index ade5005fecb7..796c39b02073 100644
--- a/fs/smb/client/netmisc_test.c
+++ b/fs/smb/client/netmisc_test.c
@@ -30,6 +30,8 @@ static void __array ## _check_sort(struct kunit *test)			\
 
 /* ntstatus_to_dos_map_check_sort */
 DEFINE_CHECK_SORT_FUNC(ntstatus_to_dos_map, ntstatus_to_dos_num, ntstatus);
+/* nt_errs_check_sort */
+DEFINE_CHECK_SORT_FUNC(nt_errs, nt_err_num, nt_errcode);
 
 #define DEFINE_CHECK_SEARCH_FUNC(__struct_name, __field,		\
 				 __array, __num)			\
@@ -65,6 +67,7 @@ DEFINE_CHECK_SEARCH_FUNC(ntstatus_to_dos, ntstatus, ntstatus_to_dos_map, ntstatu
 static struct kunit_case maperror_test_cases[] = {
 	/* check sort */
 	KUNIT_CASE(ntstatus_to_dos_map_check_sort),
+	KUNIT_CASE(nt_errs_check_sort),
 	/* check search */
 	KUNIT_CASE(ntstatus_to_dos_map_check_search),
 	{}
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 18/30] smb/client: use bsearch() to find target in nt_errs array
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (16 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 17/30] smb/client: introduce KUnit test to check sort result of " chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 19/30] smb/client: remove useless elements from " chenxiaosong.chenxiaosong
                   ` (13 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

The array currently has 520 elements. When searching for the last element,
the original loop-based search method requires 520 comparisons, while
binary search algorithm requires only 9 comparisons.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/netmisc.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/fs/smb/client/netmisc.c b/fs/smb/client/netmisc.c
index c6fa1389683b..239e5287d4d6 100644
--- a/fs/smb/client/netmisc.c
+++ b/fs/smb/client/netmisc.c
@@ -806,6 +806,8 @@ DEFINE_CMP_FUNC(nt_err_code_struct, nt_errcode);
 
 /* search_in_ntstatus_to_dos_map */
 DEFINE_SEARCH_FUNC(ntstatus_to_dos, ntstatus, ntstatus_to_dos_map, ntstatus_to_dos_num);
+/* search_in_nt_errs */
+DEFINE_SEARCH_FUNC(nt_err_code_struct, nt_errcode, nt_errs, nt_err_num);
 
 /*****************************************************************************
  Print an error message from the status code
@@ -813,17 +815,14 @@ DEFINE_SEARCH_FUNC(ntstatus_to_dos, ntstatus, ntstatus_to_dos_map, ntstatus_to_d
 static void
 cifs_print_status(__u32 status_code)
 {
-	int idx = 0;
+	struct nt_err_code_struct *err_map;
 
-	while (nt_errs[idx].nt_errstr != NULL) {
-		if (nt_errs[idx].nt_errcode == status_code) {
-			pr_notice("Status code returned 0x%08x %s\n",
-				  status_code, nt_errs[idx].nt_errstr);
-			return;
-		}
-		idx++;
-	}
-	return;
+	err_map = search_in_nt_errs(status_code);
+	if (!err_map)
+		return;
+
+	pr_notice("Status code returned 0x%08x %s\n",
+		  status_code, err_map->nt_errstr);
 }
 
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 19/30] smb/client: remove useless elements from nt_errs array
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (17 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 18/30] smb/client: use bsearch() to find target in " chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 20/30] smb/client: introduce KUnit test to check search result of " chenxiaosong.chenxiaosong
                   ` (12 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

NT_STATUS_OK are zero, it is not needed.

The last element in the array is no longer needed.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/nterr.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/smb/client/nterr.c b/fs/smb/client/nterr.c
index 8d0007db6af9..faacec11c611 100644
--- a/fs/smb/client/nterr.c
+++ b/fs/smb/client/nterr.c
@@ -12,7 +12,6 @@
 #include "nterr.h"
 
 struct nt_err_code_struct nt_errs[] = {
-	{"NT_STATUS_OK", NT_STATUS_OK},
 	{"NT_STATUS_PENDING", NT_STATUS_PENDING},
 	{"NT_STATUS_MEDIA_CHANGED", NT_STATUS_MEDIA_CHANGED},
 	{"NT_STATUS_END_OF_MEDIA", NT_STATUS_END_OF_MEDIA},
@@ -684,7 +683,6 @@ struct nt_err_code_struct nt_errs[] = {
 	{"NT_STATUS_NO_SUCH_JOB", NT_STATUS_NO_SUCH_JOB},
 	{"NT_STATUS_NO_PREAUTH_INTEGRITY_HASH_OVERLAP",
 	 NT_STATUS_NO_PREAUTH_INTEGRITY_HASH_OVERLAP},
-	{NULL, 0}
 };
 
 unsigned int nt_err_num = sizeof(nt_errs) /
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 20/30] smb/client: introduce KUnit test to check search result of nt_errs array
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (18 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 19/30] smb/client: remove useless elements from " chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 21/30] smb/client: sort mapping_table_ERRDOS array chenxiaosong.chenxiaosong
                   ` (11 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

The KUnit test are executed when cifs.ko is loaded.

The nt_errs_check_search() checks whether all elements can be correctly
found in the nt_errs array.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/netmisc_test.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/fs/smb/client/netmisc_test.c b/fs/smb/client/netmisc_test.c
index 796c39b02073..195c889af7be 100644
--- a/fs/smb/client/netmisc_test.c
+++ b/fs/smb/client/netmisc_test.c
@@ -57,8 +57,18 @@ static void test_cmp_ntstatus_to_dos(struct kunit *test,
 	KUNIT_EXPECT_EQ(test, expect->ntstatus, result->ntstatus);
 }
 
+static void test_cmp_nt_err_code_struct(struct kunit *test,
+					struct nt_err_code_struct *expect,
+					struct nt_err_code_struct *result)
+{
+	KUNIT_EXPECT_STREQ(test, expect->nt_errstr, result->nt_errstr);
+	KUNIT_EXPECT_EQ(test, expect->nt_errcode, result->nt_errcode);
+}
+
 /* ntstatus_to_dos_map_check_search */
 DEFINE_CHECK_SEARCH_FUNC(ntstatus_to_dos, ntstatus, ntstatus_to_dos_map, ntstatus_to_dos_num);
+/* nt_errs_check_search */
+DEFINE_CHECK_SEARCH_FUNC(nt_err_code_struct, nt_errcode, nt_errs, nt_err_num);
 
 /*
  * Before running these test cases, the smb_init_maperror()
@@ -70,6 +80,7 @@ static struct kunit_case maperror_test_cases[] = {
 	KUNIT_CASE(nt_errs_check_sort),
 	/* check search */
 	KUNIT_CASE(ntstatus_to_dos_map_check_search),
+	KUNIT_CASE(nt_errs_check_search),
 	{}
 };
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 21/30] smb/client: sort mapping_table_ERRDOS array
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (19 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 20/30] smb/client: introduce KUnit test to check search result of " chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 22/30] smb/client: introduce KUnit test to check sort result of " chenxiaosong.chenxiaosong
                   ` (10 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

Sort the array in ascending order, and then we can use binary search
algorithm to quickly find the target DOS class smb error code.

The array is sorted only once when cifs.ko is loaded.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/netmisc.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/fs/smb/client/netmisc.c b/fs/smb/client/netmisc.c
index 239e5287d4d6..594a7fae0060 100644
--- a/fs/smb/client/netmisc.c
+++ b/fs/smb/client/netmisc.c
@@ -59,7 +59,7 @@ struct smb_to_posix_error {
 	int posix_code;
 };
 
-static const struct smb_to_posix_error mapping_table_ERRDOS[] = {
+static struct smb_to_posix_error mapping_table_ERRDOS[] = {
 	{ERRbadfunc, -EINVAL},
 	{ERRbadfile, -ENOENT},
 	{ERRbadpath, -ENOTDIR},
@@ -101,6 +101,9 @@ static const struct smb_to_posix_error mapping_table_ERRDOS[] = {
 	{0, 0}
 };
 
+static unsigned int errdos_num = sizeof(mapping_table_ERRDOS) /
+				 sizeof(struct smb_to_posix_error);
+
 static const struct smb_to_posix_error mapping_table_ERRSRV[] = {
 	{ERRerror, -EIO},
 	{ERRbadpw, -EACCES},  /* was EPERM */
@@ -803,6 +806,8 @@ static unsigned int ntstatus_to_dos_num = sizeof(ntstatus_to_dos_map) /
 DEFINE_CMP_FUNC(ntstatus_to_dos, ntstatus);
 /* cmp_nt_err_code_struct */
 DEFINE_CMP_FUNC(nt_err_code_struct, nt_errcode);
+/* cmp_smb_to_posix_error */
+DEFINE_CMP_FUNC(smb_to_posix_error, smb_err);
 
 /* search_in_ntstatus_to_dos_map */
 DEFINE_SEARCH_FUNC(ntstatus_to_dos, ntstatus, ntstatus_to_dos_map, ntstatus_to_dos_num);
@@ -1078,6 +1083,8 @@ void smb_init_maperror(void)
 	     sizeof(struct ntstatus_to_dos), cmp_ntstatus_to_dos, NULL);
 	sort(nt_errs, nt_err_num, sizeof(struct nt_err_code_struct),
 	     cmp_nt_err_code_struct, NULL);
+	sort(mapping_table_ERRDOS, errdos_num,
+	     sizeof(struct smb_to_posix_error), cmp_smb_to_posix_error, NULL);
 }
 
 #if IS_ENABLED(CONFIG_SMB_KUNIT_TESTS)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 22/30] smb/client: introduce KUnit test to check sort result of mapping_table_ERRDOS array
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (20 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 21/30] smb/client: sort mapping_table_ERRDOS array chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 23/30] smb/client: use bsearch() to find target in " chenxiaosong.chenxiaosong
                   ` (9 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

The KUnit test are executed when cifs.ko is loaded.

The mapping_table_ERRDOS_check_sort() checks whether the array is properly
sorted.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/netmisc_test.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/smb/client/netmisc_test.c b/fs/smb/client/netmisc_test.c
index 195c889af7be..caa0892ec119 100644
--- a/fs/smb/client/netmisc_test.c
+++ b/fs/smb/client/netmisc_test.c
@@ -32,6 +32,8 @@ static void __array ## _check_sort(struct kunit *test)			\
 DEFINE_CHECK_SORT_FUNC(ntstatus_to_dos_map, ntstatus_to_dos_num, ntstatus);
 /* nt_errs_check_sort */
 DEFINE_CHECK_SORT_FUNC(nt_errs, nt_err_num, nt_errcode);
+/* mapping_table_ERRDOS_check_sort */
+DEFINE_CHECK_SORT_FUNC(mapping_table_ERRDOS, errdos_num, smb_err);
 
 #define DEFINE_CHECK_SEARCH_FUNC(__struct_name, __field,		\
 				 __array, __num)			\
@@ -78,6 +80,7 @@ static struct kunit_case maperror_test_cases[] = {
 	/* check sort */
 	KUNIT_CASE(ntstatus_to_dos_map_check_sort),
 	KUNIT_CASE(nt_errs_check_sort),
+	KUNIT_CASE(mapping_table_ERRDOS_check_sort),
 	/* check search */
 	KUNIT_CASE(ntstatus_to_dos_map_check_search),
 	KUNIT_CASE(nt_errs_check_search),
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 23/30] smb/client: use bsearch() to find target in mapping_table_ERRDOS array
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (21 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 22/30] smb/client: introduce KUnit test to check sort result of " chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 24/30] smb/client: remove useless elements from " chenxiaosong.chenxiaosong
                   ` (8 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

The array currently has 39 elements. When searching for the last element,
the original loop-based search method requires 39 comparisons, while
binary search algorithm requires only 5 comparisons.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/netmisc.c | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/fs/smb/client/netmisc.c b/fs/smb/client/netmisc.c
index 594a7fae0060..d7d1b9b4abcd 100644
--- a/fs/smb/client/netmisc.c
+++ b/fs/smb/client/netmisc.c
@@ -813,6 +813,8 @@ DEFINE_CMP_FUNC(smb_to_posix_error, smb_err);
 DEFINE_SEARCH_FUNC(ntstatus_to_dos, ntstatus, ntstatus_to_dos_map, ntstatus_to_dos_num);
 /* search_in_nt_errs */
 DEFINE_SEARCH_FUNC(nt_err_code_struct, nt_errcode, nt_errs, nt_err_num);
+/* search_in_mapping_table_ERRDOS */
+DEFINE_SEARCH_FUNC(smb_to_posix_error, smb_err, mapping_table_ERRDOS, errdos_num);
 
 /*****************************************************************************
  Print an error message from the status code
@@ -861,6 +863,7 @@ map_smb_to_linux_error(char *buf, bool logErr)
 	int rc = -EIO;	/* if transport error smb error may not be set */
 	__u8 smberrclass;
 	__u16 smberrcode;
+	struct smb_to_posix_error *err_map;
 
 	/* BB if NT Status codes - map NT BB */
 
@@ -887,19 +890,9 @@ map_smb_to_linux_error(char *buf, bool logErr)
 	/* DOS class smb error codes - map DOS */
 	if (smberrclass == ERRDOS) {
 		/* 1 byte field no need to byte reverse */
-		for (i = 0;
-		     i <
-		     sizeof(mapping_table_ERRDOS) /
-		     sizeof(struct smb_to_posix_error); i++) {
-			if (mapping_table_ERRDOS[i].smb_err == 0)
-				break;
-			else if (mapping_table_ERRDOS[i].smb_err ==
-								smberrcode) {
-				rc = mapping_table_ERRDOS[i].posix_code;
-				break;
-			}
-			/* else try next error mapping one to see if match */
-		}
+		err_map = search_in_mapping_table_ERRDOS(smberrcode);
+		if (err_map)
+			rc = err_map->posix_code;
 	} else if (smberrclass == ERRSRV) {
 		/* server class of error codes */
 		for (i = 0;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 24/30] smb/client: remove useless elements from mapping_table_ERRDOS array
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (22 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 23/30] smb/client: use bsearch() to find target in " chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 25/30] smb/client: introduce KUnit test to check search result of " chenxiaosong.chenxiaosong
                   ` (7 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

The last element in the array is no longer needed.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/netmisc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/smb/client/netmisc.c b/fs/smb/client/netmisc.c
index d7d1b9b4abcd..553d2a33b6de 100644
--- a/fs/smb/client/netmisc.c
+++ b/fs/smb/client/netmisc.c
@@ -98,7 +98,6 @@ static struct smb_to_posix_error mapping_table_ERRDOS[] = {
 	{ERRnetlogonNotStarted, -ENOPROTOOPT},
 	{ERRsymlink, -EOPNOTSUPP},
 	{ErrTooManyLinks, -EMLINK},
-	{0, 0}
 };
 
 static unsigned int errdos_num = sizeof(mapping_table_ERRDOS) /
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 25/30] smb/client: introduce KUnit test to check search result of mapping_table_ERRDOS array
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (23 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 24/30] smb/client: remove useless elements from " chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 26/30] smb/client: sort mapping_table_ERRSRV array chenxiaosong.chenxiaosong
                   ` (6 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

The KUnit test are executed when cifs.ko is loaded.

The mapping_table_ERRDOS_check_search() checks whether all elements can be
correctly found in the array.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/netmisc_test.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/fs/smb/client/netmisc_test.c b/fs/smb/client/netmisc_test.c
index caa0892ec119..eae6c0c09519 100644
--- a/fs/smb/client/netmisc_test.c
+++ b/fs/smb/client/netmisc_test.c
@@ -67,10 +67,20 @@ static void test_cmp_nt_err_code_struct(struct kunit *test,
 	KUNIT_EXPECT_EQ(test, expect->nt_errcode, result->nt_errcode);
 }
 
+static void test_cmp_smb_to_posix_error(struct kunit *test,
+					struct smb_to_posix_error *expect,
+					struct smb_to_posix_error *result)
+{
+	KUNIT_EXPECT_EQ(test, expect->smb_err, result->smb_err);
+	KUNIT_EXPECT_EQ(test, expect->posix_code, result->posix_code);
+}
+
 /* ntstatus_to_dos_map_check_search */
 DEFINE_CHECK_SEARCH_FUNC(ntstatus_to_dos, ntstatus, ntstatus_to_dos_map, ntstatus_to_dos_num);
 /* nt_errs_check_search */
 DEFINE_CHECK_SEARCH_FUNC(nt_err_code_struct, nt_errcode, nt_errs, nt_err_num);
+/* mapping_table_ERRDOS_check_search */
+DEFINE_CHECK_SEARCH_FUNC(smb_to_posix_error, smb_err, mapping_table_ERRDOS, errdos_num);
 
 /*
  * Before running these test cases, the smb_init_maperror()
@@ -84,6 +94,7 @@ static struct kunit_case maperror_test_cases[] = {
 	/* check search */
 	KUNIT_CASE(ntstatus_to_dos_map_check_search),
 	KUNIT_CASE(nt_errs_check_search),
+	KUNIT_CASE(mapping_table_ERRDOS_check_search),
 	{}
 };
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 26/30] smb/client: sort mapping_table_ERRSRV array
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (24 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 25/30] smb/client: introduce KUnit test to check search result of " chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 27/30] smb/client: introduce KUnit test to check sort result of " chenxiaosong.chenxiaosong
                   ` (5 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

Sort the array in ascending order, and then we can use binary search
algorithm to quickly find the target server class of error code.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/netmisc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/smb/client/netmisc.c b/fs/smb/client/netmisc.c
index 553d2a33b6de..4b5c049d69b9 100644
--- a/fs/smb/client/netmisc.c
+++ b/fs/smb/client/netmisc.c
@@ -103,7 +103,7 @@ static struct smb_to_posix_error mapping_table_ERRDOS[] = {
 static unsigned int errdos_num = sizeof(mapping_table_ERRDOS) /
 				 sizeof(struct smb_to_posix_error);
 
-static const struct smb_to_posix_error mapping_table_ERRSRV[] = {
+static struct smb_to_posix_error mapping_table_ERRSRV[] = {
 	{ERRerror, -EIO},
 	{ERRbadpw, -EACCES},  /* was EPERM */
 	{ERRbadtype, -EREMOTE},
@@ -148,6 +148,9 @@ static const struct smb_to_posix_error mapping_table_ERRSRV[] = {
 	{0, 0}
 };
 
+static unsigned int errsrv_num = sizeof(mapping_table_ERRSRV) /
+				 sizeof(struct smb_to_posix_error);
+
 /*
  * Convert a string containing text IPv4 or IPv6 address to binary form.
  *
@@ -1077,6 +1080,8 @@ void smb_init_maperror(void)
 	     cmp_nt_err_code_struct, NULL);
 	sort(mapping_table_ERRDOS, errdos_num,
 	     sizeof(struct smb_to_posix_error), cmp_smb_to_posix_error, NULL);
+	sort(mapping_table_ERRSRV, errsrv_num,
+	     sizeof(struct smb_to_posix_error), cmp_smb_to_posix_error, NULL);
 }
 
 #if IS_ENABLED(CONFIG_SMB_KUNIT_TESTS)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 27/30] smb/client: introduce KUnit test to check sort result of mapping_table_ERRSRV array
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (25 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 26/30] smb/client: sort mapping_table_ERRSRV array chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 28/30] smb/client: use bsearch() to find target in " chenxiaosong.chenxiaosong
                   ` (4 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

The KUnit test are executed when cifs.ko is loaded.

The mapping_table_ERRSRV_check_sort() checks whether the array is properly
sorted.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/netmisc_test.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/smb/client/netmisc_test.c b/fs/smb/client/netmisc_test.c
index eae6c0c09519..4a82edd58dcc 100644
--- a/fs/smb/client/netmisc_test.c
+++ b/fs/smb/client/netmisc_test.c
@@ -34,6 +34,8 @@ DEFINE_CHECK_SORT_FUNC(ntstatus_to_dos_map, ntstatus_to_dos_num, ntstatus);
 DEFINE_CHECK_SORT_FUNC(nt_errs, nt_err_num, nt_errcode);
 /* mapping_table_ERRDOS_check_sort */
 DEFINE_CHECK_SORT_FUNC(mapping_table_ERRDOS, errdos_num, smb_err);
+/* mapping_table_ERRSRV_check_sort */
+DEFINE_CHECK_SORT_FUNC(mapping_table_ERRSRV, errsrv_num, smb_err);
 
 #define DEFINE_CHECK_SEARCH_FUNC(__struct_name, __field,		\
 				 __array, __num)			\
@@ -91,6 +93,7 @@ static struct kunit_case maperror_test_cases[] = {
 	KUNIT_CASE(ntstatus_to_dos_map_check_sort),
 	KUNIT_CASE(nt_errs_check_sort),
 	KUNIT_CASE(mapping_table_ERRDOS_check_sort),
+	KUNIT_CASE(mapping_table_ERRSRV_check_sort),
 	/* check search */
 	KUNIT_CASE(ntstatus_to_dos_map_check_search),
 	KUNIT_CASE(nt_errs_check_search),
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 28/30] smb/client: use bsearch() to find target in mapping_table_ERRSRV array
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (26 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 27/30] smb/client: introduce KUnit test to check sort result of " chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:20 ` [PATCH 29/30] smb/client: remove useless elements from " chenxiaosong.chenxiaosong
                   ` (3 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

The array currently has 37 elements. When searching for the last element,
the original loop-based search method requires 37 comparisons, while
binary search algorithm requires only 5 comparisons.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/netmisc.c | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/fs/smb/client/netmisc.c b/fs/smb/client/netmisc.c
index 4b5c049d69b9..8f3242c1d3da 100644
--- a/fs/smb/client/netmisc.c
+++ b/fs/smb/client/netmisc.c
@@ -817,6 +817,8 @@ DEFINE_SEARCH_FUNC(ntstatus_to_dos, ntstatus, ntstatus_to_dos_map, ntstatus_to_d
 DEFINE_SEARCH_FUNC(nt_err_code_struct, nt_errcode, nt_errs, nt_err_num);
 /* search_in_mapping_table_ERRDOS */
 DEFINE_SEARCH_FUNC(smb_to_posix_error, smb_err, mapping_table_ERRDOS, errdos_num);
+/* search_in_mapping_table_ERRSRV */
+DEFINE_SEARCH_FUNC(smb_to_posix_error, smb_err, mapping_table_ERRSRV, errsrv_num);
 
 /*****************************************************************************
  Print an error message from the status code
@@ -861,7 +863,6 @@ int
 map_smb_to_linux_error(char *buf, bool logErr)
 {
 	struct smb_hdr *smb = (struct smb_hdr *)buf;
-	unsigned int i;
 	int rc = -EIO;	/* if transport error smb error may not be set */
 	__u8 smberrclass;
 	__u16 smberrcode;
@@ -897,19 +898,9 @@ map_smb_to_linux_error(char *buf, bool logErr)
 			rc = err_map->posix_code;
 	} else if (smberrclass == ERRSRV) {
 		/* server class of error codes */
-		for (i = 0;
-		     i <
-		     sizeof(mapping_table_ERRSRV) /
-		     sizeof(struct smb_to_posix_error); i++) {
-			if (mapping_table_ERRSRV[i].smb_err == 0)
-				break;
-			else if (mapping_table_ERRSRV[i].smb_err ==
-								smberrcode) {
-				rc = mapping_table_ERRSRV[i].posix_code;
-				break;
-			}
-			/* else try next error mapping to see if match */
-		}
+		err_map = search_in_mapping_table_ERRSRV(smberrcode);
+		if (err_map)
+			rc = err_map->posix_code;
 	}
 	/* else ERRHRD class errors or junk  - return EIO */
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 29/30] smb/client: remove useless elements from mapping_table_ERRSRV array
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (27 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 28/30] smb/client: use bsearch() to find target in " chenxiaosong.chenxiaosong
@ 2025-12-08  6:20 ` chenxiaosong.chenxiaosong
  2025-12-08  6:21 ` [PATCH 30/30] smb/client: introduce KUnit test to check search result of " chenxiaosong.chenxiaosong
                   ` (2 subsequent siblings)
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:20 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

The last element in the array is no longer needed.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/netmisc.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/smb/client/netmisc.c b/fs/smb/client/netmisc.c
index 8f3242c1d3da..8f93047305af 100644
--- a/fs/smb/client/netmisc.c
+++ b/fs/smb/client/netmisc.c
@@ -143,9 +143,7 @@ static struct smb_to_posix_error mapping_table_ERRSRV[] = {
 	{ERRbadclient, -EACCES},
 	{ERRbadLogonTime, -EACCES},
 	{ERRpasswordExpired, -EKEYEXPIRED},
-
 	{ERRnosupport, -EINVAL},
-	{0, 0}
 };
 
 static unsigned int errsrv_num = sizeof(mapping_table_ERRSRV) /
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 30/30] smb/client: introduce KUnit test to check search result of mapping_table_ERRSRV array
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (28 preceding siblings ...)
  2025-12-08  6:20 ` [PATCH 29/30] smb/client: remove useless elements from " chenxiaosong.chenxiaosong
@ 2025-12-08  6:21 ` chenxiaosong.chenxiaosong
  2025-12-09 23:41 ` [PATCH 00/30] smb: improve search speed of SMB1 maperror Steve French
  2025-12-10  4:32 ` ChenXiaoSong
  31 siblings, 0 replies; 37+ messages in thread
From: chenxiaosong.chenxiaosong @ 2025-12-08  6:21 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

From: ChenXiaoSong <chenxiaosong@kylinos.cn>

The KUnit test are executed when cifs.ko is loaded.

The mapping_table_ERRSRV_check_search() checks whether all elements can be
correctly found in the array.

Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
---
 fs/smb/client/netmisc_test.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/smb/client/netmisc_test.c b/fs/smb/client/netmisc_test.c
index 4a82edd58dcc..fa8e98b46e88 100644
--- a/fs/smb/client/netmisc_test.c
+++ b/fs/smb/client/netmisc_test.c
@@ -83,6 +83,8 @@ DEFINE_CHECK_SEARCH_FUNC(ntstatus_to_dos, ntstatus, ntstatus_to_dos_map, ntstatu
 DEFINE_CHECK_SEARCH_FUNC(nt_err_code_struct, nt_errcode, nt_errs, nt_err_num);
 /* mapping_table_ERRDOS_check_search */
 DEFINE_CHECK_SEARCH_FUNC(smb_to_posix_error, smb_err, mapping_table_ERRDOS, errdos_num);
+/* mapping_table_ERRSRV_check_search */
+DEFINE_CHECK_SEARCH_FUNC(smb_to_posix_error, smb_err, mapping_table_ERRSRV, errsrv_num);
 
 /*
  * Before running these test cases, the smb_init_maperror()
@@ -98,6 +100,7 @@ static struct kunit_case maperror_test_cases[] = {
 	KUNIT_CASE(ntstatus_to_dos_map_check_search),
 	KUNIT_CASE(nt_errs_check_search),
 	KUNIT_CASE(mapping_table_ERRDOS_check_search),
+	KUNIT_CASE(mapping_table_ERRSRV_check_search),
 	{}
 };
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [PATCH 01/30] smb/client: fix NT_STATUS_NO_DATA_DETECTED value
  2025-12-08  6:20 ` [PATCH 01/30] smb/client: fix NT_STATUS_NO_DATA_DETECTED value chenxiaosong.chenxiaosong
@ 2025-12-09  0:17   ` ChenXiaoSong
  2025-12-09  0:29     ` Steve French
  0 siblings, 1 reply; 37+ messages in thread
From: ChenXiaoSong @ 2025-12-09  0:17 UTC (permalink / raw)
  To: chenxiaosong.chenxiaosong, sfrench, smfrench, linkinjeon,
	linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01

Hi Steve and Namjae,

Some of these macro values seem to differ from the documentation 
(possibly due to typos or updates in the docs). Should we, like Samba, 
use a script to automatically regenerate these macro definitions on a 
regular basis?

Thanks,
ChenXiaoSong.

On 12/8/25 2:20 PM, chenxiaosong.chenxiaosong@linux.dev wrote:
> From: ChenXiaoSong <chenxiaosong@kylinos.cn>
> 
> This was reported by the KUnit tests in the later patches.
> 
> See MS-ERREF 2.3.1 STATUS_NO_DATA_DETECTED. Keep it consistent with the
> value in the documentation.
> 
> Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
> ---
>   fs/smb/client/nterr.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/smb/client/nterr.h b/fs/smb/client/nterr.h
> index 180602c22355..4fd79a82c817 100644
> --- a/fs/smb/client/nterr.h
> +++ b/fs/smb/client/nterr.h
> @@ -41,7 +41,7 @@ extern const struct nt_err_code_struct nt_errs[];
>   #define NT_STATUS_MEDIA_CHANGED    0x8000001c
>   #define NT_STATUS_END_OF_MEDIA     0x8000001e
>   #define NT_STATUS_MEDIA_CHECK      0x80000020
> -#define NT_STATUS_NO_DATA_DETECTED 0x8000001c
> +#define NT_STATUS_NO_DATA_DETECTED 0x80000022
>   #define NT_STATUS_STOPPED_ON_SYMLINK 0x8000002d
>   #define NT_STATUS_DEVICE_REQUIRES_CLEANING 0x80000288
>   #define NT_STATUS_DEVICE_DOOR_OPEN 0x80000288


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 01/30] smb/client: fix NT_STATUS_NO_DATA_DETECTED value
  2025-12-09  0:17   ` ChenXiaoSong
@ 2025-12-09  0:29     ` Steve French
  2025-12-09  0:45       ` ChenXiaoSong
  0 siblings, 1 reply; 37+ messages in thread
From: Steve French @ 2025-12-09  0:29 UTC (permalink / raw)
  To: ChenXiaoSong
  Cc: chenxiaosong.chenxiaosong, linkinjeon, linkinjeon, linux-cifs,
	linux-kernel, liuzhengyuan, huhai, liuyun01

These (return code, NT STATIUS code names) are unlikely to change much
so probably would not need to regenerate, although wouldn't hurt to
check every year or so.

On Mon, Dec 8, 2025 at 6:17 PM ChenXiaoSong <chenxiaosong@kylinos.cn> wrote:
>
> Hi Steve and Namjae,
>
> Some of these macro values seem to differ from the documentation
> (possibly due to typos or updates in the docs). Should we, like Samba,
> use a script to automatically regenerate these macro definitions on a
> regular basis?
>
> Thanks,
> ChenXiaoSong.
>
> On 12/8/25 2:20 PM, chenxiaosong.chenxiaosong@linux.dev wrote:
> > From: ChenXiaoSong <chenxiaosong@kylinos.cn>
> >
> > This was reported by the KUnit tests in the later patches.
> >
> > See MS-ERREF 2.3.1 STATUS_NO_DATA_DETECTED. Keep it consistent with the
> > value in the documentation.
> >
> > Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
> > ---
> >   fs/smb/client/nterr.h | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/smb/client/nterr.h b/fs/smb/client/nterr.h
> > index 180602c22355..4fd79a82c817 100644
> > --- a/fs/smb/client/nterr.h
> > +++ b/fs/smb/client/nterr.h
> > @@ -41,7 +41,7 @@ extern const struct nt_err_code_struct nt_errs[];
> >   #define NT_STATUS_MEDIA_CHANGED    0x8000001c
> >   #define NT_STATUS_END_OF_MEDIA     0x8000001e
> >   #define NT_STATUS_MEDIA_CHECK      0x80000020
> > -#define NT_STATUS_NO_DATA_DETECTED 0x8000001c
> > +#define NT_STATUS_NO_DATA_DETECTED 0x80000022
> >   #define NT_STATUS_STOPPED_ON_SYMLINK 0x8000002d
> >   #define NT_STATUS_DEVICE_REQUIRES_CLEANING 0x80000288
> >   #define NT_STATUS_DEVICE_DOOR_OPEN 0x80000288
>


-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 01/30] smb/client: fix NT_STATUS_NO_DATA_DETECTED value
  2025-12-09  0:29     ` Steve French
@ 2025-12-09  0:45       ` ChenXiaoSong
  0 siblings, 0 replies; 37+ messages in thread
From: ChenXiaoSong @ 2025-12-09  0:45 UTC (permalink / raw)
  To: Steve French
  Cc: chenxiaosong.chenxiaosong, linkinjeon, linkinjeon, linux-cifs,
	linux-kernel, liuzhengyuan, huhai, liuyun01

OK, I'll try to write a script in my spare time to compare these values 
with the documentation.

Thanks,
ChenXiaoSong.

On 12/9/25 08:29, Steve French wrote:
> These (return code, NT STATIUS code names) are unlikely to change much
> so probably would not need to regenerate, although wouldn't hurt to
> check every year or so.
> 
> On Mon, Dec 8, 2025 at 6:17 PM ChenXiaoSong <chenxiaosong@kylinos.cn> wrote:
>>
>> Hi Steve and Namjae,
>>
>> Some of these macro values seem to differ from the documentation
>> (possibly due to typos or updates in the docs). Should we, like Samba,
>> use a script to automatically regenerate these macro definitions on a
>> regular basis?
>>
>> Thanks,
>> ChenXiaoSong.
>>
>> On 12/8/25 2:20 PM, chenxiaosong.chenxiaosong@linux.dev wrote:
>>> From: ChenXiaoSong <chenxiaosong@kylinos.cn>
>>>
>>> This was reported by the KUnit tests in the later patches.
>>>
>>> See MS-ERREF 2.3.1 STATUS_NO_DATA_DETECTED. Keep it consistent with the
>>> value in the documentation.
>>>
>>> Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
>>> ---
>>>    fs/smb/client/nterr.h | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/fs/smb/client/nterr.h b/fs/smb/client/nterr.h
>>> index 180602c22355..4fd79a82c817 100644
>>> --- a/fs/smb/client/nterr.h
>>> +++ b/fs/smb/client/nterr.h
>>> @@ -41,7 +41,7 @@ extern const struct nt_err_code_struct nt_errs[];
>>>    #define NT_STATUS_MEDIA_CHANGED    0x8000001c
>>>    #define NT_STATUS_END_OF_MEDIA     0x8000001e
>>>    #define NT_STATUS_MEDIA_CHECK      0x80000020
>>> -#define NT_STATUS_NO_DATA_DETECTED 0x8000001c
>>> +#define NT_STATUS_NO_DATA_DETECTED 0x80000022
>>>    #define NT_STATUS_STOPPED_ON_SYMLINK 0x8000002d
>>>    #define NT_STATUS_DEVICE_REQUIRES_CLEANING 0x80000288
>>>    #define NT_STATUS_DEVICE_DOOR_OPEN 0x80000288
>>
> 
> 


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 00/30] smb: improve search speed of SMB1 maperror
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (29 preceding siblings ...)
  2025-12-08  6:21 ` [PATCH 30/30] smb/client: introduce KUnit test to check search result of " chenxiaosong.chenxiaosong
@ 2025-12-09 23:41 ` Steve French
  2025-12-10  2:48   ` ChenXiaoSong
  2025-12-10  4:32 ` ChenXiaoSong
  31 siblings, 1 reply; 37+ messages in thread
From: Steve French @ 2025-12-09 23:41 UTC (permalink / raw)
  To: chenxiaosong.chenxiaosong
  Cc: linkinjeon, linkinjeon, linux-cifs, linux-kernel, liuzhengyuan,
	huhai, liuyun01, ChenXiaoSong, samba-technical

Merged nine of the client patches from this series into cifs-2.6.git
for-next.  They looked safe.  Good catch on fixing some of these
incorrect error definitions.

a691ac0cdd97 (HEAD -> for-next, origin/for-next) smb: move
file_notify_information to common/fscc.h
c0fd2fbe4f73 smb: move SMB2 Notify Action Flags into common/smb2pdu.h
787a2b803211 smb: move notify completion filter flags into common/smb2pdu.h
14a6f0e19fc7 smb/client: add parentheses to NT error code definitions
containing bitwise OR operator
1e4c7c9ab176 smb: add documentation references for smb2 change notify
definitions
833f0f46368f smb/client: add 4 NT error code definitions
3a0a34572269 smb/client: fix NT_STATUS_UNABLE_TO_FREE_VM value
954cbce76316 smb/client: fix NT_STATUS_DEVICE_DOOR_OPEN value
b9695d00b605 smb/client: fix NT_STATUS_NO_DATA_DETECTED value
3d99347a2e1a (linus/master, linus/HEAD) Merge tag
'v6.19-rc-part1-smb3-client-fixes' of
git://git.samba.org/sfrench/cifs-2.6

On Mon, Dec 8, 2025 at 12:22 AM <chenxiaosong.chenxiaosong@linux.dev> wrote:
>
> From: ChenXiaoSong <chenxiaosong@kylinos.cn>
>
> Before applying this patchset, the patchset ("smb: improve search speed of SMB2 maperror") must
> be applied first, which introduces `CONFIG_SMB_KUNIT_TESTS` and avoids some conflicts in `fs/smb/client/cifsfs.c`:
> https://chenxiaosong.com/lkml-improve-search-speed-of-smb2-maperror.html (Redirect to the LKML link)
>
> When searching for the last element, the comparison counts are shown in the table below:
>
> +--------------------+--------+--------+
> |                    |Before  |After   |
> |                    |Patchset|Patchset|
> +--------------------+--------+--------+
> | ntstatus_to_dos_map|   525  |    9   |
> +--------------------+--------+--------+
> |             nt_errs|   516  |    9   |
> +--------------------+--------+--------+
> |mapping_table_ERRDOS|    39  |    5   |
> +--------------------+--------+--------+
> |mapping_table_ERRSRV|    37  |    5   |
> +--------------------+--------+--------+
>
> ChenXiaoSong (30):
>   smb/client: fix NT_STATUS_NO_DATA_DETECTED value
>   smb/client: fix NT_STATUS_DEVICE_DOOR_OPEN value
>   smb/client: fix NT_STATUS_UNABLE_TO_FREE_VM value
>   smb/server: remove unused nterr.h
>   smb/client: add 4 NT error code definitions
>   smb/client: add parentheses to NT error code definitions containing
>     bitwise OR operator
>   smb/client: introduce DEFINE_CMP_FUNC()
>   smb/client: sort ntstatus_to_dos_map array
>   smb/client: create netmisc_test.c and introduce
>     DEFINE_CHECK_SORT_FUNC()
>   smb/client: introduce KUnit test to check sort result of
>     ntstatus_to_dos_map array
>   smb/client: introduce DEFINE_SEARCH_FUNC()
>   smb/client: use bsearch() to find target in ntstatus_to_dos_map array
>   smb/client: remove useless elements from ntstatus_to_dos_map array
>   smb/client: introduce DEFINE_CHECK_SEARCH_FUNC()
>   smb/client: introduce KUnit test to check search result of
>     ntstatus_to_dos_map array
>   smb/client: sort nt_errs array
>   smb/client: introduce KUnit test to check sort result of nt_errs array
>   smb/client: use bsearch() to find target in nt_errs array
>   smb/client: remove useless elements from nt_errs array
>   smb/client: introduce KUnit test to check search result of nt_errs
>     array
>   smb/client: sort mapping_table_ERRDOS array
>   smb/client: introduce KUnit test to check sort result of
>     mapping_table_ERRDOS array
>   smb/client: use bsearch() to find target in mapping_table_ERRDOS array
>   smb/client: remove useless elements from mapping_table_ERRDOS array
>   smb/client: introduce KUnit test to check search result of
>     mapping_table_ERRDOS array
>   smb/client: sort mapping_table_ERRSRV array
>   smb/client: introduce KUnit test to check sort result of
>     mapping_table_ERRSRV array
>   smb/client: use bsearch() to find target in mapping_table_ERRSRV array
>   smb/client: remove useless elements from mapping_table_ERRSRV array
>   smb/client: introduce KUnit test to check search result of
>     mapping_table_ERRSRV array
>
>  fs/smb/client/cifsfs.c       |    2 +
>  fs/smb/client/cifsproto.h    |    1 +
>  fs/smb/client/netmisc.c      |  155 ++++--
>  fs/smb/client/netmisc_test.c |  114 ++++
>  fs/smb/client/nterr.c        |   12 +-
>  fs/smb/client/nterr.h        | 1017 +++++++++++++++++-----------------
>  fs/smb/server/nterr.h        |  543 ------------------
>  fs/smb/server/smb2misc.c     |    1 -
>  fs/smb/server/smb_common.h   |    1 -
>  9 files changed, 739 insertions(+), 1107 deletions(-)
>  create mode 100644 fs/smb/client/netmisc_test.c
>  delete mode 100644 fs/smb/server/nterr.h
>
> --
> 2.43.0
>


-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 00/30] smb: improve search speed of SMB1 maperror
  2025-12-09 23:41 ` [PATCH 00/30] smb: improve search speed of SMB1 maperror Steve French
@ 2025-12-10  2:48   ` ChenXiaoSong
  0 siblings, 0 replies; 37+ messages in thread
From: ChenXiaoSong @ 2025-12-10  2:48 UTC (permalink / raw)
  To: Steve French, Namjae Jeon, Namjae Jeon, Steve French
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01,
	ChenXiaoSong

Hi Steve and Namjae,

I have updated the list of patches that have not been merged yet: 
https://chenxiaosong.com/en/smb-patch.html

I will provide the test results for these patches today.

Thanks,
ChenXiaoSong.

On 12/10/25 07:41, Steve French wrote:
> Merged nine of the client patches from this series into cifs-2.6.git
> for-next.  They looked safe.  Good catch on fixing some of these
> incorrect error definitions.
> 
> a691ac0cdd97 (HEAD -> for-next, origin/for-next) smb: move
> file_notify_information to common/fscc.h
> c0fd2fbe4f73 smb: move SMB2 Notify Action Flags into common/smb2pdu.h
> 787a2b803211 smb: move notify completion filter flags into common/smb2pdu.h
> 14a6f0e19fc7 smb/client: add parentheses to NT error code definitions
> containing bitwise OR operator
> 1e4c7c9ab176 smb: add documentation references for smb2 change notify
> definitions
> 833f0f46368f smb/client: add 4 NT error code definitions
> 3a0a34572269 smb/client: fix NT_STATUS_UNABLE_TO_FREE_VM value
> 954cbce76316 smb/client: fix NT_STATUS_DEVICE_DOOR_OPEN value
> b9695d00b605 smb/client: fix NT_STATUS_NO_DATA_DETECTED value
> 3d99347a2e1a (linus/master, linus/HEAD) Merge tag
> 'v6.19-rc-part1-smb3-client-fixes' of
> git://git.samba.org/sfrench/cifs-2.6
> 
> On Mon, Dec 8, 2025 at 12:22 AM <chenxiaosong.chenxiaosong@linux.dev> wrote:
>>
>> From: ChenXiaoSong <chenxiaosong@kylinos.cn>
>>
>> Before applying this patchset, the patchset ("smb: improve search speed of SMB2 maperror") must
>> be applied first, which introduces `CONFIG_SMB_KUNIT_TESTS` and avoids some conflicts in `fs/smb/client/cifsfs.c`:
>> https://chenxiaosong.com/lkml-improve-search-speed-of-smb2-maperror.html (Redirect to the LKML link)
>>
>> When searching for the last element, the comparison counts are shown in the table below:
>>
>> +--------------------+--------+--------+
>> |                    |Before  |After   |
>> |                    |Patchset|Patchset|
>> +--------------------+--------+--------+
>> | ntstatus_to_dos_map|   525  |    9   |
>> +--------------------+--------+--------+
>> |             nt_errs|   516  |    9   |
>> +--------------------+--------+--------+
>> |mapping_table_ERRDOS|    39  |    5   |
>> +--------------------+--------+--------+
>> |mapping_table_ERRSRV|    37  |    5   |
>> +--------------------+--------+--------+
>>
>> ChenXiaoSong (30):
>>    smb/client: fix NT_STATUS_NO_DATA_DETECTED value
>>    smb/client: fix NT_STATUS_DEVICE_DOOR_OPEN value
>>    smb/client: fix NT_STATUS_UNABLE_TO_FREE_VM value
>>    smb/server: remove unused nterr.h
>>    smb/client: add 4 NT error code definitions
>>    smb/client: add parentheses to NT error code definitions containing
>>      bitwise OR operator
>>    smb/client: introduce DEFINE_CMP_FUNC()
>>    smb/client: sort ntstatus_to_dos_map array
>>    smb/client: create netmisc_test.c and introduce
>>      DEFINE_CHECK_SORT_FUNC()
>>    smb/client: introduce KUnit test to check sort result of
>>      ntstatus_to_dos_map array
>>    smb/client: introduce DEFINE_SEARCH_FUNC()
>>    smb/client: use bsearch() to find target in ntstatus_to_dos_map array
>>    smb/client: remove useless elements from ntstatus_to_dos_map array
>>    smb/client: introduce DEFINE_CHECK_SEARCH_FUNC()
>>    smb/client: introduce KUnit test to check search result of
>>      ntstatus_to_dos_map array
>>    smb/client: sort nt_errs array
>>    smb/client: introduce KUnit test to check sort result of nt_errs array
>>    smb/client: use bsearch() to find target in nt_errs array
>>    smb/client: remove useless elements from nt_errs array
>>    smb/client: introduce KUnit test to check search result of nt_errs
>>      array
>>    smb/client: sort mapping_table_ERRDOS array
>>    smb/client: introduce KUnit test to check sort result of
>>      mapping_table_ERRDOS array
>>    smb/client: use bsearch() to find target in mapping_table_ERRDOS array
>>    smb/client: remove useless elements from mapping_table_ERRDOS array
>>    smb/client: introduce KUnit test to check search result of
>>      mapping_table_ERRDOS array
>>    smb/client: sort mapping_table_ERRSRV array
>>    smb/client: introduce KUnit test to check sort result of
>>      mapping_table_ERRSRV array
>>    smb/client: use bsearch() to find target in mapping_table_ERRSRV array
>>    smb/client: remove useless elements from mapping_table_ERRSRV array
>>    smb/client: introduce KUnit test to check search result of
>>      mapping_table_ERRSRV array
>>
>>   fs/smb/client/cifsfs.c       |    2 +
>>   fs/smb/client/cifsproto.h    |    1 +
>>   fs/smb/client/netmisc.c      |  155 ++++--
>>   fs/smb/client/netmisc_test.c |  114 ++++
>>   fs/smb/client/nterr.c        |   12 +-
>>   fs/smb/client/nterr.h        | 1017 +++++++++++++++++-----------------
>>   fs/smb/server/nterr.h        |  543 ------------------
>>   fs/smb/server/smb2misc.c     |    1 -
>>   fs/smb/server/smb_common.h   |    1 -
>>   9 files changed, 739 insertions(+), 1107 deletions(-)
>>   create mode 100644 fs/smb/client/netmisc_test.c
>>   delete mode 100644 fs/smb/server/nterr.h
>>
>> --
>> 2.43.0
>>
> 
> 


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 00/30] smb: improve search speed of SMB1 maperror
  2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
                   ` (30 preceding siblings ...)
  2025-12-09 23:41 ` [PATCH 00/30] smb: improve search speed of SMB1 maperror Steve French
@ 2025-12-10  4:32 ` ChenXiaoSong
  31 siblings, 0 replies; 37+ messages in thread
From: ChenXiaoSong @ 2025-12-10  4:32 UTC (permalink / raw)
  To: sfrench, smfrench, linkinjeon, linkinjeon
  Cc: linux-cifs, linux-kernel, liuzhengyuan, huhai, liuyun01

Hi Steve and Namjae,

I have tested all patches using KUnit tests, xfstests, and smbtorture, 
and no additional test failures were observed. The detailed test results 
can be found in: https://chenxiaosong.com/en/smb-test-20251210.html

For more detailed information about the patches to be reviewed, please 
see the link: https://chenxiaosong.com/en/smb-patch.html

Thanks,
ChenXiaoSong.

On 12/8/25 14:20, chenxiaosong.chenxiaosong@linux.dev wrote:
> From: ChenXiaoSong <chenxiaosong@kylinos.cn>
> 
> Before applying this patchset, the patchset ("smb: improve search speed of SMB2 maperror") must
> be applied first, which introduces `CONFIG_SMB_KUNIT_TESTS` and avoids some conflicts in `fs/smb/client/cifsfs.c`:
> https://chenxiaosong.com/lkml-improve-search-speed-of-smb2-maperror.html (Redirect to the LKML link)
> 
> When searching for the last element, the comparison counts are shown in the table below:
> 
> +--------------------+--------+--------+
> |                    |Before  |After   |
> |                    |Patchset|Patchset|
> +--------------------+--------+--------+
> | ntstatus_to_dos_map|   525  |    9   |
> +--------------------+--------+--------+
> |             nt_errs|   516  |    9   |
> +--------------------+--------+--------+
> |mapping_table_ERRDOS|    39  |    5   |
> +--------------------+--------+--------+
> |mapping_table_ERRSRV|    37  |    5   |
> +--------------------+--------+--------+
> 
> ChenXiaoSong (30):
>    smb/client: fix NT_STATUS_NO_DATA_DETECTED value
>    smb/client: fix NT_STATUS_DEVICE_DOOR_OPEN value
>    smb/client: fix NT_STATUS_UNABLE_TO_FREE_VM value
>    smb/server: remove unused nterr.h
>    smb/client: add 4 NT error code definitions
>    smb/client: add parentheses to NT error code definitions containing
>      bitwise OR operator
>    smb/client: introduce DEFINE_CMP_FUNC()
>    smb/client: sort ntstatus_to_dos_map array
>    smb/client: create netmisc_test.c and introduce
>      DEFINE_CHECK_SORT_FUNC()
>    smb/client: introduce KUnit test to check sort result of
>      ntstatus_to_dos_map array
>    smb/client: introduce DEFINE_SEARCH_FUNC()
>    smb/client: use bsearch() to find target in ntstatus_to_dos_map array
>    smb/client: remove useless elements from ntstatus_to_dos_map array
>    smb/client: introduce DEFINE_CHECK_SEARCH_FUNC()
>    smb/client: introduce KUnit test to check search result of
>      ntstatus_to_dos_map array
>    smb/client: sort nt_errs array
>    smb/client: introduce KUnit test to check sort result of nt_errs array
>    smb/client: use bsearch() to find target in nt_errs array
>    smb/client: remove useless elements from nt_errs array
>    smb/client: introduce KUnit test to check search result of nt_errs
>      array
>    smb/client: sort mapping_table_ERRDOS array
>    smb/client: introduce KUnit test to check sort result of
>      mapping_table_ERRDOS array
>    smb/client: use bsearch() to find target in mapping_table_ERRDOS array
>    smb/client: remove useless elements from mapping_table_ERRDOS array
>    smb/client: introduce KUnit test to check search result of
>      mapping_table_ERRDOS array
>    smb/client: sort mapping_table_ERRSRV array
>    smb/client: introduce KUnit test to check sort result of
>      mapping_table_ERRSRV array
>    smb/client: use bsearch() to find target in mapping_table_ERRSRV array
>    smb/client: remove useless elements from mapping_table_ERRSRV array
>    smb/client: introduce KUnit test to check search result of
>      mapping_table_ERRSRV array
> 
>   fs/smb/client/cifsfs.c       |    2 +
>   fs/smb/client/cifsproto.h    |    1 +
>   fs/smb/client/netmisc.c      |  155 ++++--
>   fs/smb/client/netmisc_test.c |  114 ++++
>   fs/smb/client/nterr.c        |   12 +-
>   fs/smb/client/nterr.h        | 1017 +++++++++++++++++-----------------
>   fs/smb/server/nterr.h        |  543 ------------------
>   fs/smb/server/smb2misc.c     |    1 -
>   fs/smb/server/smb_common.h   |    1 -
>   9 files changed, 739 insertions(+), 1107 deletions(-)
>   create mode 100644 fs/smb/client/netmisc_test.c
>   delete mode 100644 fs/smb/server/nterr.h
> 


^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2025-12-10  4:33 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-08  6:20 [PATCH 00/30] smb: improve search speed of SMB1 maperror chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 01/30] smb/client: fix NT_STATUS_NO_DATA_DETECTED value chenxiaosong.chenxiaosong
2025-12-09  0:17   ` ChenXiaoSong
2025-12-09  0:29     ` Steve French
2025-12-09  0:45       ` ChenXiaoSong
2025-12-08  6:20 ` [PATCH 02/30] smb/client: fix NT_STATUS_DEVICE_DOOR_OPEN value chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 03/30] smb/client: fix NT_STATUS_UNABLE_TO_FREE_VM value chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 04/30] smb/server: remove unused nterr.h chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 05/30] smb/client: add 4 NT error code definitions chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 06/30] smb/client: add parentheses to NT error code definitions containing bitwise OR operator chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 07/30] smb/client: introduce DEFINE_CMP_FUNC() chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 08/30] smb/client: sort ntstatus_to_dos_map array chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 09/30] smb/client: create netmisc_test.c and introduce DEFINE_CHECK_SORT_FUNC() chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 10/30] smb/client: introduce KUnit test to check sort result of ntstatus_to_dos_map array chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 11/30] smb/client: introduce DEFINE_SEARCH_FUNC() chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 12/30] smb/client: use bsearch() to find target in ntstatus_to_dos_map array chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 13/30] smb/client: remove useless elements from " chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 14/30] smb/client: introduce DEFINE_CHECK_SEARCH_FUNC() chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 15/30] smb/client: introduce KUnit test to check search result of ntstatus_to_dos_map array chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 16/30] smb/client: sort nt_errs array chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 17/30] smb/client: introduce KUnit test to check sort result of " chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 18/30] smb/client: use bsearch() to find target in " chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 19/30] smb/client: remove useless elements from " chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 20/30] smb/client: introduce KUnit test to check search result of " chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 21/30] smb/client: sort mapping_table_ERRDOS array chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 22/30] smb/client: introduce KUnit test to check sort result of " chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 23/30] smb/client: use bsearch() to find target in " chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 24/30] smb/client: remove useless elements from " chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 25/30] smb/client: introduce KUnit test to check search result of " chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 26/30] smb/client: sort mapping_table_ERRSRV array chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 27/30] smb/client: introduce KUnit test to check sort result of " chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 28/30] smb/client: use bsearch() to find target in " chenxiaosong.chenxiaosong
2025-12-08  6:20 ` [PATCH 29/30] smb/client: remove useless elements from " chenxiaosong.chenxiaosong
2025-12-08  6:21 ` [PATCH 30/30] smb/client: introduce KUnit test to check search result of " chenxiaosong.chenxiaosong
2025-12-09 23:41 ` [PATCH 00/30] smb: improve search speed of SMB1 maperror Steve French
2025-12-10  2:48   ` ChenXiaoSong
2025-12-10  4:32 ` ChenXiaoSong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).