IDiaSectionContrib
Retrieves data describing a section contribution, that is, a contiguous block of memory contributed to the image by a compiland.
IDiaSectionContrib : IUnknown
Methods in Vtable Order
The following table shows the methods of IDiaSectionContrib.
Method |
Description |
---|---|
Retrieves a reference to the compiland symbol that contributed this section. |
|
Retrieves the section part of the contribution's address. |
|
Retrieves the offset part of the contribution's address. |
|
Retrieves the image relative virtual address (RVA) of the contribution. |
|
Retrieves the virtual address (VA) of the contribution. |
|
Retrieves the number of bytes in a section. |
|
Retrieves a flag that indicates whether the section cannot be paged out of memory. |
|
Retrieves a flag indicating whether the section should not be padded to the next memory boundary. |
|
Retrieves a flag that indicates whether the section contains executable code. |
|
Retrieves a flag that indicates whether the section contains 16-bit code. |
|
Retrieves a flag that indicates whether the section contains initialized data. |
|
Retrieves a flag that indicates whether the section contains uninitialized data. |
|
Retrieves a flag indicating whether a section contains comments or similar information. |
|
Retrieves a flag that indicates whether the section is removed before it is made part of the in-memory image. |
|
Retrieves a flag that indicates whether the section is a COMDAT record. |
|
Retrieves a flag that indicates whether the section can be discarded. |
|
Retrieves a flag that indicates whether the section cannot be cached. |
|
Retrieves a flag that indicates whether the section can be shared in memory. |
|
Retrieves a flag that indicates whether the section is executable as code. |
|
Retrieves a flag that indicates whether the section can be read. |
|
Retrieves a flag that indicates whether the section can be written. |
|
Retrieves the cyclic redundancy check (CRC) of the data in the section. |
|
Retrieves the CRC of the relocation information for the section. |
|
Retrieves the compiland identifier for the section. |
Remarks
Notes for Callers
This interface is obtained by calling the IDiaEnumSectionContribs::Item and IDiaEnumSectionContribs::Next methods. See the IDiaEnumSectionContribs interface for an example of obtaining the IDiaSectionContrib interface.
Example
This function shows the address of each section along with any associated symbols. See the IDiaEnumSectionContribs interface to see how the IDiaSectionContrib interface is obtained.
void PrintSectionContrib(IDiaSectionContrib* pSecContrib, IDiaSession* pSession)
{
if (pSecContrib != NULL && pSession != NULL)
{
DWORD rva;
if ( pSecContrib->get_relativeVirtualAddress( &rva ) == S_OK )
{
printf( "\taddr: 0x%.8X", rva );
pSecContrib = NULL;
CComPtr<IDiaSymbol> pSym;
if ( psession->findSymbolByRVA( rva, SymTagNull, &pSym ) == S_OK )
{
CDiaBSTR name;
DWORD tag;
pSym->get_symTag( &tag );
pSym->get_name( &name );
printf( " symbol: %ws (%ws)\n",
name != NULL ? name : L"",
szTags[ tag ] );
}
else
{
printf( "<no symbol found?>\n" );
}
}
else
{
DWORD isect;
DWORD offset;
pSecContrib->get_addressSection( &isect );
pSecContrib->get_addressOffset( &offset );
printf( "\taddr: 0x%.4X:0x%.8X", isect, offset );
pSecContrib = NULL;
CComPtr<IDiaSymbol> pSym;
if ( SUCCEEDED( psession->findSymbolByAddr(
isect,
offset,
SymTagNull,
&pSym )
)
)
{
CDiaBSTR name;
DWORD tag;
pSym->get_symTag( &tag );
pSym->get_name( &name );
printf( " symbol: %ws (%ws)\n",
name != NULL ? name : L"",
szTags[ tag ] );
}
else
{
printf( "<no symbol found?>\n" );
}
}
}
}
Requirements
Header: Dia2.h
Library: diaguids.lib
DLL: msdia80.dll