IDebugHostSymbols::FindModuleByLocation 方法 (dbgmodel.h)
FindModuleByLocation 方法會查看指定的主機內容,並判斷哪個模組包含指定位置所指定的位址。 接著,它會將介面傳回給這類模組。
語法
HRESULT FindModuleByLocation(
IDebugHostContext *context,
Location moduleLocation,
IDebugHostModule **module
);
參數
context
此主機內容將會搜尋載入的模組,其中包含 moduleLocation 自變數所指定的位址。
moduleLocation
指定內容中包含這個自變數所指定位址的模組將會傳回(或方法將會失敗)。
module
如果找到模組,則會在這裡傳回模組的介面。
傳回值
此方法會傳回表示成功或失敗的 HRESULT。
言論
範例程式代碼
ComPtr<IDebugHost> spHost; /* get the host */
ComPtr<IDebugHostSymbols> spSym;
if (SUCCEEDED(spHost.As(&spSym)))
{
// Find the module which contains the address 0x7f638000 in the current
// UI context (process) of the debug host
ComPtr<IDebugHostModule> spModule;
if (SUCCEEDED(sySym->FindModuleByLocation(USE_CURRENT_HOST_CONTEXT,
0x7f638000,
&spModule)))
{
// spModule is the module which contains the VA 0x7f638000
}
}
要求
要求 | 價值 |
---|---|
標頭 | dbgmodel.h |