IDiaInjectedSource
Accesses injected source code stored in the DIA data source.
IDiaInjectedSource : IUnknown
Methods in Vtable Order
The following table shows the methods of IDiaInjectedSource.
Method |
Description |
---|---|
Retrieves a cyclic redundancy check (CRC) calculated from the bytes of the source code. |
|
Retrieves the number of bytes of code. |
|
Retrieves the file name for the source. |
|
Retrieves the object file name to which the source was compiled. |
|
Retrieves the name given to non-file source code; that is, code that was injected. |
|
Retrieves the indicator of the source compression used. |
|
Retrieves the source code bytes. |
Remarks
Injected source is text that is injected during compilation. This does not mean the preprocessor #include used in C++.
Notes for Callers
Obtain this interface by calling the IDiaEnumInjectedSources::Item or IDiaEnumInjectedSources::Next methods. See the IDiaEnumInjectedSources interface for an example of obtaining the IDiaInjectedSource interface.
Example
This example displays the data available from the IDiaInjectedSource interface. For an alternative approach using the IDiaPropertyStorage interface, see the example in the IDiaEnumInjectedSources interface.
void PrintInjectedSource(IDiaInjectedSource* pSource)
{
ULONGLONG codeLength = 0;
DWORD crc = 0;
DWORD compressionType = 0;
BSTR sourceFilename = NULL;
BSTR objectFilename = NULL;
BSTR virtualFilename = NULL;
std::cout << "Injected Source:" << std::endl;
if (pSource != NULL)
{
if (pSource->get_crc(&crc) == S_OK &&
pSource->get_sourceCompression(&compressionType) == S_OK &&
pSource->get_length(&codeLength) == S_OK)
{
wprintf(L" crc = %lu\n", crc);
wprintf(L" code length = %I64u\n",codeLength);
wprintf(L" compression type code = %lu\n", compressionType);
}
wprintf(L" source filename: ");
if (pSource->get_filename(&sourceFilename) == S_OK)
{
wprintf(L"%s", sourceFilename);
}
else
{
wprintf(L"<none>");
}
wprintf(L"\n");
wprintf(L" object filename: ");
if (pSource->get_filename(&objectFilename) == S_OK)
{
wprintf(L"%s", objectFilename);
}
else
{
wprintf(L"<none>");
}
wprintf(L"\n");
wprintf(L" virtual filename: ");
if (pSource->get_filename(&virtualFilename) == S_OK)
{
wprintf(L"%s", virtualFilename);
}
else
{
wprintf(L"<none>");
}
wprintf(L"\n");
SysFreeString(sourceFilename);
SysFreeString(objectFilename);
SysFreeString(virtualFilename);
}
}
Requirements
Header: Dia2.h
Library: diaguids.lib
DLL: msdia80.dll