IDebugHostSymbols::CreateTypeSignatureForModuleRange 方法 (dbgmodel.h)

CreateTypeSignatureForModuleRange 方法會建立簽章,可用來依模組簽章和類型名稱比對一組具體類型。 這類似於 CreateTypeSignature 方法,不同之處在於,呼叫端會傳遞建立模組簽章所需的自變數, (如同使用 CreateModuleSignature 方法建立模組簽章) 。

語法

HRESULT CreateTypeSignatureForModuleRange(
  PCWSTR                  signatureSpecification,
  PCWSTR                  moduleName,
  PCWSTR                  minVersion,
  PCWSTR                  maxVersion,
  IDebugHostTypeSignature **typeSignature
);

參數

signatureSpecification

識別套用此簽章之類型的簽章字串。 此字串的格式專屬於正在偵錯的語言。 針對 C/C++,這相當於 NatVis 類型規格。 這是一種類型名稱,其中範本自變數允許通配符, (指定為 *) 。

moduleName

包含模組的名稱必須符合不區分大小寫 () ,才能將類型視為簽章相符專案。

minVersion

要視為簽章相符之型別之包含模組的最低版本。 此自變數的格式相當於 CreateModuleSignature 中的相同自變數

maxVersion

要視為簽章相符之類型的包含模組版本上限。 此自變數的格式相當於 CreateModuleSignature 中的相同自變數

typeSignature

此處會傳回新建立的類型簽章物件。

傳回值

這個方法會傳回 HRESULT,指出成功或失敗。

備註

範例程式碼

ComPtr<IDebugHost> spHost; /* get the host */

ComPtr<IDebugHostSymbols> spSym;
if (SUCCEEDED(spHost.As(&spSym)))
{
    ComPtr<IDebugHostTypeSignature> spSig;
    if (SUCCEEDED(spSym->CreateTypeSignatureForModuleRange(
        L"MyTemplateType<*>", 
        L"MyModule.dll", 
        L"6.3", 
        L"10.0.0.0", 
        &spSig)))
    {
        // spSig is a type signature which will match any template type with 
        // a base name of MyTemplateType and *ANY* template arguments that is 
        // within a module named "MyModule.dll" with a version >= 6.3(.0.0) 
        // and a version <= 10.0.0.0 (regardless of the process/context of the module)
        //
        // Note that the version arguments are optional.  If absent, it indicates 
        // there is either no lower or no upper bound on the module version 
        // to match the signature.
    }
}

FindModuleByName、CreateTypeSignature 和 CreateTypeSignatureForModuleRange 中的符號模組比對差異

FindModuleByName 可讓傳遞的模組名稱成為模組的實際映像名稱,例如 My Module.dll,或在調試 (程式引擎中參考它的名稱,例如:MyModule 或MyModule_<hex_base>) 。

呼叫 CreateTypeSignatureForModuleRange 並傳遞 name/nullptr/nullptr 將會建立簽章,以符合任何版本名稱的任何模組。

傳遞至 CreateTypeSignature 函式的模組名稱只會接受模組的實際映像名稱 (,例如:MyModule.dll) 。

呼叫 FindModuleByName ,然後使用該模組 建立 CreateTypeSignature 會建立簽章,只符合傳遞至該模組的特定模組實例。 如果模組有兩個復本載入 (例如:在64位 Windows) 上執行的32位進程中,只會符合傳遞的特定實例。 如果卸除並重載該 DLL,它也不會再相符。 簽章會與調試程式稱為模組的特定實例相關聯。

規格需求

需求
標頭 dbgmodel.h

另請參閱

IDebugHostSymbols 介面

FindModuleByName

CreateTypeSignature