2.1 HRESULT
The HRESULT numbering space is vendor-extensible. Vendors can supply their own values for this field, as long as the C bit (0x20000000) is set, indicating it is a customer code.
The HRESULT numbering space has the following internal structure. Any protocol that uses NTSTATUS values on the wire is responsible for stating the order in which the bytes are placed on the wire.
|
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
1 0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
2 0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
3 0 |
1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
S |
R |
C |
N |
X |
Facility |
Code |
|||||||||||||||||||||||||
-
S (1 bit): Severity. If set, indicates a failure result. If clear, indicates a success result.
-
R (1 bit): Reserved. If the N bit is clear, this bit MUST be set to 0. If the N bit is set, this bit is defined by the NTSTATUS numbering space (as specified in section 2.3).
-
C (1 bit): Customer. This bit specifies if the value is customer-defined or Microsoft-defined. The bit is set for customer-defined values and clear for Microsoft-defined values.<1>
-
N (1 bit): If set, indicates that the error code is an NTSTATUS value (as specified in section 2.3), except that this bit is set.
-
X (1 bit): Reserved. SHOULD be set to 0. <2>
-
Facility (11 bits): An indicator of the source of the error. New facilities are occasionally added by Microsoft.
The following table lists the currently defined facility codes:
-
Value Meaning FACILITY_NULL
0The default facility code.
FACILITY_RPC
1The source of the error code is an RPC subsystem.
FACILITY_DISPATCH
2The source of the error code is a COM Dispatch.
FACILITY_STORAGE
3The source of the error code is OLE Storage.
FACILITY_ITF
4The source of the error code is COM/OLE Interface management.
FACILITY_WIN32
7This region is reserved to map undecorated error codes into HRESULTs.
FACILITY_WINDOWS
8The source of the error code is the Windows subsystem.
FACILITY_SECURITY
9The source of the error code is the Security API layer.
FACILITY_SSPI
9The source of the error code is the Security API layer.
FACILITY_CONTROL
10The source of the error code is the control mechanism.
FACILITY_CERT
11The source of the error code is a certificate client or server?
FACILITY_INTERNET
12The source of the error code is Wininet related.
FACILITY_MEDIASERVER
13The source of the error code is the Windows Media Server.
FACILITY_MSMQ
14The source of the error code is the Microsoft Message Queue.
FACILITY_SETUPAPI
15The source of the error code is the Setup API.
FACILITY_SCARD
16The source of the error code is the Smart-card subsystem.
FACILITY_COMPLUS
17The source of the error code is COM+.
FACILITY_AAF
18The source of the error code is the Microsoft agent.
FACILITY_URT
19The source of the error code is .NET CLR.
FACILITY_ACS
20The source of the error code is the audit collection service.
FACILITY_DPLAY
21The source of the error code is Direct Play.
FACILITY_UMI
22The source of the error code is the ubiquitous memoryintrospection service.
FACILITY_SXS
23The source of the error code is Side-by-side servicing.
FACILITY_WINDOWS_CE
24The error code is specific to Windows CE.
FACILITY_HTTP
25The source of the error code is HTTP support.
FACILITY_USERMODE_COMMONLOG
26The source of the error code is common Logging support.
FACILITY_USERMODE_FILTER_MANAGER
31The source of the error code is the user mode filter manager.
FACILITY_BACKGROUNDCOPY
32The source of the error code is background copy control
FACILITY_CONFIGURATION
33The source of the error code is configuration services.
FACILITY_STATE_MANAGEMENT
34The source of the error code is state management services.
FACILITY_METADIRECTORY
35The source of the error code is the Microsoft Identity Server.
FACILITY_WINDOWSUPDATE
36The source of the error code is a Windows update.
FACILITY_DIRECTORYSERVICE
37The source of the error code is Active Directory.
FACILITY_GRAPHICS
38The source of the error code is the graphics drivers.
FACILITY_SHELL
39The source of the error code is the user Shell.
FACILITY_TPM_SERVICES
40The source of the error code is the Trusted Platform Module services.
FACILITY_TPM_SOFTWARE
41The source of the error code is the Trusted Platform Module applications.
FACILITY_PLA
48The source of the error code is Performance Logs and Alerts
FACILITY_FVE
49The source of the error code is Full volume encryption.
FACILITY_FWP
50he source of the error code is the Firewall Platform.
FACILITY_WINRM
51The source of the error code is the Windows Resource Manager.
FACILITY_NDIS
52The source of the error code is the Network Driver Interface.
FACILITY_USERMODE_HYPERVISOR
53The source of the error code is the Usermode Hypervisor components.
FACILITY_CMI
54The source of the error code is the Configuration Management Infrastructure.
FACILITY_USERMODE_VIRTUALIZATION
55The source of the error code is the user mode virtualization subsystem.
FACILITY_USERMODE_VOLMGR
56The source of the error code is the user mode volume manager
FACILITY_BCD
57The source of the error code is the Boot Configuration Database.
FACILITY_USERMODE_VHD
58The source of the error code is user mode virtual hard disk support.
FACILITY_SDIAG
60The source of the error code is System Diagnostics.
FACILITY_WEBSERVICES
61The source of the error code is the Web Services.
FACILITY_WINDOWS_DEFENDER
80The source of the error code is a Windows Defender component.
FACILITY_OPC
81The source of the error code is the open connectivity service.
-
Code (2 bytes): The remainder of the error code.