IDiaSession::findLinesByRVA

 

For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

For the latest Visual Studio 2017 documentation, see IDiaSession::findLinesByRVA on docs.microsoft.com.

Retrieves the lines in a specified compiland that contain a specified relative virtual address (RVA).

HRESULT findLinesByRVA (   
   DWORD                 rva,  
   DWORD                 length,  
   IDiaEnumLineNumbers** ppResult  
);  

Parameters

rva
[in] Specifies the address as an RVA.

length
[in] Specifies the number of bytes of address range to cover with this query.

ppResult
[out] Returns an IDiaEnumLineNumbers object that contains a list of all the line numbers that cover the specified address range.

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

This example shows a function that obtains all line numbers contained in the specified function using the function's relative virtual address and length.

IDiaEnumLineNumbers* GetLineNumbersByRVA(IDiaSymbol *pFunc, IDiaSession *pSession)  
{  
    IDiaEnumLineNumbers* pEnum = NULL;  
    DWORD                rva;  
    ULONGLONG            length;  
  
    if (pFunc->get_relativeVirtualAddress ( &rva ) == S_OK)  
    {  
        pFunc->get_length ( &length );  
        pSession->findLinesByRVA( rva, static_cast<DWORD>( length ), &pEnum );  
    }  
    return(pEnum);  
}  

IDiaEnumLineNumbers
IDiaSession

Show: