收录查询

HRESULT定义在wintrust.h头文件中

//////////////////////////////////////////////////////////////////////////////
//
//  Provider function prototypes
//----------------------------------------------------------------------------
//

//
//  entry point for the object provider
//
typedef HRESULT     (*PFN_PROVIDER_INIT_CALL)(IN OUT struct _CRYPT_PROVIDER_DATA *pProvData);

//
//  entry point for the object provider
//
typedef HRESULT     (*PFN_PROVIDER_OBJTRUST_CALL)(IN OUT struct _CRYPT_PROVIDER_DATA *pProvData);

//
//  entry point for the Signature Provider
//
typedef HRESULT     (*PFN_PROVIDER_SIGTRUST_CALL)(IN OUT struct _CRYPT_PROVIDER_DATA *pProvData);

//
//  entry point for the Certificate Provider
//
typedef HRESULT     (*PFN_PROVIDER_CERTTRUST_CALL)(IN OUT struct _CRYPT_PROVIDER_DATA *pProvData);

//
//  entry point for the Policy Provider's final call (from the trust provider)
//
typedef HRESULT     (*PFN_PROVIDER_FINALPOLICY_CALL)(IN OUT struct _CRYPT_PROVIDER_DATA *pProvData);

//
//  entry point for the Policy Provider's "dump structure" call
//
typedef HRESULT     (*PFN_PROVIDER_TESTFINALPOLICY_CALL)(IN OUT struct _CRYPT_PROVIDER_DATA *pProvData);


可以使用LONG来替换HRESULT,前提是在下面的情况中:

[MSDN2001]

HRESULT

The HRESULT data type is a 32-bit value that is used to describe an error or warning.

typedef LONG          HRESULT; 
 

Remarks

On 32-bit platforms, the HRESULT data type is the same as the SCODE data type. On 16-bit platforms, an SCODE value is used to generate an HRESULT value.

An HRESULT value is made up of the following fields:

  • A 1-bit code indicating severity, where zero represents success and 1 represents failure.
  • A 4-bit reserved value.
  • An 11-bit code indicating responsibility for the error or warning, also known as a facility code.
  • A 16-bit code describing the error or warning.

Most MAPI interface methods and functions return HRESULT values to provide detailed result information. HRESULT values are also used widely in OLE interface methods. OLE provides several macros for converting between HRESULT values and SCODE values, another common data type for error handling. For information about the OLE use of HRESULT values, see the OLE Programmer's Reference. For more information about the use of these values in MAPI, see Error Handling and any of the following interface methods:

IABLogon::GetLastError

IMAPISupport::GetLastError

IMAPIControl::GetLastError

IMAPITable::GetLastError

IMAPIProp::GetLastError

IMAPIViewAdviseSink::OnPrint

See Also

SCODE

posted @ 2005-06-07 19:45  ->  阅读(1509)  评论(0)    收藏  举报