检索包含指定的地址在指定的编译的行。
HRESULT findLinesByAddr (
DWORD seg,
DWORD offset,
DWORD length,
IDiaEnumLineNumbers** ppResult
);
参数
seg
[in] 指定该具体地址的节元素。offset
[in] 指定该具体地址的扭曲元素。length
[in] 指定字节数地址范围。此查询中。ppResult
[out] 返回包含所有行号列表包含指定的地址范围的 IDiaEnumLineNumbers 对象。
返回值
如果成功,则返回; S_OK否则,返回错误代码。
示例
此示例演示可通过在函数包含的所有行号使用函数的地址和长度的函数。
IDiaEnumLineNumbers* GetLineNumbersByAddr(IDiaSymbol *pFunc,
IDiaSession *pSession)
{
IDiaEnumLineNumbers* pEnum = NULL;
DWORD seg;
DWORD offset;
ULONGLONG length;
if (pFunc->get_addressSection ( &seg ) == S_OK &&
pFunc->get_addressOffset ( &offset ) == S_OK)
{
pFunc->get_length ( &length );
pSession->findLinesByAddr( seg, offset, static_cast<DWORD>( length ), &pEnum );
}
return(pEnum);
}