What is the difference between HRESULT error codes that start with 0x8 and with 0xC?


It's more of a curiosity than anything else. I've been reviewing the HRESULT error codes that many Win32 APIs and Windows components return to signify errors.

If I understand its structure correctly, the most significant bit 31 is the error bit. If it's set, then HRESULT contains an error.

For instance, 0x80004002 is E_NOINTERFACE:

No such interface supported.

But what happens when two of its most significant bits are set as in 0xC0262588? What makes it different?

That value above also seems to translate to an error, which is ERROR_GRAPHICS_MCA_INTERNAL_ERROR:

An internal Monitor Configuration API error occurred.

EDIT: The documentation declares such values to be invalid but then goes on to list multiple supposedly invalid values.

asked on Stack Overflow Jan 4, 2019 by c00000fd • edited Jan 4, 2019 by c00000fd

1 Answer


From the Structures of HRESULT definition, 0x8 and 0xC is different at "R" bit and if the N bit is set, this bit is defined by the NTSTATUS numbering space. In NTSTATUS definition, 0x8 indicate STATUS_SEVERITY_WARNING and 0xC indicate STATUS_SEVERITY_ERROR.

enter image description here

enter image description here

Ref: "[MS-ERREF]: Windows Error Codes"

answered on Stack Overflow Jan 7, 2019 by Rita Han - MSFT

User contributions licensed under CC BY-SA 3.0