Debug Interface Access SDK

Debug Interface Access SDK

The Microsoft® Debug Interface Access Software Development Kit (DIA SDK) provides access to debug information stored in .pdb files generated by Microsoft post-compiler tools. Because the format of the .pdb file generated by the post-compiler tools undergoes constant revision, exposing the format is impractical. Using the DIA API, you can search for and browse debug information stored in a .pdb file to develop applications that can report stack trace-back information and analyze performance data.

In the DIA SDK Documentation

Getting Started
Read an overview of the DIA SDK features and learn how to install the DIA SDK files.
Querying the .pdb File
Learn how to use the DIA API to query the .pdb file.
Symbols and Symbol Tags
Learn about how symbols and symbol tags are used in the DIA API.
API Reference
Find information about the syntax, parameters, and return values of the DIA API.
Dia2dump Sample
Examine a sample that illustrates how to use the DIA API to search for and browse debug information.

Additional Information

TBW

© 1987-2000 Microsoft Corporation. All rights reserved.


Getting Started

[This is preliminary documentation and subject to change]

The DIA SDK supplies you with instructional documentation and a sample that illustrates how to use the DIA API. With the DIA SDK, you can search for and browse debug information stored in a .pdb file to develop custom applications.

To get the most out of the DIA SDK, you should be familiar with the following programming technologies and languages:

  • Visual Studio integrated development environment (IDE).
  • C++ programming language.

In this Section

Installation Requirements
View the installation and setup information for the DIA SDK sample.
Conceptual Overview
Learn about the basic architecture of DIA.

Related Section

Querying the .pdb File
Learn how to use the DIA API to query the .pdb file.


Installation Requirements

[Topic intentionally blank - content coming in later builds]


Querying the .pdb File

[Topic intentionally blank - content coming in later builds]

To query the .pdb file
  1. Acquire a datasource by creating an IDiaDataSource.
  2. Call IDiaDataSource::openSession to open an IDiaSession.
  3. Use the methods in IDiaSession to query for the symbols in the datasource.
  4. Use the enumerator interfaces to scan through the sequence of symbols or other elements of debug information.


Symbols and Symbol Tags

Debug information about a compiled program is stored in the .pdb file as symbols that are accessible using the DIA SDK APIs. All symbols have a symTag and a symIndexId. The symTag value indicates the kind of symbol as defined by the SymTagEnum enumeration. The symIndexId property is a DWORD type unique identifier for every instance of a symbol.

Symbols also have properties that contain additional information about the symbol or references to other symbols. The tables below outline the properties that may have relevant information or references to other symbols, for each of the different kinds of symbols. If no error occurs, and the symbol property has a value, the properties “get_” method returns S_OK. A return value of S_FALSE indicates that the property is not valid for the current symbol.

Most symbols contain properties that return references to other symbols, most often a lexicalParent or classParent. All properties that return references return them as type IDiaSymbol*, and are always paired with another property named the same but suffixed with “Id”, for example, lexicalParentId and classParentId. The "Id" property returns a DWORD value that contains the unique identifier for the symbol. In the tables below the “Id” properties are omitted.

For additional information about symbols and locations, see Symbol Locations.

The symbols described are organized into two sections, which describe the Lexical Hierarchy of Symbol Types and the Class Hierarchy of Symbol Types.


Symbol Locations

Certain symbols, for example, functions and data, have a location as described in the LocationType enumeration. Several properties are used to further describe the symbol. The locationType value determines the additional properties relevant for the symbol. The following table lists the most commonly used location types and the additional properties to reference to further describe the memory location.

Location Type | Description
LocIsStatic | Static location in memory, refer to iSect and iSectOffset
LocIsTLS | Located in thread local storage, refer to iSect and iSectOffset
LocIsRegRel | Register relative, refer to registerId and offset.
LocIsThisRel | Object pointer relative, refer to offset.
LocIsEnregistered | Location is in a register, refer to registerId.
LocIsBitField | Location is in a bitfield, refer to bitPosition and length.
LocIsSlot | MSIL local variable, refer to slot.
LocInMetaData | Location must be queried from metadata, refer to token.
LocIsIlRel | Location is relative to an MSIL location as referenced by the enclosing method’s metadata token, refer to offset. iSect and iSectOffset are consistent with the line number information.


Lexical Hierarchy of Symbol Types

The following table describes the symbols types in the lexical heirarchy.

Lexical Unit | Description
Exe | Symbol for the global scope of the data.
Compiland | Symbol for each compiland linked into the exe.
CompilandDetails | Symbol for the compiland data that can be returned with and without loading additional compiland data.
CompilandEnv | Symbol for the additional environment variables in the symbols.
Function | Symbol for a function.
Block | Symbol for defining nested scopes in functions.
Data | Symbol for all variables, including parameters, local variables, global variables, and class members.
Constant | Symbol for numeric, string, date, etc. constants and enum values
Label | Symbol for A location in program code.
PublicSymbol | Symbol for a public symbol that the linker sees when building the executable.
FuncDebugStart | Symbol used if a function has a defined point at which debugging is to begin.
FuncDebugEnd | Symbol used a function has a defined point at which debugging is to end.


Block

Used for defining nested scopes in functions.

The following table lists the additional properties that are valid for this symbol type.

Property | Value | Description
lexicalParent | IDiaSymbol* | The enclosing block or function’s symbol.
locationType | DWORD | Blocks have static location.
iSect | DWORD | Section part of location.
iSectOffset | DWORD | Offset part of location.
length | ULONGLONG | Number of bytes of code (starting from location).


Compiland

There is one symbol with SymTagCompiland for each compiland linked into the exe. The compiland information is split between SymTagCompilandDetails and SymTagCompiland symbols. The split reflects the difference between data that can be returned with and without loading additional compiland data.

The following table lists the additional properties that are valid for this symbol type.

Property | Value | Description
name | BSTR | File name of the compiland’s object file.
lexicalParent | IDiaSymbol* | The exe’s symbol.
compLibName | BSTR | File name of the library (or object file) where object was loaded from.
compSourceFile | BSTR | File name of the source file.
editAndContinueEnabled | BOOL | True if edit and continue was enabled at compilation.


CompilandDetails

The following table lists the additional properties that are valid for this symbol type.

Property | Value | Description
lexicalParent | IDiaSymbol* | The symbol for the compiland.
editAndContinueEnabled | BOOL | True if edit and continue was enabled at compilation.
platform | DWORD | Platform compiled for.
language | DWORD | Language of source.
frontEndMajor | DWORD | Compiler front end major version number.
frontEndMinor | DWORD | Compiler front end minor version number.
frontEndBuild | DWORD | Compiler front end build number.
backEndMajor | DWORD | Compiler back end major version number.
backEndMinor | DWORD | Compiler back end minor version number.
backEndBuild | DWORD | Compiler back end build number.


CompilandEnv

The compiler may include additional environment variables in the symbols. There is one SymTagCompilandEnv symbol for each such variable.

The following table lists the additional properties that are valid for this symbol type.

Property | Value | Description
lexicalParent | IDiaSymbol* | The symbol for the compiland.
name | BSTR | The name of the variable.
value | VARIANT | The string valued contents of the variable (VT_BSTR).


Constant

Numeric, string, date, etc. constants and enum values appear as SymTagConstant symbols.

The following table lists the additional properties that are valid for this symbol type.

Property | Value | Description
lexicalParent | IDiaSymbol* | Symbol for the enclosing lexical scope. Could be compiland, function or block.
name | BSTR | The name of the constant.
classParent | IDiaSymbol* | The symbol for the enum, if this is an enum member.
type | IDiaSymbol* | The symbol for the underlying type.
value | VARIANT | The value of the constant.


Data

All variables, including parameters, local variables, global variables, and class members, are described via a SymTagData symbol.

The following table lists the additional properties that are valid for this symbol type.

Property | Value | Description
lexicalParent | IDiaSymbol* | Symbol for the enclosing lexical scope. Could be compiland, function or block.
name | BSTR | The name of the variable.
classParent | IDiaSymbol* | The symbol for the class, if this is a struct, union or class field.
type | IDiaSymbol* | The symbol for the variable type.
locationType | DWORD | Any of the allowable location types.
iSect | DWORD | Section part of location. Present according to locationType.
iSectOffset | DWORD | Offset part of location. Present according to locationType.
bitPosition | DWORD | Bit position of location. Present according to locationType.
register | DWORD | Register designator of location. Present according to locationType.
offset | LONG | Offset from register contents. Present according to locationType.
length | ULONGLONG | Length of bitfield. Present according to locationType.
access | DWORD | If a field then one of CV_public, CV_private, CV_protect.


Exe

A data source contains the symbols for one exe or dll. Therefore it contains one symbol with tag SymTagExe. This is the only symbol without a either a lexical or class parent. IDiaSession::get_globalScope returns the symbol.

The following table lists the additional properties that are valid for this symbol type.

Property | Value | Description
name | BSTR | File name of the exe.
symbolsFileName | BSTR | Full path for the exe’s PDB (or DBG) file.
name | BSTR | File name and extension part of the exe’s symbolFileName.


Function

Each function is represented by a SymTagFunction symbol.

The following table lists the additional properties that are valid for this symbol type.

Property | Value | Description
lexicalParent | IDiaSymbol* | The enclosing compiland’s symbol.
name | BSTR | The name of the function.
classParent | IDiaSymbol* | The symbol for the class, if this is a member function.
locationType | DWORD | Functions have static or metadata locations
type | IDiaSymbol* | The symbol for the function signature (SymTagFunctionType).
iSect | DWORD | Section part of location.
iSectOffset | DWORD | Offset part of location.
token | DWORD | Metadata token for the function.
length | ULONGLONG | Number of bytes of function code (starting from location).
access | DWORD | If a member function then one of CV_public, CV_private, CV_protected.
virtualBaseOffset | DWORD | If a virtual function then the offset in the virtual function table.
virtual | BOOL | True if a virtual function.
intro | BOOL | True if a function is intro virtual .
pure | BOOL | True if function is pure virtual.


FuncDebugEnd

If a function has a defined point at which debugging is to end, then a SymTagFuncDebugEnd child for the function indicates this.

The following table lists the additional properties that are valid for this symbol type.

Property | Value | Description
lexicalParent | IDiaSymbol* | The enclosing function’s symbol.
locationType | DWORD | End points have static location.
iSect | DWORD | Section part of location.
iSectOffset | DWORD | Offset part of location.


FuncDebugStart

If a function has a defined point at which debugging is to begin, then a SymTagFuncDebugStart child for the function indicates this.

The following table lists the additional properties that are valid for this symbol type.

Property | Value | Description
lexicalParent | IDiaSymbol* | The enclosing function’s symbol.
locationType | DWORD | Start points have static location.
iSect | DWORD | Section part of location.
iSectOffset | DWORD | Offset part of location.


Label

A location in program code.

The following table lists the additional properties that are valid for this symbol type.

Property | Value | Description
lexicalParent | IDiaSymbol* | The enclosing compiland, block or function’s symbol.
locationType | DWORD | Labels have static location.
iSect | DWORD | Section part of location.
iSectOffset | DWORD | Offset part of location.


PublicSymbol

Each public symbol that the linker sees when building the exe appears as a SymTagPublicSymbol. At a minimum all global functions and data appear as public symbols.

The following table lists the additional properties that are valid for this symbol type.

Property | Value | Description
lexicalParent | IDiaSymbol* | Symbol for the global scope (SymTagExe).
name | BSTR | The name of the public symbol.
locationType | DWORD | Public symbols have static location.
iSect | DWORD | Section part of location.
iSectOffset | DWORD | Offset part of location.
code | BOOL | True if the symbol’s location is in code.
function | BOOL | True if the symbol is a function.
managed | BOOL | True if the symbol’s location is in managed code.
msil | BOOL | True if the symbol’s location is in MSIL code.


Class Hierarchy of Symbol Types

All types have a lexical parent, but except for scoped types the lexical parent is the global scope. Most of the types in the class hierarchy, except those explicitly stated otherwise, have a class parent and may have one or more of the following attribute modifiers.

Property | Value | Description
lexicalParent | IDiaSymbol* | Symbol for the enclosing lexical scope, usually the global scope.
classParent | IDiaSymbol* | The symbol for the outer udt, if this is a nested definition.
volatileType | BOOL | True if volatile attribute is present.
constType | BOOL | True if const attribute is present
unalignedType | BOOL | True if unaligned attribute is present
access | DWORD | One of CV_public, CV_private, CV_protected, as defined in CV_access_e

The following table describes the symbol types in the class hierarchy.

Class Unit | Description
UDT | Symbol used to represent each class, struct, and union.
Enum | Symbol for enumerated types.
PointerType | Symbol for pointer types.
ArrayType | Symbol for array types.
BaseType | Symbol for base types.
Typedef | Symbol that introduces names for other types
BaseClass | Symbol used for each base class of a udt
Friend | Symbol for friend classes and friend functions.
FunctionType | Symbol for each unique function signature .
FunctionArgType | Symbol used for each parameter to a function


ArrayType

An array type is represented by a symbol of type SymTagArray.

The following table lists the additional properties that are valid for this symbol type.

Property | Value | Description
type | IDiaSymbol* | The symbol for the array element type.
length | LONGLONG | The size, in bytes, of this array.
arrayIndexType | IDiaSymbol* | Symbol for the array index type.


BaseClass

Each base class for udt is represented by a child with SymTagBaseClass. Although the type property contains the symbol for the underlying udt, all fields of that udt are available as part of this symbol.

The following table lists the additional properties that are valid for this symbol type.

Property | Value | Description
type | IDiaSymbol* | The symbol for the base class udt.
virtualBaseClass | BOOL | True if this is a virtual base class.
indirectVirtualBaseClass | BOOL | True if this is an indirect base class.
virtualBasePointerOffset | LONG | Offset of the virtual base pointer.
virtualBaseDispIndex | DWORD | Index into the virtual base displacement table.


BaseType

Base types are represented by SymTagBaseType rows.

The following table lists the additional properties that are valid for this symbol type.

Property | Value | Description
length | LONGLONG | The size, in bytes, of the type.
baseType | DWORD | One of enum BasicType.


Enum

Enumerated types are represented with SymTagEnum symbols. Each enum value appears as a class child of type SymTagConstant.

The following table lists the additional properties that are valid for this symbol type.

Property | Value | Description
name | BSTR | The name of the enum.
type | IDiaSymbol* | The symbol for the underlying type.
nested | BOOL | True if the udt is nested.
scoped | BOOL | True if the udt appears in a non-global lexical scope.


Friend

Friend classes and friend functions appear as SymTagFriend children of parent udts. No additional attribute properties are available.

The following table lists the additional properties that are valid for this symbol type.

Property | Value | Description
name | BSTR | The name of the class or function.
classParent | IDiaSymbol* | The symbol for the udt parent..
type | IDiaSymbol* | The symbol for the class or function.


FunctionArgType

Each parameter to a function is represented by a SymTagFunctionArgType child of the SymTagFunctionType parent. No additional attribute properties are available.

The following table lists the additional properties that are valid for this symbol type.

Property | Value | Description
classParent | IDiaSymbol* | The symbol for the function type parent.
type | IDiaSymbol* | The type of the parameter.


FunctionType

Each unique function signature appears as a SymTagFunctionType symbol. Each parameter appears as a class child of type SymTagFunctionArgType. No additional attribute properties are available.

The following table lists the additional properties that are valid for this symbol type.

Property | Value | Description
type | IDiaSymbol* | The symbol for the return value type.
count | DWORD | Number of parameters to the function.
callingConvention | DWORD | Calling convention. One of enum CV_call_e.


PointerType

Each pointer type appears as a SymTagPointerType symbol.

The following table lists the additional properties that are valid for this symbol type.

Property | Value | Description
type | IDiaSymbol* | The symbol for the object pointed to.
reference | BOOL | True if pointer is a reference type.


Typedef

Symbols with SymTagTypedef introduce names for other types. This symbol does not have additional attribute properties.

The following table lists the additional properties that are valid for this symbol type.

Property | Value | Description
name | BSTR | The name of the typedef.
type | IDiaSymbol* | The symbol for the underlying type.


UDT

Each class, struct, and union is represented by a SymTagUDT symbol. Each member: function, data, or nested type, and each base class, appears as a class child.

The following table lists the additional properties that are valid for this symbol type.

Property | Value | Description
name | BSTR | The name of the udt.
length | LONGLONG | The size, in bytes, of the udt.
packed | BOOL | True if the udt is packed.
constructor | BOOL | True if the udt has a constructor.
overloadedOperator | BOOL | True if overloaded operators are defined for the udt.
nested | BOOL | True if the udt is nested.
hasNestedTypes | BOOL | True if the udt has nested type definitions.
hasAssignmentOperator | BOOL | True if the udt has any assignment operators defined.
hasCastOperator | BOOL | True if the udt has any cast operators defined.
scoped | BOOL | True if the udt appears in a non-global lexical scope.


API Reference


Interfaces


IDiaDataSource

Initiates access to a source of debugging symbols. Obtained by calling the CoCreateInstance method with the class identifier CLSID_DiaSource.

IDiaDataSource : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaDataSource.

Method | Description
get_lastError | Retrieves the filename for the last load error.
loadDataFromPdb | Open and prepare a pdb file as a debug data source.
loadAndValidateDataFromPdb | Open and verify the pdb file matches the signature information provided, prepare the pdb file as a debug data source.
loadDataForExe | Open and prepare the debug data associated with the exe/dll file.
loadDataFromIStream | Prepare the debug data stored in a pdb accessed via an IStream.
openSession | Opens a session for querying symbols.

Remarks

A call to one of the load methods of IDiaDataSource opens the symbol source. A succeeding call to openSession returns an IDiaSession interface that supports querying the data source. If the load method returns a file related error then the get_lastError return value will contain the filename associated with the error.

Requirements

Header: Dia2.h

Example

   IDiaDataSource* pSource;
   CoCreateInstance(CLSID_DiaSource, NULL, CLSCTX_INPROC_SERVER,    IID_IDiaDataSource, (void**) &pSource);


IDiaDataSource::get_lastError

Retrieves the text for the last load error.

