In msdn:
The following figure shows the layout for ntstatus values.
Ntstatus Layout
313029 28 16 15 0
// + ---- + -- + ------------------------- + ------------------------------- +
// | Sev | c | r | facility | code |
// + ---- + -- + ------------------------- + ------------------------------- +
TheSevField shown in the ntstatus layout figure indicates the severity code, which must be one of the following system-defined values:
-
Status_severity_success
-
Indicates a successful ntstatus value, such as STATUS_SUCCESS, or the value io_err_retry_succeeded in error log packets.
-
Status_severity_informational
-
Indicates an informational ntstatus value, such as status_serial_more_writes.
-
Status_severity_warning
-
Indicates a warning ntstatus value, such as status_device_paper_empty.
-
Status_severity_error
-
Indicates an error ntstatus value, such as status_insufficient_resources for
Finalstatus
Value or io_err_configuration_error for
ErrorcodeValue in error log packets.
In:
Sev-is the severity code
00-success
01-Informational
10-warning
11-Error
C-is the customer code flag
Facility-is the Facility Code
Code-is the facility's status code
Refer:
Messageidtypedef = ntstatus
Severitynames = (success = 0x0: status_severity_success
Informational = 0x1: status_severity_informational
Warning = 0x2: status_severity_warning
Error = 0x3: status_severity_error
)
Facilitynames = (system = 0x0
Rpcruntime = 0x2: facility_rpc_runtime
Rpcstubs = 0x3: facility_rpc_stubs
IO = 0x4: facility_io_error_code
Devclass = 0x05: facility_devclass_error_code
)
Messageid = 0x3296 facility = devclass severity = warning symbolicname = devclass_high_temperature
Language = English
The temperature of the device % 1 is too high.
If you want to add a custom error messege,
You need to set C to differentiate the error information defined by Microsoft and customer,
0: Microsoft 1: customer