Using Macros for Error Handling
COM defines a number of macros that make it easier to work with HRESULT values.
The error handling macros are described in the following table.
| Macro | Description |
|---|---|
|
Returns an HRESULT given the severity bit, facility code, and error code that comprise the HRESULT. Note Calling MAKE_HRESULT for S_OK verification carries a performance penalty. You should not routinely use MAKE_HRESULT for successful results. | |
|
Returns an SCODE given the severity bit, facility code, and error code that comprise the SCODE. | |
|
Extracts the error code portion of the HRESULT. | |
|
Extracts the facility code of the HRESULT. | |
|
Extracts the severity bit of the HRESULT. | |
|
Extracts the error code portion of the SCODE. | |
|
Extracts the facility code of the SCODE. | |
|
Extracts the severity field of the SCODE. | |
|
Tests the severity bit of the SCODE or HRESULT; returns TRUE if the severity is zero and FALSE if it is one. | |
|
Tests the severity bit of the SCODE or HRESULT; returns TRUE if the severity is one and FALSE if it is zero. | |
|
Provides a generic test for errors on any status value. | |
|
Maps a system error code to an HRESULT value. | |
|
Maps an NT status value to an HRESULT value. |
Related topics
Send comments about this topic to Microsoft
Build date: 5/16/2013