iCertExit::GetDescription 方法 (certexit.h)

GetDescription方法會傳回結束模組及其函式的人類可讀取描述。 這個方法最初是在 ICertExit 介面中定義。

語法

HRESULT GetDescription(
  [out] BSTR *pstrDescription
);

參數

[out] pstrDescription

描述結束模組之 BSTR 的指標。

傳回值

C++

如果方法成功,方法會傳回S_OK。

如果方法失敗,它會傳回指出錯誤的 HRESULT 值。 如需常見錯誤碼的清單,請參閱 一般 HRESULT 值

VB

傳回描述結束模組及其函式的字串。

備註

當您撰寫自訂結束模組時,請實作這個方法。

範例

STDMETHODIMP
CCertExit::GetDescription(
    /* [out, retval] */ BSTR __RPC_FAR *pstrDescription)
{
    if (NULL == pstrDescription)
    {
        // Bad pointer address.
        return (E_POINTER);
    }
    if (NULL != *pstrDescription)
    {
        SysFreeString(*pstrDescription);
        *pstrDescription=NULL;
    }
    // wszMyExitModuleDesc defined elsewhere, for example:
    // #define wszMyExitModuleDesc L"My Exit Module"
    *pstrDescription = SysAllocString(wszMyExitModuleDesc);
    if (NULL == *pstrDescription)
    {
        // Not enough memory
        return ( E_OUTOFMEMORY );
    }
    // Success
    return( S_OK );
}

規格需求

   
最低支援的用戶端 都不支援
最低支援的伺服器 Windows Server 2003 [僅限桌面應用程式]
目標平台 Windows
標頭 certexit.h (包含 Certsrv.h)

另請參閱

ICertExit

ICertExit2