In this episode of Defrag Tools, we talk about HRESULT based Error Codes. The 32bits in the HRESULT have meanings, allowing the reader to gain additional insights into the error.
The 32nd bit (the top bit) indicates if an error occurred or not. This is why errors are 0x8xxxxxxx.
The 16-26 bits are the Facility - the originating API (Win32, CLR, XAML, etc.).
The 0-15 bits are the (Error) Code.
Common NULL Facility Error Codes
|S_FALSE||Operation successful but returned no results||0x00000001|
|E_NOINTERFACE||No such interface supported||0x80004002|
|E_POINTER||Pointer that is not valid||0x80004003|
Common Win32 Facility Error Codes
|E_ACCESSDENIED||General access denied error||0x80070005|
|E_HANDLE||Handle that is not valid||0x80070006|
|E_INVALIDARG||One or more arguments are not valid||0x80070057|
|E_OUTOFMEMORY||Failed to allocate necessary memory||0x8007000E|