Freigeben über


IDebugComPlusSymbolProvider2::GetTypeFromToken

Retrieves a type given its token.

HRESULT GetTypeFromToken(
   ULONG32       appDomain,
   GUID          guidModule,
   DWORD         tdToken,
   IDebugField** ppField
);
int GetTypeFromToken(
   uint            appDomain,
   Guid            guidModule,
   uint            tdToken,
   out IDebugField ppField
);

Parameters

  • appDomain
    [in] Identifier of the application domain.

  • guidModule
    [in] Unique identifier of the module.

  • tdToken
    [in] Token of the type to be retrieved.

  • ppField
    [out] Returns the type that is represented by the IDebugField.

Return Value

If successful, returns S_OK; otherwise, returns an error code.

Example

The following example shows how to implement this method for a CDebugSymbolProvider object that exposes the IDebugComPlusSymbolProvider2 interface.

HRESULT CDebugSymbolProvider::GetTypeFromToken(
    ULONG32 ulAppDomainID,
    GUID guidModule,
    DWORD tdToken,
    IDebugField **ppField)
{
    HRESULT hr = E_FAIL;

    METHOD_ENTRY( CDebugDynamicFieldSymbol::GetTypeFromToken );

    ASSERT(IsValidObjectPtr(this, CDebugSymbolProvider));
    ASSERT(IsValidWritePtr(ppField, IDebugField*));

    Module_ID idModule(ulAppDomainID, guidModule);

    IfFailGo( this->CreateClassType(idModule, tdToken, ppField) );

Error:

    METHOD_EXIT( CDebugDynamicFieldSymbol::GetTypeFromToken, hr );

    return hr;
}

See Also

Reference

IDebugComPlusSymbolProvider2