HRESULT get_lastError (
   BSTR* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a BSTR that contains the filename associated with the last load error.

Example

BSTR error;
pSource->get_lastError( &error );


IDiaDataSource::loadAndValidateDataFromPdb

Opens and verifies that the pdb file matches the signature information provided and prepares the pdb file as a debug data source.

HRESULT loadAndValidateDataFromPdb(
   LPCOLESTR pdbPath
   GUID* pcsig70,
   DWORD sig,
   DWORD age
);

Parameters

pdbPath
[in] Null-terminated string that contains the path to the .pdb file.
pcsig70
[in] signature GUID to verify against pdb signature (only VC7 and later pdb files have GUID signatures).
sig
[in] DWORD GUID to verify against pdb signature.
age
[in] Age value to verify.

Return Values

The following table shows possible HRESULT return values for loadAndValidateDataFromPdb.

Value | Description
S_OK | Success.
E_PDB_NOT_FOUND | Failed to open the file, or the file has an invalid format.
E_PDB_FORMAT | Attempt to access a pdb with obsolete format.
E_PDB_INVALID_SIG | Signature does not match.
E_PDB_INVALID_AGE | Age does not match.
E_INVALIDARG | Invalid wszPDB pointer.
E_UNEXPECTED | The data source has already been prepared.

Remarks

A pdb contains both signature and age values. These values are replicated in the exe/dll that matches the pdb. Before preparing the data source, this method verifies that the named pdb file’s signature and age match the values provided.

Example

pSource->loadAndValidateDataFromPdb( L”myprog.pdb”, &guid, sig, age );

See Also

© 1987-2000 Microsoft Corporation. All rights reserved.


IDiaDataSource::loadDataForExe

Opens and prepares the debug data associated with the exe/dll file. The debug header of the exe/dll names the associated debug data location.

HRESULT loadDataForExe (
   LPCOLESTR executable
   LPCOLESTR searchPath,
   IUnknown* pCallback
);

Parameters

executable
[in] Path to the exe or dll.
searchPath
[in] Alternate path to search for debug data.
pCallback
[in] Pointer to an IUnknown for an object that supports a debug callback interface, such as IDiaLoadCallback, IDiaReadExeAtOffsetCallback, and/or IDiaReadExeAtRVACallback.

Return Values

The following table shows possible HRESULT return values for loadDataForExe.

Value | Description
S_OK | Success.
E_PDB_NOT_FOUND | Failed to open the file, or the file has an invalid format.
E_PDB_FORMAT | Attempt to access a pdb with obsolete format.
E_PDB_INVALID_SIG | Signature does not match.
E_PDB_INVALID_AGE | Age does not match.
E_INVALIDARG | Invalid wszPDB pointer.
E_UNEXPECTED | The data source has already been prepared.

Remarks

This method reads the debug header and then finds and prepares the debug data. Many locations may be searched for data. The progress of the search may, optionally, be reported via callbacks. Optional callbacks also support reading data from the executable when the executable cannot be accessed directly via file I/O.

Example

class MyCallBack: public IDiaLoadCallback
{
…
};
MyCallBack callback;
…
pSource->loadDataForExe( L”myprog.pdb”, L”.\debug”, (IUnknown*)&callback);

See Also

© 1987-2000 Microsoft Corporation. All rights reserved.


IDiaDataSource::loadDataFromIStream

Prepare the debug data stored in a pdb accessed via an IStream.

HRESULT loadDataFromIStream(
   IStream* pIStream
);

Parameters

pIStream
[in] Pointer to the IStream.

Return Value

The following table shows possible HRESULT return values for loadDataFromIStream.

Value | Description
S_OK | Success.
E_PDB_FORMAT | Attempt to access a pdb with obsolete format.
E_INVALIDARG | Invalid pIStream pointer.
E_UNEXPECTED | The data source has already been prepared.

See Also

© 1987-2000 Microsoft Corporation. All rights reserved.


IDiaDataSource::loadDataFromPdb

Open and prepare a pdb file as a debug data source.

HRESULT loadDataFromPdb (
   LPCOLESTR pdbPath
);

Parameters

pdbPath
[in] Null-terminated string that contains the path to the .pdb file.

Return Value

The following table shows possible HRESULT return values for loadDataFromPdb.

Value | Description
S_OK | Success.
E_PDB_NOT_FOUND | Failed to open the file, or the file has an invalid format.
E_PDB_FORMAT | Attempt to access a pdb with obsolete format.
E_INVALIDARG | Invalid wszPDB pointer.
E_UNEXPECTED | The data source has already been prepared.

Example

pSource->loadDataFromPdb( L”myprog.pdb” );


IDiaDataSource::openSession

Opens an IDiaSession object for this data source.

HRESULT openSession (
   IDiaSession** ppSession
);

Parameters

ppSession
[out] Pointer to a reference to the open IDiaSession interface.

Return Value

The following table shows possible HRESULT return values for openSession.

Value | Description
S_OK | Success.
E_UNEXPECTED | IDiaDataSource has not previously been initialized with a source of symbols.
E_INVALIDARG | Invalid ppSession parameter.
E_OUTOFMEMORY | Insufficient memory to open the session.

Remarks

IDiaSession objects implement queries into the data source. A session manages one address space for a set of debug symbols. If the exe or dll that the data source symbols describe is active in multiple address ranges (for instance, because multiple processes have it loaded) then one session for each address range should be used.

Example

IDiaSession* pSession;
pSource->openSession( &pSession );

See Also

IDiaSession


IDiaEnumDebugStreamData

Enumerates the various DebugStreamData contained in the data source.

Methods in Vtable Order

The following table shows the methods of IDiaEnumDebugStreamData.

Method | Description
get__NewEnum | Retrieves the IEnumVARIANT version of this enumerator.
get_Count | Retrieves the number of DebugStreamData items.
Item | Retrieves a DebugStreamData item by means of an index.
Next | Retrieves a specified number of DebugStreamData items in the enumeration sequence.
Skip | Skips a specified number of DebugStreamData items in an enumeration sequence.
Reset | Resets an enumeration sequence to the beginning.
Clone | Creates an enumerator that contains the same enumeration state as the current enumerator.

Requirements

Header: Dia2.h

See Also

© 1987-2000 Microsoft Corporation. All rights reserved.


IDiaEnumDebugStreamData::Clone

Creates an enumerator that contains the same enumeration state as the current enumerator.

HRESULT Clone (
   IDiaEnumDebugStreamData** ppenum
);

Parameters

ppenum
[out] Pointer to the return reference to the IDiaEnumDebugStreamData interface of the clone of the enumerator.


IDiaEnumDebugStreamData::get__NewEnum

Retrieves the IEnumVARIANT version of this enumerator.

HRESULT get__NewEnum (
   IUnknown** pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a return reference to the IUnknown interface that represents the IEnumVARIANT version of this enumerator.


IDiaEnumDebugStreamData::get_Count

Retrieves the number of DebugStreamData items.

HRESULT get_Count (
   LONG* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a LONG that contains the number of DebugStreamData items.


IDiaEnumDebugStreamData::Item

Retrieves a DebugStreamData item by means of an index.

HRESULT Item (
   DWORD index
   DWORD cbData
   DWORD* pcbData
   BYTE data[]
);

Parameters

index
[in] Index of the interface to be retrieved. DWORD that must be in the range from 0 to count-1, where count is as returned by IDiaEnumDebugStreamData::get_Count.
cbData
[in] Count of bytes that represent the size of the data buffer.
pcbData
[out] Pointer to the count of bytes that represent the bytes returned. If data is NULL, then total number of bytes of data available.
data[]
[out, size_is(cbData),length_is(*pcbData)] Pointer to a buffer that contains the DebugStreamData bytes.

See Also

© 1987-2000 Microsoft Corporation. All rights reserved.


IDiaEnumDebugStreamData::Next

Retrieves a specified number of DebugStreamData items in the enumeration sequence.

HRESULT Next (
   ULONG celt,
   DWORD cbData
   DWORD* pcbData
   BYTE data[]
   ULONG* pceltFetched
);

Parameters

celt
[in] ULONG that contains the number of DebugStreamData items in the enumerator to be retrieved.
cbData
[in] Count of bytes that represent the size of the data buffer.
pcbData
[out] Pointer to the count of bytes that represent the bytes returned. If data is NULL then total number of bytes of data available.
data[]
[out, size_is(cbData),length_is(*pcbData)] Pointer to buffer to contain the DebugStreamData bytes.
pceltFetched
[in, out] Pointer to a ULONG that contains the number of DebugStreamData items in the fetched enumerator.


IDiaEnumDebugStreamData::Reset

Resets an enumeration sequence to the beginning.

HRESULT Reset ();


IDiaEnumDebugStreamData::Skip

Skips a specified number of DebugStreamData items in an enumeration sequence.

HRESULT Skip (
   ULONG celt
);

Parameters

celt
[in] ULONG that contains the number of DebugStreamData items in the enumeration sequence to skip.


IDiaEnumDebugStreams

Enumerates the various debug streams contained in the data source. Debug streams contents are implementation dependent and the data formats are undocumented.

IDiaEnumDebugStreams : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaEnumDebugStreams.

Method | Description
get__NewEnum | Retrieves the IEnumVARIANT version of this enumerator.
get_Count | Retrieves the number of debug streams.
Item | Retrieves a debug stream by means of an index or name.
Next | Retrieves a specified number of debug streams in the enumeration sequence.
Skip | Skips a specified number of debug streams in an enumeration sequence.
Reset | Resets an enumeration sequence to the beginning.
Clone | Creates an enumerator that contains the same enumeration state as the current enumerator.

Requirements

Header: Dia2.h


IDiaEnumDebugStreams::Clone

Creates an enumerator that contains the same enumeration state as the current enumerator.

HRESULT Clone (
   IDiaEnumDebugStreams** ppenum
);

Parameters

ppenum
[out] Pointer to a reference to the IDiaEnumDebugStreams interface of the clone of the enumerator.

See Also

IDiaEnumDebugStreams


IDiaEnumDebugStreams::get__NewEnum

Retrieves the IEnumVARIANT version of this enumerator.

HRESULT get__NewEnum (
   IUnknown** pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a reference to the IUnknown interface that represents the IEnumVARIANT version of this enumerator.


IDiaEnumDebugStreams::get_Count

Retrieves the number of debug streams.

HRESULT get_Count(
   LONG* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a LONG that contains the number of debug streams.


IDiaEnumDebugStreams::Item

Retrieves a debug stream by means of an index or name.

HRESULT Item (
   VARIANT index
   IDiaDebugStream** stream
);

Parameters

index
[in] Index of the IDiaDebugStream to be retrieved. If an integer variant is given then it must be in the range 0..count-1, where count is as returned by IDiaEnumDebugStreams::get_Count.
stream
[out, retval] Return reference to the IDiaEnumDebugStreamData interface of the retrieved debug stream.

Example

   VARIANT var;
   var.vt == VT_BSTR;
   var.bstrVal = SysAllocString(DiaDebugStream_DebugStreams );
   IDiaDebugStream* pDebugStream;
   pEnumDebugStreams->Item( var, &pDebugStream );

See Also

© 1987-2000 Microsoft Corporation. All rights reserved.


IDiaEnumDebugStreams::Next

Retrieves a specified number of debug streams in the enumeration sequence.

HRESULT Next (
   ULONG celt,
   IDiaEnumDebugStreamData** rgelt,
   ULONG* pceltFetched
);

Parameters

celt
[in] ULONG that contains the number of debug streams in the enumerator to be retrieved.
rgelt
[out] Array of IDiaEnumDebugStreamData interfaces that represents the debug streams being retrieved.
pceltFetched
[out] Pointer to a ULONG that contains the number of debug streams in the fetched enumerator.


IDiaEnumDebugStreams::Reset

Resets an enumeration sequence to the beginning.

HRESULT Reset ();


IDiaEnumDebugStreams::Skip

Skips a specified number of debug streams in an enumeration sequence.

HRESULT Skip (
   ULONG celt
);

Parameters

celt
[in] ULONG that contains the number of debug streams in the enumeration sequence to skip.


IDiaEnumFrameData

Enumerates the various frame data elements contained in the data source.

IDiaEnumFrameData : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaEnumFrameData.

Method | Description
get__NewEnum | Retrieves the IEnumVARIANT version of this enumerator.
get_Count | Retrieves the number of frame data elements.
Item | Retrieves a frame data element by means of an index or name.
Next | Retrieves a specified number of frame data elements in the enumeration sequence.
Skip | Skips a specified number of frame data elements in an enumeration sequence.
Reset | Resets an enumeration sequence to the beginning.
Clone | Creates an enumerator that contains the same enumeration state as the current enumerator.

Requirements

Header: Dia2.h


IDiaEnumFrameData::Clone

Creates an enumerator that contains the same enumeration state as the current enumerator.

HRESULT Clone(
   IDiaEnumFrameDatas** ppenum
);

Parameters

ppenum
[out] Pointer to a reference to the IDiaEnumFrameData interface of the clone of the enumerator.

See Also

IDiaEnumFrameData


IDiaEnumFrameData::get__NewEnum

Retrieves the IEnumVARIANT version of this enumerator.

HRESULT get__NewEnum (
   IUnknown** pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a reference to the IUnknown interface that represents the IEnumVARIANT version of this enumerator.


IDiaEnumFrameData::get_Count

Retrieves the number of frame data elements.

HRESULT get_Count (
   LONG* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a LONG that contains the number of frame data elements.


IDiaEnumFrameData::Item

Retrieves a frame data element by means of an index or name.

HRESULT Item (
   VARIANT index
   IDiaFrameData** section
);

Parameters

index
[in] Index of the IDiaFrameData to be retrieved. If an integer variant is specified then it must be in the range 0..count-1, where count is as returned by IDiaEnumFrameData::get_Count.
section
[out, retval] Return reference to the IDiaFrameData interface of the retrieved frame data element.

Example

VARIANT var;
var.vt == VT_BSTR;
var.bstrVal = SysAllocString(DiaFrameData_FrameDatas );
IDiaFrameData* pFrameData;
pEnumFrameDatas->Item( var, &pFrameData );

See Also

IDiaFrameData


IDiaEnumFrameData::Next

Retrieves a specified number of frame data elements in the enumeration sequence.

HRESULT Next (
   ULONG celt,
   IDiaFrameData** rgelt,
   ULONG* pceltFetched
);

Parameters

celt
[in] ULONG that contains the number of frame data elements in the enumerator to be retrieved.
rgelt
[out] Array of IDiaFrameData interfaces that represents the frame data element being retrieved.
pceltFetched
[out] Pointer to a ULONG that contains the number of frame data elements in the fetched enumerator.

See Also

IDiaFrameData


IDiaEnumFrameData::Reset

Resets an enumeration sequence to the beginning.

HRESULT Reset();


IDiaEnumFrameData::Skip

Skips a specified number of frame data elements in an enumeration sequence.

HRESULT Skip (
   ULONG celt
);

Parameters

celt
[in] ULONG that contains the number of frame data elements in the enumeration sequence to skip.


IDiaEnumInjectedSources

Enumerate the various injected sources contained in the data source.

IDiaEnumInjectedSources : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaEnumInjectedSources.

Method | Description
get__NewEnum | Retrieves the IEnumVARIANT version of this enumerator.
get_Count | Retrieves the number of injected sources.
Item | Retrieves an injected sources by means of an index or name.
Next | Retrieves a specified number of injected sources in the enumeration sequence.
Skip | Skips a specified number of injected sources in an enumeration sequence.
Reset | Resets an enumeration sequence to the beginning.
Clone | Creates an enumerator that contains the same enumeration state as the current enumerator.

Requirements

Header: Dia2.h


IDiaEnumInjectedSources::Clone

Creates an enumerator that contains the same enumeration state as the current enumerator.

HRESULT Clone (
   IDiaEnumInjectedSources** ppenum
);

Parameters

ppenum
[out] Pointer to a reference to the IDiaEnumInjectedSources interface of the clone of the enumerator.

See Also

IDiaEnumInjectedSources


IDiaEnumInjectedSources::get__NewEnum

Retrieves the IEnumVARIANT version of this enumerator.

HRESULT get__NewEnum (
   IUnknown** pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a reference to the IUnknown interface that represents the IEnumVARIANT version of this enumerator.


IDiaEnumInjectedSources::get_Count

Retrieves the number of injected sources.

HRESULT get_Count (
   LONG* pRetVal
);

Parameters

pRetVal
[out, retval] LONG that contains the number of injected sources.


IDiaEnumInjectedSources::Item

Retrieves an injected source by means of an index or name.

HRESULT Item (
   VARIANT index
   IDiaInjectedSource** injectedSource
);

Parameters

index
[in] Index of the IDiaInjectedSource to be retrieved. If an integer variant is specified then it must be in the range 0..count-1, where count is as returned by IDiaEnumInjectedSources::get_Count.
injectedSource
[out, retval] Return reference to the IDiaInjectedSource interface of the retrieved injected source.

Example

   VARIANT var;
   var.vt == VT_BSTR;
   var.bstrVal = SysAllocString(DiaInjectedSource_InjectedSources );
   IDiaInjectedSource* pInjectedSource;
   pEnumInjectedSources->Item( var, &pInjectedSource );

See Also

IDiaInjectedSource


IDiaEnumInjectedSources::Next

Retrieves a specified number of injected sources in the enumeration sequence.

HRESULT Next (
   ULONG celt,
   IDiaInjectedSource** rgelt,
   ULONG* pceltFetched
);

Parameters

celt
[in] ULONG that contains the number of injected sources in the enumerator to be retrieved.
rgelt
[out] Array of IDiaInjectedSource interfaces that represents the injected sources being retrieved.
pceltFetched
[out] Pointer to a ULONG that contains the number of injected sources in the fetched enumerator.

See Also

IDiaInjectedSource


IDiaEnumInjectedSources::Reset

Resets an enumeration sequence to the beginning.

HRESULT Reset();


IDiaEnumInjectedSources::Skip

Skips a specified number of injected sources in an enumeration sequence.

HRESULT Skip (
   ULONG celt
);

Parameters

celt
[in] ULONG that contains the number of injected sources in the enumeration sequence to skip.


IDiaEnumLineNumbers

Enumerates the various line numbers contained in the data source.

IDiaEnumLineNumbers : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaEnumLineNumbers.

Method | Description
get__NewEnum | Retrieves the IEnumVARIANT version of this enumerator.
get_Count | Retrieves the number of line numbers.
Item | Retrieves a line number by means of an index or name.
Next | Retrieves a specified number of line numbers in the enumeration sequence.
Skip | Skips a specified number of line numbers in an enumeration sequence.
Reset | Resets an enumeration sequence to the beginning.
Clone | Creates an enumerator that contains the same enumeration state as the current enumerator.

Requirements

Header: Dia2.h


IDiaEnumLineNumbers::Clone

Creates an enumerator that contains the same enumeration state as the current enumerator.

HRESULT Clone (
   IDiaEnumLineNumbers** ppenum
);

Parameters

ppenum
[out] Pointer to a reference to the IDiaEnumLineNumbers interface of the clone of the enumerator.

See Also

IDiaEnumLineNumbers


IDiaEnumLineNumbers::get__NewEnum

Retrieves the IEnumVARIANT version of this enumerator.

HRESULT get__NewEnum (
   IUnknown** pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a reference to the IUnknown interface that represents the IEnumVARIANT version of this enumerator.


IDiaEnumLineNumbers::get_Count

Retrieves the number of line numbers.

HRESULT get_Count (
   LONG* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a LONG that contains the number of line numbers.


IDiaEnumLineNumbers::Item

Retrieves a line number by means of an index or name.

HRESULT Item (
   VARIANT index
   IDiaLineNumber** lineNumber
);

Parameters

index
[in] Index of the IDiaLineNumber to be retrieved. If an integer variant is specified then it must be in the range 0..count-1, where count is as returned by IDiaEnumLineNumbers::get_Count.
lineNumber
[out, retval] Return reference to the IDiaLineNumber interface of the retrieved line number.

Example

   VARIANT var;
   var.vt == VT_BSTR;
   var.bstrVal = SysAllocString(DiaLineNumber_LineNumbers );
   IDiaLineNumber* pLineNumber;
   pEnumLineNumbers->Item( var, &pLineNumber );

See Also

IDiaLineNumber


IDiaEnumLineNumbers::Next

Retrieves a specified number of line numbers in the enumeration sequence.

HRESULT Next (
   ULONG celt,
   IDiaLineNumber** rgelt,
   ULONG* pceltFetched
);

Parameters

celt
[in] ULONG that contains the number of line numbers in the enumerator to be retrieved.
rgelt
[out] Array of IDiaLineNumber interfaces that represents the line numbers being retrieved.
pceltFetched
[out] Pointer to a ULONG that contains the number of line numbers in the fetched enumerator.

See Also

IDiaLineNumber


IDiaEnumLineNumbers::Reset

Resets an enumeration sequence to the beginning.

HRESULT Reset();


IDiaEnumLineNumbers::Skip

Skips a specified number of line numbers in an enumeration sequence.

HRESULT Skip (
   ULONG celt
);

Parameters

celt
[in] ULONG that contains the number of line numbers in the enumeration sequence to skip.


IDiaEnumSectionContribs

Enumerates the various section contributions contained in the data source.

IDiaEnumSectionContribs : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaEnumSectionContribs.

Method | Description
get__NewEnum | Retrieves the IEnumVARIANT version of this enumerator.
get_Count | Retrieves the number of section contributions.
Item | Retrieves a section contributions by means of an index or name.
Next | Retrieves a specified number of section contributions in the enumeration sequence.
Skip | Skips a specified number of section contributions in an enumeration sequence.
Reset | Resets an enumeration sequence to the beginning.
Clone | Creates an enumerator that contains the same enumeration state as the current enumerator.

Requirements

Header: Dia2.h


IDiaEnumSectionContribs::Clone

Creates an enumerator that contains the same enumeration state as the current enumerator.

HRESULT Clone(
   IDiaEnumSectionContrib** ppenum
);

Parameters

ppenum
[out] Return reference to the IDiaEnumSectionContribs interface of the clone of the enumerator.

See Also

IDiaEnumSectionContribs


IDiaEnumSectionContribs::get__NewEnum

Retrieves the IEnumVARIANT version of this enumerator.

HRESULT get__NewEnum (
   IUnknown** pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a reference to the IUnknown interface that represents the IEnumVARIANT version of this enumerator.


IDiaEnumSectionContribs::get_Count

Retrieves the number of section contributions.

HRESULT get_Count (
   LONG* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a LONG that contains the number of section contributions.


IDiaEnumSectionContribs::Item

Retrieves a section contributions by means of an index or name.

HRESULT Item (
   VARIANT index
   IDiaSectionContrib** section
);

Parameters

index
[in] Index of the IDiaSectionContrib to be retrieved. If an integer variant is specified then it must be in the range 0..count-1, where count is as returned by IDiaEnumSectionContribs::get_Count.
section
[out, retval] Return reference to the IDiaSectionContrib interface of the retrieved section contributions.

Example

   VARIANT var;
   var.vt == VT_BSTR;
   var.bstrVal = SysAllocString(DiaSectionContrib_SectionContrib );
   IDiaSectionContrib* pSectionContrib;
   pEnumSectionContribs->Item( var, &pSectionContrib );

See Also

IDiaSectionContrib


IDiaEnumSectionContribs::Next

Retrieves a specified number of section contributions in the enumeration sequence.

HRESULT Next(
   ULONG celt,
   IDiaSectionContrib** rgelt,
   ULONG* pceltFetched
);

Parameters

celt
[in] ULONG that contains the number of section contributions in the enumerator to be retrieved.
rgelt
[out] Array of IDiaSectionContrib interfaces that represents the section contributions being retrieved.
pceltFetched
[out] ULONG pointer to the number of section contributions in the enumerator fetched.

See Also

IDiaSectionContrib


IDiaEnumSectionContribs::Reset

Resets an enumeration sequence to the beginning.

HRESULT Reset();


IDiaEnumSectionContribs::Skip

Skips a specified number of section contributions in an enumeration sequence.

HRESULT Skip(
   ULONG celt
);

Parameters

celt
[in] ULONG that contains the number of section contributions in the enumeration sequence to skip


IDiaEnumSegments

Enumerates the various segments contained in the data source.

IDiaEnumSegments : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaEnumSegments.

Method | Description
get__NewEnum | Retrieves the IEnumVARIANT version of this enumerator.
get_Count | Retrieves the number of segments.
Item | Retrieves a segment by means of an index or name.
Next | Retrieves a specified number of segments in the enumeration sequence.
Skip | Skips a specified number of segments in an enumeration sequence.
Reset | Resets an enumeration sequence to the beginning.
Clone | Creates an enumerator that contains the same enumeration state as the current enumerator.

Requirements

Header: Dia2.h


IDiaEnumSegments::Clone

Creates an enumerator that contains the same enumeration state as the current enumerator.

HRESULT Clone (
   IDiaEnumSegments** ppenum
);

Parameters

ppenum
[out] Pointer to a reference to the IDiaEnumSegments interface of the clone of the enumerator.

See Also

IDiaEnumSegments


IDiaEnumSegments::get__NewEnum

Retrieves the IEnumVARIANT version of this enumerator.

HRESULT get__NewEnum (
   IUnknown** pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a reference to the IUnknown interface that represents the IEnumVARIANT version of this enumerator.


IDiaEnumSegments::get_Count

Retrieves the number of segments.

HRESULT get_Count (
   LONG* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a LONG that contains the number of segments.


IDiaEnumSegments::Item

Retrieves a segment by means of an index or name.

HRESULT Item (
   VARIANT index
   IDiaSegment** segment
);

Parameters

index
[in] Index of the IDiaSegment to be retrieved. If an integer variant is specified then it must be in the range 0..count-1, where count is as returned by IDiaEnumSegments::get_Count.
segment
[out, retval] Return reference to the IDiaSegment interface of the retrieved segment.

Example

   VARIANT var;
   var.vt == VT_BSTR;
   var.bstrVal = SysAllocString(DiaSegment_Segments );
   IDiaSegment* pSegment;
   pEnumSegments->Item( var, &pSegment );

See Also

IDiaSegment


IDiaEnumSegments::Next

Retrieves a specified number of segments in the enumeration sequence.

HRESULT Next (
   ULONG celt,
   IDiaSegment** rgelt,
   ULONG* pceltFetched
);

Parameters

celt
[in] ULONG that contains the number of segments in the enumerator to be retrieved.
rgelt
[out] Array of IDiaSegment interfaces that represents the segments being retrieved.
pceltFetched
[out] Pointer to a ULONG that contains the number of segments in the fetched enumerator.

See Also

IDiaSegment


IDiaEnumSegments::Reset

Resets an enumeration sequence to the beginning.

HRESULT Reset ();


IDiaEnumSegments::Skip

Skips a specified number of segments in an enumeration sequence.

HRESULT Skip (
   ULONG celt
);

Parameters

celt
[in] ULONG that contains the number of segments in the enumeration sequence to skip


IDiaEnumSourceFiles

Enumerates the various source files contained in the data source.

IDiaEnumSourceFiles : IUknown

Methods in Vtable Order

The following table shows the methods of IDiaEnumSourceFiles.

Method | Description
get__NewEnum | Retrieves the IEnumVARIANT version of this enumerator.
get_Count | Retrieves the number of source files.
Item | Retrieves a source file by means of an index or name.
Next | Retrieves a specified number of source files in the enumeration sequence.
Skip | Skips a specified number of source files in an enumeration sequence.
Reset | Resets an enumeration sequence to the beginning.
Clone | Creates an enumerator that contains the same enumeration state as the current enumerator.

Requirements

Header: Dia2.h


IDiaEnumSourceFiles::Clone

Creates an enumerator that contains the same enumeration state as the current enumerator.

HRESULT Clone (
   IDiaEnumSourceFiles** ppenum
);

Parameters

ppenum
[out] Pointer to a reference to the IDiaEnumSourceFiles interface of the clone of the enumerator.

See Also

IDiaEnumSourceFiles


IDiaEnumSourceFiles::get__NewEnum

Retrieves the IEnumVARIANT version of this enumerator.

HRESULT get__NewEnum (
   IUnknown** pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a reference to the IUnknown interface that represents the IEnumVARIANT version of this enumerator.


IDiaEnumSourceFiles::get_Count

Retrieves the number of source files.

HRESULT get_Count (
   LONG* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a LONG that contains the number of source files.


IDiaEnumSourceFiles::Item

Retrieves a source file by means of an index or name.

HRESULT Item (
   VARIANT index
   IDiaSourceFile** sourceFile
);

Parameters

index
[in] Index of the IDiaSourceFile to be retrieved. If an integer variant is specified then it must be in the range 0..count-1, where count is as returned by IDiaEnumSourceFiles::get_Count.
sourceFile
[out, retval] Return reference to the IDiaSourceFile interface of the retrieved sourceFile.

Example

   VARIANT var;
   var.vt == VT_BSTR;
   var.bstrVal = SysAllocString(DiaSourceFile_Symbols );
   IDiaSourceFile* pSourceFile;
   pEnumSourceFiles->Item( var, &pSourceFile );

See Also

IDiaSourceFile


IDiaEnumSourceFiles::Next

Retrieves a specified number of source files in the enumeration sequence.

HRESULT Next (
   ULONG celt,
   IDiaSourceFile** rgelt,
   ULONG* pceltFetched
);

Parameters

celt
[in] ULONG that contains the number of source files in the enumerator to be retrieved.
rgelt
[out] Array of IDiaSourceFile interfaces that represents the source files being retrieved.
pceltFetched
[out] Pointer to a ULONG that contains the number of source files in the fetched enumerator.

See Also

IDiaSourceFile


IDiaEnumSourceFiles::Reset

Resets an enumeration sequence to the beginning.

HRESULT Reset ();


IDiaEnumSourceFiles::Skip

Skips a specified number of source files in an enumeration sequence.

HRESULT Skip (
   ULONG celt
);

Parameters

celt
[in] ULONG that contains the number of source files in the enumeration sequence to skip.


IDiaEnumSymbols

Enumerates the various symbols contained in the data source.

IDiaEnumSymbols : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaEnumSymbols.

Method | Description
get__NewEnum | Retrieves the IEnumVARIANT version of this enumerator.
get_Count | Retrieves the number of symbols.
Item | Retrieves a symbol by means of an index or name.
Next | Retrieves a specified number of symbols in the enumeration sequence.
Skip | Skips a specified number of symbols in an enumeration sequence.
Reset | Resets an enumeration sequence to the beginning.
Clone | Creates an enumerator that contains the same enumeration state as the current enumerator.

Requirements

Header: Dia2.h


IDiaEnumSymbols::Clone

Creates an enumerator that contains the same enumeration state as the current enumerator.

HRESULT Clone (
   IDiaEnumSymbols** ppenum
);

Parameters

ppenum
[out] Pointer to a reference to the IDiaEnumSymbols interface of the clone of the enumerator.

See Also

IDiaEnumSymbols


IDiaEnumSymbols::get__NewEnum

Retrieves the IEnumVARIANT version of this enumerator.

HRESULT get__NewEnum (
   IUnknown** pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a reference to the IUnknown interface that represents the IEnumVARIANT version of this enumerator.


IDiaEnumSymbols::get_Count

Retrieves the number of symbols.

HRESULT get_Count (
   LONG* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a LONG that contains the number of symbols.


IDiaEnumSymbols::Item

Retrieves a symbol by means of an index or name.

HRESULT Item (
   VARIANT index
   IDiaSymbol** symbol
);

Parameters

index
[in] Index of the IDiaSymbol to be retrieved. If an integer variant is specified then it must be in the range 0..count-1, where count is as returned by IDiaEnumSymbols::get_Count.
symbol
[out, retval] Return reference to the IDiaSymbol interface of the retrieved symbol.

Example

   VARIANT var;
   var.vt == VT_BSTR;
   var.bstrVal = SysAllocString(DiaSymbol_Symbols );
   IDiaSymbol* pSymbol;
   pEnumSymbols->Item( var, &pSymbol );

See Also

IDiaSymbol


IDiaEnumSymbols::Next

Retrieves a specified number of symbols in the enumeration sequence.

HRESULT Next (
   ULONG celt,
   IDiaSymbol** rgelt,
   ULONG* pceltFetched
);

Parameters

celt
[in] ULONG that contains the number of symbols in the enumerator to be retrieved.
rgelt
[out] Array of IDiaSymbol interfaces that represents the symbols being retrieved.
pceltFetched
[out] Pointer to a ULONG that contains the number of symbols in the fetched enumerator.

Example

   IDiaEnumSymbols* pEnum
   CComPtr< IDiaSymbol> pSym;
   DWORD celt;
   pEnum->Next( 1, &pSym, &celt );

See Also

IDiaSymbol


IDiaEnumSymbols::Reset

Resets an enumeration sequence to the beginning.

HRESULT Reset ();


IDiaEnumSymbols::Skip

Skips a specified number of symbols in an enumeration sequence.

HRESULT Skip (
   ULONG celt
);

Parameters

celt
[in] ULONG that contains the number of symbols in the enumeration sequence to skip.


IDiaEnumSymbolsbyAddr

Enumerates the various symbols contained in the data source.

IDiaEnumSymbolsbyAddr : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaEnumSymbolsbyAddr.

Method | Description
symbolByAddr | To Be Written.
symbolByRVA | To Be Written.
symbolByVA | To Be Written.
Next | To Be Written.
Prev | To Be Written.
Clone | To Be Written.

Requirements

Header: Dia2.h


IDiaEnumSymbolsbyAddr::Clone

To Be Written.

HRESULT Clone (
   IDiaEnumSymbolsbyAddr** ppenum
);

Parameters

ppenum
[out] Pointer to a reference to the IDiaEnumSymbolsbyAddr interface of the clone of the enumerator.

See Also

IDiaEnumSymbolsbyAddr


IDiaEnumSymbolsbyAddr::Next

To Be Written.

HRESULT Next (
   ULONG celt,
   IDiaSymbol** rgelt,
   ULONG* pceltFetched
);

Parameters

celt
[in] ULONG that contains the number of symbols in the enumerator to be retrieved.
rgelt
[out] Array of IDiaSymbol interfaces that represents the symbols being retrieved.
pceltFetched
[out] Pointer to a ULONG that contains the number of symbols in the fetched enumerator.

See Also

IDiaSymbol


IDiaEnumSymbolsbyAddr::Prev

To Be Written.

HRESULT Prev (
   ULONG celt,
   IDiaSymbol** rgelt,
   ULONG* pceltFetched
);

Parameters

celt
[in] ULONG that contains the number of symbols in the enumerator to be retrieved.
rgelt
[out] Array of IDiaSymbol interfaces that represents the symbols being retrieved.
pceltFetched
[out] Pointer to a ULONG that contains the number of symbols in the fetched enumerator.

See Also

IDiaSymbol


IDiaEnumSymbolsbyAddr::symbolByAddr

To Be Written.

HRESULT symbolByAddr(
   DWORD** isect
   DWORD** offsect
   IDiaSymbol** ppsymbol
);

Parameters

isect
[in] To Be Written.
offsect
[in] To Be Written.
ppsymbol
[out, retval] To Be Written.

See Also

IDiaSymbol


IDiaEnumSymbolsbyAddr::symbolByRVA

To Be Written.

HRESULT symbolByRVA(
   DWORD** relativeVirtualAddress
   IDiaSymbol** ppsymbol
);

Parameters

relativeVirtualAddress
[in] To Be Written.
ppsymbol
[out, retval] To Be Written.

See Also

IDiaSymbol


IDiaEnumSymbolsbyAddr::symbolByVA

To Be Written.

HRESULT symbolByRVA(
   DWORD** virtualAddress
   IDiaSymbol** ppsymbol
);

Parameters

virtualAddress
[in] To Be Written.
ppsymbol
[out, retval] To Be Written.

See Also

IDiaSymbol


IDiaEnumTables

Enumerates the various tables contained in the data source.

IDiaEnumTables : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaEnumTables.

Method | Description
get__NewEnum | Retrieves the IEnumVARIANT version of this enumerator.
get_Count | Retrieves the number of tables.
Item | Retrieves a table by means of an index or name.
Next | Retrieves a specified number of tables in the enumeration sequence.
Skip | Skips a specified number of tables in an enumeration sequence.
Reset | Resets an enumeration sequence to the beginning.
Clone | Creates an enumerator that contains the same enumeration state as the current enumerator.

Requirements

Header: Dia2.h


IDiaEnumTables::Clone

Creates an enumerator that contains the same enumeration state as the current enumerator.

HRESULT Clone (
   IDiaEnumTables** ppenum
);

Parameters

ppenum
[out] Pointer to a reference to the IDiaEnumTables interface of the clone of the enumerator.

See Also

IDiaEnumTables


IDiaEnumTables::get__NewEnum

Retrieves the IEnumVARIANT version of this enumerator.

HRESULT get__NewEnum (
   IUnknown** pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a reference to the IUnknown interface that represents the IEnumVARIANT version of this enumerator.


IDiaEnumTables::get_Count

Retrieves the number of tables.

HRESULT get_Count (
   LONG* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a LONG that contains the number of tables.


IDiaEnumTables::Item

Retrieves a table by means of an index or name.

HRESULT Item (
   VARIANT index
   IDiaTable** table
);

Parameters

index
[in] Index of the IDiaTable to be retrieved. If an integer variant is specified then it must be in the range 0..count-1, where count is as returned by IDiaEnumTables::get_Count.
table
[out, retval] Return reference to the IDiaTable interface of the retrieved table.

Remarks

If a string variant is specified then the string names a particular table. The name should be one of the table names as defined in Dia2.idl.

Example

   VARIANT var;
   var.vt == VT_BSTR;
   var.bstrVal = SysAllocString(DiaTable_Symbols );
   IDiaTable* pTable;
   pEnumTables->Item( var, &pTable );

See Also

IDiaTable


IDiaEnumTables::Next

Retrieves a specified number of tables in the enumeration sequence.

HRESULT Next (
   ULONG celt,
   IDiaTable** rgelt,
   ULONG* pceltFetched
);

Parameters

celt
[in] ULONG that contains the number of tables in the enumerator to be retrieved.
rgelt
[out] Array of IDiaTable interfaces that represents the tables being retrieved.
pceltFetched
[in, out] Pointer to a ULONG that contains the number of tables in the fetched enumerator.

See Also

IDiaTable


IDiaEnumTables::Reset

Resets an enumeration sequence to the beginning.

HRESULT Reset ();


IDiaEnumTables::Skip

Skips a specified number of tables in an enumeration sequence.

HRESULT Skip (
   ULONG celt
);

Parameters

celt
[in] ULONG that contains the number of tables in the enumeration sequence to skip.


IDiaFrameData

Exposes the details of a stack frame for execution points within the address range indicated by the address and block length.

IDiaFrameData : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaFrameData.

Method | Description
get_addressSection | Retrieves the section part of the code address for the frame.
get_addressOffset | Retrieves the offset part of the code address for the frame.
get_relativeVirtualAddress | Retrieves the image relative virtual address of the code for the frame.
get_virtualAddrress | Retrieves the virtual address of the code for the frame.
get_lengthBlock | Retrieves the length, in bytes, of the block of code described by the frame.
get_lengthLocals | Retrieves the number of bytes of local variables pushed on the stack.
get_lengthParams | Retrieves the number of bytes of parameters pushed on the stack.
get_maxStack | Retrieves the maximum number of bytes pushed on the stack in the frame.
get_lengthProlog | Retrieves the number of bytes of prolog code in the block.
get_lengthSavedRegisters | Retrieves the number of bytes of saved registers pushed on the stack.
get_program | Retrieves the program string that is used to compute the register set before the call to the current function.
get_systemExceptionHandling | Retrieves a flag indicating that system exception handling is in effect.
get_cplusplusExceptionHandling | Retrieves a flag indicating that C++ exception handling is in effect.
get_functionStart | Retrieves a flag indicating that the block contains the entry point of a function.
get_allocatesBasePointer | Retrieves a flag indicating that the base pointer is allocated for code in this address range. (Deprecated)

Requirements

Header: Dia2.h


IDiaFrameData::get_addressOffset

Retrieves the offset part of the code address for the frame.

HRESULT get_ addressOffset (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the offset part of the code address for the frame.


IDiaFrameData::get_addressSection

Retrieves the section part of the code address for the frame.

HRESULT get_addressSection (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the section part of the code address for the frame.


IDiaFrameData::get_allocatesBasePointer

Retrieves a flag indicating that the base pointer is allocated for code in this address range. This method is deprecated.

HRESULT get_allocatesBasePointer (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag.

Remarks

This property should be used only by code that formerly accessed FPO_DATA, or when the program string is NULL. Otherwise the program string contains all the information needed to compute previous register values.


IDiaFrameData::get_cplusplusExceptionHandling

Retrieves a flag indicating that C++ exception handling is in effect.

HRESULT get_cplusplusExceptionHandling (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag.


IDiaFrameData::get_functionStart

Retrieves a flag indicating that the block contains the entry point of a function.

HRESULT get_functionStart (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag.


IDiaFrameData::get_lengthBlock

Retrieves the length, in bytes, of the block of code described by the frame.

HRESULT get_lengthBlock (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the number of bytes of code in the frame.


IDiaFrameData::get_lengthLocals

Retrieves the number of bytes of local variables pushed on the stack.

HRESULT get_lengthLocals (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the number of bytes of local variables.


IDiaFrameData::get_lengthParams

Retrieves the number of bytes of parameters pushed on the stack.

HRESULT get_lengthParams (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the number of bytes of parameters.


IDiaFrameData::get_lengthProlog

Retrieves the number of bytes of prolog code in the block.

HRESULT get_lengthProlog (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the number of bytes of prolog code.


IDiaFrameData::get_lengthSavedRegisters

Retrieves the number of bytes of saved registers pushed on the stack.

HRESULT get_lengthSavedRegisters (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the number of bytes of saved registers.


IDiaFrameData::get_maxStack

Retrieves the maximum number of bytes pushed on the stack in the frame.

HRESULT get_maxStack (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the maximum number of bytes pushed on the stack.


IDiaFrameData::get_program

Retrieves the program string that is used to compute the register set before the call to the current function.

HRESULT get_program (
   BSTR* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a BSTR that contains the program string.


IDiaFrameData::get_relativeVirtualAddress

Retrieves the image relative virtual address of the code for the frame.

HRESULT get_relativeVirtualAddress (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the image relative virtual address of the code for the frame.


IDiaFrameData::get_systemExceptionHandling

Retrieves a flag indicating that system exception handling is in effect.

HRESULT get_systemExceptionHandling (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag.


IDiaFrameData::get_virtualAddress

Retrieves the virtual address of the code for the frame.

HRESULT get_virtualAddress (
   ULONGLONG* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a ULONGLONG that contains the virtual address of the code for the frame.


IDiaInjectedSource

Accesses the program source code stored in the DIA data source.

IDiaInjectedSource : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaInjectedSource.

Method | Description
get_crc | Retrieves a cyclic redundancy check (CRC) calculated from the bytes of the source code.
get_length | Retrieves the number of bytes of code.
get_filename | Retrieves the file name for the source.
get_objectFilename | Retrieves the object file name that the source was compiled to.
get_virtualFilename | Retrieves the name given to injected, non-file source code.
get_sourceCompression | Retrieves the indicator of the source compression used.
get_source | Retrieves the source code bytes.

Requirements

Header: Dia2.h


IDiaInjectedSource::get_crc

Retrieves a CRC calculated from the bytes of the source code.

HRESULT get_crc (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the CRC calculated from the bytes of the source code.


IDiaInjectedSource::get_filename

Retrieves the file name for the source.

HRESULT get_filename (
   BSTR* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a BSTR that contains the file name for the source.


IDiaInjectedSource::get_length

Retrieves the number of bytes of code.

HRESULT get_length (
   ULONGLONG* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a ULONGLONG that contains the number of bytes of code.


IDiaInjectedSource::get_objectFilename

Retrieves the object file name that the source was compiled to.

HRESULT get_objectFilename(
   BSTR* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a BSTR that contains the object file name that the source was compiled to.


IDiaInjectedSource::get_source

Retrieves the source code bytes.

HRESULT get_source (
   DWORD cbData
   DWORD* pcbData,
   BYTE data[]
);

Parameters

cbData
[in] Count of bytes that represents the size of the data buffer.
pcbData
[out] Pointer to the count of bytes that represents the bytes returned. If data is NULL then total number of bytes of data available.
data[]
[out, size_is(cbData),length_is(*pcbData)] Pointer to buffer to contain the source bytes.


IDiaInjectedSource::get_sourceCompression

Retrieves the indicator of the source compression used.

HRESULT get_sourceCompression (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the indicator of the source compression used.


IDiaInjectedSource::get_virtualFilename

Retrieves the name given to non-file source code; that is, code that was injected.

HRESULT get_virtualFilename (
   BSTR* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a BSTR that contains the name given to injected, non-file source code.


IDiaLineNumber

Accesses information that describes the mapping from a block of bytes of image text to a source file line number.

IDiaLineNumber : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaLineNumber.

Method | Description
get_compiland | Retrieves a reference to the symbol for the compiland that contributed the bytes of image text.
get_sourceFile | Retrieves a reference to the source file object.
get_lineNumber | Retrieves the line number in the source file.
get_lineNumberEnd | Retrieves the one-based source line number where the statement or expression ends.
get_columnNumber | Retrieves the column number where the expression or statement begins.
get_columnNumberEnd | Retrieves the column number where the expression or statement ends.
get_addressSection | Retrieves the section part of the memory address where a block begins.
get_addressOffset | Retrieves the offset part of the memory address where a block begins.
get_relativeVirtualAddress | Retrieves the image relative virtual address of a block.
get_virtualAddress | Retrieves the virtual address of a block.
get_length | Retrieves the number of bytes in a block.
get_sourceFileId | Retrieves a unique source file identifier for the source file that contributed this line.
get_statement | Retrieves a flag indicating that this line information describes the beginning of a statement in the program source.
get_compilandID | Retrieves a unique compiland identifier for the compiland that contributed this line.

Requirements

Header: Dia2.h


IDiaLineNumber::get_addressOffset

Retrieves the offset part of the memory address where a block begins.

HRESULT get_addressOffset (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the offset part of the memory address where a block begins.

Example

   CComPtr< IDiaLineNumber > pLine;
   DWORD offset;
   pLine->get_addressSection( &offset);


IDiaLineNumber::get_addressSection

Retrieves the section part of the memory address where a block begins.

HRESULT get_addressSection (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the section part of the memory address where a block begins.

Example

   CComPtr< IDiaLineNumber > pLine;
   DWORD seg;
   pLine->get_addressSection( &seg );


IDiaLineNumber::get_columnNumber

Retrieves the column number where the expression or statement begins.

HRESULT get_columnNumber (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the column number where the expression or statement begins. If DWORD value is zero, then column information is not present.


IDiaLineNumber::get_columnNumberEnd

Retrieves the column number where the expression or statement ends.

HRESULT get_columnNumberEnd (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the column number where the expression or statement ends. If DWORD value is zero, then column end information is not present.


IDiaLineNumber::get_compiland

Retrieves a reference to the symbol for the compiland that contributed the bytes of image text.

HRESULT get_compiland (
   IDiaSymbol* ppRetVal
);

Parameters

ppRetVal
[out, retval] Pointer to a reference to the IDiaSymbol for the compiland that contributed the bytes of image text.


IDiaLineNumber::get_compilandId

Retrieve a unique compiland identifier for the compiland that contributed this line.

HRESULT get_compilandId (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the unique compiland identifier for the compiland that contributed this line.


IDiaLineNumber::get_length

Retrieves the number of bytes in a block.

HRESULT get_length (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the number of bytes in a block.


IDiaLineNumber::get_lineNumber

Retrieves the line number in the source file.

HRESULT get_lineNumber (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the line number in the source file.

Example

   CComPtr< IDiaLineNumber > pLine;
   DWORD linenum;
   pLine->get_lineNumber( &linenum );


IDiaLineNumber::get_lineNumberEnd

Retrieves the one-based source line number where the statement or expression ends.

HRESULT get_lineNumberEnd (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the line number where the statement or expression ends. If DWORD value is zero, then end information is not present.


IDiaLineNumber::get_relativeVirtualAddress

Retrieves the image relative virtual address of the block.

HRESULT get_relativeVirtualAddress (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the image relative virtual address of the block.


IDiaLineNumber::get_sourceFile

Retrieves a reference to the source file.

HRESULT get_sourceFile (
   IDiaSourceFile** ppRetVal
);

Parameters

ppRetVal
[out, retval] Pointer to a reference to the IDiaSourceFile interface representing the source file.


IDiaLineNumber::get_sourceFileId

Retrieve a unique source file identifier for the source file that contributed this line.

HRESULT get_sourceFileId (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the unique source file identifier for the source file that contributed this line.


IDiaLineNumber::get_statement

Retrieve a flag indicating that this line information describes the beginning of a statement, rather than an expression, in the program source.

HRESULT get_statement (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains a flag indicating that this line information describes the beginning of a statement in the program source.


IDiaLineNumber::get_virtualAddress

Retrieves the virtual address of the block.

HRESULT get_virtualAddress (
   ULONGLONG* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the virtual address of the block.


IDiaLoadCallback

Receives callbacks from the program database locating procedure and enables a user interface to report on the progress of the location attempt.

IDiaLoadCallback : IUnknown
Methods in Vtable Order

The following table shows the methods of IDiaLoadCallback.

Method | Description
NotifyDebugDir | Notifies the debug directory found in the exe.
NotifyOpenDBG | Notifies that a candidate DBG file was opened.
NotifyOpenPDB | Notifies that a candidate PDB file was opened.
NotifySymbolServerQuery | Notifies that a symbol server query was attempted.

Requirements

Header: Dia2.h


IDiaLoadCallback::NotifyDebugDir

Notifies the debug directory found in the exe. IDiaDataSource::loadDataForExe invokes this callback when is finds a debug directory while processing the executable.

HRESULT NotifyDebugDir(
   BOOL fExecutable,
   DWORD cbData,
   BYTE data[]
);

Parameters

fExecutable
[in] Is true if the debug directory was read from an executable (rather than a DBG).
cbData
[in] Count of bytes of data in the debug directory.
data[]
[in, size_is(cbData)] The data comprising the debug directory.

Remarks

The NotifyDebugDir callback is to remove the need for the client to crack the executable and/or debug file to support non-PDB debug information. Since DIA is cracking the files anyway it will call back the client to report the contents of the debug directory. With the data supplied the client can know the type of debug information available and whether it resides in the executable or the DBG.

Most clients will not have need of this callback as IDiaDataSource::loadDataFromExe transparently opens both PDB and DBG files as necessary to serve symbols.


IDiaLoadCallback::NotifyOpenDBG

Notifies that a candidate DBG file was opened.

HRESULT NotifyOpenDBG(
   LPCOLESTR dbgPath,
   HRESULT resultCode
);

Parameters

dbgPath
[in] The full path to the DBG file.
resultCode
[in] A code indicating the success (S_OK) or failure of the load as applied to this file.


IDiaLoadCallback::NotifyOpenPDB

Notifies that a candidate PDB file was opened.

HRESULT NotifyOpenPDB(
   LPCOLESTR pdbPath,
   HRESULT resultCode
);

Parameters

pdbPath
[in] The full path to the PDB file.
resultCode
[in] A code indicating the success (S_OK) or failure of the load as applied to this file.


IDiaLoadCallback::NotifySymbolServerQuery

Notifies that a symbol server query was attempted.

HRESULT NotifySymbolServerQuery(
   LPCOLESTR url,
   HRESULT resultCode
);

Parameters

url
[in] The url given to the Symbol Server.
resultCode
[in] The return code from the Symbol Server request.


IDiaReadExeAtRVACallback

Reads bytes, specified by relative virtual address, from the executable. IDiaReadExeAtRVACallback: IUnknown Methods in Vtable Order

The following table shows the methods of IDiaReadExeAtRVACallback.

Method | Description
ReadExecutableAtRVA | Implements a read of bytes, specified by relative virtual address, from the executable.

Requirements

Header: Dia2.h


IDiaReadExeAtRVACallback::ReadExecutableAtRVA

Reads bytes, specified by relative virtual address, from the executable.

HRESULT ReadExecutableAtRVA(
   DWORD relativeVirtualAddress,
   DWORD cbData,
   DWORD* pcbData,
   BYTE data[]
);

Parameters

relativeVirtualAddress
[in] RVA in the executable to begin reading bytes.
cbData
[in] Number of bytes to read.
pcbData
[out] Number of bytes read.
data[]
[out, size_is(cbData),length_is(*pcbData)] Data bytes read from executable.


IDiaReadExeAtOffsetCallback

Reads bytes, specified by file position, from the executable. IDiaReadExeAtOffsetCallback: IUnknown Methods in Vtable Order

The following table shows the methods of IDiaReadExeAtOffsetCallback.

Method | Description
ReadExecutableAt | Implements a read of bytes, specified by file position, from the executable.

Requirements

Header: Dia2.h


IDiaReadExeAtOffsetCallback::ReadExecutableAt

Reads bytes, specified by file position, from the executable.

HRESULT ReadExecutableAt(
   DWORDLONG fileOffset,
   DWORD cbData,
   DWORD* pcbData,
   BYTE data[]
);

Parameters

fileOffset
[in] Offset in the executable file to begin reading bytes.
cbData
[in] Number of bytes to read.
pcbData
[out] Number of bytes read.
data[]
[out, size_is(cbData),length_is(*pcbData)]Data bytes read from file.


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
get_compiland | Retrieves a reference to the compiland symbol that contributed this block.
get_addressSection | Retrieves the section part of the contribution’s address.
get_addressOffset | Retrieves the offset part of the contribution’s address.
get_relativeVirtualAddress | Retrieves the image relative virtual address of the contribution.
get_virtualAddress | Retrieves the virtual address of the contribution.
get_length | Retrieves the number of bytes in the block.
get_nopad | Retrieves a flag indicating that the block is not padded.
get_code | Retrieves a flag indicating that the block is code.
get_initializedData | Retrieves a flag indicating that the block contains initialized data.
get_uninitializedData | Retrieves a flag indicating that the block contains uninitialized data.
get_informational | Retrieves a flag indicating that the block contains informational data.
get_remove | Retrieves a flag indicating that the block can be removed from the image.
get_comdat | Retrieves a flag indicating that the block is a comdat.
get_discardable | Retrieves a flag indicating that the block is discardable.
get_notCached | Retrieves a flag indicating that the block is not cached.
get_notPaged | Retrieves a flag indicating that the block is not paged.
get_share | Retrieves a flag indicating that the block is sharable.
get_execute | Retrieves a flag indicating that the block is executable.
get_read | Retrieves a flag indicating that the block is readable.
get_write | Retrieves a flag indicating that the block identifier is writeable.
get_dataCrc | Retrieves the cyclic redundancy check (CRC) of the data in the block.
get_relocationsCrc | Retrieves the CRC of the relocation information for the block.
get_compilandid | Retrieves the compiland ID for the block.

Requirements

Header: Dia2.h


IDiaSectionContrib::get_addressOffset

Retrieves the offset part of the contribution’s address.

HRESULT get_addressOffset (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to the DWORD that contains the offset part of the contribution’s address.


IDiaSectionContrib::get_addressSection

Retrieves the section part of the contribution’s address.

HRESULT get_addressSection (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to the DWORD that contains the section part of the contribution’s address.


IDiaSectionContrib::get_code

Retrieves a flag indicating that the block is code.

HRESULT get_code (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains a flag indicating that the block is code.


IDiaSectionContrib::get_comdat

Retrieves a flag indicating that the block is a comdat.

HRESULT get_comdat (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains a flag indicating that the block is a comdat.


IDiaSectionContrib::get_compiland

Retrieves a reference to the compiland symbol that contributed this block.

HRESULT get_compiland (
   IDiaSymbol** ppRetVal
);

Parameters

ppRetVal
[out, retval] Pointer to the reference to the IDiaSymbol of the compiland that contributed this block.


IDiaSectionContrib::get_compilandId

Retrieves the compiland ID for the block.

HRESULT get_compilandId (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the compiland ID for the block.


IDiaSectionContrib::get_dataCrc

Retrieves the cyclic redundancy check (CRC) of the data in the block.

HRESULT get_dataCrc (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the CRC of the data in the block.


IDiaSectionContrib::get_discardable

Retrieves a flag indicating that the block is discardable.

HRESULT get_discardable (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains a flag indicating that the block is discardable.


IDiaSectionContrib::get_execute

Retrieves a flag indicating that the block is executable.

HRESULT get_excute (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains a flag indicating that the block is executable.


IDiaSectionContrib::get_informational

Retrieves a flag indicating that the block contains informational data.

HRESULT get_informational (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains a flag indicating that the block contains informational data.


IDiaSectionContrib::get_initializedData

Retrieves a flag indicating that the block contains initialized data.

HRESULT get_initializedData (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains a flag indicating that the block contains initialized data.


IDiaSectionContrib::get_length

Retrieves the number of bytes in the block.

HRESULT get_length (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the number of bytes in the block.


IDiaSectionContrib::get_nopad

Flag indicating that the block is not padded.

HRESULT get_nopad (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains a flag indicating that the block is not padded.


IDiaSectionContrib::get_notCached

Retrieves a flag indicating that the block is not cached.

HRESULT get_notCached (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains a flag indicating that the block is not cached.


IDiaSectionContrib::get_notPaged

Retrieves a flag indicating that the block is not paged.

HRESULT get_notPaged (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains a flag indicating that the block is not paged.


IDiaSectionContrib::get_read

Retrieves a flag indicating that the block is readable.

HRESULT get_read (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains a flag indicating that the block is readable.


IDiaSectionContrib::get_relativeVirtualAddress

Retrieves the image relative virtual address of the contribution.

HRESULT get_relativeVirtualAddress (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to the DWORD that contains the image relative virtual address of the contribution.


IDiaSectionContrib::get_relocationsCrc

Retrieves the cyclic redundancy check (CRC) of the relocation information for the block.

HRESULT get_relocationsCrc (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the CRC of the relocation information for the block.


IDiaSectionContrib::get_remove

Retrieves a flag indicating that the block can be removed from the image.

HRESULT get_remove (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains a flag indicating that the block can be removed from the image.


IDiaSectionContrib::get_share

Retrieves a flag indicating that the block is sharable.

HRESULT get_share (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains a flag indicating that the block is sharable.


IDiaSectionContrib::get_uninitializedData

Retrieves a flag indicating that the block contains informational data.

HRESULT get_uninitializedData (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains a flag indicating that the block contains informational data.


IDiaSectionContrib::get_virtualAddress

Retrieves the virtual address of the contribution.

HRESULT get_virtualAddress (
   ULONGLONG* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a ULONGLONG that contains the virtual address of the contribution.


IDiaSectionContrib::get_write

Retrieves a flag indicating that the block identifier is writeable.

HRESULT get_write (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains a flag indicating that the block is writeable.


IDiaSegment

Maps from the section number to segments of address space. Because DIA performs translation from section:offset to relative virtual addresses, most applications will not make use of the information in the segment map.

IDiaSegment : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaSegment.

Method | Description
get_frame | Retrieves the segment number.
get_offset | Retrieves the offset in segments where the section begins.
get_length | Retrieves the number of bytes in the segment.
get_read | Retrieves a flag indicating that the segment is readable.
get_write | Retrieves a flag indicating that the segment is writeable.
get_execute | Retrieves a flag indicating that the segment is executable.
get_addressSection | Retrieves the section number that maps to this segment.
get_relativeVirtualAddress | Retrieves the relative virtual address of the start of the section.
get_virtualAddress | Retrieves the virtual address of the start of the section.

Requirements

Header: dia2.h


IDiaSegment::get_addressSection

Retrieves the section number that maps to this segment.

HRESULT get_sectionAddress (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the section number that maps to this segment.

Example

   CComPtr<IDiaSegment> pSegment;
   DWORD seg;
   pSegment->get_addressSection( &seg );


IDiaSegment::get_execute

Retrieves a flag indicating that the segment is executable.

HRESULT get_execute (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains a flag indicating that the segment is executable.


IDiaSegment::get_frame

Retrieves the segment number.

HRESULT get_frame (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the segment number.


IDiaSegment::get_length

Retrieves the number of bytes in the segment.

HRESULT get_ length (
   DWORD * pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the number of bytes in the segment.


IDiaSegment::get_offset

Retrieves the offset in segments where the section begins.

HRESULT get_offset (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the offset in segments where the section begins.


IDiaSegment::get_read

Retrieves a flag indicating that the segment is readable.

HRESULT get_read (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains a flag indicating that the segment is readable.


IDiaSegment::get_relativeVirtualAddress

Retrieves the relative virtual address of the start of the section.

HRESULT get_relativeVirtualAddress (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the relative virtual address of the start of the section.

Example

   CComPtr<IDiaSegment> pSegment;
   DWORD rva;
   pSegment->get_relativeVirtualAddress( &rva );


IDiaSegment::get_virtualAddress

Retrieves the virtual address of the start of the section.

HRESULT get_virtualAddress (
   ULONGLONG* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a ULONGLONG that contains the virtual address of the start of the section.


IDiaSegment::get_write

Retrieves a flag indicating that the segment is writeable.

HRESULT get_write (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains a flag indicating that the segment is writeable.


IDiaSession

Provides a query context for debug symbols.

IDiaSession. : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaSession.

Method | Description
get_loadAddress | Retrieves the load address for the executable corresponding to the symbols in this symbol store.
put_loadAddress | Sets the load address for the executable corresponding to the symbols in this symbol store
get_globalScope | Retrieves a reference to the global scope.
get_addressMapEnabled | Get the Boolean valued addressMapEnabled property.
put_addressMapEnabled | Set the Boolean valued addressMapEnabled property.
get_relativeVirtualAddressEnabled | Get the Boolean valued relativeVirtualAddressEnabled property.
put_relativeVirtualAddressEnabled | Set the Boolean valued relativeVirtualAddressEnabled property.
set_imageHeaders | Set image headers to enable relative virtual address translation.
getEnumTables | Retrieves an enumerator for all tables contained in the symbol store.
getSymbolsByAddr | Retrieves an enumerator for all named symbols at static locations.
findChildren | Retrieves all children of a specified parent identifier that match the name and symbol type.
findSymbolByAddr | Retrieves a specified symbol type that contains (or is closest to) a specified address.
findSymbolByRVA | Retrieves a specified symbol type that contains (or is closest to) a specified relative virtual address.
findSymbolByVA | Retrieves a specified symbol type that contains (or is closest to) a specified virtual address.
findSymbolByToken | Retrieves the symbol that contains a specified metadata token.
symsAreEquiv | Checks to see if two symbols are equivalent.
symbolbyid | Retrieves a symbol by its unique identifier.
findFile | Retrieves source files by compiland and name.
findFileById | Retrieves a source file by source file identifier.
findLines | Retrieves line numbers within a specified compiland and source file identifiers.
findLinesByAddr | Retrieves the lines in a specified compiland that contain a specified address.
findLinesByRVA | Retrieves the lines in a specified compiland that contain a specified relative virtual address.
findLinesByVA | Finds the line number information for lines contained in a specified address range.
findLinesByLinenum | Retrieves the lines in a specified compiland by source file and line number.
findInjSrc | Retrieves a source that has been placed into the symbol store by attribute providers or other components of the compilation process.

Requirements

Header: Dia.h


IDiaSession::findChildren

Retrieves all children of a specified parent identifier that match the name and symbol type.

HRESULT findChildren (
   IDiaSymbol* parent
   enum SymTagEnum symtag
   LPCOLESTR name
   enum NameSearchOptions option
   IDiaEnumSymbols** ppResult
);

Parameters

Parent
[in] Pointer to the IDiaSymbol interface of the parent. If the symbol is a function, module, or block, then its lexical children are returned. If the symbol is a type, then its class children are returned. If NULL, then symtag must be SymTagExe, which returns the global scope (.exe file).
symtag
[in] Specifies the symbol tags of the children to be retrieved. Set to SymTagNull for all children to be retrieved.
name
[in] Specifies the name of the children to be retrieved. Set to Null for all children to be retrieved.
option
[in] Specify the name search options applied to name matching.
ppResult
[out] Pointer to a reference to the IDiaEnumSymbols interface representing the child symbols retrieved.

Return Value

The following table shows possible HRESULT return values for findChildren.

Value | Description
S_OK | Success.
E_INVALIDARG | Invalid psidParent parameter.
E_OUTOFMEMORY | Insufficient memory to create the symbol enumeration object.

Example

// Find local variables of function pFunc that match name szVarName.
//
IDiaEnumSymbols* pEnum;
PSession->findChildren( pFunc, SymTagData, szVarName, nsCaseSensitive, &pEnum );

See Also

IDiaSymbol | DiaEnumSymbols


IDiaSession::findFile

Retrieves source files by compiland and name.

HRESULT findFile (
   IDiaSymbol* pCompiland
   LPCOLESTR name,
   enum NameSearchOptions option,
   IDiaEnumSourceFiles** ppResult
);

Parameters

pCompiland
[in] Pointer to the IDiaSymbol of the specified compiland in which to search for source files. Set to NULL to find source files in all compilands.
name
[in] Specifies the name of the source file to be retrieved. Set to Null for all source files to be retrieved.
option
[in] Specifies the NameSearchOptions applied to name matching.
ppResult
[out] Pointer to a reference to the IDiaEnumSourceFiles interface representing the source files retrieved.

Example

IDiaEnumSourceFiles* pEnum;
pSession->findFile( NULL, L”sourcefile.cpp”, nsFNameExt, &pEnum );

See Also

IDiaSymbol | NameSearchOptions | IDiaEnumSourceFiles


IDiaSession::findFileById

Retrieves a source file by source file identifier.

HRESULT findFileById (
   DWORD uniqueId,
   IDiaEnumSourceFiles** ppResult
);

Parameters

uniqueId
[in] Specifies the source file identifier.
ppResult
[out] Pointer to a reference to the IDiaEnumSourceFiles interface representing the source file retrieved.

See Also

IDiaEnumSourceFiles


IDiaSession::FindInjSrc

Retrieves a source that has been placed into the symbol store by attribute providers or other components of the compilation process.

HRESULT FindInjSrc (
   LPCOLESTR srcFile,
   IDiaEnumInjectedSources** ppResult
);

Parameters

srcFile
[in] Name of the source file to search for.
ppResult
[out] Pointer to a reference to the IDiaEnumInjectedSources interface representing the injected source retrieved.

See Also

IDiaEnumInjectedSources


IDiaSession::findLines

Retrieves line numbers within a specified compiland and source file identifiers.

HRESULT findLines (
   IDiaSymbol* compiland,
   IDiaSourceFile* file,
   IDiaEnumLineNumbers** ppResult
);

Parameters

compiland
[in] Reference to the IDiaSymbol of the compiland to use as a context in which to search for the line numbers.
file
[in] Reference to the IDiaSourceFile in which to search for the line numbers.
ppResult
[out] Pointer to a reference to the IDiaEnumLineNumbers interface representing the line numbers retrieved.

See Also

IDiaSymbol | IDiaSourceFile | IDiaEnumLineNumbers


IDiaSession::findLinesByAddr

Retrieves the lines in a specified compiland that contain a specified address.

HRESULT findLinesByAddr (
   DWORD seg,
   DWORD offset,
   DWORD length,
   IDiaEnumLineNumbers** ppResult
);

Parameters

seg
[in] Specifies the section component of the specific address.
offset
[in] Specifies the offset component of the specific address.
length
[in] Specifies the number of bytes of address range to cover with this query.
ppResult
[out] Pointer to a reference to the IDiaEnumLineNumbers interface representing all the line numbers that cover any part of the address range specified.

Example

DWORD seg, offset;
ULONGLONG length;
pFunc-> get_addressSection( &seg );
pFunc->get_addressOffset( &offset );
pFunc->get_length( &length );
IDiaEnumLineNumbers* pEnum;
pSession->findLinesByAddr( seg, offset, static_cast<DWORD>( length ), &pEnum );

See Also

DiaEnumLineNumbers


IDiaSession::findLinesByLinenum

Retrieves the lines in a specified compiland by source file and line number.

HRESULT findLinesByLinenum (
   IDiaSymbol* compiland,
   IDiaSourceFile* file,
   DWORD linenum,
   DWORD column,
   IDiaEnumLineNumbers** ppResult
);

Parameters

compiland
[in] Reference to the IDiaSymbol of the specific compiland in which to search for the line numbers.
file
[in] Specifies the IDiaSourceFile.
linenum
[in] Specifies the line number.
column
[in] Specifies the column number. Use 0 to specify all columns.
ppResult
[out] Pointer to a reference to the IDiaEnumLineNumbers interface representing the line numbers retrieved.

Example

IDiaEnumSourceFiles* pEnum;
pSession->findFile( NULL, L”sourcefile.cpp”, nsFNameExt, &pEnum );
IDiaSourceFile pFile;
DWORD celt;
while ( pEnum->Next( 1, &pFile, &celt ) {   // for all matching files
   IDiaEnumSymbols* pEnumCompilands;
   pFile->get_compilands( &pEnumCompilands );
   IDiaSymbol* pCompiland;
   while ( pEnumCompilands->Next( 1, pCompiland, &celt ) ) {// for all compilands
      IDiaEnumLineNumbers* pEnum;
      pSession->findLinesByLinenum( pCompiland, pFile, line, 0, &pEnum );
      …
   }
}

See Also

IDiaSymbol | IDiaSourceFile | IDiaEnumLineNumbers


IDiaSession::findLinesByRVA

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

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

Parameters

rva
[in] Specifies the address as a relative virtual address.
length
[in] Specifies the number of bytes of address range to cover with this query.
ppResult
[out] Pointer to a reference to the IDiaEnumLineNumbers interface representing all the line numbers that cover any part of the address range specified.

Example

DWORD rva;
ULONGLONG length;
pFunc->get_relativeVirtualAddress ( &rva );
pFunc->get_length( &length );
IDiaEnumLineNumbers* pEnum;
pSession->findLinesByRVA( rva, static_cast<DWORD>( length ), &pEnum );

See Also

IDiaEnumLineNumbers


IDiaSession::findLinesByVA

Retrieves the line number information for lines contained in a specified address range.

HRESULT findLinesByVA (
   ULONGLONG va,
   DWORD length,
   IDiaEnumLineNumbers** ppResult
);

Parameters

va
[in] Specifies the address as a virtual address.
length
[in] Specifies the number of bytes of address range to cover with this query.
ppResult
[out] Pointer to a reference to the IDiaEnumLineNumbers interface representing all the line numbers that cover any part of the address range specified.

Example

ULONGLONG va;
ULONGLONG length;
pFunc->get_virtualAddress ( &va );
pFunc->get_length( &length );
IDiaEnumLineNumbers* pEnum;
pSession->findLinesByVA( va, static_cast<DWORD>( length ), &pEnum );

See Also

IDiaEnumLineNumbers


IDiaSession::findSymbolByAddr

Retrieves a specified symbol type that contains, or is closest to, a specified address.

HRESULT findSymbolByAddr (
   DWORD isect,
   DWORD offset,
   enum SymTagEnum symtag,
   IDiaSymbol** ppSymbol
);

Parameters

isect
[in] Specifies the section component of the address.
offset
[in] Specifies the offset component of the address.
symtag
[in] Symbol type to be found.
ppSymbol
[out] Pointer to reference to the IDiaSymbol interface representing the symbol retrieved.

Return Value

The following table shows possible HRESULT return values for findSymbolByAddr.

Value | Description
S_OK | Success.
E_INVALIDARG | Invalid isect parameter.
E_OUTOFMEMORY | Insufficient memory to create the symbol enumeration object.

Example

IDiaSymbol* pFunc;
pSession->FindSymbolByAddr( isect, offset, SymTagFunction, &pFunc );

See Also

IDiaSymbol


IDiaSession::findSymbolByRVA

Retrieves a specified symbol type that contains, or is closest to, a specified relative virtual address.

HRESULT findSymbolByRVA (
   DWORD rva,
   enum SymTagEnum symtag,
   IDiaSymbol** ppSymbol
);

Parameters

rva
[in] Specifies the relative virtual address.
symtag
[in] Symbol type to be found.
ppSymbol
[out] Pointer to a reference to the IDiaSymbol interface representing the symbol retrieved.

Example

IDiaSymbol* pFunc;
pSession->FindSymbolByRVA( rva, SymTagFunction, &pFunc );

See Also

IDiaSymbol


IDiaSession::findSymbolByToken

Retrieves the symbol that contains a specified metadata token.

HRESULT findSymbolByToken (
   ULONG token,
   enum SymTagEnum symtag
   IDiaSymbol** ppSymbol
);

Parameters

token
[in] Specifies the token.
symtag
[in] Symbol type to be found.
ppSymbol
[out] Pointer to a reference to the IDiaSymbol interface representing the symbol retrieved.

See Also

IDiaSymbol


IDiaSession::findSymbolByVA

Retrieves a specified symbol type that contains, or is closest to, a specified virtual address.

HRESULT findSymbolByVA (
   ULONGLONG va
   enum SymTagEnum symtag
   IDiaSymbol** ppSymbol
);

Parameters

va
[in] Specifies the virtual address.
symtag
[in] Symbol type to be found.
ppSymbol
[out] Pointer to a reference to the IDiaSymbol interface representing the symbol retrieved.

Example

IDiaSymbol* pFunc;
pSession->FindSymbolByVA( va, SymTagFunction, &pFunc );

See Also

IDiaSymbol


IDiaSession::get_addressMapEnabled

Executable post-processors sometimes re-layout the executable. DIA contains a mechanism to support translation of symbols to the new executable layout. This property indicates whether the translation is enabled.

HRESULT get_addressMapEnabled(
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] True if the address mapping is enabled.

See Also

© 1987-2000 Microsoft Corporation. All rights reserved.


IDiaSession::get_globalScope

Retrieves a reference to the global scope.

HRESULT get_globalScope (
   IDiaSymbol** pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a reference to the IDiaSymbol that identifies the global scope.

See Also

IDiaSymbol


IDiaSession::get_loadAddress

Retrieves the load address for the executable corresponding to the symbols in this symbol store. This is always zero unless specifically set using put_loadAddress.

HRESULT get_loadAddress (
   ULONGLONG* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a virtual address where an .exe file or .dll file is loaded.

See Also

put_loadAddress.


IDiaSession::get_relativeVirtualAddressEnabled

Addresses for debug objects described by DIA interfaces can be retrieved as relative (to the executable’s image base) virtual addresses – RVA’s. This method allows the client to determine whether the calculation of RVA’s is enabled.

HRESULT get_relativeVirtualAddressEnabled(
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Returns true if the calculation of RVA’s is enabled.

See Also

© 1987-2000 Microsoft Corporation. All rights reserved.


IDiaSession::getEnumTables

Retrieves an enumerator for all tables contained in the symbol store.

HRESULT getEnumTables (
   IDiaEnumTables** ppEnumTables
);

Parameters

ppEnumTables
[out] Pointer to a reference to the IDiaEnumTables interface to the object enumerating the tables in the symbol store.

Example

   IDiaEnumTables* pTables;
   pSession->getEnumTables( &pTables );

See Also

IDiaEnumTables


IDiaSession::getSymbolsByAddr

Retrieves an enumerator for all tables contained in the symbol store.

HRESULT getSymbolsByAddr(
   IDiaEnumSymbolsByAddr** ppEnumbyAddr
);

Parameters

ppEnumbyAddr
[out] Pointer to a reference to the IDiaEnumSymbolsByAddr interface to the object enumerating the tables in the symbol store.

Example

See Also

IDiaEnumSymbolsByAddr


IDiaSession::put_addressMapEnabled

Executable post-processors sometimes re-layout the executable. DIA contains a mechanism to support translation of symbols to the new executable layout. This property allows the client to enable or disable the translation.

HRESULT put_addressMapEnabled(
   BOOL NewVal
);

Parameters

NewVal
[in] Set to true to enable, false to disable.


IDiaSession::put_loadAddress

Sets the load address for the executable corresponding to the symbols in this symbol store. Symbol virtual address properties are computed using the value of this method. Virtual addresses are not calculated unless this property is set non-zero.

HRESULT put_loadAddress (
   ULONGLONG NewVal
);

Parameters

NewVal
[in] Load address for the executable.


IDiaSession::put_relativeVirtualAddressEnabled

Addresses for debug objects described by DIA interfaces can be retrieved as relative (to the executable’s image base) virtual addresses – RVA’s. This method allows the client to enable or disable the calculation of RVA’s.

HRESULT put_relativeVirtualAddressEnabled(
   BOOL NewVal
);

Parameters

NewVal
[in] set to true to enable, false to disable.


IDiaSession::set_imageHeaders

Set image headers to enable relative virtual address translation.

HRESULT set_imageHeaders(
   DWORD cbData,
   BYTE data[]
);

Parameters

cbData
[in] Number of bytes of header data. Must be n*sizeof(IMAGE_SECTION_HEADER) where n is the number of section headers in the executable.
data[]
[in, size_is(cbData)] The IMAGE_SECTION_HEADER data.

Remarks

Relative virtual address calculations depend upon the executable’s IMAGE_SECTION_HEADER values. Normally DIA retrieves these from the pdb file. However sometimes they are missing. In which case DIA is unable to calculate RVA’s and get_relativeVirtualAddressEnabled will return false. The client, if it has them available, can supply the missing headers using this method.


IDiaSession::symbolById

Retrieves a symbol by its unique identifier.

HRESULT symbolById (
   DWORD id,
   IDiaSymbol** ppSymbol
);

Parameters

id
[in] Unique symbol identifier.
ppSymbol
[out] Pointer to a reference to the IDiaSymbol interface representing the symbol retrieved.

See Also

IDiaSymbol


IDiaSession::symsAreEquiv

Checks to see if two symbols are equivalent.

HRESULT symsAreEquiv (
   IDiaSymbol* symbolA,
   IDiaSymbol* symbolb
);

Parameters

symbolA
[in] Pointer to the first IDiaSymbol used in the comparison.
symbolb
[in] Pointer to the second IDiaSymbol used in the comparison.

Return Value

The following table shows possible HRESULT return values for symsAreEquiv.

Value | Description
S_OK | The symbols are equivalent.
S_FALSE | The symbols are not equivalent.

See Also

IDiaSymbol


IDiaSourceFile

Represents a source file.

IDiaSourceFile : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaSourceFile.

Method | Description
get_uniqueId | Retrieves a simple integer key value that is unique for this image.
get_fileName | Retrieves the source file name.
get_checksumType | Retrieves the checksum type.
get_compiland | Retrieves an enumerator of the compilands with line numbers referencing this file.
get_checksum | Retrieves the checksum bytes.

Requirements

Header: Dia2.h


IDiaSourceFile::get_checksum

Retrieves the checksum bytes.

HRESULT get_checksum (
   DWORD cbData,
   DWORD* pcbData,
   BYTE data[]

);

Parameters

cbData
[in] Count of bytes that represent the size of the data buffer.
pcbData
[out] Pointer to the count of bytes that represent the bytes returned.
data[]
[out, size_is(cbData),length_is(*pcbData)] Pointer to the buffer to contain checksum bytes.


IDiaSourceFile::get_checksumType

Retrieves the checksum type.

HRESULT get_checksumType (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the checksum type.


IDiaSourceFile::get_compiland

Retrieves a reference to the enumerator of the compilands with line numbers referencing this file.

HRESULT get_compiland (
   IDiaEnumSymbols** ppRetVal
);

Parameters

ppRetVal
[out, retval] Return reference to the IDiaEnumSymbols enumerator of the compilands with line numbers referencing this file.

See Also

IDiaEnumSymbols


IDiaSourceFile::get_fileName

Retrieves the source file name.

HRESULT get_fileName (
   BSTR* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a BSTR that contains the source file name.


IDiaSourceFile::get_uniqueId

Retrieves a simple integer key value that is unique for this image. Comparing keys rather than strings can expedite line number processing.

HRESULT get_uniqueId (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains a simple integer key value that is unique for this image.


IDiaSymbol

Describes the properties of a symbol instance.

IDiaSymbol : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaSymbol.

Method | Description
get_symIndexID | Retrieves the symbol index of the symbol.
get_symTag | Retrieves the symbol type classifier.
get_name | Retrieves the name of the executable file, compiland, or function.
get_lexicalParent | Retrieves a reference to the lexical parent of the symbol.
get_classParentId | Retrieves a reference to the class parent of the symbol.
get_type | Retrieves a reference to the function signature.
get_dataKind | Retrieves the variable classification of a data symbol.
get_locationType | Retrieves the location type of a data symbol.
get_addressSection | Retrieves the section part of an address location.
get_addressOffset | Retrieves the offset part of an address location.
get_relativeVirtualAddress | Retrieves the relative virtual address of the location.
get_virtualAddress | Retrieves the virtual address of the location.
get_registerId | Retrieves the register designator of the location.
get_offset | Retrieves the offset of the symbol location.
get_length | Retrieves the number of bytes of memory used by the object represented by this symbol.
get_slot | Retrieves the slot number of the location.
get_volatileType | Retrieves a flag specifying whether the user-defined data type is volatile.
get_constType | Retrieves a flag specifying whether the user-defined data type is constant.
get_unalignedType | Retrieves a flag specifying whether the user-defined data type is unaligned.
get_access | Retrieves the access modifier of a class member.
get_libraryName | Retrieves the file name of the library, or object file, from which the object was loaded.
get_platform | Retrieves the platform type the program or compiland was compiled for.
get_language | Retrieves the language of the source.
get_editAndContinueEnabled | Retrieves the flag describing the edit and continue features of the compiled program or unit.
get_frontEndMajor | Retrieves the front-end major version number.
get_frontEndMinor | Retrieves the front-end minor version number.
get_frontEndBuild | Retrieves the front-end build number.
get_backEndMajor | Retrieves the back-end major version number.
get_backEndMinor | Retrieves the back-end minor version number.
get_backEndBuild | Retrieves the back-end build number.
get_sourceFileName | Retrieves the file name of the source file.
get_objectFileName | Retrieves the file name of the compiland object file.
get_thunkOrdinal | Retrieves the kind of thunk that a function is.
get_thisAdjust | Retrieves the logical this adjustor for the method.
get_virtualBaseOffset | Retrieves the offset in the virtual function table of a virtual function.
get_virtua | Retrieves a flag specifying whether the function is virtual.
get_intro | Retrieves a flag specifying whether the function is intro virtual.
get_pure | Retrieves a flag specifying whether the function is pure virtual.
get_callingConvention | Returns an indicator of a methods calling convention.
get_value | Retrieves the value of a constant.
get_baseType | Retrieves the type tag of a simple type.
get_token | Retrieves the metadata token of a managed function or variable.
get_timeStamp | Retrieves the timestamp of the underlying executable.
get_guid | Retrieves the symbol’s GUID.
get_symbolsFileName | Retrieves the name of the file from which the symbols were loaded.
get_reference | Retrieves a flag specifying whether a pointer type is a reference.
get_count | Retrieves the number of items in a list or array.
get_bitPosition | Retrieves the bit position of a location.
get_arrayIndexType | Retrieves the symbol identifier of the array index type.
get_packed | Retrieves a flag specifying whether the user-defined data type is packed.
get_constructor | Retrieves a flag specifying whether the user-defined data type has a constructor.
get_overloadedOperator | Retrieves a flag specifying whether the user-defined data type has overloaded operators.
get_nested | Retrieves a flag specifying whether the user defined data type is nested.
get_hasNestedTypes | Retrieves a flag specifying whether the user-defined data type has nested type definitions.
get_hasAssignmentOperator | Retrieves a flag specifying whether the user defined data type has any assignment operators defined.
get_hasCastOperator | Retrieves a flag specifying whether the user-defined data type has any cast operators defined.
get_scoped | Retrieves a flag specifying whether the user-defined data type appears in a non-global lexical scope.
get_virtualBaseClass | Retrieves a flag specifying whether the user-defined data type is a virtual base class.
get_indirectVirtualBaseClass | Retrieves a flag specifying whether the user-defined data type is an indirect virtual base class.
get_virtualBasePointerOffset | Retrieves the offset of the virtual base pointer.
get_virtualTableShape | Retrieves the symbol interface of the type of the virtual table for a user-defined type.
get_thunk | Retrieves a flag specifying whether the function is a thunk.
get_dataBytes | Retrieves the data bytes of an OEM symbol.
get_lexicalParentId | Retrieves the lexical Parent ID of the symbol.
get_classParentId | Retrieves the class Parent ID of the symbol.
get_typeId | Retrieves the type ID of the symbol.
get_arrayIndexTypeId | Retrieves the array index type ID of the symbol.
get_VirtualTableShapeId | Retrieves the virtual table shape ID of the symbol.
get_code | Retrieves a flag specifying whether the symbol refers to a code address.
get_function | Retrieves a flag specifying whether the symbol refers to a function.
get_managed | Retrieves a flag specifying whether the symbol refers to managed code
get_msil | Retrieves a flag specifying whether the symbol refers to MSIL code.
findChildren | Retrieves all children of the symbol

Requirements

Header: Dia2.h


IDiaSymbol::findChildren

Retrieves the children of the symbol. Identical to calling IDiaSession::findChildren with this symbol as the first parameter.

HRESULT findChildren (
   enum SymTagEnum symtag,
   LPCOLESTR name,
   enum NameSearchOptions option,
   IDiaEnumSymbols** ppResult
);

Parameters

symtag
[in] Specifies the symbol tags of the children to be retrieved. Set to SymTagNull for all children to be retrieved.
name
[in] Specifies the name of the children to be retrieved. Set to Null for all children to be retrieved.
option
[in] Specify the name search options applied to name matching.
ppResult
[out] Pointer to a reference to the IDiaEnumSymbols interface representing the child symbols retrieved.


IDiaSymbol::get_access

Retrieves the access modifier of a class member, as defined in CV_access_e .

HRESULT get_access (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the access modifier of a class member.


IDiaSymbol::get_addressOffset

Retrieves the offset part of an address location. Use when the LocationType is set to LocIsStatic.

HRESULT get_addressOffset (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the offset part of an address location.


IDiaSymbol::get_addressSection

Retrieves the section part of an address location. Use when the LocationType is set to LocIsStatic.

HRESULT get_addressSection (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the section part of an address location.


IDiaSymbol::get_arrayIndexType

Retrieves the symbol interface of the array index type of the symbol.

HRESULT get_arrayIndexType (
   IDiaSymbol** pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a return reference to the IDiaSymbol representing the symbol interface of the array index type of the symbol.

See Also

IDiaSymbol


IDiaSymbol::get_arrayIndexTypeId

Retrieves the array index type ID of the symbol.

HRESULT get_arrayIndexTypeId(
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the array index type ID of the symbol.

See Also

© 1987-2000 Microsoft Corporation. All rights reserved.


IDiaSymbol::get_backEndBuild

Retrieves the back-end build number.

HRESULT get_backEndBuild (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the back-end build number.


IDiaSymbol::get_backEndMajor

Retrieves the back-end major version number.

HRESULT get_backEndMajor (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the back-end major version number.


IDiaSymbol::get_backEndMinor

Retrieves the back-end minor version number.

HRESULT get_backEndMinor (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the back-end minor version number.


IDiaSymbol::get_baseType

Retrieves the type tag of a simple type, as defined in BasicType.

HRESULT get_baseType (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the type tag of a simple type.


IDiaSymbol::get_bitPosition

Retrieves the bit position of location. Used when LocationType is LocIsBitField.

HRESULT get_bitPosition (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the bit position of the location.


IDiaSymbol::get_callingConvention

Returns an indicator of a methods calling convention, as defined in CV_call_e.

HRESULT get_callingConvention (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the indicator of a methods calling convention.


IDiaSymbol::get_classParent

Retrieves a reference to the class parent of the symbol.

HRESULT get_classParent (
   IDiaSymbol** ppParent
);

Parameters

ppParent
[out, retval] Pointer to a reference to the IDiaSymbol interface representing the class parent of the symbol.

See Also

IDiaSymbol


IDiaSymbol::get_classParentId

Retrieves the class Parent ID of the symbol.

HRESULT get_classParentId(
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the class Parent ID of the symbol.

See Also

© 1987-2000 Microsoft Corporation. All rights reserved.


IDiaSymbol::get_code

Retrieves a flag specifying whether the symbol refers to a code address.

HRESULT get_code (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag specifying whether the symbol refers to a code address.


IDiaSymbol::get_constructor

Retrieves a flag specifying whether the user-defined data type has a constructor.

HRESULT get_constructor (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag specifying whether the user-defined data type has a constructor.


IDiaSymbol::get_constType

Retrieves a flag specifying whether the user-defined data type is constant.

HRESULT get_constType (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag specifying whether the user-defined data type is constant.


IDiaSymbol::get_count

Retrieves the number of items in a list or array.

HRESULT get_count (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the number of items in a list or array.


IDiaSymbol::get_dataBytes

Retrieves the data bytes of an OEM symbol.

HRESULT get_dataBytes (
   DWORD cbData,
   DWORD* pcbData,
   BYTE data[]

);

Parameters

cbData
[in] Size of the buffer to hold the data.
pcbData
[out] Number of bytes written, or if data is NULL then number of bytes available.
data[]
[out, size_is(cbData),length_is(*pcbData)]Buffer to hold data.


IDiaSymbol::get_dataKind

Retrieves the variable classification of a data symbol as defined in DataKind.

HRESULT get_dataKind (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the variable classification of a data symbol as defined in DataKind.


IDiaSymbol::get_editAndContinueEnabled

Retrieves the flag describing the edit and continue features of the compiled program or unit. True if edit and continue was enabled at compilation.

HRESULT get_editAndContinueEnabled (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag describing the edit and continue features of the compiled program or unit.


IDiaSymbol::get_frontEndBuild

Retrieves the front-end build number.

HRESULT get_frontEndBuild (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the front-end build number.


IDiaSymbol::get_frontEndMajor

Retrieves the front-end major version number.

HRESULT get_frontEndMajor (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the front-end major version number.


IDiaSymbol::get_frontEndMinor

Retrieves the front-end minor version number.

HRESULT get_frontEndMinor (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the front-end minor version number.


IDiaSymbol::get_function

Retrieves a flag specifying whether the symbol refers to a function.

HRESULT get_function(
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag specifying whether the symbol refers to a function.


IDiaSymbol::get_guid

Retrieves the symbol’s GUID.

HRESULT get_guid (
   GUID* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to the symbol’s GUID.


IDiaSymbol::get_hasAssignmentOperator

Retrieves a flag specifying whether the user-defined data type has any assignment operators defined.

HRESULT get_hasAssignmentOperator (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag specifying whether the user-defined data type has any assignment operators defined.


IDiaSymbol::get_hasCastOperator

Retrieves a flag specifying whether the user-defined data type has any cast operators defined.

HRESULT get_hasCastOperator (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag specifying whether the user-defined data type has any cast operators defined.


IDiaSymbol::get_hasNestedTypes

Retrieves a flag specifying whether the user-defined data type has nested type definitions.

HRESULT get_hasNestedTypes (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag specifying whether the user-defined data type has nested type definitions.


IDiaSymbol::get_indirectVirtualBaseClass

Retrieves a flag specifying whether the user-defined data type is an indirect virtual base class.

HRESULT get_indirectVirtualBaseClass (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag specifying whether the user-defined data type is an indirect virtual base class.


IDiaSymbol::get_intro

Retrieves a flag specifying whether the function is intro virtual.

HRESULT get_intro (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag specifying whether the function is intro virtual.


IDiaSymbol::get_language

Retrieves the language of the source, as defined in LanguageEnum.

HRESULT get_language (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the language of the source.


IDiaSymbol::get_length

Retrieves the number of bytes of memory used by the object represented by this symbol.

HRESULT get_length (
   ULONGLONG* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a ULONGLONG that contains the number of bytes of memory used by the object represented by this symbol.

Example

IDiaSymbol* pSymbol;
ULONGLONG length;
pSymbol->get_length( &length );


IDiaSymbol::get_lexicalParent

Retrieves a reference to the lexical parent of the symbol.

HRESULT get_lexicalParent (
   IDiaSymbol** ppParent
);

Parameters

ppParent
[out, retval] Pointer to a reference to the IDiaSymbol interface representing the lexical parent of the symbol.

See Also

IDiaSymbol


IDiaSymbol::get_lexicalParentID

Retrieves the lexical Parent ID of the symbol.

HRESULT get_lexicalParentID(
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the lexical Parent ID of the symbol.

See Also

© 1987-2000 Microsoft Corporation. All rights reserved.


IDiaSymbol::get_libraryName

Retrieves the file name of the library, or object file, from which the object was loaded.

HRESULT get_libraryName (
   BSTR* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a BSTR that contains the file name of the library, or object file, from which the object was loaded.


IDiaSymbol::get_locationType

Retrieves the location type of a data symbol, as defined in LocationType.

HRESULT get_locationType (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the location type of a data symbol, as defined in LocationType.


IDiaSymbol::get_managed

Retrieves a flag specifying whether the symbol refers to managed code.

HRESULT get_managed (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag specifying whether the symbol refers to managed code.


IDiaSymbol::get_msil

Retrieves a flag specifying whether the symbol refers to MSIL code.

HRESULT get_msil (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag specifying whether the symbol refers to MSIL code.


IDiaSymbol::get_name

Retrieves the name of the executable file, compiland, or function.

HRESULT get_name (
   BSTR* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a BSTR that contains the name of the executable file, compiland, or function.

Example

IDiaSymbol* pType;
BSTR name;
pType->get_name( &name );


IDiaSymbol::get_nested

Retrieves a flag specifying whether the user-defined data type is nested.

HRESULT get_nested (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag specifying whether the user-defined data type is nested.


IDiaSymbol::get_objectFileName

Retrieves the file name of the compiland object file.

HRESULT get_objectFileName (
   BSTR* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a BSTR that contains the file name of the compiland object file.


IDiaSymbol::get_offset

Retrieves the offset of the symbol location. Use when the LocationType is LocIsRegRel.

HRESULT get_offset (
   LONG* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a LONG that contains the offset of the symbol location.


IDiaSymbol::get_overloadedOperator

Retrieves a flag specifying whether the user-defined data type has overloaded operators.

HRESULT get_overloadedOperator (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag specifying whether the user-defined data type has overloaded operators.


IDiaSymbol::get_packed

Retrieves a flag specifying whether the user-defined data type is packed.

HRESULT get_packed (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag specifying whether the user-defined data type is packed.


IDiaSymbol::get_platform

Retrieves the platform type the compiland was compiled for, as defined in CV_CPU_TYPE_e .

HRESULT get_platform (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the platform type the compiland was compiled for.


IDiaSymbol::get_pure

Retrieves a flag specifying whether the function is pure virtual.

HRESULT get_pure (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag specifying whether the function is pure virtual.


IDiaSymbol::get_reference

Retrieves a flag specifying whether a pointer type is a reference.

HRESULT get_reference (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag specifying whether a pointer type is a reference.


IDiaSymbol::get_registerId

Retrieves the register designator of location. Use when the LocationType is set to LocIsEnregistered.

HRESULT get_registerId (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the register designator of the location.


IDiaSymbol::get_relativeVirtualAddress

Retrieves the relative virtual address of the location. Use when the LocationType is set to LocIsStatic.

HRESULT get_relativeVirtualAddress (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the relative virtual address of the location.

Example

IDiaSymbol* pSymbol;
DWORD rva;
pSymbol->get_relativeVirtualAddress( &rva );


IDiaSymbol::get_scoped

Retrieves a flag specifying whether the user-defined data type appears in a non-global lexical scope.

HRESULT get_scoped (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag specifying whether the user-defined data type appears in a non-global lexical scope.


IDiaSymbol::get_slot

Retrieves the slot number of the location. Use when the LocationType is LocIsSlot.

HRESULT get_slot (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the slot number of the location.


IDiaSymbol::get_sourceFileName

Retrieves the file name of the compiland source file.

HRESULT get_sourceFileName (
   BSTR* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a BSTR that contains the file name of the compiland source file.


IDiaSymbol::get_symbolsFileName

Retrieves the name of the file from which the symbols were loaded.

HRESULT get_symbolsFileName (
   BSTR* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a BSTR that contains the name of the file from which the symbols were loaded.


IDiaSymbol::get_symIndexID

Retrieves the symbol index ID of the symbol.

HRESULT get_symIndexID (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the symbol index ID of the symbol.

See Also

© 1987-2000 Microsoft Corporation. All rights reserved.


IDiaSymbol::get_symTag

Retrieves the symbol type classifier, as defined in SymTagEnum.

HRESULT get_symTag (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the symbol type classifier, as defined in SymTagEnum.

Example

IDiaSymbol* pType;
DWORD tag = 0;
pType->get_symTag( &tag );


IDiaSymbol::get_thisAdjust

Retrieves the logical this adjustor for the method.

HRESULT get_thisAdjust (
   LONG* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a LONG that contains the logical this adjustor for the method.

Remarks

In some multiple inheritance cases the method itself must calculate a true this value by adding an offset to this.


IDiaSymbol::get_thunk

Retrieves a flag specifying whether the function is a thunk.

HRESULT get_thunk (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag specifying whether the function is a thunk.


IDiaSymbol::get_thunkOrdinal

Retrieves the kind of thunk that a function is. Used only if a function is actually a thunk.

HRESULT get_thunkOrdinal (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the kind of thunk that a function is.


IDiaSymbol::get_timeStamp

Retrieves the timestamp of the underlying executable.

HRESULT get_timeStamp (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the timestamp of the underlying executable.


IDiaSymbol::get_token

Retrieves the metadata token of a managed function or variable.

HRESULT get_token (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the metadata token of a managed function or variable.


IDiaSymbol::get_type

Retrieves a reference to the function signature.

HRESULT get_type (
   IDiaSymbol** ppRetVal
);

Parameters

ppRetVal
[out, retval] Pointer to a reference to the IDiaSymbol representing the function signature.

Example

IDiaSymbol* pType;
CComPtr<IDiaSymbol> pBaseType;
pType->get_type( &pBaseType );

See Also

IDiaSymbol


IDiaSymbol::get_typeID

Retrieves the type ID of the symbol.

HRESULT get_typeID (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the type ID of the symbol.

See Also

© 1987-2000 Microsoft Corporation. All rights reserved.


IDiaSymbol::get_unalignedType

Retrieves a flag specifying whether the user-defined data type is unaligned.

HRESULT get_unalignedType (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag specifying whether the user-defined data type is unaligned.


IDiaSymbol::get_value

Retrieves the value of a constant.

HRESULT get_value (
   VARIANT* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a VARIANT that contains the value of a constant.


IDiaSymbol::get_virtual

Retrieves a flag specifying whether the function is virtual.

HRESULT get_virtual (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag specifying whether the function is virtual.


IDiaSymbol::get_virtualAddress

Retrieves the virtual address of the location. Use when the LocationType is set to LocIsStatic.

HRESULT get_virtualAddress (
   ULONGLONG* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the virtual address of the location.


IDiaSymbol::get_virtualBaseClass

Retrieves a flag specifying whether the user-defined data type is a virtual base class.

HRESULT get_virtualBaseClass (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag specifying whether the user-defined data type is a virtual base class.


IDiaSymbol::get_virtualBaseOffset

Retrieves the offset in the virtual function table of a virtual function.

HRESULT get_virtualBaseOffset (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the offset in the virtual function table of a virtual function.


IDiaSymbol::get_virtualBasePointerOffset

Retrieves the offset of the virtual base pointer.

HRESULT get_virtualBasePointerOffset (
   LONG* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a LONG that contains the offset of the virtual base pointer.


IDiaSymbol::get_virtualTableShape

Retrieves the symbol interface of the type of the virtual table for a user-defined type.

HRESULT get_virtualTableShape (
   IDiaSymbol** pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a reference to the IDiaSymbol interface of the type of the virtual table for a user-defined type.

See Also

IDiaSymbol


IDiaSymbol::get_VirtualTableShapeId

Retrieves the virtual table shape ID of the symbol.

HRESULT get_VirtualTableShapeId(
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a DWORD that contains the virtual table shape ID of the symbol.

See Also

© 1987-2000 Microsoft Corporation. All rights reserved.


IDiaSymbol::get_volatileType

Retrieves a flag specifying whether the user-defined data type is volatile.

HRESULT get_volatileType (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a Boolean that contains the flag specifying whether the user-defined data type is volatile.


IDiaTable

Enumerates a DIA data source table.

IDiaTable : IEnumUnknown

Methods in Vtable Order

The following table shows the methods of IDiaTable.

Method | Description
get__NewEnum | Retrieves the IEnumVARIANT version of this enumerator.
get_name | Retrieves the name of the table.
get_Count | Retrieves the number of items in the table.
Item | Retrieves a reference to a particular entry index.

Remarks

IDiaTable implements the IEnumUnknown enumeration methods. The IEnumUnknown enumeration interface is much more efficient for iterating over the table contents than the get_Count and Item methods.

Requirements

Header: Dia2.h


IDiaTable::get__NewEnum

Retrieves the IEnumVARIANT version of this enumerator.

HRESULT get__NewEnum (
   IUnknown** pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a reference to the IEnumVARIANT version of this enumerator.


IDiaTable::get_Count

Retrieves the number of items in the table.

HRESULT get_Count (
   LONG* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a LONG that contains the number of items in the table.


IDiaTable::get_name

Retrieves the name of the table.

HRESULT get_name (
   BSTR* pRetVal
);

Parameters

pRetVal
[out, retval] Pointer to a BSTR that contains the name of the table.


IDiaTable::Item

Retrieves a reference to a particular entry index.

HRESULT Item (
   VARIANT index
   IUnknown** element
);

Parameters

index
[in] Index of the specified table entry.
element
[out, retval] Return reference to the IUnknown interface that represents the specified entry.


Enumerations


BasicType

Specifies the basic type of a variable.

enum BasicType
{
   btNoType = 0,
   btVoid = 1,
   btChar = 2,
   btWChar = 3,
   btSChar = 4,
   btUChar = 5,
   btInt = 6,
   btUInt = 7,
   btFloat = 8,
   btBCD = 9,
   btBool = 10,
   btShort = 11,
   btUShort = 12,
   btLong = 13,
   btULong = 14,
   btInt8 = 15,
   btInt16 = 16,
   btInt32 = 17,
   btInt64 = 18,
   btInt128 = 19,
   btUInt8 = 20,
   btUInt16 = 21,
   btUInt32   = 22,
   btUInt64   = 23,
   btUInt128 = 24,
   btCurrency = 25,
   btDate = 26,
   btVariant = 27 ,
   btComplex = 28,
   btBit = 29,
   btBSTR = 30
};

Elements

btNoType
No basic type is specified.
btVoid
Basic type is a void.
btChar
Basic type is a char.
btWChar
Basic type is a wchar.
btSChar
Basic type is an schar.
btUChar
Basic type is an uchar.
btInt
Basic type is an int.
btUInt
Basic type is an uint.
btFloat
Basic type is a float.
btBCD
Basic type is a BCD.
btBool
Basic type is a bool.
btShort
Basic type is a short.
btUShort
Basic type is an ushort.
btLong
Basic type is a long.
btULong
Basic type is an ulong.
btInt8
Basic type is an int8.
btInt16
Basic type is an int16.
btInt32
Basic type is an int32.
btInt64
Basic type is an int64.
btInt128
Basic type is an int128.
btUInt8
Basic type is an uint8.
btUInt16
Basic type is an uint16.
btUInt32
Basic type is an uint32.
btUInt64
Basic type is an uint64.
btUInt128
Basic type is an uint128.
btCurrency
Basic type is a currency.
btDate
Basic type is a date.
btVariant
Basic type is a variant.
btComplex
Basic type is a complex.
btBit
Basic type is a bit.
btBSTR
Basic type is a bstr.


CV_access_e

Specifies the access of member variables.

typedef enum CV_access_e
{
   CV_private = 1,
   CV_protected = 2,
   CV_public = 3
};

Elements

CV_private
Member has private access.
CV_protected
Member has protected access.
CV_public
Member has public access.


CV_call_e

Specifies the calling convention for a function.

enum CV_call_e {
   CV_CALL_NEAR_C = 0x00,
   CV_CALL_FAR_C = 0x01,
   CV_CALL_NEAR_PASCAL = 0x02,
   CV_CALL_FAR_PASCAL = 0x03,
   CV_CALL_NEAR_FAST = 0x04,
   CV_CALL_FAR_FAST = 0x05,
   CV_CALL_SKIPPED = 0x06,
   CV_CALL_NEAR_STD= 0x07,
   CV_CALL_FAR_STD = 0x08,
   CV_CALL_NEAR_SYS= 0x09,
   CV_CALL_FAR_SYS = 0x0a,
   CV_CALL_THISCALL = 0x0b,
   CV_CALL_MIPSCALL = 0x0c,
   CV_CALL_GENERIC = 0x0d,
   CV_CALL_ALPHACALL = 0x0e,
   CV_CALL_PPCCALL = 0x0f,
   CV_CALL_SHCALL = 0x10,
   CV_CALL_ARMCALL  = 0x11,
   CV_CALL_AM33CALL = 0x12,
   CV_CALL_TRICALL = 0x13,
   CV_CALL_RESERVED = 0x14
};

Elements

CV_CALL_NEAR_C
Specifies a function calling convention using a near right to left push, with the calling function popping the stack.
CV_CALL_FAR_C
Specifies a function calling convention using a far right to left push, with the calling function popping the stack.
CV_CALL_NEAR_PASCAL
Specifies a function calling convention using a near left to right push, with the parameter popping the stack.
CV_CALL_FAR_PASCAL
Specifies a function calling convention using a far left to right push, with the parameter popping the stack.
CV_CALL_NEAR_FAST
Specifies a function calling convention using a near left to right push with registers, with the parameter popping the stack.
CV_CALL_FAR_FAST
Specifies a function calling convention using a far left to right push with registers, with the parameter popping the stack.
CV_CALL_SKIPPED
Specifies a function calling convention using a skipped call index.
CV_CALL_NEAR_STD
Specifies a function calling convention using a near standard call.
CV_CALL_FAR_STD
Specifies a function calling convention using a far standard call.
CV_CALL_NEAR_SYS
Specifies a function calling convention using a near system call.
CV_CALL_FAR_SYS
Specifies a function calling convention using a far system call.
CV_CALL_THISCALL
Specifies a function calling convention using this call (this passed in register).
CV_CALL_MIPSCALL
Specifies a function calling convention using a MIPS call.
CV_CALL_GENERIC
Specifies a function calling convention using a generic call sequence.
CV_CALL_ALPHACALL
Specifies a function calling convention using an alphabetical call.
CV_CALL_PPCCALL
Specifies a function calling convention using a PPC call.
CV_CALL_SHCALL
Specifies a function calling convention using a Hitachi SuperH call.
CV_CALL_ARMCALL
Specifies a function calling convention using an ARM call.
CV_CALL_AM33CALL
Specifies a function calling convention using an AM33 call.
CV_CALL_TRICALL
Specifies a function calling convention using a TriCore call.
CV_CALL_RESERVED
Specifies a function calling convention using a first unused call enumeration.


CV_CPU_TYPE_e

Specifies a target processor. The processor is identified in the enumeration element after the CV_CFL_.

typedef enum CV_CPU_TYPE_e {
   CV_CFL_8080 = 0x00,
   CV_CFL_8086 = 0x01,
   CV_CFL_80286 = 0x02,
   CV_CFL_80386 = 0x03,
   CV_CFL_80486 = 0x04,
   CV_CFL_PENTIUM = 0x05,
   CV_CFL_PENTIUMII = 0x06,
   CV_CFL_PENTIUMPRO = CV_CFL_PENTIUMII,
   CV_CFL_PENTIUMIII = 0x07,
   CV_CFL_MIPS = 0x10,
   CV_CFL_MIPSR4000 = CV_CFL_MIPS,
   CV_CFL_MIPS16 = 0x11,
   CV_CFL_MIPS32 = 0x12,
   CV_CFL_MIPS64 = 0x13,
   CV_CFL_MIPSI = 0x14,
   CV_CFL_MIPSII = 0x15,
   CV_CFL_MIPSIII = 0x16,
   CV_CFL_MIPSIV = 0x17,
   CV_CFL_MIPSV = 0x18,
   CV_CFL_M68000 = 0x20,
   CV_CFL_M68010 = 0x21,
   CV_CFL_M68020 = 0x22,
   CV_CFL_M68030 = 0x23,
   CV_CFL_M68040 = 0x24,
   CV_CFL_ALPHA = 0x30,
   CV_CFL_ALPHA_21064 = 0x30,
   CV_CFL_ALPHA_21164 = 0x31,
   CV_CFL_ALPHA_21164A = 0x32,
   CV_CFL_ALPHA_21264 = 0x33,
   CV_CFL_ALPHA_21364 = 0x34,
   CV_CFL_PPC601 = 0x40,
   CV_CFL_PPC603 = 0x41,
   CV_CFL_PPC604 = 0x42,
   CV_CFL_PPC620 = 0x43,
   CV_CFL_SH3 = 0x50,
   CV_CFL_SH3E = 0x51,
   CV_CFL_SH3DSP = 0x52,
   CV_CFL_SH4 = 0x53,
   CV_CFL_ARM3 = 0x60,
   CV_CFL_ARM4 = 0x61,
   CV_CFL_ARM4T = 0x62,
   CV_CFL_OMNI = 0x70,
   CV_CFL_IA64 = 0x80,
   CV_CFL_CEE = 0x90,
} CV_CPU_TYPE_e;


DataKind

Indicates why a data value is within a particular scope.

enum DataKind
{
   DataIsUnknown,
   DataIsLocal,
   DataIsStaticLocal,
   DataIsParam,
   DataIsObjectPtr,
   DataIsFileStatic,
   DataIsGlobal,
   DataIsMember,
   DataIsStaticMember
};

Elements

DataIsUnknown
Unable to determine the data symbol.
DataIsLocal
Data item is a local variable.
DataIsStaticLocal
Data item is a static local variable.
DataIsParam
Data item is a formal parameter.
DataIsObjectPtr
Data item is an object pointer (this).
DataIsFileStatic
Data item is a file scoped variable.
DataIsGlobal
Data item is a global variable.
DataIsMember
Data item is an object member variable.
DataIsStaticMember
Data item is a class variable.


LanguageEnum

Specifies the language of the application.

enum LanguageEnum
{
   LanguageC,
   LanguageCPlus,
   LanguageVB,
   LanguageFortran,
   LanguagePascal,
   LanguageJava,
   LanguageCSharp,
   LanguageCobol
};

Elements

LanguageC
Application language is C.
LanguageCPlus
Application language is C++.
LanguageVB
Application language is Visual Basic.
LanguageFortran
Application language is Fortran.
LanguagePascal
Application language is Pascal.
LanguageJava
Application language is Java.
LanguageCSharp
Application language is C#.
LanguageCobol
Application language is Cobol.


LocationType

Indicates the kind of location information contained in a symbol.

enum LocationType
{
   LocIsNull,
   LocIsStatic,
   LocIsTLS,
   LocIsRegRel,
   LocIsThisRel,
   LocIsEnregistered,
   LocIsBitField,
   LocIsSlot,
   LocIsIlRel,
   LocInMetaData,
   LocTypeMax
};

Elements

LocIsNull
No location information is available.
LocIsStatic
Location is static.
LocIsTLS
Location is in thread local storage.
LocIsRegRel
Location is register relative.
LocIsThisRel
Location is this relative.
LocIsEnregistered
Location is in a register.
LocIsBitField
Location is in a bit field.
LocIsSlot
Location is an MSIL (Microsoft Intermediate Language) slot.
LocIsIlRel
Location is IL relative.
LocInMetaData
Location is found in the metadata for this symbol.
LocTypeMax
Maximum location type value.


NameSearchOptions

Specifies the name search option.

enum NameSearchOptions
{
   nsNone,
   nsCaseSensitive,
   nsCaseInsensitive,
   nsFNameExt,
   nsRegularExpression,
   nsCaseInRegularExpression
};

Elements

nsNone
No options are specified.
nsCaseSensitive
Apply a case sensitive name match.
nsCaseInsensitive,
Apply a case insensitive name match.
nsFNameExt
Treat names as paths and apply a filename.ext name match.
nsRegularExpression
Apply a case sensitive name match with regular expressions that use only '*' and '?'.
nsCaseInRegularExpression
Apply a case insensitive name match with regular expressions that use only '*' and '?'.


SymTagEnum

Each symbol is classified with the following enumerator value. The values describe both the class and lexical hierarchies.

enum SymTagEnum
{
   SymTagNull,
   SymTagExe,
   SymTagCompiland,
   SymTagCompilandDetails,
   SymTagCompilandEnv,
   SymTagFunction,
   SymTagBlock,
   SymTagData,
   SymTagConstant,
   SymTagLabel,
   SymTagPublicSymbol,
   SymTagUDT,
   SymTagEnum,
   SymTagFunctionType,
   SymTagPointerType,
   SymTagArrayType,
   SymTagBaseType,
   SymTagTypedef,
   SymTagBaseClass,
   SymTagFriend,
   SymTagFunctionArgType,
   SymTagFuncDebugStart,
   SymTagFuncDebugEnd,
   SymTagUsingNamespace,
   SymTagVTableShape,
   SymTagVTable,
   SymTagCustom,
   SymTagMax
};

Elements

SymTagNull
No classification can be discovered for this symbol; most likely an internal error has occurred.
SymTagExe
Tag indicating an .exe file described by the symbol store. There is only one symbol with SymTagExe per symbols store. It serves as the global scope. It does not have a lexical parent.
SymTagCompiland
Tag indicating the compiland symbol for each compiland component of the symbol store. For native programs these correspond to the object files linked into the image. For some kinds of MSIL images there is one compiland per class.
SymTagCompilandDetails
Tag indicating that the CompilandDetails symbol contains extended attributes of the compiland. Retrieving these properties may require loading compiland symbols.
SymTagCompilandEnv
Tag indicating the environment strings defined for the compiland.
SymTagFunction
Tag indicating the symbol is a function (or thunk).
SymTagBlock
Tag indicating the symbol is a nested block.
SymTagData
Tag indicating the symbol is data.
SymTagConstant
Tag indicating the symbol is a constant value.
SymTagLabel
Tag indicating the symbol is a label.
SymTagPublicSymbol
Tag indicating the symbol is a public symbol. For native application these are the COFF external symbols encountered while linking the image.
SymTagUDT
Tag indicating the symbol is a user-defined type (struct or class).
SymTagEnum
Tag indicating the symbol is an enumerated type.
SymTagFunctionType
Tag indicating the symbol is a function signature type.
SymTagPointerType
Tag indicating the symbol is a pointer type.
SymTagArrayType
Tag indicating the symbol is an array type.
SymTagBaseType
Tag indicating the symbol is a simple type.
SymTagTypedef
Tag indicating the symbol is a typedef; that is, an alias for another type.
SymTagBaseClass
Tag indicating the symbol is a base class of a user-defined type.
SymTagFriend
Tag indicating the symbol is a friend of a user-defined type.
SymTagFunctionArgType
Tag indicating the symbol is a function argument.
SymTagFuncDebugStart
Tag indicating the symbol indicates the location of the end of the function’s prologue code.
SymTagFuncDebugEnd
Tag indicating the symbol indicates the location of the beginning of the function’s epilogue code.
SymTagUsingNamespace
Tag indicating the symbol is a namespace name active in the current scope.
SymTagVTableShape
Tag indicating the symbol is a virtual table description.
SymTagVTable
Tag indicating the symbol is a virtual table pointer.
SymTagCustom
Tag indicating the symbol is a custom symbol uninterrupted by DIA.
SymTagMax
Tag indicating the maximum symbol type.


Thunk_Ordinal

Designates thunk types.

typedef enum Thunk_Ordinal
{
   THUNK_ORDINAL_NOTYPE,
   THUNK_ORDINAL_ADJUSTOR,
   THUNK_ORDINAL_VCALL,
   THUNK_ORDINAL_PCODE,
   THUNK_ORDINAL_LOAD
};

Elements

THUNK_ORDINAL_NOTYPE
Standard thunk.
THUNK_ORDINAL_ADJUSTOR
“this” adjustor thunk.
THUNK_ORDINAL_VCALL
Virtual call thunk.
THUNK_ORDINAL_PCODE
Pcode thunk.
THUNK_ORDINAL_LOAD
Delay load thunk.


Dia2dump Sample

The Dia2dump sample consists of the dia2dump.cpp source file. The compiled executable runs from the command line and displays the contents of an entire .pdb file.

dia2dump [-nocom] <filename>

Parameters

-nocom
Specifies that the .pdb file was created from a program that did not use COM.


Dia2dump.cpp Source File

// dia2dump.cpp : Defines the entry point for the console application.

//

#include "stdafx.h"
#include <pdb.h>

//
// A private function to do the equivalent of a CoCreateInstance in
// cases where you cannot make the real call. Use this when, for
// instance, you need to create a symbol reader in the runtime but
// you are not CoInitialized. Obviously, this is only good for COM
// objects for which CoCreateInstance is just a glorified
// find-and-load-me operation.
//
typedef HRESULT __stdcall DLLGETCLASSOBJECT(REFCLSID rclsid,
                                 REFIID   riid,
                                 void   **ppv);

IID IID_ICF = {0x00000001, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}};

HRESULT FakeCoCreateInstance(REFCLSID   rclsid,
                      REFIID   riid,
                      void   **ppv)
{
   HRESULT hr = S_OK;

   // Convert the CLSID to a string so the InprocServer32 can be found
   // in the registry.
   WCHAR guidString[64];
   WCHAR keyString[1024];

   StringFromGUID2(rclsid, guidString, 64);
   swprintf(keyString, L"CLSID\\%s\\InprocServer32", guidString);

   // Grab the DLL name now.
   HKEY key;
   DWORD len;
   LONG result = RegOpenKeyW(HKEY_CLASSES_ROOT, keyString, &key);
   WCHAR dllName[MAX_PATH];

   if (result == ERROR_SUCCESS)
   {
      DWORD type;

      result = RegQueryValueExW(key, NULL, NULL, &type, NULL, &len);

      if ((result == ERROR_SUCCESS) && ((type == REG_SZ) ||
                                (type == REG_EXPAND_SZ)))
      {
         assert(len <= MAX_PATH);

         result = RegQueryValueExW(key, NULL, NULL, &type,
                              (BYTE*) dllName, &len);

         if (result != ERROR_SUCCESS)
            hr = HRESULT_FROM_WIN32(GetLastError());
      }
      else
         hr = HRESULT_FROM_WIN32(GetLastError());

      RegCloseKey(key);
   }
   else
      hr = HRESULT_FROM_WIN32(GetLastError());

   if (FAILED(hr))
      return hr;

   // Load the name of the DLL now.
   HINSTANCE dll = LoadLibraryW(dllName);

   if (dll != NULL)
   {
      // Find the DllGetClassObject function now.
      FARPROC func = GetProcAddress(dll, "DllGetClassObject");

      if (func != NULL)
      {
         // Call the function to get a class factory for
         // the RCLSID passed in.
         IClassFactory *classFactory;
         DLLGETCLASSOBJECT *dllGetClassObject = (DLLGETCLASSOBJECT*)func;

         hr = dllGetClassObject(rclsid,
                           IID_ICF,
                           (void**)&classFactory);

         if (SUCCEEDED(hr))
         {
            // Ask the class factory to create an instance of the
            // necessary object.
            hr = classFactory->CreateInstance(NULL, riid, ppv);

            // Release the class factory.
            classFactory->Release();
         }
      }
      else
         hr = HRESULT_FROM_WIN32(GetLastError());
   }
   else
      hr = HRESULT_FROM_WIN32(GetLastError());

   return hr;
}

void Fatal( const char *msg )
{
   printf( msg );
   printf( "\n" );
   exit( -1 );
}

bool fNoCom = false;

void freeString( BSTR bstr )
{
   if ( fNoCom )
      LocalFree( bstr );
   else
      SysFreeString( bstr );
}

void setupNoCom()
{
   fNoCom = true;
}

CComPtr<IDiaSession> psession;
CComPtr<IDiaSymbol> pglobal;

void printType( IDiaSymbol* pType )
{
   DWORD tag = 0;
   pType->get_symTag( &tag );
   BSTR name;
   pType->get_name( &name );
   if ( name != NULL ) {
      printf( "%ws", name );
      freeString( name );
   } else if ( tag == SymTagPointerType ) {
      CComPtr<IDiaSymbol> pBaseType;
      if ( SUCCEEDED ( pType->get_type( &pBaseType ) ) ) {
         printType( pBaseType );
         printf( "*" );
      } else {
         Fatal( "pointer get_type" );
      }
   }
}

void dumpFunctionLines( IDiaSymbol* pSymbol, IDiaSession* pSession )
{
   DWORD rva;
   ULONGLONG length;
   pSymbol->get_relativeVirtualAddress( &rva );
   pSymbol->get_length( &length );
   if ( rva != 0 && length > 0 ) {
      CComPtr< IDiaEnumLineNumbers > pLines;
      if ( SUCCEEDED( pSession->findLinesByRVA( rva, static_cast<DWORD>( length ), &pLines ) ) ) {
         CComPtr< IDiaLineNumber > pLine;
         DWORD celt;
         while ( SUCCEEDED( pLines->Next( 1, &pLine, &celt ) ) && celt == 1 ){
            DWORD offset;
            DWORD seg;
            DWORD linenum;
            pLine->get_addressSection( &seg );
            pLine->get_addressOffset( &offset );
            pLine->get_lineNumber( &linenum );
            printf( "\tline %d at 0x%x:0x%x\n", linenum, seg, offset );
            pLine = NULL;
         }
      }
   }
}

wchar_t* szTags[] = {
   L"",
   L"Executable (Global)",
   L"Compiland",
   L"CompilandDetails",
   L"CompilandEnv",
   L"Function",
   L"Block",
   L"Data",
   L"Constant",
   L"Label",
   L"PublicSymbol",
   L"UDT",
   L"Enum",
   L"FunctionType",
   L"PointerType",
   L"ArrayType",
   L"BaseType",
   L"Typedef",
   L"BaseClass",
   L"Friend",
   L"FunctionArgType",
   L"FuncDebugStart",
   L"FuncDebugEnd",
   L"UsingNamespace",
   L"VTableShape",
   L"VTable",
   L"Custom",
   L""
};

bool fTagScopes[] = {
   false,
   true,
   true,
   false,
   false,
   true,
   true,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false,
   false
};

wchar_t* symbolTagName( DWORD tag )
{
   if ( tag > SymTagNull && tag < SymTagMax )
      return szTags[ tag ];
   assert( false );
   return L"Error!";
}

bool isScopeSym( DWORD tag )
{
   if ( tag > SymTagNull && tag < SymTagMax )
      return fTagScopes[ tag ];
   assert( false );
   return false;
}

void printScopeName( IDiaSymbol* pscope )
{
   DWORD tag;
   BSTR name;
   if ( FAILED( pscope->get_symTag( &tag ) ) )
      Fatal( "Internal error, getting SymTag" );
   if ( FAILED( pscope->get_name( &name ) ) )
      Fatal( "Internal error, getting name" );
   if ( name == NULL ) {
      wprintf( szTags[ tag ] );
      return;
   }
   wprintf( L"%ws (%ws)", name, szTags[ tag ] );
   freeString( name );
}

void PrintNameFromScope( wchar_t* name, IDiaSymbol* pscope, IDiaEnumSymbols* pEnum )
{
   CComPtr< IDiaSymbol> pSym;
   DWORD celt;
   while ( SUCCEEDED( pEnum->Next( 1, &pSym, &celt ) ) && celt == 1 ) {
      DWORD tag;
      if ( FAILED( pSym->get_symTag( &tag ) ) )
         Fatal( "Internal error, no SymTag" );
      // Tagtype name found in the name or scopeTag.
      wprintf( L"\t%ws %ws found in ", szTags[ tag ], name );
      printScopeName( pscope );
      wprintf( L"\n" );
      pSym = 0;
   }
}

void FindNameInNamespace( wchar_t* name, IDiaSymbol* pnamespace )
{
   wchar_t *buf = NULL;
   BSTR szNamespace;
   pnamespace->get_name( &szNamespace );
   buf = new wchar_t[ wcslen( name ) + wcslen( szNamespace ) + 3];
   wsprintfW( buf, L"%s::%s", szNamespace, name );
   freeString( szNamespace );
   CComPtr< IDiaEnumSymbols > pEnum;
   if ( FAILED( psession->findChildren( pglobal, SymTagNull, name, nsCaseSensitive, &pEnum ) ) )
      Fatal( "Namespace findChildren failed" );
   long cnt = 0;
   if ( pEnum != NULL && SUCCEEDED( pEnum->get_Count(&cnt) ) && cnt > 0 ) {  // Found a name.
      PrintNameFromScope( name, pglobal, pEnum );
   }
   delete [] buf;
}

void FindNameInEnum( wchar_t* name, IDiaSymbol* penumeration )
{
   CComPtr< IDiaEnumSymbols > pEnum;
   if ( FAILED( psession->findChildren( penumeration, SymTagConstant, name, nsCaseSensitive, &pEnum ) ) )
      Fatal( "Enumeration findChildren failed" );
   long cnt = 0;
   if ( pEnum != NULL && SUCCEEDED( pEnum->get_Count(&cnt) ) && cnt > 0 ) {  // Found a name.
      PrintNameFromScope( name, penumeration, pEnum );
   }
}

void FindNameInClass( wchar_t* name, IDiaSymbol* pclass )
{
   CComPtr< IDiaEnumSymbols > pEnum;
   if ( FAILED( psession->findChildren( pclass, SymTagNull, name, nsCaseSensitive, &pEnum ) ) )
      Fatal( "Class findChildren failed" );
   long cnt = 0;
   if ( pEnum != NULL && SUCCEEDED( pEnum->get_Count(&cnt) ) && cnt > 0 ) {  // found a name!
      PrintNameFromScope( name, pclass, pEnum );
   }
   pEnum = 0;
   // check out the enumerations
   CComPtr< IDiaSymbol > pSym;
   if ( FAILED( psession->findChildren( pclass, SymTagEnum, NULL, nsNone, &pEnum ) ) )
      Fatal( "Class findChildren for enums failed" );
   if ( pEnum != NULL && SUCCEEDED( pEnum->get_Count(&cnt) ) && cnt > 0 ) {  // found an enum!
      DWORD celt;
      while ( SUCCEEDED( pEnum->Next( 1, &pSym, &celt ) ) && celt == 1 ) {
         FindNameInEnum( name, pSym );
         pSym = 0;
      }
   }
   pEnum = 0;
   // check out the base classes
   if ( FAILED( psession->findChildren( pclass, SymTagBaseClass, NULL, nsNone, &pEnum ) ) )
      Fatal( "Class findChildren for base classes failed" );
   if ( pEnum != NULL && SUCCEEDED( pEnum->get_Count(&cnt) ) && cnt > 0 ) {  // found a base class!
      DWORD celt;
      while ( SUCCEEDED( pEnum->Next( 1, &pSym, &celt ) ) && celt == 1 ) {
         CComPtr< IDiaSymbol > pClass;
         if ( FAILED( pSym->get_type( &pClass ) ) )
            Fatal( "Getting class for a base type failed" );
         if ( pClass )
            FindNameInClass( name, pClass );
         pSym = 0;
      }
   }
}

void FindCppNameInScope( wchar_t* name, IDiaSymbol* pScope )
{
   // while ( scope ) {
      // Scan the scope for a symbol.
      // If any namespaces, then scan for name in namespace.
      // If scope is a member function then
      //   scan class parent for member with name.
      // scope = scope.parent;
   // }

   wprintf( L"Finding name \"%ws\" in ", name );
   printScopeName( pScope );
   wprintf( L"\n" );

   DWORD celt;
   long cnt = 0;
   CComPtr< IDiaSymbol > pSym;
   CComPtr< IDiaSymbol > pParent;
   CComPtr< IDiaSymbol > pscope;
   for ( pscope = pScope; pscope != NULL; ) {
      CComPtr< IDiaEnumSymbols > pEnum;
      // local data search
      if ( FAILED( psession->findChildren( pscope, SymTagNull, name, nsCaseSensitive, &pEnum ) ) )
         Fatal( "Local scope findChildren failed" );
      if ( pEnum != NULL && SUCCEEDED( pEnum->get_Count(&cnt) ) && cnt > 0 ) {  // found a name!
         PrintNameFromScope( name, pscope, pEnum );
      }
      pEnum = 0;
      // look into any namespaces
      if ( FAILED( psession->findChildren( pscope, SymTagUsingNamespace, NULL, nsNone, &pEnum ) ) )
         Fatal( "Namespace findChildren failed" );
      if ( pEnum != NULL && SUCCEEDED( pEnum->get_Count(&cnt) ) && cnt > 0 ) {  // found a namespace!
         while ( SUCCEEDED( pEnum->Next( 1, &pSym, &celt ) ) && celt == 1 ) {
            FindNameInNamespace( name, pSym );
            pSym = 0;
         }
      }
      pEnum = 0;
      // is this a member function?
      DWORD tag = SymTagNull;
      if ( SUCCEEDED( pscope->get_symTag( &tag ) )
         && tag == SymTagFunction
         && SUCCEEDED( pscope->get_classParent( &pParent ) )
         && pParent != NULL ) {
         FindNameInClass( name, pParent );
      }
      pParent = NULL;
      // move to lexical parent
      if ( SUCCEEDED( pscope->get_lexicalParent( &pParent ) )
         && pParent != NULL ) {
         pscope = pParent;
      } else {
         pscope = NULL;
      }
      pParent = NULL;
   };
}

void
Dump(
   char *szFilename,
   IDiaDataSource* pSource,
   wchar_t* szLookup
)
{
   HRESULT   hr;
   EC ec;
   char szError[ cbErrMax ];
   PDB* ppdb = NULL;
   if ( !PDB::Open( szFilename, pdbRead, 0, &ec, szError, &ppdb ) || ppdb == NULL )
      Fatal( "PDB::Open" );
   if ( FAILED( pSource->openWithPdb( ppdb ) ) )
      Fatal( "openWithPdb" );
   if ( FAILED( pSource->openSession( &psession ) ) )
      Fatal( "openSession" );
   if ( FAILED( psession->get_globalScope( &pglobal) ) )
      Fatal( "get_globalScope" );
   CComPtr<IDiaEnumTables> pTables;
   if ( FAILED( psession->getEnumTables( &pTables ) ) )
      Fatal( "getEnumTables" );
   CComPtr< IDiaTable > pTable;
   ULONG celt = 0;
   while ( SUCCEEDED( hr = pTables->Next( 1, &pTable, &celt ) ) && celt == 1 ) {
      BSTR name;
      if ( FAILED( pTable->get_name( &name ) ) )
         Fatal( "get_name" );
      printf( "Found table: %ws\n", name );
      freeString( name );
      CComPtr<IDiaEnumSymbols> pSymbols;
      CComPtr<IDiaEnumSourceFiles> pSourceFiles;
      CComPtr<IDiaEnumSegments> pSegments;
      if ( SUCCEEDED( pTable->QueryInterface( IID_IDiaEnumSymbols, (void**)&pSymbols ) ) ) {
         CComPtr<IDiaSymbol> pSymbol;
         while ( SUCCEEDED( hr = pSymbols->Next( 1, &pSymbol, &celt ) ) && celt == 1 ) {
            pSymbol->get_name( &name );
            DWORD symTag;
            pSymbol->get_symTag( &symTag );
            if ( name != NULL ) {
               printf( "sym name: %ws", name );
               freeString( name );
               CComPtr<IDiaSymbol> pType;
               if ( SUCCEEDED ( hr = pSymbol->get_type( &pType ) ) ) {
                  printf( " has type " );
                  printType( pType );
               }
               printf( "\n" );
               if ( symTag == SymTagFunction ) {
                  dumpFunctionLines( pSymbol, psession );
               }

            }
            if ( isScopeSym( symTag ) ) {
               FindCppNameInScope( szLookup, pSymbol );
            }
            pSymbol = NULL;
         }
      } else if ( SUCCEEDED( pTable->QueryInterface( IID_IDiaEnumSourceFiles, (void**)&pSourceFiles ) ) ) {
         CComPtr<IDiaSourceFile> pSourceFile;
         while ( SUCCEEDED( hr = pSourceFiles->Next( 1, &pSourceFile, &celt ) ) && celt == 1 ) {
            pSourceFile->get_fileName( &name );
            if ( name != NULL ) {
               printf( "file name: %ws\n", name );
               freeString( name );
            }
            pSourceFile = NULL;
         }
      } else if ( SUCCEEDED( pTable->QueryInterface( IID_IDiaEnumSegments, (void**)&pSegments ) ) ) {
         CComPtr<IDiaSegment> pSegment;
         while ( SUCCEEDED( hr = pSegments->Next( 1, &pSegment, &celt ) ) && celt == 1 ) {
            DWORD rva;
            DWORD seg;
            pSegment->get_relativeVirtualAddress( &rva );
            pSegment->get_addressSection( &seg );
            printf( "Segment %i addr: 0x%.8X\n", seg, rva );
            pSegment = NULL;
         }
      }

      pTable = NULL;
   }
   if ( FAILED( hr ) )
      Fatal( "Next" );
}

void usage( int argc, char* argv[] )
{
   printf( "usage: %s [-nocom] <filename>\n", argv[0] );
   exit( -1 );
}

int main(int argc, char* argv[])
{
   if ( argc < 2 ) {
      usage(argc, argv);
   }

   if ( argc > 2 ) {
      if ( strcmp( argv[1], "-nocom" ) == 0 ) {
         setupNoCom();
      }
   }

   CComPtr<IDiaDataSource> pSource;
   HRESULT   hr;
   // Initialize The Component Object Module Library

   if ( fNoCom ) {
      FakeCoCreateInstance( CLSID_DiaSourceAlt, IID_IDiaDataSource, (void **) &pSource );
   } else {
      hr = CoInitialize(NULL);
      if (FAILED(hr))
      {
         Fatal("CoInitialize failed\n");
      }

      // Obtain Access To The Provider
      hr = CoCreateInstance(CLSID_DiaSource, NULL, CLSCTX_INPROC_SERVER,
         IID_IDiaDataSource, (void **) &pSource);
      if (FAILED(hr))
      {
         Fatal("Could not CoCreate CLSID_DiaSource");
      }
   }
   int iPdb = fNoCom ? 2 : 1;
   wchar_t name[ 256 ];
   mbstowcs( name, argv[ iPdb+1 ], 256 );
   Dump( argv[ iPdb ], pSource, name );
   return 0;
}

#if defined(_DEBUG)

extern "C" void failAssertion(const char* szAssertFile, int line)
{
   fprintf(stderr, "assertion failure: file %s, line %d\n", szAssertFile, line);
   fflush(stderr);
   DebugBreak();
}

extern "C" void failExpect(const char* szFile, int line)
{
   fprintf(stderr, "expect failure: file %s, line %d\n", szFile, line);
   fflush(stderr);
}

#endif


Debug Interface Access SDK

Conceptual Overview

Except where explicitly stated otherwise, the interfaces in the DIA SDK each represents a different COM object. Additional interfaces, and thus additional object, are created via explicit queries, such as IDiaDataSource::openSession or IDiaSession::findChildren, rather than by calling QueryInterface on existing interface pointers.