|
2 | 2 | title: "IDiaSession::findLinesByRVA | Microsoft Docs"
|
3 | 3 | ms.date: "11/04/2016"
|
4 | 4 | ms.topic: "conceptual"
|
5 |
| -dev_langs: |
| 5 | +dev_langs: |
6 | 6 | - "C++"
|
7 |
| -helpviewer_keywords: |
| 7 | +helpviewer_keywords: |
8 | 8 | - "IDiaSession::findLinesByRVA method"
|
9 | 9 | ms.assetid: 06f53b0b-b5b4-42cf-9252-dcee0dbe2d71
|
10 | 10 | author: "mikejo5000"
|
11 | 11 | ms.author: "mikejo"
|
12 | 12 | manager: jillfra
|
13 |
| -ms.workload: |
| 13 | +ms.workload: |
14 | 14 | - "multiple"
|
15 | 15 | ---
|
16 | 16 | # IDiaSession::findLinesByRVA
|
17 |
| -Retrieves the lines in a specified compiland that contain a specified relative virtual address (RVA). |
18 |
| - |
19 |
| -## Syntax |
20 |
| - |
21 |
| -```C++ |
22 |
| -HRESULT findLinesByRVA ( |
23 |
| - DWORD rva, |
24 |
| - DWORD length, |
25 |
| - IDiaEnumLineNumbers** ppResult |
26 |
| -); |
27 |
| -``` |
28 |
| - |
29 |
| -#### Parameters |
30 |
| - `rva` |
31 |
| - [in] Specifies the address as an RVA. |
32 |
| - |
33 |
| - `length` |
34 |
| - [in] Specifies the number of bytes of address range to cover with this query. |
35 |
| - |
36 |
| - `ppResult` |
37 |
| - [out] Returns an [IDiaEnumLineNumbers](../../debugger/debug-interface-access/idiaenumlinenumbers.md) object that contains a list of all the line numbers that cover the specified address range. |
38 |
| - |
39 |
| -## Return Value |
40 |
| - If successful, returns `S_OK`; otherwise, returns an error code. |
41 |
| - |
42 |
| -## Example |
43 |
| - This example shows a function that obtains all line numbers contained in the specified function using the function's relative virtual address and length. |
44 |
| - |
45 |
| -```C++ |
46 |
| -IDiaEnumLineNumbers* GetLineNumbersByRVA(IDiaSymbol *pFunc, IDiaSession *pSession) |
47 |
| -{ |
48 |
| - IDiaEnumLineNumbers* pEnum = NULL; |
49 |
| - DWORD rva; |
50 |
| - ULONGLONG length; |
51 |
| - |
52 |
| - if (pFunc->get_relativeVirtualAddress ( &rva ) == S_OK) |
53 |
| - { |
54 |
| - pFunc->get_length ( &length ); |
55 |
| - pSession->findLinesByRVA( rva, static_cast<DWORD>( length ), &pEnum ); |
56 |
| - } |
57 |
| - return(pEnum); |
58 |
| -} |
59 |
| -``` |
60 |
| - |
61 |
| -## See Also |
62 |
| - [IDiaEnumLineNumbers](../../debugger/debug-interface-access/idiaenumlinenumbers.md) |
63 |
| - [IDiaSession](../../debugger/debug-interface-access/idiasession.md) |
| 17 | +Retrieves the lines in a specified compiland that contain a specified relative virtual address (RVA). |
| 18 | + |
| 19 | +## Syntax |
| 20 | + |
| 21 | +```C++ |
| 22 | +HRESULT findLinesByRVA ( |
| 23 | + DWORD rva, |
| 24 | + DWORD length, |
| 25 | + IDiaEnumLineNumbers** ppResult |
| 26 | +); |
| 27 | +``` |
| 28 | + |
| 29 | +#### Parameters |
| 30 | +`rva` |
| 31 | +[in] Specifies the address as an RVA. |
| 32 | + |
| 33 | +`length` |
| 34 | +[in] Specifies the number of bytes of address range to cover with this query. |
| 35 | + |
| 36 | +`ppResult` |
| 37 | +[out] Returns an [IDiaEnumLineNumbers](../../debugger/debug-interface-access/idiaenumlinenumbers.md) object that contains a list of all the line numbers that cover the specified address range. |
| 38 | + |
| 39 | +## Return Value |
| 40 | +If successful, returns `S_OK`; otherwise, returns an error code. |
| 41 | + |
| 42 | +## Example |
| 43 | +This example shows a function that obtains all line numbers contained in the specified function using the function's relative virtual address and length. |
| 44 | + |
| 45 | +```C++ |
| 46 | +IDiaEnumLineNumbers* GetLineNumbersByRVA(IDiaSymbol *pFunc, IDiaSession *pSession) |
| 47 | +{ |
| 48 | + IDiaEnumLineNumbers* pEnum = NULL; |
| 49 | + DWORD rva; |
| 50 | + ULONGLONG length; |
| 51 | + |
| 52 | + if (pFunc->get_relativeVirtualAddress ( &rva ) == S_OK) |
| 53 | + { |
| 54 | + pFunc->get_length ( &length ); |
| 55 | + pSession->findLinesByRVA( rva, static_cast<DWORD>( length ), &pEnum ); |
| 56 | + } |
| 57 | + return(pEnum); |
| 58 | +} |
| 59 | +``` |
| 60 | +
|
| 61 | +## See Also |
| 62 | +[IDiaEnumLineNumbers](../../debugger/debug-interface-access/idiaenumlinenumbers.md) |
| 63 | +[IDiaSession](../../debugger/debug-interface-access/idiasession.md) |
0 commit comments