IDiaSession::findILOffsetsByRVA

Retrieves an enumeration that allows a client to iterate through the MSIL offsets within a specified address range.

Syntax

HRESULT findILOffsetsByRVA (
    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 MSIL offsets that cover the specified address range.

Return Value

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

Example

This example shows a function that obtains all MSIL offset contained in a function using the function's address and length.

IDiaEnumLineNumbers* GetLineNumbersByAddr(IDiaSymbol *pFunc,
                                          IDiaSession *pSession)
{
    IDiaEnumLineNumbers* pEnum = NULL;
    DWORD                rva = 0;
    ULONGLONG            length;

    if (pFunc->get_relativeVirtualAddress ( &rva ) == S_OK)
    {
        pFunc->get_length ( &length );
        pSession->findILOffsetsByRVA( rva, static_cast<DWORD>( length ), &pEnum );
    }
    return(pEnum);
}

See also