In the Microsoft® Windows® operating system, error codes are returned as signed 32-bit HRESULT values that indicate the status of an operation. The high-order sign bit indicates success or failure of the particular method function call.
The HRESULT data type is composed of fields depicted by the following diagram:
The 32-bit value is used to describe an error or warning and is composed of a 1-bit code that indicates the severity (S) of the condition; 0 for success and 1 for failure. The severity code is followed by 4 reserved bits depicted as R, C, N, and r, and then by an 11-bit facility code that indicates responsibility for the error or warning that is defined in the method implementation.
The Facility codes and Error codes are defined by the Winerror.h header file. The following table lists some typical HRESULT values:
Interface not supported
One or more arguments are invalid
Note Because error codes are implementation specific, two identical HRESULTs that are returned from two different interfaces can have different meanings.