细看了下NTSTATUS

msdn 中的:

The following figure shows the layout for NTSTATUS values.

NTSTATUS Layout

   313029 28                       16 15                                  0

// +----+--+-------------------------+-------------------------------+
// |Sev|C  |R|    Facility            |           Code         |
// +----+--+-------------------------+-------------------------------+

The Sev field 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 a FinalStatus value or IO_ERR_CONFIGURATION_ERROR for an ErrorCodevalue in error log packets.

即在上图中:

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

 

参考:

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 .

如果想添加自定义的Error Messege,
需要设置C以区别Microsoft 和Customer定义的错误信息,
  0:Microsoft   1:Customer

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值