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

另请参阅

IDebugHostSymbols 接口