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 program database (.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 develop applications that search for and browse debug information stored in a .pdb file. Such applications could, for example, report stack trace-back information and analyze performance data.

In the DIA SDK Documentation

Getting Started
Gives an overview of the DIA SDK features and how to install the DIA SDK files.
Querying the .pdb File
Provides instructions on how to use the DIA API to query the .pdb file.
Symbols and Symbol Tags
Discusses how symbols and symbol tags are used in the DIA API.
API Reference
Contains the interfaces, methods, enumerations, and structures of the DIA API.
Dia2dump Sample
Illustrates how to use the DIA API to search for and browse debug information.

© 2001 Microsoft Corporation. All rights reserved.

Build: Topic Version 7.0.9328.1129


Getting Started

The Debug Interface Access (DIA) SDK supplies you with instructional documentation and a sample that illustrates how to use the DIA API. Use the interfaces and methods in the DIA SDK to develop custom applications that open the .pdb and .dbg files and search their content for symbols, values, attributes, addresses, and other debugging information. This SDK also provides reference tables for the properties associated with symbols found in C++ applications.

To best use the DIA SDK, you should be familiar with the following:

  • C++ programming language
  • COM programming
  • Visual Studio .NET integrated development environment (IDE) for compiling the samples

In This Section

Conceptual Overview
Reviews the basic architecture of DIA.
Querying the .pdb File
Provides step-by-step instructions on how to use the DIA API to query a .pdb file.


Conceptual Overview

Use the DIA SDK to access the Microsoft debug information. The DIA SDK provides a COM based API set that eliminates the need to rewrite your code whenever Microsoft changes the format of the debug information. The DIA SDK also allows you to read from a select set of previous versions of debug information, located in .pdb and .dbg files generated by Visual C++ versions 5.0 and later.

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

For terminology used within the DIA SDK, see Glossary of DIA SDK Terms.

See Also

IDiaDataSource::openSession | IDiaSession::findChildren


Querying the .pdb File

Your DIA application uses the following general steps to obtain details about the various symbols, objects, and data elements within an executable image.

To query the .pdb file

  1. Acquire a data source by creating an IDiaDataSource interface.
  2. Call IDiaDataSource::openSession to open an IDiaSession.
  3. Use the methods in IDiaSession to query for the symbols in the data source.
  4. Use the IDiaEnum* interfaces to enumerate and scan through the symbols or other elements of debug information.

See Also

IDiaDataSource


Symbols and Symbol Tags

Debug information about a compiled program is stored in the program database (.pdb) file as symbols that are accessible using the Debug Interface Access (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 value that contains the unique identifier for every instance of a symbol.

Symbols also have properties that can contain additional information about the symbol as well as references to other symbols, most often a lexicalParent or classParent. When you query a property that contains a reference, the reference is returned as an IDiaSymbol interface. Such properties are always paired with another property by the same name but suffixed with Id, for example, lexicalParentId and classParentId. The tables in Symbol Locations, Lexical Hierarchy of Symbol Types, and Class Hierarchy of Symbol Types outline the properties for each of the different kinds of symbols. These properties may have relevant information about or references to other symbols. Because the *Id properties are simply numeric ordinal identifiers of their related properties, they are omitted from further discussions. They are referred to only where needed for parameter clarification.

When trying to access the property, if no error occurs and the symbol property has been assigned a value, the property's get_* method returns S_OK. A return value of S_FALSE indicates that the property is not valid for the current symbol.

See Also

Symbol Locations | Lexical Hierarchy of Symbol Types | Class Hierarchy of Symbol Types


Symbol Locations

Most symbols have a defined location within the image file. A symbol's location is specified with a value from the LocationType enumeration. The symbol may support additional properties depending on its location.

The following table shows the most commonly used location types and their additional properties.

Location type | Additional properties
LocIsNull | none
LocIsStatic | addressOffset addressSection relativeVirtualAddress (if relative virtual addresses are enabled) virtualAddress (if the image base has been set to nonzero)
LocIsTLS | addressSection addressOffset
LocIsRegRel | registerId offset
LocIsThisRel | offset
LocIsEnregistered | registerId
LocIsBitField | bitPosition length
LocIsSlot | slot
LocIsIlRel | offset
LocInMetaData | token
LocIsConstant | value

See Also

IDiaSymbol::get_addressOffset | IDiaSymbol::get_addressSection | IDiaSymbol::get_bitPosition | IDiaSymbol::get_length | IDiaSymbol::get_locationType | IDiaSymbol::get_offset | IDiaSymbol::get_registerId | IDiaSymbol::get_relativeVirtualAddress | IDiaSymbol::get_slot | IDiaSymbol::get_token | IDiaSymbol::get_value | IDiaSymbol::get_virtualAddress | LocationType | Symbols and Symbol Tags


Lexical Hierarchy of Symbol Types

The following table shows the symbol types in the lexical hierarchy.

Symbol type | Description
Exe | Specifies the global scope of the data; corresponds to an entire .exe or .dll file.
Compiland | Specifies a compiland linked into the .exe file.
CompilandDetails | Specifies compiland data that may require loading additional compiland details and thus incur run-time overhead to retrieve.
CompilandEnv | Specifies any additional environment variables significant to the compilation of the compiland.
Function | Specifies a function.
Block | Specifies nested scopes in functions.
Data | Specifies such variables as parameters, local variables, global variables, and class members.
Label | Specifies a location in program code.
PublicSymbol | Specifies an external symbol that appears when building the executable program.
FuncDebugStart | Specifies a function that has a defined point at which debugging is to begin.
FuncDebugEnd | Specifies a function that has a defined point at which debugging is to end.
UsingNameSpace | Specifies a namespace identifier.
Custom | Specifies a user-defined symbol
Thunk | Specifies a thunk.
Note Additional symbol properties may be available depending on the symbol type. These properties are listed in the individual symbol topics as appropriate.

See Also

Class Hierarchy of Symbol Types | IDiaSymbol::get_symTag | Symbols and Symbol Tags | SymTagEnum


Block

Each code block is identified by a SymTagBlock symbol. Block symbols are used to identify nested scopes within functions.

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

Property | Data type | Description
addressOffset | DWORD | Offset part of location; for details, see the LocationType enumeration
addressSection | DWORD | Section part of location; for details, see the LocationType enumeration
length | ULONGLONG | Number of bytes of code in the block
lexicalParent | IDiaSymbol* | Symbol of the enclosing block or function
locationType | DWORD | Blocks have static locations; for details, see Symbol Locations

See Also

Lexical Hierarchy of Symbol Types | LocationType | Symbol Locations


Compiland

There is one symbol with SymTagCompiland for each compiland linked into the .exe file. Compiland information is split between symbols with a SymTagCompiland tag, which can be retrieved without loading additional compiland symbols, and symbols with a SymTagCompilandDetails tag, which may require loading additional symbols.

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

Property | Data type | Description
editAndContinueEnabled | BOOL | TRUE if Edit and Continue was enabled at compilation
lexicalParent | IDiaSymbol* | Symbol for the .exe file
libraryName | BSTR | Name of the library or object file from where object was loaded
name | BSTR | File name of the compiland's object file
sourceFileName | BSTR | Name of the source file

See Also

CompilandDetails | CompilandEnv | Lexical Hierarchy of Symbol Types


CompilandDetails

Compiland information is split between symbols with a SymTagCompiland tag, which can be retrieved without loading additional compiland symbols, and symbols with a SymTagCompilandDetails tag, which may require loading additional symbols. Therefore, you may experience greater expensive when querying for SymTagCompilandDetails symbols.

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

Property | Data type | Description
backEndBuild | DWORD | Back-end build number of the compiler
backEndMajor | DWORD | Back-end major version number of the compiler
backEndMinor | DWORD | Back-end minor version number of the compiler
editAndContinueEnabled | BOOL | TRUE if Edit and Continue was enabled at compilation
frontEndBuild | DWORD | Front-end build number of the compiler
frontEndMajor | DWORD | Front-end major version number of the compiler
frontEndMinor | DWORD | Front-end minor version number of the compiler
language | DWORD | Source code language
lexicalParent | IDiaSymbol* | Symbol for the compiland
platform | DWORD | Platform on which the compiland was compiled

See Also

Compiland | Lexical Hierarchy of Symbol Types


CompilandEnv

The compiler may include additional environment variables with symbols. There is one SymTagCompilandEnv symbol for each of these variables.

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

Property | Data type | Description
lexicalParent | IDiaSymbol* | Symbol for the parent compiland
name | BSTR | Name of the variable
value | VARIANT | String-valued contents of the variable (VT_BSTR)

See Also

Compiland | Lexical Hierarchy of Symbol Types


Custom

Some compilers introduce symbols that are not identified by any of the standard lexical symbol types. These symbols are identified by a SymTagCustom tag.

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

Property | Data type | Description
dataBytes | BYTE | Array of data associated with the symbol
guid | GUID | A vendor-assigned identifier for the symbol
lexicalParent | IDiaSymbol* | Symbol for the enclosing compiland, block or function
type | IDiaSymbol* | A type associated with the symbol

See Also

Lexical Hierarchy of Symbol Types


Data

All variables, such as parameters, local variables, global variables, and class members, are identified by SymTagData symbols. Constant values (LocIsConstant) are also identified with this type.

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

Property | Data type | Description
access | DWORD | If a field, then one of the values of the CV_access_e enumeration
addressOffset | DWORD | Offset part of location; for details, see the LocationType enumeration
addressSection | DWORD | Section part of location; for details, see the LocationType enumeration
bitPosition | DWORD | Bit position of location; for details, see the LocationType enumeration
classParent | IDiaSymbol* | Symbol for the class, if this is a structure, union, or class field
dataKind | DWORD | Any of the DataKind enumeration values
length | ULONGLONG | Length of bitfield; for details, see the LocationType enumeration
lexicalParent | IDiaSymbol* | Symbol for the enclosing compiland, function, or block
locationType | DWORD | Any of the allowable location types; for details, see Symbol Locations
name | BSTR | Name of the variable
offset | LONG | Offset from register contents; for details, see the LocationType enumeration
registerId | DWORD | Register designator of location; for details, see the LocationType enumeration
type | IDiaSymbol* | Symbol for the variable type
value | VARIANT | The value of constant data

See Also

CV_access_e | DataKind | Lexical Hierarchy of Symbol Types | LocationType | Symbol Locations


Exe

Exe is the only symbol without either a lexical or class parent as it represents the global scope of the .exe or .dll file. There is only one symbol with the SymTagExe tag per file. The IDiaSession::globalScope method returns the symbol.

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

Property | Data type | Description
name | BSTR | Name of the .exe file
symbolsFileName | BSTR | Full path for the .exe file's .pdb or .dbg file

See Also

IDiaSession::globalScope | Lexical Hierarchy of Symbol Types


Function

Each function is identified by a SymTagFunction symbol.

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

Property | Data type | Description
access | DWORD | If a member function, then one of the values of the CV_access_e enumeration
addressOffset | DWORD | Offset part of location; for details, see the LocationType enumeration
addressSection | DWORD | Section part of location; for details, see the LocationType enumeration
classParent | IDiaSymbol* | Symbol for the class, if the function is a member function
intro | BOOL | TRUE if a function is intro virtual
length | ULONGLONG | Number of bytes of function code starting from location
lexicalParent | IDiaSymbol* | Symbol of the enclosing compiland
locationType | DWORD | Functions can have static or metadata locations; for details, see Symbol Locations
name | BSTR | Name of the function
pure | BOOL | TRUE if function is pure virtual
token | DWORD | Metadata token for the function
type | IDiaSymbol* | Symbol for the function signature
virtualBaseOffset | DWORD | If a virtual function, then the offset in the virtual function table
virtual | BOOL | TRUE if a virtual function

See Also

CV_access_e | Lexical Hierarchy of Symbol Types | LocationType | Symbol Locations


FuncDebugEnd

If a function has a defined point at which debugging is to end, the debug starting point is identified by a symbol with a SymTagFuncDebugEnd tag.

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

Property | Data type | Description
addressOffset | DWORD | Offset part of location; for details, see the LocationType enumeration
addressSection | DWORD | Section part of location; for details, see the LocationType enumeration
lexicalParent | IDiaSymbol* | Symbol for the enclosing function
locationType | DWORD | End points have static location; for details, see Symbol Locations

See Also

Lexical Hierarchy of Symbol Types | LocationType | Symbol Locations


FuncDebugStart

If a function has a defined point at which debugging is to begin, the debug starting point is identified by a symbol with a SymTagFuncDebugStart tag.

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

Property | Data type | Description
addressOffset | DWORD | Offset part of location; for details, see the LocationType enumeration
addressSection | DWORD | Section part of location; for details, see the LocationType enumeration
lexicalParent | IDiaSymbol* | Symbol for the enclosing function
locationType | DWORD | Start points have static locations; for details, see Symbol Locations

See Also

Lexical Hierarchy of Symbol Types | LocationType | Symbol Locations


Label

A location in program code is identified by a SymTagLabel symbol.

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

Property | Data type | Description
addressOffset | DWORD | Offset part of location; for details, see the LocationType enumeration
addressSection | DWORD | Section part of location; for details, see the LocationType enumeration
lexicalParent | IDiaSymbol* | Symbol for the enclosing compiland, block or function
locationType | DWORD | Labels have static locations; for details, see the Symbol Locations enumeration

See Also

Lexical Hierarchy of Symbol Types | LocationType | Symbol Locations


PublicSymbol

When the .exe file is created, each public symbol (at a minimum, each global function and data symbol) is given a SymTagPublicSymbol tag.

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

Property | Data type | Description
addressOffset | DWORD | Offset part of location; for details, see the LocationType enumeration
addressSection | DWORD | Section part of location; for details, see the LocationType enumeration
code | BOOL | TRUE if the symbol's location is in code
function | BOOL | TRUE if the symbol is a function
lexicalParent | IDiaSymbol* | Symbol for the global scope
locationType | DWORD | Public symbols have static locations; for details, see Symbol Locations
managed | BOOL | TRUE if the symbol's location is in managed code
msil | BOOL | TRUE if the symbol's location is in Microsoft Intermediate Language (MSIL) code
name | BSTR | The fully decorated name of the symbol
undecoratedName | BSTR | The undecorated symbol name

See Also

Lexical Hierarchy of Symbol Types | LocationType | Symbol Locations


Thunk

Each thunk is identified by a SymTagThunk tag.

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

Property | Data type | Description
addressOffset | DWORD | Offset part of location; for details, see the LocationType enumeration
addressSection | DWORD | Section part of location; for details, see the LocationType enumeration
length | ULONGLONG | Number of bytes of code in the thunk
lexicalParent | IDiaSymbol* | Symbol for the enclosing compiland, block or function
locationType | DWORD | End points have static location; for details, see Symbol Locations enumeration
name | BSTR | Name of the thunk
thunkOrdinal | DWORD | Thunk type, as defined by the THUNK_ORDINAL enumeration

See Also

Lexical Hierarchy of Symbol Types | LocationType | THUNK_ORDINAL


UsingNameSpace

Some symbols might be referred to by namespace, and would subsequently be identified by a SymTagUsingNameSpace tag.

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

Property | Data type | Description
lexicalParent | IDiaSymbol* | Symbol for the enclosing compiland, block or function
name | BSTR | Namespace name

See Also

Lexical Hierarchy of Symbol Types


Class Hierarchy of Symbol Types

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

Symbol type | Description
UDT | Symbol used to represent each class, structure, 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 user-defined type (UDT)
Friend | Symbol for friend classes and friend functions
FunctionType | Symbol for each unique function signature
FunctionArgType | Symbol for each parameter to a function
VTableShape | Symbol for the size of the virtual table
VTable | Symbol for a virtual table
CustomType | Symbol for vendor-defined type
ManagedType | Symbol for a type defined in metadata
Dimension | Symbol for array dimensions
Note Each symbol can have properties that hold information about the symbol, as well as references to other symbols. These properties are listed in individual symbol topics as appropriate.

All class symbol types, except for those with a scoped property, have a lexicalParent property. In this case, the lexical parent is the global scope. Unless otherwise specified in the individual symbols' topics, the symbol types in the class hierarchy usually have one or more of the properties shown in the following table.

Property | Value | Description
access | DWORD | One of the values of the CV_access_e enumeration
classParent | IDiaSymbol* | Symbol for the parent user-defined type (UDT), if the parent symbol is a nested definition
constType | BOOL | TRUE if const attribute is present
lexicalParent | IDiaSymbol* | Symbol for the global scope
unalignedType | BOOL | TRUE if unaligned attribute is present
volatileType | BOOL | TRUE if volatile attribute is present

See Also

CV_access_e | Lexical Hierarchy of Symbol Types | Symbols and Symbol Tags


ArrayType

An array is identified by a SymTagArray symbol.

The following table shows additional valid properties for this symbol type.

Property | Data type | Description
arrayIndexType | IDiaSymbol* | Symbol for the array index type
length | LONGLONG | Size, in bytes, of this array
rank | DWORD | Rank of a FORTRAN multi-dimensional array
type | IDiaSymbol* | Symbol for the array element type

See Also

Class Hierarchy of Symbol Types | Dimension


BaseClass

Each base class for a user-defined type (UDT) symbol is identified by a child with a SymTagBaseClass tag. The type property contains the symbol for the underlying UDT, and all properties of the underlying UDT are available as part of this BaseClass symbol.

The following table shows additional valid properties for this symbol type.

Property | Data type | Description
indirectVirtualBaseClass | BOOL | TRUE if the base class is indirect
offset | LONG | Offset of sub-object that represents the base class within the structure
type | IDiaSymbol* | The symbol for the base class UDT
virtualBaseClass | BOOL | TRUE if the base class is virtual
virtualBaseDispIndex | DWORD | Index into the virtual base displacement table
virtualBasePointerOffset | LONG | Offset of the virtual base pointer

See Also

Class Hierarchy of Symbol Types | UDT


BaseType

Base types are identified by SymTagBaseType symbols.

The following table shows additional valid properties for this symbol type.

Property | Data type | Description
baseType | DWORD | One of the values of the BasicType enumeration
length | LONGLONG | Size, in bytes, of the base type

See Also

BasicType | Class Hierarchy of Symbol Types


CustomType

Vendor-defined types (compiler-specific types) are identified by a SymTagCustom symbol.

The following table shows additional valid properties for this symbol type.

Property | Data type | Description
dataBytes | BYTE | Array of data associated with the CustomType
guid | GUID | Vendor-supplied identifier
oemId | DWORD | Identifier of OEM
oemSymbolId | DWORD | OEM's internal ID
types | IDiaSymbol** | Array of all types referenced by the custom type symbol
type | IDiaSymbol* | The first type referenced by the custom type symbol

Remarks

None of the other additional properties listed in the Class Hierarchy of Symbol Types topic apply to this symbol.

See Also

Class Hierarchy of Symbol Types


Dimension

Each array has a dimension that is identified by a SymTagDimension symbol.

The following table shows additional valid properties for this symbol type.

Property | Data type | Description
lowerBound | IDiaSymbol* | Lower bound of a FORTRAN array dimension
rank | DWORD | Rank of a FORTRAN multi-dimension array
type | IDiaSymbol* | Symbol for the parent array
upperBound | IDiaSymbol* | Upper bound of a FORTRAN array dimension

Remarks

None of the other additional properties listed in the Class Hierarchy of Symbol Types topic apply to this symbol.

See Also

ArrayType | Class Hierarchy of Symbol Types


Enum

Enumerations are identified by SymTagEnum symbols. Each enumeration value appears as a class child with a SymTagConstant tag.

The following table shows additional valid properties for this symbol type.

Property | Data type | Description
name | BSTR | Name of the enumerated type
nested | BOOL | TRUE if the UDT is nested
scoped | BOOL | TRUE if the UDT appears in a non-global lexical scope
type | IDiaSymbol* | Symbol for the underlying type

See Also

Class Hierarchy of Symbol Types


Friend

Friend classes and friend functions are identified by SymTagFriend symbols. They are children of parent UDTs and have a classParent property.

The following table shows additional valid properties for this symbol type.

Property | Data type | Description
classParent | IDiaSymbol* | Symbol for the UDT parent
name | BSTR | Name of the class or function
type | IDiaSymbol* | Symbol for the class or function

Remarks

None of the other additional properties listed in the Class Hierarchy of Symbol Types topic apply to this symbol.

See Also

Class Hierarchy of Symbol Types


FunctionArgType

Each parameter of a function is identified by a SymTagFunctionArgType symbol.

The following table shows additional valid properties for this symbol type.

Property | Data type | Description
classParent | IDiaSymbol* | Symbol for the FunctionType parent
type | IDiaSymbol* | Type of the parameter

Remarks

None of the other additional properties listed in the Class Hierarchy of Symbol Types topic apply to this symbol.

See Also

Class Hierarchy of Symbol Types | FunctionType


FunctionType

Each unique function signature is identified by a SymTagFunctionType symbol. Each parameter is identified as a class child symbol with a SymTagFunctionArgType tag.

The following table shows additional valid properties for this symbol type.

Property | Data type | Description
callingConvention | DWORD | One of the values of CV_access_e enumeration
classParent | IDiaSymbol* | Class this function (or, method) is a member of
count | DWORD | Number of function parameters
objectPointerType | IDiaSymbol* | Type of the method's object pointer (this)
thisAdjust | LONG | Logical this adjustor for the method
type | IDiaSymbol* | Symbol for the return value type

Remarks

None of the additional properties listed in the Class Hierarchy of Symbol Types topic apply to this symbol.

See Also

Class Hierarchy of Symbol Types | CV_access_e | FunctionArgType


ManagedType

A managed type (any symbol defined by metadata, or native to memory and resource management functionality of languages such as C#) is identified by a SymTagManagedType symbol.

The following table shows additional valid properties for this symbol type.

Property | Data type | Description
name | BSTR | Name of the managed symbol

Remarks

None of the other additional properties listed in the Class Hierarchy of Symbol Types topic apply to this symbol.

See Also

Class Hierarchy of Symbol Types


PointerType

Each pointer is identified by a SymTagPointerType symbol.

The following table shows additional valid properties for this symbol type.

Property | Data type | Description
length | ULONGLONG | Size, in bytes, of the pointer
reference | BOOL | TRUE if pointer is a reference type
type | IDiaSymbol* | Target symbol of the pointer

See Also

Class Hierarchy of Symbol Types


Typedef

Symbols with SymTagTypedef tags introduce names for other types.

The following table shows additional valid properties for this symbol type.

Property | Data type | Description
name | BSTR | Name of the typedef
type | IDiaSymbol* | Symbol for the underlying type

Remarks

None of the additional properties listed in the Class Hierarchy of Symbol Types topic apply to this symbol.

See Also

Class Hierarchy of Symbol Types


UDT

Each class, structure, and union is identified by a SymTagUDT symbol. Each member, function, data, or nested type, and each base class, appears as a class child of the user-defined type (UDT).

The following table shows additional valid properties for this symbol type.

Property | Data type | Description
constructor | BOOL | TRUE if the UDT has a constructor
hasAssignmentOperator | BOOL | TRUE if the UDT has any assignment operators defined
hasCastOperator | BOOL | TRUE if the UDT has any cast operators defined
hasNestedTypes | BOOL | TRUE if the UDT has nested type definitions
length | LONGLONG | The size, in bytes, of the UDT
name | BSTR | The name of the UDT
nested | BOOL | TRUE if the UDT is nested
overloadedOperator | BOOL | TRUE if overloaded operators are defined for the UDT
packed | BOOL | TRUE if the UDT is packed
scoped | BOOL | TRUE if the UDT appears in a non-global lexical scope
udtKind | DWORD | Indicates whether this is a structure, class, or union; for details, see UdtKind enumeration

See Also

Class Hierarchy of Symbol Types


VTable

The virtual table is identified by the SymTagVTable symbol.

The following table shows additional valid properties for this symbol type.

Property | Data type | Description
type | IDiaSymbol* | Symbol for the VTable's VTableShape

Remarks

None of the other additional properties listed in the Class Hierarchy of Symbol Types topic apply to this symbol.

See Also

Class Hierarchy of Symbol Types | VTableShape


VTableShape

The VTable symbol has a class child symbol identified by the SymTagVTableShape tag.

The following table shows additional valid properties for this symbol type.

Property | Data type | Description
count | DWORD | Number of entries in the VTable

Remarks

None of the other additional properties listed in the Class Hierarchy of Symbol Types topic apply to this symbol.

See Also

Class Hierarchy of Symbol Types | VTable


API Reference

In This Section

Interfaces

Enumerations and Structures

Related Sections

Symbols and Symbol Tags


Interfaces

Methods are listed alphabetically under each interface in the table of contents and on the interface page in Vtable order.

In This Section

IDiaAddressMap

IDiaDataSource

IDiaEnumDebugStreamData

IDiaEnumDebugStreams

IDiaEnumFrameData

IDiaEnumInjectedSources

IDiaEnumLineNumbers

IDiaEnumSectionContribs

IDiaEnumSegments

IDiaEnumSourceFiles

IDiaEnumSymbols

IDiaEnumSymbolsbyAddr

IDiaEnumTables

IDiaFrameData

IDiaImageData

IDiaInjectedSource

IDiaLineNumber

IDiaLoadCallback

IDiaReadExeAtRVACallback

IDiaReadExeAtOffsetCallback

IDiaSectionContrib

IDiaSegment

IDiaSession

IDiaSourceFile

IDiaStackWalkFrame

IDiaSymbol

IDiaTable

Related Sections

API Reference


IDiaAddressMap Interface

Allows you to exercise control over how DIA computes virtual and relative virtual addresses for debug objects. This control is encapsulated in two sets of data you can provide, image headers and address maps. Most clients will use the IDiaDataSource::loadDataForExe method to find the proper debug information for an image. The loadDataForExe method usually discovers all the necessary headers and maps data itself. Therefore these clients will not need to use the IDiaAddressMap interface. However some clients implement specialized processing and searching for data. Such clients use the methods of IDiaAddressMap to provide DIA with the search results.

This interface is available from the DIA Session object. The DIA client would invoke QueryInterface on another DIA Session object interface, usually IDiaSession, to retrieve a pointer to an instance of an IDiaAddressMap.

IDiaAddressMap : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaAddressMap.

Method | Description
get_addressMapEnabled | Indicates whether the translation of symbols is enabled after the post-processor upgrades the executable layout.
put_addressMapEnabled | Allows the client to enable or disable the translation of symbols after the post-processor upgrades the executable layout.
get_relativeVirtualAddressEnabled | Allows the client to determine whether the calculation of relative virtual addresses is enabled.
put_relativeVirtualAddressEnabled | Allows the client to enable or disable the calculation of relative virtual addresses.
get_imageAlign | Retrieves the image alignment value from the executable.
put_imageAlign | Sets the image alignment value in the executable.
set_imageHeaders | Sets image headers to enable the translation of relative virtual addresses.
set_addressMap | Provides an address map to support image layout translations.

Requirements

Header: Dia2.h

See Also

IDiaDataSource::loadDataForExe | IDiaSession


IDiaAddressMap::get_addressMapEnabled Method

Indicates whether the translation of symbols is enabled after the post-processor upgrades the executable layout.

HRESULT get_addressMapEnabled (
   BOOL* pRetVal
);

Parameters

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

Remarks

Executable post-processors sometimes update the executable. DIA contains a mechanism to support the translation of symbols to the new layout.

See Also

IDiaAddressMap


IDiaAddressMap::get_imageAlign Method

Retrieves image alignment.

HRESULT get_imageAlign (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a DWORD that contains the image alignment value from the executable.

See Also

IDiaAddressMap


IDiaAddressMap::get_relativeVirtualAddressEnabled Method

Allows the client to determine whether the calculation of relative virtual addresses is enabled.

HRESULT get_relativeVirtualAddressEnabled (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Returns TRUE if the calculation of relative virtual addresses is enabled.

Remarks

The relativeVirtualAddressEnabled method retrieves addresses for debug objects described by DIA interfaces and relative to the executable's image base.

See Also

IDiaAddressMap | IDiaAddressMap::set_imageHeaders


IDiaAddressMap::put_addressMapEnabled Method

Allows the client to enable or disable the translation of symbols after the post-processor upgrades the executable layout.

HRESULT put_addressMapEnabled (
   BOOL NewVal
);

Parameters

NewVal
[in] Set to TRUE to enable the translation of symbols, or FALSE to disable.

Remarks

Executable post-processors sometimes update the executable. DIA contains a mechanism to support the translation of symbols to the new layout.

See Also

IDiaAddressMap


IDiaAddressMap::put_imageAlign Method

Sets image alignment.

HRESULT put_imageAlign (
   DWORD NewVal
);

Parameters

NewVal
[in] The new image alignment value for the executable.

Remarks

The following image alignment values are valid: 1, 2, 4, 8, 16, 32, and 64.

See Also

IDiaAddressMap


IDiaAddressMap::put_relativeVirtualAddressEnabled Method

Allows the client to enable or disable the calculation of relative virtual addresses.

HRESULT put_relativeVirtualAddressEnabled (
   BOOL NewVal
);

Parameters

NewVal
[in] Set to TRUE to enable, or FALSE to disable.

Remarks

Addresses for debug objects described by DIA interfaces, and relative to the executable's image base, can be retrieved as relative virtual addresses.

See Also

IDiaAddressMap


IDiaAddressMap::set_addressMap Method

Provides an address map to support image layout translations.

HRESULT set_addressMap (
   DWORD cbData,
   Struct DiaAddressMapEntry data[],
   BOOL imagetoSymbols
);

Parameters

cbData
[in] Number of DiaAddressMapEntry elements in data.
data[]
[in, size_is(cbData)] The translation map, as DiaAddressMapEntry elements, that defines an image layout translation.
imagetoSymbols
[in] TRUE if data defines a map from the new image layout to the original layout (as described by the debug symbols). FALSE if data is a map to the new image layout taken from the original layout.

Remarks

Usually, DIA retrieves address translation maps from the program database (.pdb) file. If these values are missing, the set_imageHeaders method is called twice, once with imagetoSymbols set to TRUE and once with imagetoSymbols set to FALSE. Address map translations cannot be enabled using the put_addressMapEnabled method unless both translation maps are provided.

See Also

DiaAddressMapEntry | IDiaAddressMap | IDiaAddressMap::put_addressMapEnabled | IDiaAddressMap::set_imageHeaders


IDiaAddressMap::set_imageHeaders Method

Sets image headers to enable relative virtual address translation.

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

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)] Specifies the IMAGE_SECTION_HEADER data.
originalHeaders
[in] Set to FALSE if the image headers are from the new image, TRUE if they reflect the original image prior to an upgrade. Typically, this would be set to TRUE only in combination with calls to the set_addressMap method.

Remarks

The IMAGE_SECTION_HEADER structure is declared in Winnt.h and represents the image section header format of the executable.

Relative virtual address calculations depend upon the IMAGE_SECTION_HEADER values. Usually, DIA retrieves these from the program database (.pdb) file. If these values are missing, DIA is unable to calculate relative virtual addresses and IDiaAddressMap::get_relativeVirtualAddressEnabled method returns FALSE. The client must then call IDiaAddressMap::put_relativeVirtualAddressEnabled method to enable the relative virtual address calculations after providing the missing image headers from the image itself.

See Also

IDiaAddressMap | IDiaAddressMap::set_addressMap


IDiaDataSource Interface

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 file name for the last load error.
loadDataFromPdb | Opens and prepares a program database (.pdb) file as a debug data source.
loadAndValidateDataFromPdb | Opens and verifies that the program database (.pdb) file matches the signature information provided; prepares the .pdb file as a debug data source.
loadDataForExe | Opens and prepares the debug data associated with the .exe/.dll file.
loadDataFromIStream | Prepares the debug data stored in a program database (.pdb) file accessed through 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 successful call to the openSession method returns an IDiaSession interface that supports querying the data source. If the load method returns a file-related error then the get_lastError method return value contains the file name associated with the error.

Requirements

Header: Dia2.h

Example

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

See Also

Interfaces


IDiaDataSource::get_lastError Method

Retrieves the file name for the last load error.

HRESULT get_lastError (
   BSTR* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a BSTR that contains the file name associated with the last load error.

Example

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

See Also

IDiaDataSource


IDiaDataSource::loadAndValidateDataFromPdb Method

Opens and verifies that the program database (.pdb) file matches the signature information provided; 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 file signature. Only .pdb files in Visual C++ .NET and later have GUID signatures.
sig
[in] DWORD GUID to verify against .pdb file signature.
age
[in] Age value to verify.

Return Value

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 | Attempted to access a file with an 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 file contains both signature and age values. These values are replicated in the .exe/.dll file that matches the .pdb file. 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

IDiaDataSource


IDiaDataSource::loadDataForExe Method

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

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

Parameters

executable
[in] Path to the .exe or .dll file.
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 Value

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 | Attempted to access a file with an 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 | Data source has already been prepared.

Remarks

This method reads the debug header and then searches for and prepares the debug data. The progress of the search may, optionally, be reported through callbacks. For example, IDiaLoadCallback::NotifyDebugDir is invoked when IDiaDataSource::loadDataForExe finds and processes a debug directory. Optional callbacks also support reading data from the executable file when this file cannot be accessed directly through file I/O.

Example

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

See Also

IDiaDataSource | IDiaLoadCallback | IDiaLoadCallback::NotifyDebugDir | IDiaReadExeAtOffsetCallback | IDiaReadExeAtRVACallback


IDiaDataSource::loadDataFromIStream Method

Prepares the debug data stored in a program database (.pdb) file accessed through 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 | Attempted to access a file with an obsolete format.
E_INVALIDARG | Invalid pIStream pointer.
E_UNEXPECTED | Data source has already been prepared.

See Also

IDiaDataSource


IDiaDataSource::loadDataFromPdb Method

Opens and prepares a program database (.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 determined that the file has an invalid format.
E_PDB_FORMAT | Attempted to access a file with an obsolete format.
E_INVALIDARG | Invalid wszPDB pointer.
E_UNEXPECTED | Data source has already been prepared.

Example

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

See Also

IDiaDataSource


IDiaDataSource::openSession Method

Opens a session for querying symbols.

HRESULT openSession (
   IDiaSession** ppSession
);

Parameters

ppSession
[out] Returns 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

This method opens an IDiaSession object for a data source.

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

Example

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

See Also

Conceptual Overview | IDiaSession | Querying the .pdb File


IDiaEnumDebugStreamData Interface

Enumerates the various debug data streams 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 debug data streams.
get_Name | Retrieves the name of a debug data stream.
Item | Retrieves a debug data stream by means of an index.
Next | Retrieves a specified number of debug data streams in the enumerated sequence.
Skip | Skips a specified number of debug data streams in an enumerated sequence.
Reset | Resets an enumerated sequence to the beginning.
Clone | Creates an enumerator that contains the same enumerated sequence as the current enumerator.

Requirements

Header: Dia2.h

See Also

Interfaces


IDiaEnumDebugStreamData::Clone Method

Creates an enumerator that contains the same enumerated sequence as the current enumerator.

HRESULT Clone (
   IDiaEnumDebugStreamData** ppenum
);

Parameters

ppenum
[out] Returns an IDiaEnumDebugStreamData interface that contains the duplicated sequence of debug data streams.

See Also

IDiaEnumDebugStreamData


IDiaEnumDebugStreamData::get_Name Method

Retrieves the name of a debug data stream.

HRESULT get_Name (
   BSTR * pRetVal
)

Parameters

pRetVal
[out, retval] Returns a BSTR that contains the name of a debug data stream.

See Also

IDiaEnumDebugStreamData


IDiaEnumDebugStreamData::get__NewEnum Method

Retrieves the IEnumVARIANT version of this enumerator.

HRESULT get__NewEnum (
   IUnknown** pRetVal
);

Parameters

pRetVal
[out, retval] Returns the IUnknown interface that represents the IEnumVARIANT version of this enumerator.

See Also

IDiaEnumDebugStreamData


IDiaEnumDebugStreamData::get_Count Method

Retrieves the number of debug data streams.

HRESULT get_Count (
   LONG* pRetVal
);

Parameters

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

See Also

IDiaEnumDebugStreamData | IDiaEnumDebugStreamData::Item


IDiaEnumDebugStreamData::Item Method

Retrieves a debug data stream 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. The index is a DWORD in the range 0 to count-1, where count is returned by IDiaEnumDebugStreamData::get_Count.
cbData
[in] Size of the data buffer, in bytes.
pcbData
[out] Returns the number of bytes returned. If data is NULL, then pcbData contains the total number of bytes of data available.
data[]
[out, size_is(cbData),length_is(*pcbData)] Returns a buffer that contains the debug stream data.

See Also

IDiaEnumDebugStreamData | IDiaEnumDebugStreamData::Next | IDiaEnumDebugStreams::Item | IDiaEnumDebugStreamData::get_Count | IDiaEnumDebugStreamData::Skip


IDiaEnumDebugStreamData::Next Method

Retrieves a specified number of sequential debug data streams in the enumerated sequence.

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

Parameters

celt
[in] ULONG that contains the number of debug data streams to be retrieved.
cbData
[in] Size of the data buffer, in bytes.
pcbData
[out] Returns the number of bytes returned. If data is NULL, then pcbData contains the total number of bytes of data available.
data[]
[out, size_is(cbData),length_is(*pcbData)] Returns a buffer that contains the debug stream data.
pceltFetched
[in, out] Returns a ULONG that contains the number of debug data streams in data.

See Also

IDiaEnumDebugStreamData | IDiaEnumDebugStreams::Next


IDiaEnumDebugStreamData::Reset Method

Resets to the beginning of an enumerated sequence.

HRESULT Reset ();

See Also

IDiaEnumDebugStreamData


IDiaEnumDebugStreamData::Skip Method

Skips a specified number of debug data streams in an enumerated sequence.

HRESULT Skip (
   ULONG celt
);

Parameters

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

See Also

IDiaEnumDebugStreamData


IDiaEnumDebugStreams Interface

Enumerates the various debug streams contained in the data source. The content of debug streams is 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

See Also

Interfaces


IDiaEnumDebugStreams::Clone Method

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

HRESULT Clone (
   IDiaEnumDebugStreams** ppenum
);

Parameters

ppenum
[out] Returns the IDiaEnumDebugStreams interface of the clone of the enumerator.

See Also

IDiaEnumDebugStreams


IDiaEnumDebugStreams::get__NewEnum Method

Retrieves the IEnumVARIANT version of this enumerator.

HRESULT get__NewEnum (
   IUnknown** pRetVal
);

Parameters

pRetVal
[out, retval] Returns the IUnknown interface that represents the IEnumVARIANT version of this enumerator.

See Also

IDiaEnumDebugStreams


IDiaEnumDebugStreams::get_Count Method

Retrieves the number of debug streams.

HRESULT get_Count(
   LONG* pRetVal
);

Parameters

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

See Also

IDiaEnumDebugStreams | IDiaEnumDebugStreams::Item


IDiaEnumDebugStreams::Item Method

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

HRESULT Item (
   VARIANT index,
   IDiaEnumDebugStreamData** stream
);

Parameters

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

See Also

IDiaEnumDebugStreamData | IDiaEnumDebugStreams


IDiaEnumDebugStreams::Next Method

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] Returns an array of IDiaEnumDebugStreamData interfaces that represents the debug streams being retrieved.
pceltFetched
[out] Returns a ULONG that contains the number of debug streams in the fetched enumerator.

See Also

IDiaEnumDebugStreams


IDiaEnumDebugStreams::Reset Method

Resets an enumeration sequence to the beginning.

HRESULT Reset ();

See Also

IDiaEnumDebugStreams


IDiaEnumDebugStreams::Skip Method

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.

See Also

IDiaEnumDebugStreams


IDiaEnumFrameData Interface

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.
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.
frameByRVA | Returns a frame by relative virtual address (RVA).
frameByVA | Returns a frame by virtual address (VA).

Requirements

Header: Dia2.h

See Also

Interfaces


IDiaEnumFrameData::Clone Method

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

HRESULT Clone(
   IDiaEnumFrameData** ppenum
);

Parameters

ppenum
[out] Returns the IDiaEnumFrameData interface of the clone of the enumerator.

See Also

IDiaEnumFrameData


IDiaEnumFrameData::frameByRVA Method

Returns a frame by relative virtual address (RVA).

HRESULT frameByRVA(
   DWORD relativeVirtualAddress,
   IDiaFrameData** frame
);

Parameters

relativeVirtualAddress
[in] RVA of the frame of interest.
frame
[out, retval] Returns a pointer to the IDiaFrameData interface in the address provided.

See Also

IDiaEnumFrameData | IDiaFrameData


IDiaEnumFrameData::frameByVA Method

Returns a frame by virtual address (VA).

HRESULT frameByVA(
   ULONGLONG virtualAddress,
   IDiaFrameData** frame
);

Parameters

virtualAddress
[in] VA of the frame of interest.
frame
[out, retval] Returns a pointer to the IDiaFrameData interface in the address provided.

See Also

IDiaEnumFrameData | IDiaFrameData | Glossary


IDiaEnumFrameData::get__NewEnum Method

Retrieves the IEnumVARIANT version of this enumerator.

HRESULT get__NewEnum (
   IUnknown** pRetVal
);

Parameters

pRetVal
[out, retval] Returns the IUnknown interface that represents the IEnumVARIANT version of this enumerator.

See Also

IDiaEnumFrameData


IDiaEnumFrameData::get_Count Method

Retrieves the number of frame data elements.

HRESULT get_Count (
   LONG* pRetVal
);

Parameters

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

See Also

IDiaEnumFrameData | IDiaEnumFrameData::Item


IDiaEnumFrameData::Item Method

Retrieves a frame data element by means of an index.

HRESULT Item (
   DWORD index,
   IDiaFrameData** section
);

Parameters

index
[in] Index of the IDiaFrameData to be retrieved. The index is a DWORD in the range 0 to count-1, where count is returned by IDiaEnumFrameData::get_Count.
section
[out, retval] Returns the IDiaFrameData interface of the retrieved frame data element.

See Also

IDiaEnumFrameData | IDiaFrameData


IDiaEnumFrameData::Next Method

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] Returns an array of IDiaFrameData interfaces that represents the frame data element being retrieved.
pceltFetched
[out] Returns a ULONG that contains the number of frame data elements in the fetched enumerator.

See Also

IDiaEnumFrameData | IDiaFrameData


IDiaEnumFrameData::Reset Method

Resets an enumeration sequence to the beginning.

HRESULT Reset();

See Also

IDiaEnumFrameData


IDiaEnumFrameData::Skip Method

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.

See Also

IDiaEnumFrameData


IDiaEnumInjectedSources Interface

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 source by means of an index.
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

See Also

IDiaSession::findInjectedSource | Interfaces | Glossary


IDiaEnumInjectedSources::Clone Method

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

HRESULT Clone (
   IDiaEnumInjectedSources** ppenum
);

Parameters

ppenum
[out] Returns the IDiaEnumInjectedSources interface of the clone of the enumerator.

See Also

IDiaEnumInjectedSources


IDiaEnumInjectedSources::get__NewEnum Method

Retrieves the IEnumVARIANT version of this enumerator.

HRESULT get__NewEnum (
   IUnknown** pRetVal
);

Parameters

pRetVal
[out, retval] Returns the IUnknown interface that represents the IEnumVARIANT version of this enumerator.

See Also

IDiaEnumInjectedSources


IDiaEnumInjectedSources::get_Count Method

Retrieves the number of injected sources.

HRESULT get_Count (
   LONG* pRetVal
);

Parameters

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

See Also

IDiaEnumInjectedSources | IDiaEnumInjectedSources::Item


IDiaEnumInjectedSources::Item Method

Retrieves an injected source by means of an index.

HRESULT Item (
   DWORD index,
   IDiaInjectedSource** injectedSource
);

Parameters

index
[in] Index of the IDiaInjectedSource to be retrieved. The index is a DWORD in the range 0 to count-1, where count is returned by IDiaEnumInjectedSources::get_Count.
injectedSource
[out, retval] Returns the IDiaInjectedSource interface of the retrieved injected source.

See Also

IDiaEnumInjectedSources | IDiaInjectedSource


IDiaEnumInjectedSources::Next Method

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] Returns an array of IDiaInjectedSource interfaces that represents the injected sources being retrieved.
pceltFetched
[out] Returns a ULONG that contains the number of injected sources in the fetched enumerator.

See Also

IDiaEnumInjectedSource | IDiaInjectedSources


IDiaEnumInjectedSources::Reset Method

Resets an enumeration sequence to the beginning.

HRESULT Reset();

See Also

IDiaEnumInjectedSources


IDiaEnumInjectedSources::Skip Method

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.

See Also

IDiaEnumInjectedSources


IDiaEnumLineNumbers Interface

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.
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

See Also

Interfaces | IDiaSession::findLinesByLinenum | IDiaSession::findLinesByRVA | IDiaSession::findLinesByVA | IDiaSession::findLines | IDiaSession::findLinesByAddr


IDiaEnumLineNumbers::Clone Method

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

HRESULT Clone (
   IDiaEnumLineNumbers** ppenum
);

Parameters

ppenum
[out] Returns the IDiaEnumLineNumbers interface of the clone of the enumerator.

See Also

IDiaEnumLineNumbers


IDiaEnumLineNumbers::get__NewEnum Method

Retrieves the IEnumVARIANT version of this enumerator.

HRESULT get__NewEnum (
   IUnknown** pRetVal
);

Parameters

pRetVal
[out, retval] Returns the IUnknown interface that represents the IEnumVARIANT version of this enumerator.

See Also

IDiaEnumLineNumbers


IDiaEnumLineNumbers::get_Count Method

Retrieves the number of line numbers.

HRESULT get_Count (
   LONG* pRetVal
);

Parameters

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

See Also

IDiaEnumLineNumbers | IDiaEnumLineNumbers::Item


IDiaEnumLineNumbers::Item Method

Retrieves a line number by means of an index.

HRESULT Item (
   DWORD index,
   IDiaLineNumber** lineNumber
);

Parameters

index
[in] Index of the IDiaLineNumber to be retrieved. The index is a DWORD in the range 0 to count-1, where count is returned by IDiaEnumLineNumbers::get_Count.
lineNumber
[out, retval] Returns the IDiaLineNumber interface of the retrieved line number.

See Also

IDiaEnumLineNumbers | IDiaLineNumber


IDiaEnumLineNumbers::Next Method

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] Returns an array of IDiaLineNumber interfaces that represents the line numbers being retrieved.
pceltFetched
[out] Returns a ULONG that contains the number of line numbers in the fetched enumerator.

See Also

IDiaEnumLineNumbers | IDiaLineNumber | IDiaSession::findLinesByLinenum


IDiaEnumLineNumbers::Reset Method

Resets an enumeration sequence to the beginning.

HRESULT Reset();

See Also

IDiaEnumLineNumbers


IDiaEnumLineNumbers::Skip Method

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.

See Also

IDiaEnumLineNumbers


IDiaEnumSectionContribs Interface

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 section contributions by means of an index.
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

See Also

Interfaces


IDiaEnumSectionContribs::Clone Method

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

HRESULT Clone(
   IDiaEnumSectionContrib** ppenum
);

Parameters

ppenum
[out] Returns the IDiaEnumSectionContribs interface of the clone of the enumerator.

See Also

IDiaEnumSectionContribs


IDiaEnumSectionContribs::get__NewEnum Method

Retrieves the IEnumVARIANT version of this enumerator.

HRESULT get__NewEnum (
   IUnknown** pRetVal
);

Parameters

pRetVal
[out, retval] Returns the IUnknown interface that represents the IEnumVARIANT version of this enumerator.

See Also

IDiaEnumSectionContribs


IDiaEnumSectionContribs::get_Count Method

Retrieves the number of section contributions.

HRESULT get_Count (
   LONG* pRetVal
);

Parameters

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

See Also

IDiaEnumSectionContribs | IDiaEnumSectionContribs::Item


IDiaEnumSectionContribs::Item Method

Retrieves section contributions by means of an index.

HRESULT Item (
   DWORD index,
   IDiaSectionContrib** section
);

Parameters

index
[in] Index of the IDiaSectionContrib interface to be retrieved. The index is a DWORD in the range 0 to count-1, where count is returned by IDiaEnumSectionContribs::get_Count method.
section
[out, retval] Returns the IDiaSectionContrib interface of the retrieved section contributions.

See Also

IDiaEnumSectionContribs::get_Count | IDiaSectionContrib


IDiaEnumSectionContribs::Next Method

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] Returns an array of IDiaSectionContrib interfaces that represents the section contributions being retrieved.
pceltFetched
[out] Returns a ULONG that contains the number of section contributions in the enumerator fetched.

See Also

IDiaEnumSectionContribs | IDiaSectionContrib


IDiaEnumSectionContribs::Reset Method

Resets an enumeration sequence to the beginning.

HRESULT Reset();

See Also

IDiaEnumSectionContribs


IDiaEnumSectionContribs::Skip Method

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.

See Also

IDiaEnumSectionContribs


IDiaEnumSegments Interface

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.
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

See Also

Interfaces


IDiaEnumSegments::Clone Method

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

HRESULT Clone (
   IDiaEnumSegments** ppenum
);

Parameters

ppenum
[out] Returns the IDiaEnumSegments interface of the clone of the enumerator.

See Also

IDiaEnumSegments


IDiaEnumSegments::get__NewEnum Method

Retrieves the IEnumVARIANT version of this enumerator.

HRESULT get__NewEnum (
   IUnknown** pRetVal
);

Parameters

pRetVal
[out, retval] Returns the IUnknown interface that represents the IEnumVARIANT version of this enumerator.

See Also

IDiaEnumSegments


IDiaEnumSegments::get_Count Method

Retrieves the number of segments.

HRESULT get_Count (
   LONG* pRetVal
);

Parameters

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

See Also

IDiaEnumSegments | IDiaEnumSegments::Item


IDiaEnumSegments::Item Method

Retrieves a segment by means of an index.

HRESULT Item (
   DWORD index,
   IDiaSegment** segment
);

Parameters

index
[in] Index of the IDiaSegment to be retrieved. The index is a DWORD in the range 0 to count-1, where count is returned by IDiaEnumSegments::get_Count.
segment
[out, retval] Returns the IDiaSegment interface of the retrieved segment.

See Also

IDiaEnumSegments | IDiaSegment


IDiaEnumSegments::Next Method

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] Returns an array of IDiaSegment interfaces that represents the segments being retrieved.
pceltFetched
[out] Returns a ULONG that contains the number of segments in the fetched enumerator.

See Also

IDiaEnumSegments | IDiaSegment


IDiaEnumSegments::Reset Method

Resets an enumeration sequence to the beginning.

HRESULT Reset ();

See Also

IDiaEnumSegments


IDiaEnumSegments::Skip Method

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.

See Also

IDiaEnumSegments


IDiaEnumSourceFiles Interface

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.
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

See Also

IDiaSession::findFile | IDiaSession::findLinesByLinenum | Interfaces


IDiaEnumSourceFiles::Clone Method

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

HRESULT Clone (
   IDiaEnumSourceFiles** ppenum
);

Parameters

ppenum
[out] Returns the IDiaEnumSourceFiles interface of the clone of the enumerator.

See Also

IDiaEnumSourceFiles


IDiaEnumSourceFiles::get__NewEnum Method

Retrieves the IEnumVARIANT version of this enumerator.

HRESULT get__NewEnum (
   IUnknown** pRetVal
);

Parameters

pRetVal
[out, retval] Returns the IUnknown interface that represents the IEnumVARIANT version of this enumerator.

See Also

IDiaEnumSourceFiles


IDiaEnumSourceFiles::get_Count Method

Retrieves the number of source files.

HRESULT get_Count (
   LONG* pRetVal
);

Parameters

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

See Also

IDiaEnumSourceFiles | IDiaEnumSourceFiles::Item


IDiaEnumSourceFiles::Item Method

Retrieves a source file by means of an index.

HRESULT Item (
   DWORD index,
   IDiaSourceFile** sourceFile
);

Parameters

index
[in] Index of the IDiaSourceFile to be retrieved. The index is a DWORD in the range 0 to count-1, where count is returned by IDiaEnumSourceFiles::get_Count.
sourceFile
[out, retval] Returns the IDiaSourceFile interface of the retrieved source file.

See Also

IDiaEnumSourceFiles | IDiaSourceFile


IDiaEnumSourceFiles::Next Method

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] Returns an array of IDiaSourceFile interfaces that represents the source files being retrieved.
pceltFetched
[out] Returns a ULONG that contains the number of source files in the fetched enumerator.

See Also

IDiaEnumSourceFiles | IDiaSession::findLinesByLinenum | IDiaSourceFile


IDiaEnumSourceFiles::Reset Method

Resets an enumeration sequence to the beginning.

HRESULT Reset ();

See Also

IDiaEnumSourceFiles


IDiaEnumSourceFiles::Skip Method

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.

See Also

IDiaEnumSourceFiles


IDiaEnumSymbols Interface

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.
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

See Also

IDiaSession::findChildren | IDiaSourceFile::get_compiland | IDiaSymbol::findChildren | IDiaSession::findLinesByLinenum | Interfaces


IDiaEnumSymbols::Clone Method

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

HRESULT Clone (
   IDiaEnumSymbols** ppenum
);

Parameters

ppenum
[out] Returns the IDiaEnumSymbols interface of the clone of the enumerator.

See Also

IDiaEnumSymbols


IDiaEnumSymbols::get__NewEnum Method

Retrieves the IEnumVARIANT version of this enumerator.

HRESULT get__NewEnum (
   IUnknown** pRetVal
);

Parameters

pRetVal
[out, retval] Returns the IUnknown interface that represents the IEnumVARIANT version of this enumerator.

See Also

IDiaEnumSymbols


IDiaEnumSymbols::get_Count Method

Retrieves the number of symbols.

HRESULT get_Count (
   LONG* pRetVal
);

Parameters

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

See Also

IDiaEnumSymbols | IDiaEnumSymbols::Item


IDiaEnumSymbols::Item Method

Retrieves a symbol by means of an index.

HRESULT Item (
   DWORD index,
   IDiaSymbol** symbol
);

Parameters

index
[in] Index of the IDiaSymbol to be retrieved. The index is a DWORD in the range 0 to count-1, where count is returned by IDiaEnumSymbols::get_Count.
symbol
[out, retval] Returns the IDiaSymbol interface of the retrieved symbol.

See Also

IDiaEnumSymbols | IDiaSymbol


IDiaEnumSymbols::Next Method

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] Returns an array of IDiaSymbol interfaces that represents the symbols being retrieved.
pceltFetched
[out] Returns 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

IDiaEnumSymbols | IDiaSession::findLinesByLinenum | IDiaSymbol


IDiaEnumSymbols::Reset Method

Resets an enumeration sequence to the beginning.

HRESULT Reset ();

See Also

IDiaEnumSymbols


IDiaEnumSymbols::Skip Method

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.

See Also

IDiaEnumSymbols


IDiaEnumSymbolsByAddr Interface

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 | Positions the enumerator by performing a lookup by section and offset.
symbolByRVA | Positions the enumerator by performing a lookup by relative virtual address (RVA).
symbolByVA | Positions the enumerator by performing a lookup by virtual address (VA).
Next | Retrieves the next symbols in order by address. Updates the enumerator position by number of elements fetched.
Prev | Retrieves the previous symbols in order by address. Updates the enumerator position by number of elements fetched.
Clone | Makes a copy of an object.

Requirements

Header: Dia2.h

See Also

IDiaSession::getSymbolsByAddr | Interfaces


IDiaEnumSymbolsByAddr::Clone Method

Makes a copy of an object.

HRESULT Clone (
   IDiaEnumSymbolsByAddr** ppenum
);

Parameters

ppenum
[out] Returns the IDiaEnumSymbolsByAddr interface of the clone of the enumerator.

See Also

IDiaEnumSymbolsByAddr


IDiaEnumSymbolsByAddr::Next Method

Retrieves the next symbols in order by address. Updates the enumerator position by number of elements fetched.

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] Returns an array of IDiaSymbol interfaces that represents the symbols being retrieved.
pceltFetched
[out] Returns a ULONG that contains the number of symbols in the fetched enumerator.

See Also

IDiaEnumSymbolsByAddr | IDiaSymbol


IDiaEnumSymbolsByAddr::Prev Method

Retrieves the previous symbols in order by address. Updates the enumerator position by number of elements fetched.

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] Returns an array of IDiaSymbol interfaces that represents the symbols being retrieved.
pceltFetched
[out] Returns a ULONG that contains the number of symbols in the fetched enumerator.

See Also

IDiaEnumSymbolsByAddr | IDiaSymbol


IDiaEnumSymbolsByAddr::symbolByAddr Method

Positions the enumerator by performing a lookup by image section number and offset.

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

Parameters

isect
[in] Image section number.
offsect
[in] Offset in section.
ppsymbol
[out, retval] Returns an IDiaSymbol interface for symbol found.

See Also

IDiaEnumSymbolsByAddr | IDiaSymbol | Glossary


IDiaEnumSymbolsByAddr::symbolByRVA Method

Positions the enumerator by performing a lookup by relative virtual address (RVA).

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

Parameters

relativeVirtualAddress
[in] Address relative to start of image.
ppsymbol
[out, retval] Returns an IDiaSymbol interface for the symbol found.

See Also

IDiaEnumSymbolsByAddr | IDiaEnumSymbolsByAddr::symbolByVA | IDiaSymbol | Glossary


IDiaEnumSymbolsByAddr::symbolByVA Method

Positions the enumerator by performing a lookup by virtual address (VA).

HRESULT symbolByVA (
   DWORD** virtualAddress,
   IDiaSymbol** ppsymbol
);

Parameters

virtualAddress
[in] Virtual address.
ppsymbol
[out, retval] Returns an IDiaSymbol interface for the symbol found.

See Also

IDiaEnumSymbolsByAddr | IDiaSymbol | Glossary


IDiaEnumTables Interface

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 a 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

See Also

IDiaSession::getEnumTables | Interfaces


IDiaEnumTables::Clone Method

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

HRESULT Clone (
   IDiaEnumTables** ppenum
);

Parameters

ppenum
[out] Returns the IDiaEnumTables interface of the clone of the enumerator.

See Also

IDiaEnumTables


IDiaEnumTables::get__NewEnum Method

Retrieves the IEnumVARIANT version of this enumerator.

HRESULT get__NewEnum (
   IUnknown** pRetVal
);

Parameters

pRetVal
[out, retval] Returns the IUnknown interface that represents the IEnumVARIANT version of this enumerator.

See Also

IDiaEnumTables


IDiaEnumTables::get_Count Method

Retrieves the number of tables.

HRESULT get_Count (
   LONG* pRetVal
);

Parameters

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

See Also

IDiaEnumTables | IDiaEnumTables::Item


IDiaEnumTables::Item Method

Retrieves a table by means of an index or name.

HRESULT Item (
   VARIANT index,
   IDiaTable** table
);

Parameters

index
[in] Index or name of the IDiaTable to be retrieved. If an integer variant is used, it must be in the range 0 to count-1, where count is as returned by IDiaEnumTables::get_Count.
table
[out, retval] Returns 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

IDiaEnumTables | IDiaTable


IDiaEnumTables::Next Method

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] Returns an array of IDiaTable interfaces that represents the tables being retrieved.
pceltFetched
[in, out] Returns a ULONG that contains the number of tables in the fetched enumerator.

See Also

IDiaEnumTables | IDiaTable


IDiaEnumTables::Reset Method

Resets an enumeration sequence to the beginning.

HRESULT Reset ();

See Also

IDiaEnumTables


IDiaEnumTables::Skip Method

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.

See Also

IDiaEnumTables


IDiaFrameData Interface

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 (RVA) of the code for the frame.
get_virtualAddress | Retrieves the virtual address (VA) 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 prologue 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 that indicates that system exception handling is in effect.
get_cplusplusExceptionHandling | Retrieves a flag that indicates that C++ exception handling is in effect.
get_functionStart | Retrieves a flag that indicates that the block contains the entry point of a function.
get_allocatesBasePointer | Retrieves a flag that indicates that the base pointer is allocated for code in this address range. This method is deprecated.
get_type | Retrieves the compiler-specific frame type.
get_functionParent | Retrieves frame data interface for enclosing function.
execute | Performs stack unwinding and returns the current state of registers in a stack walk frame interface.

Requirements

Header: Dia2.h

See Also

IDiaEnumFrameData::Item | IDiaEnumFrameData::Next | Interfaces


IDiaFrameData::execute Method

Performs stack unwinding and returns results in a stack walk frame interface.

HRESULT execute (
   IDiaStackWalkFrame* frame
);

Parameters

frame
[in] Supplies the IDiaStackWalkFrame interface pointer that holds the state of frame registers.

Return Values

The following table shows possible HRESULT return values for execute.

Value | Description
S_OK | Success.
E_DIA_INPROLOG | Cannot execute a stack frame while in prologue code.
E_DIA_SYNTAX | Parse error encountered in frame program.
E_DIA_FRAME_ACCESS | Unable to access registers or memory.
E_DIA_VALUE | Error in computation of a value (for example, division by zero).

See Also

IDiaFrameData | IDiaStackWalkFrame


IDiaFrameData::get_addressOffset Method

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

HRESULT get_addressOffset (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaFrameData


IDiaFrameData::get_addressSection Method

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

HRESULT get_addressSection (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaFrameData


IDiaFrameData::get_allocatesBasePointer Method

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

HRESULT get_allocatesBasePointer (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Returns 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 returned by IDiaFrameData::get_program is NULL. Otherwise, the program string contains all the information needed to compute previous register values.

See Also

IDiaFrameData | IDiaFrameData::get_program


IDiaFrameData::get_cplusplusExceptionHandling Method

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

HRESULT get_cplusplusExceptionHandling (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaFrameData


IDiaFrameData::get_functionParent Method

Retrieves a frame data interface for the enclosing function.

HRESULT get_functionParent (
   IDiaFrameData** pRetVal
);

Parameters

pRetVal
[out, retval] Returns an IDiaFrameData interface pointer for the enclosing function.

See Also

IDiaFrameData


IDiaFrameData::get_functionStart Method

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

HRESULT get_functionStart (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaFrameData


IDiaFrameData::get_lengthBlock Method

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

HRESULT get_lengthBlock (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaFrameData


IDiaFrameData::get_lengthLocals Method

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

HRESULT get_lengthLocals (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaFrameData


IDiaFrameData::get_lengthParams Method

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

HRESULT get_lengthParams (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaFrameData


IDiaFrameData::get_lengthProlog Method

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

HRESULT get_lengthProlog (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a DWORD that contains the number of bytes of prologue code.

See Also

IDiaFrameData


IDiaFrameData::get_lengthSavedRegisters Method

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

HRESULT get_lengthSavedRegisters (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaFrameData


IDiaFrameData::get_maxStack Method

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

HRESULT get_maxStack (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaFrameData


IDiaFrameData::get_program Method

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] Returns a BSTR that contains the program string.

See Also

IDiaFrameData


IDiaFrameData::get_relativeVirtualAddress Method

Retrieves the relative virtual address (RVA) of the code for the frame.

HRESULT get_relativeVirtualAddress (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaFrameData | Glossary


IDiaFrameData::get_systemExceptionHandling Method

Retrieves a flag that indicates whether system exception handling is in effect.

HRESULT get_systemExceptionHandling (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaFrameData


IDiaFrameData::get_type Method

Retrieves the compiler-specific frame type.

HRESULT get_type (
   DWORD* pRetVal
);

Parameters

pRetVal
[out] Returns a DWORD that indicates the compiler-specific frame type.

Return Value

The following frame types are defined in winnt.h:

#define FRAME_FPO 0
#define FRAME_TRAP 1
#define FRAME_TSS 2
#define FRAME_NONFPO 3

See Also

IDiaFrameData


IDiaFrameData::get_virtualAddress Method

Retrieves the virtual address (VA) of the code for the frame.

HRESULT get_virtualAddress (
   ULONGLONG* pRetVal
);

Parameters

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

See Also

IDiaFrameData | Glossary


IDiaImageData Interface

Exposes the details of the base location and memory offsets of the module or image.

IDiaImageData : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaImageData.

Method | Description
get_relativeVirtualAddress | Retrieves the location in virtual memory of the module relative to the application.
get_virtualAddress | Retrieves the location in virtual memory of the image.
get_imageBase | Retrieves the memory location where the image is based.

Requirements

Header: Dia2.h

Remarks

Some debug streams (XDATA, PDATA) contain copies of data also stored in the image. These stream data objects (IDiaEnumDebugStreamData) can be queried for their IDiaImageData interface pointer.

See Also

IDiaEnumDebugStreamData | Interfaces


IDiaImageData::get_imageBase Method

Retrieves the memory location where the image will be based.

HRESULT get_imageBase (
   ULONGLONG* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a ULONGLONG with the suggested image base value.

Remarks

Due to image base conflicts, an image may be rebased automatically to an unused memory location when it is loaded. IDiaImageData::get_imageBase returns the base hint (suggested memory location) stored in the module at compile time.

See Also

IDiaImageData


IDiaImageData::get_relativeVirtualAddress Method

Retrieves the location in virtual memory of the module relative to the application.

HRESULT get_relativeVirtualAddress (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a DWORD that contains the relative virtual memory offset of the module.

See Also

IDiaImageData


IDiaImageData::get_virtualAddress Method

Retrieves the location in virtual memory of the image.

HRESULT get_virtualAddress (
   ULONGLONG* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a ULONGLONG that contains the virtual address of the image.

See Also

IDiaImageData


IDiaInjectedSource Interface

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 to which the source was compiled.
get_virtualFilename | Retrieves the name given to non-file source code; that is, code that was injected.
get_sourceCompression | Retrieves the indicator of the source compression used.
get_source | Retrieves the source code bytes.

Requirements

Header: Dia2.h

See Also

IDiaEnumInjectedSources::Item | IDiaEnumInjectedSources::Next | Interfaces


IDiaInjectedSource::get_crc Method

Retrieves a cyclic redundancy check (CRC) calculated from the bytes of the source code.

HRESULT get_crc (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaInjectedSource


IDiaInjectedSource::get_filename Method

Retrieves the file name for the source.

HRESULT get_filename (
   BSTR* pRetVal
);

Parameters

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

See Also

IDiaInjectedSource


IDiaInjectedSource::get_length Method

Retrieves the number of bytes of code.

HRESULT get_length (
   ULONGLONG* pRetVal
);

Parameters

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

See Also

IDiaInjectedSource


IDiaInjectedSource::get_objectFilename Method

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

HRESULT get_objectFilename (
   BSTR* pRetVal
);

Parameters

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

See Also

IDiaInjectedSource


IDiaInjectedSource::get_source Method

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] Returns the count of bytes that represents the bytes returned. If data is NULL, then pcbData is the total number of bytes of data available.
data[]
[out, size_is(cbData),length_is(*pcbData)] Returns a buffer to contain the source bytes.

See Also

IDiaInjectedSource


IDiaInjectedSource::get_sourceCompression Method

Retrieves the indicator of the source compression used.

HRESULT get_sourceCompression (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a DWORD that contains the indicator of the source compression used. A value of zero indicates that no source compression was used.

See Also

IDiaInjectedSource


IDiaInjectedSource::get_virtualFilename Method

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

HRESULT get_virtualFilename (
   BSTR* pRetVal
);

Parameters

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

See Also

IDiaInjectedSource


IDiaLineNumber Interface

Accesses information that describes the process of 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 (RVA) of a block.
get_virtualAddress | Retrieves the virtual address (VA) 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 the unique identifier for the compiland that contributed this line.

Requirements

Header: Dia2.h

See Also

IDiaEnumLineNumbers::Item | IDiaEnumLineNumbers::Next | Interfaces


IDiaLineNumber::get_addressOffset Method

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

HRESULT get_addressOffset (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns 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);

See Also

IDiaLineNumber | IDiaLineNumber::get_addressSection


IDiaLineNumber::get_addressSection Method

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

HRESULT get_addressSection (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns 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 );

See Also

IDiaLineNumber | IDiaLineNumber::get_addressOffset


IDiaLineNumber::get_columnNumber Method

Retrieves the column number where the expression or statement begins.

HRESULT get_columnNumber (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaLineNumber


IDiaLineNumber::get_columnNumberEnd Method

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

HRESULT get_columnNumberEnd (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaLineNumber


IDiaLineNumber::get_compiland Method

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

HRESULT get_compiland (
   IDiaSymbol** pRetVal
);

Parameters

pRetVal
[out, retval] Returns an IDiaSymbol interface pointer for the compiland that contributed the bytes of image text.

See Also

IDiaLineNumber | Glossary


IDiaLineNumber::get_compilandId Method

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

HRESULT get_compilandId (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaLineNumber


IDiaLineNumber::get_length Method

Retrieves the number of bytes in a block.

HRESULT get_length (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaLineNumber


IDiaLineNumber::get_lineNumber Method

Retrieves the line number in the source file.

HRESULT get_lineNumber (
   DWORD* pRetVal
);

Parameters

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

Example

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

See Also

IDiaLineNumber


IDiaLineNumber::get_lineNumberEnd Method

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

HRESULT get_lineNumberEnd (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaLineNumber


IDiaLineNumber::get_relativeVirtualAddress Method

Retrieves the relative virtual address (RVA) of the block.

HRESULT get_relativeVirtualAddress (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaLineNumber | Glossary


IDiaLineNumber::get_sourceFile Method

Retrieves a reference to the source file.

HRESULT get_sourceFile (
   IDiaSourceFile** pRetVal
);

Parameters

pRetVal
[out, retval] Returns an IDiaSourceFile interface pointer that represents the source file.

See Also

IDiaLineNumber


IDiaLineNumber::get_sourceFileId Method

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

HRESULT get_sourceFileId (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaLineNumber


IDiaLineNumber::get_statement Method

Retrieves 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] Returns a Boolean that contains a flag indicating that this line information describes the beginning of a statement in the program source.

See Also

IDiaLineNumber


IDiaLineNumber::get_virtualAddress Method

Retrieves the virtual address (VA) of the block.

HRESULT get_virtualAddress (
   ULONGLONG* pRetVal
);

Parameters

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

See Also

IDiaLineNumber | Glossary


IDiaLoadCallback Interface

Receives callbacks from the DIA symbol locating procedure, thus enabling a user interface to report on the progress of the location attempt. The client application may optionally provide a reference to its own implementation of this virtual base class to the IDiaDataSource::loadDataForExe method.

IDiaLoadCallback : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaLoadCallback.

Method | Description
NotifyDebugDir | Notifies that a debug directory was found in the .exe file.
NotifyOpenDBG | Notifies that a candidate .dbg file was opened.
NotifyOpenPDB | Notifies that a candidate .pdb file was opened.
RestrictRegistryAccess | Use to prevent registry queries to locate symbol search paths.
RestrictSymbolServerAccess | Use to disable access of a symbol server to resolve symbols.

Requirements

Header: Dia2.h

See Also

IDiaDataSource::loadDataForExe | IDiaReadExeAtOffsetCallback | IDiaReadExeAtRVACallback | Interfaces


IDiaLoadCallback::NotifyDebugDir Method

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

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

Parameters

fExecutable
[in] TRUE if the debug directory was read from an executable (rather than a .dbg file).
cbData
[in] Count of bytes of data in the debug directory.
data[]
[in, size_is(cbData)] Data that comprises the debug directory.

Remarks

The NotifyDebugDir callback method removes the need for the client to reverse engineer the executable and/or debug file to support debug information other than that found in the .pdb file. With this data, the client can recognize the type of debug information available and whether it resides in the executable file or the .dbg file.

Most clients will not need this callback because IDiaDataSource::loadDataForExe transparently opens both .pdb and .dbg files when necessary to serve symbols.

See Also

IDiaLoadCallback | IDiaDataSource::loadDataForExe


IDiaLoadCallback::NotifyOpenDBG Method

Notifies that a candidate .dbg file was opened.

HRESULT NotifyOpenDBG (
   LPCOLESTR dbgPath,
   HRESULT resultCode
);

Parameters

dbgPath
[in] Pointer to the full path of the .dbg file.
resultCode
[in] Code that indicates the success (S_OK) or failure of the load as applied to this file.

See Also

IDiaLoadCallback


IDiaLoadCallback::NotifyOpenPDB Method

Notifies that a candidate .pdb file was opened.

HRESULT NotifyOpenPDB (
   LPCOLESTR pdbPath,
   HRESULT resultCode
);

Parameters

pdbPath
[in] Pointer to the full path of the .pdb file.
resultCode
[in] Code that indicates the success (S_OK) or failure of the load as applied to this file.

See Also

IDiaLoadCallback


IDiaLoadCallback::RestrictRegistryAccess Method

Use to prevent registry queries to locate symbol search paths.

HRESULT RestrictRegistryAccess();

Remarks

Return an HRESULT value other than S_OK to prevent querying the registry for symbol search paths.

See Also

IDiaLoadCallback


IDiaLoadCallback::RestrictSymbolServerAccess Method

Use to disable access of a symbol server to resolve symbols.

HRESULT RestrictSymbolServerAccess();

Remarks

Return an HRESULT other than S_OK to prevent use of a symbol server to resolve symbols.

See Also

IDiaLoadCallback


IDiaReadExeAtRVACallback Interface

Enables a client application to read bytes, specified by relative virtual address (RVA), from the executable file. The client application may optionally provide a reference to its own implementation of this virtual base class to the IDiaDataSource::loadDataForExe method.

IDiaReadExeAtRVACallback : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaReadExeAtRVACallback.

Method | Description
ReadExecutableAtRVA | Specifies relative virtual address (RVA) and number of bytes to read from the executable file.

Requirements

Header: Dia2.h

See Also

IDiaDataSource::loadDataForExe | IDiaLoadCallback | IDiaReadExeAtOffsetCallback | Interfaces


IDiaReadExeAtRVACallback::ReadExecutableAtRVA Method

Specifies relative virtual address (RVA) and number of bytes to read from the executable file.

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

Parameters

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

See Also

IDiaReadExeAtRVACallback


IDiaReadExeAtOffsetCallback Interface

Enables a client application to reads bytes, specified by file position, from the executable file. The client application may optionally provide a reference to its own implementation of this virtual base class to the IDiaDataSource::loadDataForExe method.

IDiaReadExeAtOffsetCallback : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaReadExeAtOffsetCallback.

Method | Description
ReadExecutableAt | Specifies file position and number of bytes to read from an executable file.

Requirements

Header: Dia2.h

See Also

IDiaDataSource::loadDataForExe | IDiaLoadCallback | IDiaReadExeAtRVACallback | Interfaces


IDiaReadExeAtOffsetCallback::ReadExecutableAt Method

Specifies file position and number of bytes to read from an executable file.

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

Parameters

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

See Also

IDiaReadExeAtOffsetCallback


IDiaSectionContrib Interface

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 (RVA) of the contribution.
get_virtualAddress | Retrieves the virtual address (VA) of the contribution.
get_length | Retrieves the number of bytes in a block.
get_notPaged | Retrieves a flag that indicates whether the block is not paged.
get_code | Retrieves a flag that indicates whether the block contains code.
get_initializedData | Retrieves a flag that indicates whether the block contains initialized data.
get_uninitializedData | Retrieves a flag that indicates whether the block contains uninitialized data.
get_remove | Retrieves a flag that indicates whether the block can be removed from the image.
get_comdat | Retrieves a flag that indicates whether the block is a COMDAT record.
get_discardable | Retrieves a flag that indicates whether the block can be discarded.
get_notCached | Retrieves a flag that indicates whether the block is not cached.
get_share | Retrieves a flag that indicates whether the block can be shared.
get_execute | Retrieves a flag that indicates whether the block is executable.
get_read | Retrieves a flag that indicates whether the block can be read.
get_write | Retrieves a flag that indicates whether the block can be written.
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 identifier for the block.

Requirements

Header: Dia2.h

See Also

IDiaEnumSectionContribs::Item | IDiaEnumSectionContribs::Next | Interfaces | Glossary


IDiaSectionContrib::get_addressOffset Method

Retrieves the offset part of the contribution's address.

HRESULT get_addressOffset (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns the DWORD that contains the offset part of the contribution's address.

See Also

IDiaSectionContrib


IDiaSectionContrib::get_addressSection Method

Retrieves the section part of the contribution's address.

HRESULT get_addressSection (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns the DWORD that contains the section part of the contribution's address.

See Also

IDiaSectionContrib


IDiaSectionContrib::get_code Method

Retrieves a flag that indicates whether the block contains code.

HRESULT get_code (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSectionContrib


IDiaSectionContrib::get_comdat Method

Retrieves a flag that indicates whether the block is a COMDAT record.

HRESULT get_comdat (
   BOOL* pRetVal
);

Parameters

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

Remarks

A COMDAT record is a Common Object File Format (COFF) record that makes packaged functions visible to the linker.

See Also

IDiaSectionContrib


IDiaSectionContrib::get_compiland Method

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

HRESULT get_compiland (
   IDiaSymbol** pRetVal
);

Parameters

pRetVal
[out, retval] Returns the IDiaSymbol of the compiland that contributed this block.

See Also

IDiaSectionContrib | IDiaSymbol | Glossary


IDiaSectionContrib::get_compilandId Method

Retrieves the compiland identifier for the block.

HRESULT get_compilandId (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a DWORD that contains the compiland identifier for the block.

See Also

IDiaSectionContrib | Glossary


IDiaSectionContrib::get_dataCrc Method

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

HRESULT get_dataCrc (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSectionContrib


IDiaSectionContrib::get_discardable Method

Retrieves a flag that indicates whether the block can be discarded.

HRESULT get_discardable (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSectionContrib


IDiaSectionContrib::get_execute Method

Retrieves a flag that indicates whether the block is executable.

HRESULT get_excute (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSectionContrib


IDiaSectionContrib::get_initializedData Method

Retrieves a flag that indicates whether the block contains initialized data.

HRESULT get_initializedData (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSectionContrib


IDiaSectionContrib::get_length Method

Retrieves the number of bytes in a block.

HRESULT get_length (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSectionContrib


IDiaSectionContrib::get_notCached Method

Retrieves a flag that indicates whether the block is not cached.

HRESULT get_notCached (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSectionContrib


IDiaSectionContrib::get_notPaged Method

Retrieves a flag that indicates whether the block is not paged.

HRESULT get_notPaged (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSectionContrib


IDiaSectionContrib::get_read Method

Retrieves a flag that indicates whether the block can be read.

HRESULT get_read (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSectionContrib


IDiaSectionContrib::get_relativeVirtualAddress Method

Retrieves the image relative virtual address (RVA) of the contribution.

HRESULT get_relativeVirtualAddress (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns the DWORD that contains the image RVA of the contribution.

See Also

IDiaSectionContrib | Glossary


IDiaSectionContrib::get_relocationsCrc Method

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

HRESULT get_relocationsCrc (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSectionContrib


IDiaSectionContrib::get_remove Method

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

HRESULT get_remove (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSectionContrib


IDiaSectionContrib::get_share Method

Retrieves a flag that indicates whether the block can be shared.

HRESULT get_share (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSectionContrib


IDiaSectionContrib::get_uninitializedData Method

Retrieves a flag that indicates whether the block contains informational data.

HRESULT get_uninitializedData (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSectionContrib


IDiaSectionContrib::get_virtualAddress Method

Retrieves the virtual address (VA) of the contribution.

HRESULT get_virtualAddress (
   ULONGLONG* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a ULONGLONG that contains the VA of the contribution.

See Also

IDiaSectionContrib | Glossary


IDiaSectionContrib::get_write Method

Retrieves a flag that indicates whether the block can be modified.

HRESULT get_write (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSectionContrib


IDiaSegment Interface

Maps data from the section number to segments of address space. Because DIA performs translations from the 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 that indicates whether the segment can be read.
get_write | Retrieves a flag that indicates whether the segment can be modified.
get_execute | Retrieves a flag that indicates whether the segment is executable.
get_addressSection | Retrieves the section number that maps to this segment.
get_relativeVirtualAddress | Retrieves the relative virtual address (RVA) of the beginning of the section.
get_virtualAddress | Retrieves the virtual address (VA) of the beginning of the section.

Requirements

Header: Dia2.h

See Also

IDiaEnumSegments::Item | IDiaEnumSegments::Next


IDiaSegment::get_addressSection Method

Retrieves the section number that maps to this segment.

HRESULT get_addressSection (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSegment


IDiaSegment::get_execute Method

Retrieves a flag that indicates whether the segment is executable.

HRESULT get_execute (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSegment


IDiaSegment::get_frame Method

Retrieves the segment number.

HRESULT get_frame (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSegment


IDiaSegment::get_length Method

Retrieves the number of bytes in the segment.

HRESULT get_ length (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSegment


IDiaSegment::get_offset Method

Retrieves the offset, in segments, where the section begins.

HRESULT get_offset (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSegment


IDiaSegment::get_read Method

Retrieves a flag that indicates whether the segment can be read.

HRESULT get_read (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSegment


IDiaSegment::get_relativeVirtualAddress Method

Retrieves the relative virtual address (RVA) of the beginning of the section.

HRESULT get_relativeVirtualAddress (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a DWORD that contains the RVA of the beginning of the section.

See Also

IDiaSegment | Glossary


IDiaSegment::get_virtualAddress Method

Retrieves the virtual address (VA) of the beginning of the section.

HRESULT get_virtualAddress (
   ULONGLONG* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a ULONGLONG that contains the VA of the beginning of the section.

See Also

IDiaSegment | Glossary


IDiaSegment::get_write Method

Retrieves a flag that indicates whether the segment can be modified.

HRESULT get_write (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSegment


IDiaSession Interface

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 file that corresponds to the symbols in this symbol store.
put_loadAddress | Sets the load address for the executable file that corresponds to the symbols in this symbol store.
get_globalScope | Retrieves a reference to the global scope.
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, a specified address.
findSymbolByRVA | Retrieves a specified symbol type that contains, or is closest to, a specified relative virtual address (RVA).
findSymbolByVA | Retrieves a specified symbol type that contains, or is closest to, a specified virtual address (VA).
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.
findSymbolByRVAEx | Retrieves a specified symbol type that contains, or is closest to, a specified relative virtual address and offset.
findSymbolByVAEx | Retrieves a specified symbol type that contains, or is closest to, a specified virtual address and offset.
findFile | Retrieves a source file by compiland and name.
findFileById | Retrieves a source file by source file identifier.
findLines | Retrieves line numbers within a specified compiland and source file identifier.
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.
findInjectedSource | Retrieves a source that has been placed into the symbol store by attribute providers or other components of the compilation process.
getEnumDebugStreams | Retrieves an enumerated sequence of debug data streams.

Requirements

Header: Dia.h

See Also

Conceptual Overview | Exe Symbol | IDiaAddressMap | IDiaDataSource | IDiaDataSource::openSession | IDiaSymbol::findChildren | Querying the .pdb File


IDiaSession::findChildren Method

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

HRESULT findChildren (
   IDiaSymbol* parent,
   SymTagEnum symtag,
   LPCOLESTR name,
   DWORD compareFlags,
   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 set to SymTagExe, which returns the global scope (.exe file).
symtag
[in] Specifies the symbol tags of the children to be retrieved. Values are taken from the SymTagEnum enumeration. Set to SymTagNull to retrieve all children.
name
[in] Specifies the name of the children to be retrieved. Set to NULL for all children to be retrieved.
compareFlags
[in] Specifies the comparison options applied to name matching. Values from the NameSearchOptions enumeration can be used alone or in combination.
ppResult
[out] Returns the IDiaEnumSymbols interface, which represents the child symbols retrieved.

Return Value

The following table shows possible HRESULT return values for findChildren.

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

Example

The following exmaple shows how to find local variables of function pFunc that match name szVarName.

IDiaEnumSymbols* pEnum;
PSession->findChildren( pFunc, SymTagData, szVarName, nsCaseSensitive, &pEnum );

See Also

Conceptual Overview | IDiaEnumSymbols | IDiaSession | IDiaSymbol | NameSearchOptions | SymTagEnum


IDiaSession::findFile Method

Retrieves source files by compiland and name.

HRESULT findFile (
   IDiaSymbol* pCompiland,
   LPCOLESTR name,
   DWORD compareFlags,
   IDiaEnumSourceFiles** ppResult
);

Parameters

pCompiland
[in] Pointer to the IDiaSymbol interface of the compiland to be used as a context for the search. 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.
compareFlags
[in] Specifies the comparison options applied to name searching. Values from the NameSearchOptions enumeration can be used alone or in combination.
ppResult
[out] Returns the IDiaEnumSourceFiles interface, which represents the source files retrieved.

Example

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

See Also

IDiaEnumSourceFiles | IDiaSession | IDiaSymbol | NameSearchOptions


IDiaSession::findFileById Method

Retrieves a source file by source file identifier.

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

Parameters

uniqueId
[in] Specifies the source file identifier.
ppResult
[out] Returns the IDiaSourceFile interface, which represents the source file retrieved.

See Also

IDiaSession | IDiaSession::findFile | IDiaSourceFile


IDiaSession::FindInjectedSource Method

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

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

Parameters

srcFile
[in] Name of the source file for which to search.
ppResult
[out] Returns the IDiaEnumInjectedSources interface, which contains the injected source retrieved.

See Also

IDiaEnumInjectedSources | IDiaSession


IDiaSession::findLines Method

Retrieves line numbers within specified compiland and source file identifiers.

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

Parameters

compiland
[in] Pointer to the IDiaSymbol interface of the compiland. Use this interface as a context in which to search for the line numbers.
file
[in] Pointer to the IDiaSourceFile interface in which to search for the line numbers.
ppResult
[out] Returns the IDiaEnumLineNumbers interface, which represents the line numbers retrieved.

See Also

IDiaEnumLineNumbers | IDiaSession | IDiaSourceFile | IDiaSymbol


IDiaSession::findLinesByAddr Method

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] Returns the IDiaEnumLineNumbers interface, which represents all the line numbers that cover the specified address range.

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

IDiaEnumLineNumbers | IDiaSession | IDiaSession::findLinesByVA


IDiaSession::findLinesByLinenum Method

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] Pointer 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. Use zero to specify all lines.
column
[in] Specifies the column number. Use zero to specify all columns.
ppResult
[out] Returns the IDiaEnumLineNumbers interface, which represents the line numbers retrieved.

Example

The following example shows how to open a source file (sourcefile.cpp), enumerate the compilands contributed by this file, and locate the line numbers in the source file for each compiland found.

IDiaEnumSourceFiles* pEnum;
pSession->findFile ( NULL, L"sourcefile.cpp", nsFNameExt, &pEnum );
IDiaSourceFile* pFile;
DWORD celt;
while ( pEnum->Next ( 1, &pFile, &celt ) { // for each file
   IDiaEnumSymbols* pEnumCompilands;
   pFile->get_compilands ( &pEnumCompilands );
   IDiaSymbol* pCompiland;
   while ( pEnumCompilands->Next ( 1, pCompiland, &celt ) ) { // for each compiland
      IDiaEnumLineNumbers* pEnum;
      pSession->findLinesByLinenum( pCompiland, pFile, 0, 0, &pEnum );
      …
   }
}

See Also

IDiaEnumLineNumbers | IDiaSession | IDiaSession::findLinesByAddr | IDiaSourceFile | IDiaSymbol


IDiaSession::findLinesByRVA Method

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

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

Parameters

rva
[in] Specifies the address as an RVA.
length
[in] Specifies the number of bytes of address range to cover with this query.
ppResult
[out] Returns the IDiaEnumLineNumbers interface, which represents all the line numbers that cover the specified address range.

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 | Glossary


IDiaSession::findLinesByVA Method

Retrieves the line number information for lines contained in a specified virtual address (VA) range.

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

Parameters

va
[in] Specifies the address as a VA.
length
[in] Specifies the number of bytes of address range to cover with this query.
ppResult
[out] Returns the IDiaEnumLineNumbers interface, which represents all the line numbers that cover the specified address range.

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 | Glossary


IDiaSession::findSymbolByAddr Method

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

HRESULT findSymbolByAddr (
   DWORD isect,
   DWORD offset,
   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. Values are taken from the SymTagEnum enumeration.
ppSymbol
[out] Returns the IDiaSymbol interface, which represents 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

IDiaSession | IDiaSymbol | SymTagEnum


IDiaSession::findSymbolByRVA Method

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

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

Parameters

rva
[in] Specifies the RVA.
symtag
[in] Symbol type to be found. Values are taken from the SymTagEnum enumeration.
ppSymbol
[out] Returns the IDiaSymbol interface, which represents the symbol retrieved.

Example

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

See Also

IDiaSession | IDiaSymbol | SymTagEnum | Glossary


IDiaSession::findSymbolByRVAEx Method

Retrieves a specified symbol type that contains, or is closest to, a specified relative virtual address (RVA) and offset.

HRESULT findSymbolByRVAEx (
   DWORD rva,
   SymTagEnum symtag,
   IDiaSymbol** ppSymbol,
   LONG* displacement
);

Parameters

rva
[in] Specifies the RVA.
symtag
[in] Symbol type to be found. Values are taken from the SymTagEnum enumeration.
ppSymbol
[out] Returns the IDiaSymbol interface, which represents the symbol retrieved.
displacement
[out] Returns a LONG specifying an offset from rva.

Example

IDiaSymbol* pFunc;
disp = 120;
pSession->FindSymbolByRVAEx( rva, SymTagFunction, &pFunc, &disp );

See Also

IDiaSession | IDiaSymbol | SymTagEnum | Glossary


IDiaSession::findSymbolByToken Method

Retrieves the symbol that contains a specified metadata token.

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

Parameters

token
[in] Specifies the token.
symtag
[in] Symbol type to be found. Values are taken from the SymTagEnum enumeration.
ppSymbol
[out] Returns the IDiaSymbol interface, which represents the symbol retrieved.

See Also

IDiaSession | IDiaSymbol | SymTagEnum


IDiaSession::findSymbolByVA Method

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

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

Parameters

va
[in] Specifies the VA.
symtag
[in] Symbol type to be found. Values are taken from the SymTagEnum enumeration.
ppSymbol
[out] Returns the IDiaSymbol interface, which represents the symbol retrieved.

Example

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

See Also

IDiaSession | IDiaSymbol | SymTagEnum | Glossary


IDiaSession::findSymbolByVAEx Method

Retrieves a specified symbol type that contains, or is closest to, a specified virtual address (VA) and offset.

HRESULT findSymbolByVAEx (
   ULONGLONG va,
   SymTagEnum symtag,
   IDiaSymbol** ppSymbol,
   LONG* displacement
);

Parameters

va
[in] Specifies the VA.
symtag
[in] Symbol type to be found. Values are taken from the SymTagEnum enumeration.
ppSymbol
[out] Returns the IDiaSymbol interface, which represents the symbol retrieved.
displacement
[out] Returns a LONG that specifies an offset from va.

Example

IDiaSymbol* pFunc;
disp = 120;
pSession->FindSymbolByVAEx( va, SymTagFunction, &pFunc, disp );

See Also

IDiaSession | IDiaSession::findChildren | IDiaSession::findSymbolByVA | IDiaSymbol | SymTagEnum | Glossary


IDiaSession::get_globalScope Method

Retrieves a reference to the global scope.

HRESULT get_globalScope (
   IDiaSymbol** pRetVal
);

Parameters

pRetVal
[out, retval] Returns the IDiaSymbol interface for the global scope.

See Also

Exe Symbol | IDiaSession | IDiaSymbol


IDiaSession::get_loadAddress Method

Retrieves the load address for the executable file that corresponds to the symbols in this symbol store. The load address is always zero unless specifically set using put_loadAddress.

HRESULT get_loadAddress (
   ULONGLONG* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a virtual address (VA) where an .exe file or .dll file is loaded.

See Also

IDiaSession


IDiaSession::getEnumDebugStreams Method

Retrieves an enumerated sequence of debug data streams.

HRESULT GetEnumDebugStreams (
   IDiaEnumDebugStreams** ppEnumDebugStreams
)

Parameters

ppEnumDebugStreams
[out] Returns an IDiaEnumDebugStreams interface, which represents the enumerated debug streams.

See Also

IDiaEnumDebugStreams | IDiaSession


IDiaSession::getEnumTables Method

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

HRESULT getEnumTables (
   IDiaEnumTables** ppEnumTables
);

Parameters

ppEnumTables
[out] Returns the IDiaEnumTables interface. Use this interface to enumerate the tables in the symbol store.

Example

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

See Also

IDiaEnumTables | IDiaSession


IDiaSession::getSymbolsByAddr Method

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

HRESULT getSymbolsByAddr(
   IDiaEnumSymbolsByAddr** ppEnumbyAddr
);

Parameters

ppEnumbyAddr
[out] Returns the IDiaEnumSymbolsByAddr interface. Use this interface to search for symbols in the symbol store by memory location.

See Also

IDiaEnumSymbolsByAddr | IDiaSession


IDiaSession::put_loadAddress Method

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

HRESULT put_loadAddress (
   ULONGLONG NewVal
);

Parameters

NewVal
[in] Load address for the executable file.

See Also

IDiaSession


IDiaSession::symbolById Method

Retrieves a symbol by its unique identifier.

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

Parameters

id
[in] Unique symbol identifier.
ppSymbol
[out] Returns the IDiaSymbol interface, which represents the symbol retrieved.

See Also

IDiaSession | IDiaSymbol


IDiaSession::symsAreEquiv Method

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 | Symbols are equivalent.
S_FALSE | Symbols are not equivalent.

See Also

IDiaSession | IDiaSymbol


IDiaSourceFile Interface

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_compilands | Retrieves an enumerator of the compilands with line numbers referencing this file.
get_checksum | Retrieves the checksum bytes.

Requirements

Header: Dia2.h

See Also

IDiaEnumSourceFiles::Item | IDiaEnumSourceFiles::Next | IDiaLineNumber::get_sourceFile | IDiaSession::findFileById | IDiaSession::findLines | IDiaSession::findLinesByLinenum |


IDiaSourceFile::get_checksum Method

Retrieves the checksum bytes.

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

Parameters

cbData
[in] Size of the data buffer, in bytes.
pcbData
[out] Returns the number of checksum bytes.
data[]
[out, size_is(cbData),length_is(*pcbData)] Returns the buffer of checksum bytes.

See Also

IDiaSourceFile


IDiaSourceFile::get_checksumType Method

Retrieves the checksum type.

HRESULT get_checksumType (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSourceFile


IDiaSourceFile::get_compilands Method

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

HRESULT get_compilands (
   IDiaEnumSymbols** ppRetVal
);

Parameters

ppRetVal
[out, retval] Returns the IDiaEnumSymbols enumerator of compilands that have line numbers referencing this file.

See Also

IDiaEnumSymbols | IDiaSourceFile


IDiaSourceFile::get_fileName Method

Retrieves the source file name.

HRESULT get_fileName (
   BSTR* pRetVal
);

Parameters

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

See Also

IDiaSourceFile


IDiaSourceFile::get_uniqueId Method

Retrieves a simple integer key value that is unique for this image.

HRESULT get_uniqueId (
   DWORD* pRetVal
);

Parameters

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

Remarks

Comparing keys rather than strings can accelerate line number processing.

See Also

IDiaSourceFile


IDiaStackWalkFrame Interface

Maintains stack context between invocations of IDiaFrameData::execute.

IDiaStackWalkFrame : IUnknown

Methods in Vtable Order

The following table shows the methods of IDiaStackWalkFrame.

Method | Description
get_registerValue | Retrieves the value of a register.
put_registerValue | Sets the value of a register.
readMemory | Reads memory from image.
searchForReturnAddress | Searches current stack frame for the nearest function return address.
searchForReturnAddressStart | Searches current stack frame for a return address at or near specified stack address.

Requirements

Header: Dia2.h

See Also

Interfaces | IDiaFrameData::execute


IDiaStackWalkFrame::get_registerValue Method

Retrieves the value of a register.

HRESULT get_registerValue (
   DWORD index,
   ULONGLONG* pRetVal
);

Parameters

index
[in] A DWORD that represents the register to retrieve, from the CV_HREG_e enumeration.
pRetVal
[out, retval] Returns the current value of the register.

See Also

CV_HREG_e | IDiaStackWalkFrame Interface


IDiaStackWalkFrame::put_registerValue Method

Sets the value of a register.

HRESULT put_registerValue (
   DWORD index,
   ULONGLONG NewVal
);

Parameters

index
[in] A DWORD that represents the register to modify, from the CV_HREG_e enumeration.
NewVal
[in] The new register value.

See Also

CV_HREG_e | IDiaStackWalkFrame Interface


IDiaStackWalkFrame::readMemory Method

Reads memory from image.

HRESULT readMemory (
   ULONGLONG va,
   DWORD cbData,
   DWORD* pcbData,
   BYTE data[]
);

Parameters

va
[in] Virtual memory address location in image to begin reading.
cbData
[in] Size of the data buffer, in bytes.
pcbData
[out] Returns the number of bytes returned. If data is NULL, then pcbData contains the total number of bytes of data available.
data[]
[out, size_is(cbData), length_is(*pcbData)] Returns a buffer that contains the memory read.

See Also

IDiaStackWalkFrame Interface


IDiaStackWalkFrame::searchForReturnAddress Method

Searches current stack frame for the nearest function return address.

HRESULT searchForReturnAddress (
   IDiaFrameData* frame,
   ULONGLONG* returnAddress
);

Parameters

frame
[in] IDiaFrameData interface that represents the current stack frame.
returnAddress
[out] Returns the nearest function return address.

See Also

IDiaFrameData | IDiaStackWalkFrame Interface


IDiaStackWalkFrame::searchForReturnAddressStart Method

Searches current stack frame for a return address at or near specified stack address.

HRESULT searchForReturnAddressStart (
   IDiaFrameData* frame,
   ULONGLONG startAddress,
   ULONGLONG* returnAddress
);

Parameters

frame
[in] IDiaFrameData interface that represents the current stack frame.
startAddress
[in] A virtual memory address from which to begin searching.
returnAddress
[out] Returns the nearest function return address to startAddress.

See Also

IDiaFrameData | IDiaStackWalkFrame Interface


IDiaSymbol Interface

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 unique symbol identifier.
get_symTag | Retrieves the symbol type classifier.
get_name | Retrieves the name of the symbol.
get_lexicalParent | Retrieves a reference to the lexical parent of the symbol.
get_classParent | 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 (RVA) of the location.
get_virtualAddress | Retrieves the virtual address (VA) 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 that specifies whether the user-defined data type is volatile.
get_constType | Retrieves a flag that specifies whether the user-defined data type is constant.
get_unalignedType | Retrieves a flag that specifies 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 for which the program or compiland was compiled.
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 thunk type of a function.
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_virtual | Retrieves a flag that specifies whether the function is virtual.
get_intro | Retrieves a flag that specifies whether the function is an introducing virtual function.
get_pure | Retrieves a flag that specifies 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 file.
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 that specifies 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 that specifies whether the user-defined data type is packed.
get_constructor | Retrieves a flag that specifies whether the user-defined data type has a constructor.
get_overloadedOperator | Retrieves a flag that specifies whether the user-defined data type has overloaded operators.
get_nested | Retrieves a flag that specifies whether the user-defined data type is nested.
get_hasNestedTypes | Retrieves a flag that specifies whether the user-defined data type has nested type definitions.
get_hasAssignmentOperator | Retrieves a flag that specifies whether the user-defined data type has any assignment operators defined.
get_hasCastOperator | Retrieves a flag that specifies whether the user-defined data type has any cast operators defined.
get_scoped | Retrieves a flag that specifies whether the user-defined data type appears in a non-global lexical scope.
get_virtualBaseClass | Retrieves a flag that specifies whether the user-defined data type is a virtual base class.
get_indirectVirtualBaseClass | Retrieves a flag that specifies 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_lexicalParentId | Retrieves the lexical parent identifier of the symbol.
get_classParentId | Retrieves the class parent identifier of the symbol.
get_typeId | Retrieves the type identifier of the symbol.
get_arrayIndexTypeId | Retrieves the array index type identifier of the symbol.
get_virtualTableShapeId | Retrieves the virtual table shape identifier of the symbol.
get_code | Retrieves a flag that specifies whether the symbol refers to a code address.
get_function | Retrieves a flag that specifies whether the public symbol refers to a function.
get_managed | Retrieves a flag that specifies whether the symbol refers to managed code.
get_msil | Retrieves a flag that specifies whether the symbol refers to Microsoft Intermediate Language (MSIL) code.
get_virtualBaseDispIndex | Retrieves the index into the virtual base displacement table.
get_undecoratedName | Retrieves the undecorated name for a C++ decorated, or linkage, name.
get_age | Retrieves the age value of a program database.
get_signature | Retrieves the symbol's signature value.
get_compilerGenerated | Retrieves a flag that indicates whether the symbol was compiler generated.
get_addressTaken | Retrieves a flag that indicates whether another symbol references this address.
get_rank | Retrieves the rank of a FORTRAN multi-dimensional array.
get_lowerBound | Retrieves the lower bound of a FORTRAN array dimension.
get_upperBound | Retrieves the upper bound of a FORTRAN array dimension.
get_lowerBoundId | Retrieves the symbol identifier of lower bound of a FORTRAN array dimension.
get_upperBoundId | Retrieves the symbol identifier of upper bound of a FORTRAN array dimension.
get_dataBytes | Retrieves the data bytes of an OEM symbol.
findChildren | Retrieves all children of the symbol.
get_targetSection | Retrieves the address section of a thunk target.
get_targetOffset | Retrieves the offset section of a thunk target.
get_targetRelativeVirtualAddress | Retrieves the relative virtual address (RVA) of a thunk target.
get_targetVirtualAddress | Retrieves the virtual address (VA) of a thunk target.
get_machineType | Retrieves the type of the target CPU.
get_oemId | Retrieves the symbol's oemId value.
get_oemSymbolId | Retrieves the symbol's oemSymbolId value.
get_types | Retrieves an array of compiler-specific type values for this symbol.
get_typeIds | Retrieves an array of compiler-specific type identifier values for this symbol.
get_objectPointerType | Retrieves the type of the object pointer for a class method.
get_udtKind | Retrieves the variety of a user-defined type (UDT).

Requirements

Header: Dia2.h

See Also

Class Hierarchy of Symbol Types | IDiaEnumSymbolsbyAddr | IDiaEnumSymbols | IDiaLineNumber::get_compiland | IDiaSectionContrib::get_compiland | IDiaSession | Symbols and Symbol Tags


IDiaSymbol::findChildren Method

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,
   DWORD compareFlags,
   IDiaEnumSymbols** ppResult
);

Parameters

symtag
[in] Specifies the symbol tags of the children to be retrieved, as defined in SymTagEnum. 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.
compareFlags
[in] Specifies the comparison options applied to name matching. Values from the NameSearchOptions enumeration can be used alone or in combination.
ppResult
[out] Returns the IDiaEnumSymbols interface that represents the child symbols retrieved.

See Also

IDiaSymbol | SymTagEnum | IDiaEnumSymbols | IDiaSession::findChildren | NameSearchOptions


IDiaSymbol::get_addressTaken Method

Retrieves a flag that indicates whether another symbol references this symbol's address.

HRESULT get_addressTaken (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Returns TRUE if another symbol references this address.

Example

In the following example, B references A. Therefore, symbol A's IDiaSymbol::get_addressTaken would return TRUE.

int A = 0;
int* B = &A;

See Also

IDiaSymbol


IDiaSymbol::get_age Method

Retrieves the age value of a program database.

HRESULT get_age (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a DWORD that contains the age value of a program database.

See Also

IDiaSymbol


IDiaSymbol::get_access Method

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

HRESULT get_access (
   DWORD* pRetVal
);

Parameters

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

See Also

CV_access_e | IDiaSymbol


IDiaSymbol::get_addressOffset Method

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] Returns a DWORD that contains the offset part of an address location.

See Also

IDiaSymbol | LocationType


IDiaSymbol::get_addressSection Method

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] Returns a DWORD that contains the section part of an address location.

See Also

IDiaSymbol | LocationType


IDiaSymbol::get_arrayIndexType Method

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

HRESULT get_arrayIndexType (
   IDiaSymbol** pRetVal
);

Parameters

pRetVal
[out, retval] Returns the IDiaSymbol interface that represents the array index type of the symbol.

See Also

IDiaSymbol


IDiaSymbol::get_arrayIndexTypeId Method

Retrieves the array index type identifier of the symbol.

HRESULT get_arrayIndexTypeId (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_backEndBuild Method

Retrieves the back-end build number.

HRESULT get_backEndBuild (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_backEndMajor Method

Retrieves the back-end major version number.

HRESULT get_backEndMajor (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_backEndMinor Method

Retrieves the back-end minor version number.

HRESULT get_backEndMinor (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_baseType Method

Retrieves the type tag of a simple type.

HRESULT get_baseType (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a DWORD that contains the type tag of a simple type, as defined in BasicType

See Also

BasicType | IDiaSymbol


IDiaSymbol::get_bitPosition Method

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

HRESULT get_bitPosition (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSymbol | LocationType


IDiaSymbol::get_callingConvention Method

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

HRESULT get_callingConvention (
   DWORD* pRetVal
);

Parameters

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

See Also

CV_call_e | IDiaSymbol


IDiaSymbol::get_classParent Method

Retrieves a reference to the class parent of the symbol.

HRESULT get_classParent (
   IDiaSymbol** pRetVal
);

Parameters

pRetVal
[out, retval] Returns the IDiaSymbol interface that represents the class parent of the symbol.

See Also

IDiaSymbol


IDiaSymbol::get_classParentId Method

Retrieves the class parent identifier of the symbol.

HRESULT get_classParentId (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a DWORD that contains the class parent ID of the symbol.

See Also

IDiaSymbol


IDiaSymbol::get_code Method

Retrieves a flag that specifies whether the symbol refers to a code address.

HRESULT get_code (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_compilerGenerated Method

Retrieves a flag that indicates whether the symbol was generated by the compiler.

HRESULT get_compilerGenerated (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Returns TRUE if the compiler generated the symbol.

See Also

IDiaSymbol


IDiaSymbol::get_constructor Method

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

HRESULT get_constructor (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_constType Method

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

HRESULT get_constType (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_count Method

Retrieves the number of items in a list or array.

HRESULT get_count (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_dataBytes Method

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] Returns the number of bytes written, or, if data is NULL, then the number of bytes available.
data[]
[out, size_is(cbData),length_is(*pcbData)] Returns a buffer that contains the data bytes.

See Also

IDiaSymbol


IDiaSymbol::get_dataKind Method

Retrieves the variable classification of a data symbol.

HRESULT get_dataKind (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSymbol | DataKind


IDiaSymbol::get_editAndContinueEnabled Method

Retrieves the flag describing the edit-and-continue features of the compiled program or unit.

HRESULT get_editAndContinueEnabled (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a Boolean that contains the flag describing the edit-and-continue features of the compiled program or unit. TRUE indicates that edit-and-continue was enabled at compilation.

See Also

IDiaSymbol


IDiaSymbol::get_frontEndBuild Method

Retrieves the front-end build number.

HRESULT get_frontEndBuild (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_frontEndMajor Method

Retrieves the front-end major version number.

HRESULT get_frontEndMajor (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_frontEndMinor Method

Retrieves the front-end minor version number.

HRESULT get_frontEndMinor (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_function Method

Retrieves a flag that specifies whether the public symbol refers to a function.

HRESULT get_function (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_guid Method

Retrieves the symbol's globally unique identifier (GUID).

HRESULT get_guid (
   GUID* pRetVal
);

Parameters

pRetVal
[out, retval] Returns the symbol's GUID.

See Also

IDiaSymbol


IDiaSymbol::get_hasAssignmentOperator Method

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

HRESULT get_hasAssignmentOperator (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_hasCastOperator Method

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

HRESULT get_hasCastOperator (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_hasNestedTypes Method

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

HRESULT get_hasNestedTypes (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_indirectVirtualBaseClass Method

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

HRESULT get_indirectVirtualBaseClass (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_intro Method

Retrieves a flag that specifies whether the function is an introducing virtual function.

HRESULT get_intro (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a flag that specifies whether the function is intro virtual.

Example

Class A {
   Virtual int f1();
}
Class B : Public A {
   Int f1();
}

Both A::f1 and B::f1 are virtual functions, but A::f1 is intro virtual.

See Also

IDiaSymbol


IDiaSymbol::get_language Method

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

HRESULT get_language (
   DWORD* pRetVal
);

Parameters

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

See Also

CV_CFL_LANG | IDiaSymbol


IDiaSymbol::get_length Method

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

HRESULT get_length (
   ULONGLONG* pRetVal
);

Parameters

pRetVal
[out, retval] Returns 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 );

See Also

IDiaSymbol


IDiaSymbol::get_lexicalParent Method

Retrieves a reference to the lexical parent of the symbol.

HRESULT get_lexicalParent (
   IDiaSymbol** pRetVal
);

Parameters

pRetVal
[out, retval] Returns the IDiaSymbol interface that represents the lexical parent of the symbol.

See Also

IDiaSymbol


IDiaSymbol::get_lexicalParentId Method

Retrieves the lexical parent identifier of the symbol.

HRESULT get_lexicalParentId (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a DWORD that contains the lexical parent ID of the symbol.

See Also

IDiaSymbol


IDiaSymbol::get_libraryName Method

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] Returns a BSTR that contains the file name of the library or object file from which the object was loaded.

See Also

IDiaSymbol


IDiaSymbol::get_locationType Method

Retrieves the location type of a data symbol.

HRESULT get_locationType (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSymbol | LocationType


IDiaSymbol::get_lowerBound Method

Retrieves the lower bound of a FORTRAN array dimension.

HRESULT get_lowerBound (
   IDiaSymbol** pRetVal
);

Parameters

pRetVal
[out, retval] Returns the IDiaSymbol interface of the lower bound of a FORTRAN array dimension.

See Also

IDiaSymbol


IDiaSymbol::get_lowerBoundId Method

Retrieves the symbol identifier of the lower bound of a FORTRAN array dimension.

HRESULT get_lowerBoundId (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns the symbol ID of the lower bound of a FORTRAN array dimenstion.

See Also

IDiaSymbol


IDiaSymbol::get_machineType Method

Retrieves the type of the target CPU.

HRESULT get_machineType (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns the target CPU type. Values are taken from the CV_CPU_TYPE_e enumeration.

See Also

CV_CPU_TYPE_e | IDiaSymbol


IDiaSymbol::get_managed Method

Retrieves a flag that specifies whether the symbol refers to managed code.

HRESULT get_managed (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_msil Method

Retrieves a flag that specifies whether the symbol refers to Microsoft Intermediate Language (MSIL) code.

HRESULT get_msil (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_name Method

Retrieves the name of the symbol.

HRESULT get_name (
   BSTR* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a BSTR that contains the name of the symbol.

Example

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

See Also

IDiaSymbol


IDiaSymbol::get_nested Method

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

HRESULT get_nested (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_objectFileName Method

Retrieves the file name of the compiland object file.

HRESULT get_objectFileName (
   BSTR* pRetVal
);

Parameters

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

See Also

IDiaSymbol | Glossary


IDiaSymbol::get_objectPointerType Method

Retrieves the type of the object pointer for a class method.

HRESULT get_objectPointerType (
   IDiaSymbol** pRetVal
);

Parameters

pRetVal
[out, retval] Returns the IDiaSymbol interface that represents the object pointer for a class method.

Remarks

Valid only for symbols of SymTagFunctionType.

See Also

IDiaSymbol | IDiaSymbol::get_symTag


IDiaSymbol::get_udtKind Method

Retrieves the variety of a user-defined type (UDT). Values are taken from the UdtKind enumeration.

HRESULT get_udtKind (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a DWORD that represents the kind of a user defined type: structure, class, or union. Values are from UdtKind enumeration.

See Also

IDiaSymbol | UdtKind


IDiaSymbol::get_oemId Method

Retrieves the symbol's oemId value.

HRESULT get_oemId (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a unique value that identifies an OEM.

See Also

IDiaSymbol


IDiaSymbol::get_oemSymbolId Method

Retrieves the symbol's oemSymbolId value.

HRESULT get_oemSymbolId (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns an OEM's internally assigned symbol ID.

See Also

IDiaSymbol


IDiaSymbol::get_offset Method

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

HRESULT get_offset (
   LONG* pRetVal
);

Parameters

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

See Also

IDiaSymbol | LocationType


IDiaSymbol::get_overloadedOperator Method

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

HRESULT get_overloadedOperator (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_packed Method

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

HRESULT get_packed (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_platform Method

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

HRESULT get_platform (
   DWORD* pRetVal
);

Parameters

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

See Also

CV_CPU_TYPE_e | IDiaSymbol


IDiaSymbol::get_pure Method

Retrieves a flag that specifies whether the function is pure virtual.

HRESULT get_pure (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a flag that specifies whether the function is pure virtual.

See Also

IDiaSymbol


IDiaSymbol::get_rank Method

Retrieves the rank (number of dimensions) of a FORTRAN multi-dimensional array.

HRESULT get_rank (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns the number of dimensions in a FORTRAN multi-dimensional array.

See Also

IDiaSymbol


IDiaSymbol::get_reference Method

Retrieves a flag that specifies whether a pointer type is a reference.

HRESULT get_reference (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a Boolean that contains the flag that specifies whether a pointer type is a reference.

See Also

IDiaSymbol


IDiaSymbol::get_registerId Method

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

HRESULT get_registerId (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSymbol | LocationType


IDiaSymbol::get_relativeVirtualAddress Method

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

HRESULT get_relativeVirtualAddress (
   DWORD* pRetVal
);

Parameters

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

Example

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

See Also

IDiaSymbol | LocationType


IDiaSymbol::get_scoped Method

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

HRESULT get_scoped (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_signature Method

Retrieves the symbol's signature value.

HRESULT get_signature (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a DWORD that contains the symbol's signature value.

See Also

IDiaSymbol


IDiaSymbol::get_slot Method

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

HRESULT get_slot (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSymbol | LocationType | Glossary


IDiaSymbol::get_sourceFileName Method

Retrieves the file name of the compiland source file.

HRESULT get_sourceFileName (
   BSTR* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_symbolsFileName Method

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

HRESULT get_symbolsFileName (
   BSTR* pRetVal
);

Parameters

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

Remarks

Only symbols of type SymTagExe that have global scope will return a valid value for this field query.

See Also

IDiaSymbol


IDiaSymbol::get_symIndexId Method

Retrieves the unique symbol identifier.

HRESULT get_symIndexId (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_symTag Method

Retrieves the symbol type classifier.

HRESULT get_symTag (
   DWORD* pRetVal
);

Parameters

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

Example

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

See Also

IDiaSymbol | SymTagEnum


IDiaSymbol::get_targetOffset Method

Retrieves the offset section of a thunk target.

HRESULT get_targetOffset (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns the offset part of a thunk target address.

See Also

IDiaSymbol


IDiaSymbol::get_targetRelativeVirtualAddress Method

Retrieves the relative virtual address (RVA) of a thunk target.

HRESULT get_targetRelativeVirtualAddress (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns the RVA of a thunk target.

See Also

IDiaSymbol | Glossary


IDiaSymbol::get_targetSection Method

Retrieves the address section of a thunk target.

HRESULT get_targetSection (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Section part of a thunk target address.

See Also

IDiaSymbol


IDiaSymbol::get_targetVirtualAddress Method

Retrieves the virtual address (VA) of a thunk target.

HRESULT get_targetVirtualAddress (
   ULONGLONG* pRetVal
);

Parameters

pRetVal
[out, retval] Returns the VA of a thunk target.

See Also

IDiaSymbol | Glossary


IDiaSymbol::get_thisAdjust Method

Retrieves the logical this adjustor for the method.

HRESULT get_thisAdjust (
   LONG* pRetVal
);

Parameters

pRetVal
[out, retval] Returns 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.

See Also

IDiaSymbol


IDiaSymbol::get_thunkOrdinal Method

Retrieves the thunk type of a function, as defined in THUNK_ORDINAL.

HRESULT get_thunkOrdinal (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a DWORD that contains the thunk type of a function.

Remarks

Used only if a function is actually a thunk.

See Also

IDiaSymbol | THUNK_ORDINAL


IDiaSymbol::get_timeStamp Method

Retrieves the timestamp of the underlying executable file.

HRESULT get_timeStamp (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_token Method

Retrieves the metadata token of a managed function or variable.

HRESULT get_token (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_type Method

Retrieves a reference to the function signature.

HRESULT get_type (
   IDiaSymbol** pRetVal
);

Parameters

pRetVal
[out, retval] Returns the IDiaSymbol interface that represents the function signature.

Example

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

See Also

IDiaSymbol


IDiaSymbol::get_typeId Method

Retrieves the type identifier of the symbol.

HRESULT get_typeId (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_typeIds Method

Retrieves an array of compiler-specific type identifier values for this symbol.

HRESULT get_typeIds (
   DWORD cTypeIds,
   DWORD* pcTypeIds,
   IDiaSymbol* typeIds[]
);

Parameters

cTypeIds
[in] Size of the buffer to hold the data.
pcTypeIds
[out] Returns the number of typeIds written, or, if typeIds is NULL, then the total number of type identifiers available.
typeIds[]
[out, size_is(cTypeIds), length_is(*pcTypeIds)] Returns a buffer that contains an array of IDiaSymbol interface pointers that represent the type identifiers.

See Also

IDiaSymbol


IDiaSymbol::get_types Method

Retrieves an array of compiler-specific type values for this symbol.

HRESULT get_types (
   DWORD cTypes,
   DWORD* pcTypes,
   IDiaSymbol* types[]
);

Parameters

cTypes
[in] Size of the buffer to hold the data.
pcTypes
[out] Returns the number of types written, or, if types is NULL, then the total number of types available.
types[]
[out, size_is(cTypes), length_is(*pcTypes)] Returns a buffer that contains an array of IDiaSymbol interface pointers that represent the types.

See Also

IDiaSymbol


IDiaSymbol::get_unalignedType Method

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

HRESULT get_unalignedType (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_undecoratedName Method

Retrieves the undecorated name for a C++ decorated, or linkage, name.

HRESULT get_undecoratedName (
   BSTR* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a BSTR that contains the undecorated name for a C++ decorated name.

See Also

IDiaSymbol


IDiaSymbol::get_upperBound Method

Retrieves the upper bound of a FORTRAN array dimension.

HRESULT get_upperBound (
   IDiaSymbol** pRetVal
);

Parameters

pRetVal
[out, retval] Returns the IDiaSymbol interface of the upper bound of a FORTRAN array dimension.

See Also

IDiaSymbol


IDiaSymbol::get_upperBoundId Method

Retrieves the symbol identifier of the upper bound of a FORTRAN array dimension.

HRESULT get_upperBoundId (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns the symbol ID of the upper bound of a FORTRAN array dimenstion.

See Also

IDiaSymbol


IDiaSymbol::get_value Method

Retrieves the value of a constant.

HRESULT get_value (
   VARIANT* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_virtual Method

Retrieves a flag that specifies whether the function is virtual.

HRESULT get_virtual (
   BOOL* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a Boolean that contains the flag that specifies whether the function is virtual.

See Also

IDiaSymbol


IDiaSymbol::get_virtualAddress Method

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

HRESULT get_virtualAddress (
   ULONGLONG* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a ULONGLONG that contains the virtual address of the location.

See Also

IDiaSymbol | LocationType


IDiaSymbol::get_virtualBaseClass Method

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

HRESULT get_virtualBaseClass (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_virtualBaseDispIndex Method

Retrieves the index of the symbol in the virtual base displacement table.

HRESULT get_virtualBaseDispIndex (
   DWORD* pRetVal
);

Parameters

pRetVal
[out, retval] Returns a DWORD that contains the index into the virtual base displacement table.

See Also

IDiaSymbol


IDiaSymbol::get_virtualBaseOffset Method

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

HRESULT get_virtualBaseOffset (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_virtualBasePointerOffset Method

Retrieves the offset of the virtual base pointer.

HRESULT get_virtualBasePointerOffset (
   LONG* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_virtualTableShape Method

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] Returns the IDiaSymbol interface of the virtual table for a user-defined type.

See Also

IDiaSymbol


IDiaSymbol::get_virtualTableShapeId Method

Retrieves the virtual table shape identifier of the symbol.

HRESULT get_virtualTableShapeId (
   DWORD* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaSymbol::get_volatileType Method

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

HRESULT get_volatileType (
   BOOL* pRetVal
);

Parameters

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

See Also

IDiaSymbol


IDiaTable Interface

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

See Also

IDiaEnumTables | IDiaEnumTables::Item | IDiaEnumTables::Next | Interfaces


IDiaTable::get__NewEnum

Retrieves the IEnumVARIANT version of this enumerator.

HRESULT get__NewEnum (
   IUnknown** pRetVal
);

Parameters

pRetVal
[out, retval] Returns the IEnumVARIANT version of this enumerator.

See Also

IDiaTable


IDiaTable::get_Count Method

Retrieves the number of items in the table.

HRESULT get_Count (
   LONG* pRetVal
);

Parameters

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

See Also

IDiaTable | IDiaTable::Item


IDiaTable::get_name Method

Retrieves the name of the table.

HRESULT get_name (
   BSTR* pRetVal
);

Parameters

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

See Also

IDiaTable


IDiaTable::Item Method

Retrieves a reference to a particular entry index.

HRESULT Item (
   DWORD index,
   IUnknown** element
);

Parameters

index
[in] A DWORD that represents the index of the table entry in the range 0 to count-1, where count is returned by IDiaTable::get_Count.
element
[out, retval] Returns the IUnknown interface that represents the specified table entry.

See Also

IDiaTable | IDiaTable::get_Count


Enumerations and Structures

In This Section

BasicType

CV_access_e

CV_call_e

CV_CFL_LANG

CV_CPU_TYPE_e

CV_HREG_e

DataKind

DiaAddressMapEntry

LocationType

NameSearchOptions

SymTagEnum

THUNK_ORDINAL

Related Sections

API Reference


BasicType Enumeration

Specifies the symbol's base type.

enum BasicType
{
   btNoType = 0,
   btVoid = 1,
   btChar = 2,
   btWChar = 3,
   btInt = 6,
   btUInt = 7,
   btFloat = 8,
   btBCD = 9,
   btBool = 10,
   btLong = 13,
   btULong = 14,
   btCurrency = 25,
   btDate = 26,
   btVariant = 27,
   btComplex = 28,
   btBit = 29,
   btBSTR = 30,
   btHresult = 31
};

Elements

btNoType
No basic type is specified.
btVoid
Basic type is a void.
btChar
Basic type is a char (C/C++ type).
btWChar
Basic type is a wide (Unicode) character (WCHAR).
btInt
Basic type is signed char (C/C++ type).
btUInt
Basic type is unsigned char (C/C++ type).
btFloat
Basic type is a floating-point number (FLOAT).
btBCD
Basic type is a binary-coded decimal (BCD).
btBool
Basic type is a Boolean (BOOL).
btLong
Basic type is a long int (C/C++ type).
btULong
Basic type is an unsigned long int (C/C++ type).
btCurrency
Basic type is currency.
btDate
Basic type is date/time (DATE).
btVariant
Basic type is a variable type structure (VARIANT).
btComplex
Basic type is a complex number.
btBit
Basic type is a bit.
btBSTR
Basic type is a basic or binary string (BSTR).
btHresult
Basic type is an HRESULT.

See Also

IDiaSymbol::get_baseType | IDiaSymbol::get_length


CV_access_e Enumeration

Specifies the scope of visibility (access level) of member functions and 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.

Remarks

The friend access specifier is not included here because it is typically used by non-member functions that have access to both private and protected elements of the class. Use IDiaSymbol::get_symTag to find symbols with SymTagFriend access.

See Also

IDiaSymbol::get_access | IDiaSymbol::get_symTag


CV_call_e Enumeration

Specifies the calling convention for a function.

Note Only the most common enumeration values are documented here. The complete enumeration is available in the cvconst.h header file.
enum CV_call_e {
   CV_CALL_NEAR_C = 0x00,
   CV_CALL_NEAR_FAST = 0x04,
   CV_CALL_NEAR_STD= 0x07,
   CV_CALL_NEAR_SYS= 0x09,
   CV_CALL_THISCALL = 0x0b
};

Elements

CV_CALL_NEAR_C
Specifies a function-calling convention using a near right-to-left push. The calling function clears the stack.
CV_CALL_NEAR_FAST
Specifies a function-calling convention using a near left-to-right push with registers. The called function uses the sum of parameter bytes to clear the stack.
CV_CALL_NEAR_STD
Specifies a function-calling convention using a near standard call (right-to-left push).
CV_CALL_NEAR_SYS
Specifies a function-calling convention using a near system call.
CV_CALL_THISCALL
Specifies a function-calling convention using this call (this pointer passed in register).

See Also

IDiaSymbol::get_callingConvention


CV_CFL_LANG Enumeration

Specifies the language of the application or linked module.

enum CV_CFL_LANG {
   CV_CFL_C = 0x00,
   CV_CFL_CXX = 0x01,
   CV_CFL_FORTRAN = 0x02,
   CV_CFL_MASM = 0x03,
   CV_CFL_PASCAL = 0x04,
   CV_CFL_BASIC = 0x05,
   CV_CFL_COBOL = 0x06,
   CV_CFL_LINK = 0x07,
   CV_CFL_CVTRES = 0x08,
   CV_CFL_CVTPGD = 0x09
};

Elements

CV_CFL_C
Application language is C.
CV_CFL_CXX
Application language is C++.
CV_CFL_FORTRAN
Application language is FORTRAN.
CV_CFL_MASM
Application language is Microsoft Macro Assembler.
CV_CFL_PASCAL
Application language is Pascal.
CV_CFL_BASIC
Application language is BASIC.
CV_CFL_COBOL
Application language is COBOL.
CV_CFL_LINK
Application is a linker-generated module.
CV_CFL_CVTRES
Application is a resource module converted with CVTRES tool.
CV_CFL_CVTPGD
Application is a POGO optimized module generated with CVTPGD tool.

See Also

IDiaSymbol::get_language | Glossary


CV_CPU_TYPE_e Enumeration

Specifies the target processor.

Note The processor is identified in the enumeration element after the CV_CFL_* prefix.
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;

See Also

IDiaSymbol::get_platform


CV_HREG_e Enumeration

Specifies a target register. Each processor type uses its own unique set of registers.

Note Because the CV_HREG_e enumeration is too large to duplicate in its entirety here, an abbreviated version is provided as a reference. Missing entries are notated in italics. The complete enumeration is available in the cvconst.h header file.
enum CV_HREG_e {
   // Register subset shared by all processor types
   CV_ALLREG_ERR = 30000,
   CV_ALLREG_TEB = 30001,
   CV_ALLREG_TIMER = 30002,
   CV_ALLREG_EFAD1 = 30003,
   CV_ALLREG_EFAD2 = 30004,
   CV_ALLREG_EFAD3 = 30005,
   CV_ALLREG_VFRAME = 30006,
   CV_ALLREG_HANDLE = 30007,
   CV_ALLREG_PARAMS = 30008,
   CV_ALLREG_LOCALS = 30009,

   //** Register set for Intel 80x86 and ix86 processor series **//
   CV_REG_NONE = 0,
   CV_REG_AL = 1,
   CV_REG_CL = 2,
   CV_REG_DL = 3,
   CV_REG_BL = 4,
   CV_REG_AH = 5,
   CV_REG_CH = 6,
   CV_REG_DH = 7,
   CV_REG_BH = 8,
   CV_REG_AX = 9,
   CV_REG_CX = 10,
   CV_REG_DX = 11,
   CV_REG_BX = 12,
   CV_REG_SP = 13,
   CV_REG_BP = 14,
   CV_REG_SI = 15,
   CV_REG_DI = 16,
   CV_REG_EAX = 17,
   CV_REG_ECX = 18,
   CV_REG_EDX = 19,
   CV_REG_EBX = 20,
   CV_REG_ESP = 21,
   CV_REG_EBP = 22,
   CV_REG_ESI = 23,
   CV_REG_EDI = 24,
   CV_REG_ES = 25,
   CV_REG_CS = 26,
   CV_REG_SS = 27,
   CV_REG_DS = 28,
   CV_REG_FS = 29,
   CV_REG_GS = 30,
   CV_REG_IP = 31,
   CV_REG_FLAGS = 32,
   CV_REG_EIP = 33,
   CV_REG_EFLAGS = 34,
   CV_REG_TEMP = 40,      // PCODE Temp
   CV_REG_TEMPH = 41,     // PCODE TempH
   CV_REG_QUOTE = 42,     // PCODE Quote
   CV_REG_PCDR3 = 43,     // PCODE reserved
   // CV_REG_PCDR4 through CV_REG_PCDR7 defined
   CV_REG_CR0 = 80,       // CR0 -- control registers
   // CV_REG_CR1 through CV_REG_CR4 defined
   CV_REG_DR0 = 90,       // Debug register
   // CV_REG_DR1 through CV_REG_DR7 defined

   CV_REG_GDTR = 110,
   CV_REG_GDTL = 111,
   CV_REG_IDTR = 112,
   CV_REG_IDTL = 113,
   CV_REG_LDTR = 114,
   CV_REG_TR = 115,

   CV_REG_PSEUDO1 = 116,
   // CV_REG_PSEUDO2 through CV_REG_PSEUDO9 defined

   CV_REG_ST0 = 128,
   // CV_REG_ST1 through CV_REG_ST7 defined
   CV_REG_CTRL = 136,
   CV_REG_STAT = 137,
   CV_REG_TAG = 138,
   CV_REG_FPIP = 139,
   CV_REG_FPCS = 140,
   CV_REG_FPDO = 141,
   CV_REG_FPDS = 142,
   CV_REG_ISEM = 143,
   CV_REG_FPEIP = 144,
   CV_REG_FPEDO = 145,
   CV_REG_MM0 = 146,
   // CV_REG_MM1 through CV_REG_MM7 defined

   CV_REG_XMM0 = 154,  // KATMAI registers
   // CV_REG_XMM1 through CV_REG_XMM7 defined
   CV_REG_XMM00 = 162, // KATMAI sub-registers
   // CV_REG_XMM01, 02, and 03 defined
   // CV_REG_XMM10, 11, 12, and 13 defined
   // CV_REG_XMM20, 21, 22, and 23 defined
   // CV_REG_XMM30, 31, 32, and 33 defined
   // CV_REG_XMM40, 41, 42, and 43 defined
   // CV_REG_XMM50, 51, 52, and 53 defined
   // CV_REG_XMM60, 61, 62, and 63 defined
   // CV_REG_XMM70, 71, 72, and 73 defined

   CV_REG_XMM0L = 194,
   // CV_REG_XMM1L through CV_REG_XMM7L defined
   CV_REG_XMM0H = 202,
   // CV_REG_XMM1H through CV_REG_XMM7H defined
   CV_REG_MXCSR = 211,  // XMM status register
   CV_REG_EDXEAX = 212, // EDX:EAX pair

   CV_REG_EMM0L = 220,  // XMM sub-registers (WNI integer)
   // CV_REG_EMM1L through CV_REG_EMM7L defined
   CV_REG_EMM0H = 228,
   // CV_REG_EMM1H through CV_REG_EMM7H defined

   CV_REG_MM00 = 236,
   CV_REG_MM01 = 237,
   CV_REG_MM10 = 238,
   CV_REG_MM11 = 239,
   CV_REG_MM20 = 240,
   CV_REG_MM21 = 241,
   CV_REG_MM30 = 242,
   CV_REG_MM31 = 243,
   CV_REG_MM40 = 244,
   CV_REG_MM41 = 245,
   CV_REG_MM50 = 246,
   CV_REG_MM51 = 247,
   CV_REG_MM60 = 248,
   CV_REG_MM61 = 249,
   CV_REG_MM70 = 250,
   CV_REG_MM71 = 251,

   //** Register set for the 68K processors **//
   CV_R68_D0 = 0,
   // CV_R68_D1 through CV_R68_D7 defined
   CV_R68_A0 = 8,
   // CV_R68_A1 through CV_R68_A7 defined
   CV_R68_CCR = 16,
   CV_R68_SR = 17,
   CV_R68_USP = 18,
   CV_R68_MSP = 19,
   CV_R68_SFC = 20,
   CV_R68_DFC = 21,
   CV_R68_CACR = 22,
   CV_R68_VBR = 23,
   CV_R68_CAAR = 24,
   CV_R68_ISP = 25,
   CV_R68_PC = 26,
   //reserved 27
   CV_R68_FPCR = 28,
   CV_R68_FPSR = 29,
   CV_R68_FPIAR = 30,
   //reserved 31
   CV_R68_FP0 = 32,
   // CV_R68_FP1 through CV_R68_FP7 defined
   //reserved 40
   CV_R68_MMUSR030 = 41,
   CV_R68_MMUSR = 42,
   CV_R68_URP = 43,
   CV_R68_DTT0 = 44,
   CV_R68_DTT1 = 45,
   CV_R68_ITT0 = 46,
   CV_R68_ITT1 = 47,
   //reserved 50
   CV_R68_PSR = 51,
   CV_R68_PCSR = 52,
   CV_R68_VAL = 53,
   CV_R68_CRP = 54,
   CV_R68_SRP = 55,
   CV_R68_DRP = 56,
   CV_R68_TC = 57,
   CV_R68_AC = 58,
   CV_R68_SCC = 59,
   CV_R68_CAL = 60,
   CV_R68_TT0 = 61,
   CV_R68_TT1 = 62,
   //reserved 63
   CV_R68_BAD0 = 64,
   // CV_R68_BAD1 through CV_R68_BAD7 defined
   CV_R68_BAC0 = 72,
   // CV_R68_BAC1 through CV_R68_BAC7 defined

   //** Register set for the MIPS 4000 **//
   CV_M4_NOREG = CV_REG_NONE,
   CV_M4_IntZERO = 10, // CPU register
   CV_M4_IntAT = 11,
   CV_M4_IntV0 = 12,
   CV_M4_IntV1 = 13,
   CV_M4_IntA0 = 14,
   // CV_M4_IntA1, A2, and A3 defined
   CV_M4_IntT0 = 18,
   // CV_M4_IntT1 through CV_M4_IntT7 defined
   CV_M4_IntS0 = 26,
   // CV_M4_IntS1 through CV_M4_IntS7 defined
   CV_M4_IntT8 = 34,
   CV_M4_IntT9 = 35,
   CV_M4_IntKT0 = 36,
   CV_M4_IntKT1 = 37,
   CV_M4_IntGP = 38,
   CV_M4_IntSP = 39,
   CV_M4_IntS8 = 40,
   CV_M4_IntRA = 41,
   CV_M4_IntLO = 42,
   CV_M4_IntHI = 43,

   CV_M4_Fir = 50,
   CV_M4_Psr = 51,

   CV_M4_FltF0 = 60, // Floating point registers
   // CV_M4_FltF1 through CV_M4_FltF31 defined
   CV_M4_FltFsr = 92,

   //** Register set for the ALPHA AXP **//
   CV_ALPHA_NOREG = CV_REG_NONE,
   CV_ALPHA_FltF0 = 10, // Floating point registers
   // CV_ALPHA_FltF1 through CV_ALPHA_FltF31 defined

   CV_ALPHA_IntV0 = 42, // Integer registers
   CV_ALPHA_IntT0 = 43,
   // CV_ALPHA_IntT1 through CV_ALPHA_IntT7 defined
   CV_ALPHA_IntS0 = 51,
   // CV_ALPHA_IntS1 through CV_ALPHA_IntS5 defined
   CV_ALPHA_IntFP = 57,
   CV_ALPHA_IntA0 = 58,
   // CV_ALPHA_IntA1 through CV_ALPHA_IntA5 defined
   CV_ALPHA_IntT8 = 64,
   CV_ALPHA_IntT9 = 65,
   CV_ALPHA_IntT10 = 66,
   CV_ALPHA_IntT11 = 67,
   CV_ALPHA_IntRA = 68,
   CV_ALPHA_IntT12 = 69,
   CV_ALPHA_IntAT = 70,
   CV_ALPHA_IntGP = 71,
   CV_ALPHA_IntSP = 72,
   CV_ALPHA_IntZERO = 73,

   CV_ALPHA_Fpcr = 74, // Control registers
   CV_ALPHA_Fir = 75,
   CV_ALPHA_Psr = 76,
   CV_ALPHA_FltFsr = 77,
   CV_ALPHA_SoftFpcr = 78,

   //** Register set for Motorola/IBM PowerPC **//
   CV_PPC_GPR0 = 1, // PowerPC general registers (User Level)
   // CV_PPC_GPR1 through CV_PPC_GPR31 defined

   CV_PPC_CR = 33, // PowerPC condition register (User Level)
   CV_PPC_CR0 = 34,
   // CV_PPC_CR1 through CV_PPC_CR7 defined

   CV_PPC_FPR0 = 42, // PowerPC floating point registers (User Level)
   // CV_PPC_FPR1 through CV_PPC_FPR31 defined

   CV_PPC_FPSCR = 74, // PowerPC floating point status and control register (User Level)
   CV_PPC_MSR = 75, // PowerPC machine state register (Supervisor Level)
   CV_PPC_SR0 = 76, // PowerPC segment registers (Supervisor Level)
   // CV_PPC_SR1 through CV_PPC_SR15 defined

   //** ADDITIONAL PowerPC REGISTERS DEFINED IN cvconst.h **//

   //** Register set for the Hitachi SH3 **//
   CV_SH3_NOREG = CV_REG_NONE,
   CV_SH3_IntR0 = 10, // CPU register
   // CV_SH3_IntR1 through CV_SH3_IntR13 defined
   CV_SH3_IntFp = 24,
   CV_SH3_IntSp = 25,
   CV_SH3_Gbr = 38,
   CV_SH3_Pr = 39,
   CV_SH3_Mach = 40,
   CV_SH3_Macl = 41,
   CV_SH3_Pc = 50,
   CV_SH3_Sr = 51,
   CV_SH3_BarA = 60,
   CV_SH3_BasrA = 61,
   CV_SH3_BamrA = 62,
   CV_SH3_BbrA = 63,
   CV_SH3_BarB = 64,
   CV_SH3_BasrB = 65,
   CV_SH3_BamrB = 66,
   CV_SH3_BbrB = 67,
   CV_SH3_BdrB = 68,
   CV_SH3_BdmrB = 69,
   CV_SH3_Brcr = 70,

   // Additional registers for Hitachi SH processors
   CV_SH_Fpscr = 75, // Floating point status/control register
   CV_SH_Fpul = 76, // Floating point communication register
   CV_SH_FpR0 = 80, // Floating point registers
   // CV_SH_FpR1 through CV_SH_FpR15 defined
   CV_SH_XFpR0 = 96,
   // CV_SH_XFpR1 through CV_SH_XFpR15 defined

   //** Register set for the ARM processor **//
   CV_ARM_NOREG = CV_REG_NONE,
   CV_ARM_R0 = 10,
   // CV_ARM_R1 through CV_ARM_R12 defined
   CV_ARM_SP = 23, // Stack pointer
   CV_ARM_LR = 24, // Link register
   CV_ARM_PC = 25, // Program counter
   CV_ARM_CPSR = 26, // Current program status register

   //** Register set for Intel IA64 **//
   CV_IA64_NOREG = CV_REG_NONE,
   CV_IA64_Br0 = 512, // Branch registers
   // CV_IA64_Br1 through CV_IA64_Br7 defined
   CV_IA64_P0 = 704, // Predicate registers
   // CV_IA64_P1 through CV_IA64_P63 defined
   CV_IA64_Preds = 768,
   CV_IA64_IntH0 = 832, // Banked general registers
   // CV_IA64_IntH1 through CV_IA64_IntH15 defined
   CV_IA64_Ip = 1016, // Special registers
   CV_IA64_Umask = 1017,
   CV_IA64_Cfm = 1018,
   CV_IA64_Psr = 1019,
   CV_IA64_Nats = 1020, // Banked general registers
   CV_IA64_Nats2 = 1021,
   CV_IA64_Nats3 = 1022,
   CV_IA64_IntR0 = 1024, // Integer registers
   // CV_IA64_IntR1 through CV_IA64_IntR127 defined
   CV_IA64_FltF0 = 2048, // Low floating point registers
   // CV_IA64_FltF1 through CV_IA64_FltF127 defined

   //** ADDITIONAL Intel IA64 REGISTERS DEFINED IN cvconst.h **//

   //** Register set for the TriCore processor **//
   CV_TRI_NOREG = CV_REG_NONE,
   CV_TRI_D0 = 10, // General purpose data registers
   // CV_TRI_D1 through CV_TRI_D15 defined
   CV_TRI_A0 = 26, // General purpose address registers
   // CV_TRI_A1 through CV_TRI_A15 defined
   CV_TRI_E0 = 42, // Extended (64-bit) data registers
   CV_TRI_E2 = 43,
   CV_TRI_E4 = 44,
   CV_TRI_E6 = 45,
   CV_TRI_E8 = 46,
   CV_TRI_E10 = 47,
   CV_TRI_E12 = 48,
   CV_TRI_E14 = 49,
   CV_TRI_EA0 = 50, // Extended (64-bit) address registers
   CV_TRI_EA2 = 51,
   CV_TRI_EA4 = 52,
   CV_TRI_EA6 = 53,
   CV_TRI_EA8 = 54,
   CV_TRI_EA10 = 55,
   CV_TRI_EA12 = 56,
   CV_TRI_EA14 = 57,

   //** ADDITIONAL TriCore REGISTERS DEFINED IN cvconst.h **//

   //** Register set for the AM33 and related processors **//
   CV_AM33_NOREG = CV_REG_NONE,
   // "Extended" (general purpose integer) registers
   CV_AM33_E0 = 10,
   // CV_AM33_E1 through CV_AM33_E7 defined
   CV_AM33_A0 = 20, // Address registers
   // CV_AM33_A1 through CV_AM33_A3 defined
   CV_AM33_D0 = 30, // Integer data registers
   // CV_AM33_D1 CV_AM33_D3 defined
   CV_AM33_FS0 = 40, // (Single-precision) floating-point registers
   // CV_AM33_FS1 through CV_AM33_FS31 defined

   //** ADDITIONAL AM33 REGISTERS DEFINED IN cvconst.h **//

   //** Register set for the Mitsubishi M32R **//
   CV_M32R_NOREG = CV_REG_NONE,
   CV_M32R_R0 = 10,
   // CV_M32R_R1 through CV_M32R_R11 defined
   CV_M32R_R12 = 22, // Global pointer, if used
   CV_M32R_R13 = 23, // Frame pointer, if allocated
   CV_M32R_R14 = 24, // Link register
   CV_M32R_R15 = 25, // Stack pointer
   CV_M32R_PSW = 26, // Preprocessor status register
   CV_M32R_CBR = 27, // Condition bit register
   CV_M32R_SPI = 28, // Interrupt stack pointer
   CV_M32R_SPU = 29, // User stack pointer
   CV_M32R_SPO = 30, // OS stack pointer
   CV_M32R_BPC = 31, // Backup program counter
   CV_M32R_ACHI = 32, // Accumulator high
   CV_M32R_ACLO = 33, // Accumulator low
   CV_M32R_PC = 34, // Program counter

} CV_HREG_e;

Elements

CV_REG_*
Registers used by Intel® 80x86 and ix86 processors, and p-code.
CV_R68_*
Registers used by 68K processor.
CV_M4_*
Registers used by MIPS 4000 series processor.
CV_ALPHA_*
Registers used by Digital Equipment Corporation® Alpha AXP series processor.
CV_PPC_*
Registers used by Motorola/IBM® PowerPC processor.
CV_SH3_* and CV_SH_*
Registers used by Hitachi® SH3 and Hitachi SH series processor.
CV_ARM_*
Registers used by Advanced RISC Machine (ARM) processors.
CV_IA64_*
Registers used by Intel® IA64 series processors.
CV_TRI_*
Registers used by Infineon Technologies® TriCore processor.
CV_AM33_*
Registers used by Matsushita/Panasonic® AM33 and related processors.
CV_M32R_*
Registers used by Mitsubishi® M32R processor.

See Also

IDiaStackWalkFrame::get_registerValue | IDiaStackWalkFrame::put_registerValue


DataKind Enumeration

Indicates the particular scope of a data value.

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

Elements

DataIsUnknown
Data symbol cannot be determined.
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 static variable.
DataIsConstant
Data item is a constant value.

See Also

IDiaSymbol::get_dataKind


DiaAddressMapEntry Structure

Indicates an entry in an address map and is used in combination with the IDiaAddressMap interface. An address map provides a translation from one image layout (A) to another (B).

struct DiaAddressMapEntry
{
   DWORD rva,
   DWORD rvaTo
};

Elements

rva
A relative virtual address (RVA) in image A.
rvaTo
The relative virtual address rva is mapped to image B.

Remarks

An array of DiaAddressMapEntry structures sorted by rva defines an address map.

To translate an address a in A to an address b in B, perform the following steps:

  1. Search the map for the entry, e, with the largest rva less than or equal to a.
  2. Set delta = a – e.rva.
  3. Set b = e.rvaTo + delta.

See Also

IDiaAddressMap::set_addressMap | Glossary


LocationType Enumeration

Indicates the kind of location information contained in a symbol.

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

Elements

LocIsNull
Location information is unavailable.
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 a Microsoft Intermediate Language (MSIL) slot.
LocIsIlRel
Location is MSIL-relative.
LocInMetaData
Location is in metadata.
LocIsConstant
Location is in a constant value.

Remarks

The properties available to the IDiaSymbol interface depend on the symbol's location within the image file. For more information, see Symbol Locations.

See Also

IDiaSymbol | Symbol Locations


NameSearchOptions Enumeration

Specifies the search options for symbol and file names.

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 using asterisks (*) and question marks (?) as wildcards.
nsCaseInRegularExpression
Apply a case-insensitive name match using asterisks (*) and question marks (?) as wildcards.

See Also

IDiaSession::findChildren | IDiaSession::findFile | IDiaSymbol::findChildren


SymTagEnum Enumeration

All symbols within a debug file have an identifying tag that specifies the symbol's type. The tag is one of the following enumerator values.

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

Elements

SymTagNull
Indicates that the symbol has no type.
SymTagExe
Indicates that the symbol is an .exe file. There is only one SymTagExe symbol per symbol store. It serves as the global scope and does not have a lexical parent.
SymTagCompiland
Indicates that the compiland symbol for each compiland component of the symbol store. For native applications, SymTagCompiland symbols correspond to the object files linked into the image. For some kinds of Microsoft Intermediate Language (MSIL) images, there is one compiland per class.
SymTagCompilandDetails
Indicates that the symbol contains extended attributes of the compiland. Retrieving these properties may require loading compiland symbols.
SymTagCompilandEnv
Indicates that the symbol is an environment string defined for the compiland.
SymTagFunction
Indicates that the symbol is a function.
SymTagBlock
Indicates that the symbol is a nested block.
SymTagData
Indicates that the symbol is data.
SymTagAnnotation
Indicates that the symbol is for a code annotation. Children of this symbol are constant data strings (SymTagData, LocIsConstant, DataIsConstant). Most clients would ignore this symbol.
SymTagLabel
Indicates that the symbol is a label.
SymTagPublicSymbol
Indicates that the symbol is a public symbol. For native applications, this symbol is the COFF external symbol encountered while linking the image.
SymTagUDT
Indicates that the symbol is a user-defined type (structure, class, or union).
SymTagEnum
Indicates that the symbol is an enumeration.
SymTagFunctionType
Indicates that the symbol is a function signature type.
SymTagPointerType
Indicates that the symbol is a pointer type.
SymTagArrayType
Indicates that the symbol is an array type.
SymTagBaseType
Indicates that the symbol is a base type.
SymTagTypedef
Indicates that the symbol is a typedef, that is, an alias for another type.
SymTagBaseClass
Indicates that the symbol is a base class of a user-defined type.
SymTagFriend
Indicates that the symbol is a friend of a user-defined type.
SymTagFunctionArgType
Indicates that the symbol is a function argument.
SymTagFuncDebugStart
Indicates that the symbol is the end location of the function's prologue code.
SymTagFuncDebugEnd
Indicates that the symbol is the beginning location of the function's epilogue code.
SymTagUsingNamespace
Indicates that the symbol is a namespace name active in the current scope.
SymTagVTableShape
Indicates that the symbol is a virtual table description.
SymTagVTable
Indicates that the symbol is a virtual table pointer.
SymTagCustom
Indicates that the symbol is a custom symbol uninterrupted by DIA.
SymTagThunk
Indicates that the symbol is a thunk.
SymTagCustomType
Indicates that the symbol is a custom compiler symbol.
SymTagManagedType
Indicates that the symbol is in metadata.
SymTagDimension
Indicates that the symbol is a FORTRAN multi-dimensional array.

See Also

IDiaSession | IDiaSymbol | Lexical Hierarchy of Symbol Types


THUNK_ORDINAL Enumeration

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
A this adjustor thunk.
THUNK_ORDINAL_VCALL
Virtual call thunk.
THUNK_ORDINAL_PCODE
P-code thunk.
THUNK_ORDINAL_LOAD
Delay load thunk.

See Also

IDiaSymbol::get_thunkOrdinal | Glossary


UdtKind Enumeration

Describes the variety of user-defined type (UDT).

typedef enum UdtKind
{
   UdtStruct,
   UdtClass,
   UdtUnion
};

Elements

UdtStruct
UDT is a structure.
UdtClass
UDT is a class.
UdtUnion
UDT is a union.

See Also

IDiaSymbol::get_udtKind


Glossary

Debug Interface Access SDK

Glossary of DIA SDK Terms

This glossary defines terms that appear in the Debug Interface Access (DIA) SDK.

compiland
The basic unit of compilation or translation. A project usually consists of several compilands (for example, .c and .cpp files) that are compiled to produce a corresponding object file. See also function.
executable file
The top-most level of the executable image. See module.
function
Several functions may make up a compiland. Functions that are members of a class are referred to as methods. Functions may in turn consist of several lexical blocks.
injected source
Code that has been placed into the symbol store by attribute providers or other components of the compilation process. May also refer to code that is generated automatically by the compiler and/or linker.
image
See module.
lexical scope
The region of source code in which a symbol (or identifier) is considered valid; that is, a namespace, file, function, block of code, or function prototype.
module
An independent unit of execution that forms part of one or more larger applications. Both .exe and .dll files are considered modules. See also compiland.
namespace
A set of unique symbols or identifiers; a collection of symbols related by function or vendor.
performance-oriented grammar optimizer (POGO)
A tool for controlled language checking and generation.
procedure
See function.
program database (.pdb) file
A file used to store symbolic information about the compiled application.
relative virtual address (RVA)
An offset from the address of a module loaded in memory. See also virtual address.
slot
The location offset of an imported function within the import address table of an executable; the location offset of a memory address in a Microsoft Intermediate Language (MSIL) P-code assembly.
symbol
For the compiler, any name used to identify coding constructs (such as a variable, function, structure, enumeration, constant, class, method, property, and so on) and memory locations within an application.
thunk
Code that performs a translation or conversion during a call or indirection. For example, a thunk may be used to change the size or type of function parameters when passing data between 16-bit and 32-bit code.
user-defined types (UDT)
Base data types explicitly defined with a new name through the pre-compiler's typedef directive. They are equivalent to the base types from which they were defined.
virtual address (VA)
For systems with virtual memory, a VA is a memory location that intervening hardware and/or software maps to physical memory. As an application runs, the same virtual address may be mapped to many different physical addresses as data and programs are paged out and paged in to new memory locations. See also relative virtual address.


Dia2dump Sample

The Dia2dump sample is installed with Visual Studio .NET and consists of the Dia2dump.cpp source file. The compiled executable runs from the command line and displays the contents of an entire program database (.pdb) file.

To install the sample

  1. Verify that your system meets all setup requirements described in the Visual Studio Setup start page.
  2. Install Visual Studio and follow all setup and installation instructions for the included samples.

The default install directory is [drive:]\Program Files\Microsoft Visual Studio .NET\Visual Studio SDKs\DIA SDK\Sample, but you can select an alternate directory for installation.

To build the sample

  1. Open the Dia2dump.dsw file in Visual Studio.
  2. From the Build menu, choose Rebuild.
  3. Close Visual Studio.

To run the sample

  • Open a command prompt and type the following:
    dia2dump <filename>

See Also

Dia2dump.cpp Source File


Dia2dump.cpp Source File

The source code for Dia2dump.cpp follows.

// dia2dump.cpp : Dump contents of a pdb file using DIA.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//---------------------------------------------------------------
//

#include "stdafx.h"
#include "diacreate.h"
#include "cvconst.h"

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

#ifdef NOCOM

#define freeString LocalFree

#else

#define freeString SysFreeString

#endif

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

void printVariant( VARIANT& v )
{
   switch( v.vt )
   {
 //*   LONGLONG      VT_I8
   case VT_I8:
      printf( "%ld", v.llVal );
      break;
 //*   LONG         VT_I4
   case VT_I4:
      printf( "%d", v.lVal );
      break;
 //*   BYTE         VT_UI1
   case VT_UI1:
      printf( "%d", v.bVal);
      break;
 //*   SHORT         VT_I2
   case VT_I2:
      printf( "%d", v.iVal);
      break;
 //*   CHAR         VT_I1
   case VT_I1:
      printf( "%d", v.cVal);
      break;
 //*   USHORT         VT_UI2
   case VT_UI2:
      printf( "%d", v.uiVal);
      break;
//*   ULONG         VT_UI4
   case VT_UI4:
      printf( "%d", v.ulVal);
      break;
 //*   ULONGLONG         VT_UI8
   case VT_UI8:
      printf( "%ld", v.ullVal);
      break;
 //*   INT         VT_INT
   case VT_INT:
      printf( "%d", v.intVal);
      break;
 //*   UINT         VT_UINT
   case VT_UINT:
      printf( "%d", v.uintVal);
      break;
   default:
      printf( "<Not implemented>" );
      break;
   }
}

void printBound( IDiaSymbol* pBound )
{
   DWORD tag = 0;
   BSTR name;
   DWORD kind;
   pBound->get_symTag( &tag );
   pBound->get_locationType( &kind );
   if ( tag == SymTagData && kind == LocIsConstant ) {
      CComVariant v;
      pBound->get_value( &v );
      printVariant( v );
   } else if ( pBound->get_name( &name ) == S_OK ) {
      printf( "%ws", name );
      freeString( name );
   }
}

void printType( IDiaSymbol* pType )
{
   DWORD tag = 0;
   pType->get_symTag( &tag );
   BSTR name;
   if ( pType->get_name( &name ) == S_OK && name != NULL ) {
      printf( "-%ws", name );
      freeString( name );
   } else if ( tag == SymTagPointerType ) {
      CComPtr<IDiaSymbol> pBaseType;
      if (  pType->get_type( &pBaseType ) == S_OK ) {
         printType( pBaseType );
         printf( "*" );
      } else {
         Fatal( "pointer get_type" );
      }
   } else if ( tag == SymTagBaseType ) {
      ULONGLONG size;
      DWORD bt;
      if ( pType->get_length( &size ) != S_OK )
         Fatal( "Internal error, no Length" );
      if ( pType->get_baseType( &bt ) != S_OK )
         Fatal( "Internal error, no baseType" );
       wprintf( L"(base type=%d, len=%ld)  ", bt, size );
   } else if ( tag == SymTagArrayType ) {
      CComPtr<IDiaSymbol> pBaseType;
      if ( pType->get_type( &pBaseType ) == S_OK ) {
         printType( pBaseType );
      } else {
         Fatal( "array get_type" );
      }
      DWORD rank;
      DWORD celt;
      LONG count;
      CComPtr< IDiaEnumSymbols > pEnum;
      if ( pType->get_rank( &rank ) == S_OK ) {
         if ( pType->findChildren( SymTagDimension, NULL, nsNone, &pEnum ) == S_OK && pEnum != NULL ) {
            CComPtr< IDiaSymbol > pSym;
            while ( pEnum->Next( 1, &pSym, &celt ) == S_OK && celt == 1 ) {
               CComPtr< IDiaSymbol > pBound;
               printf( "[" );
               if ( pSym->get_lowerBound( &pBound ) == S_OK ) {
                  printBound( pBound );
                  printf("..");
               }
               pBound = NULL;
               if ( pSym->get_upperBound( &pBound ) == S_OK ) {
                  printBound( pBound );
               }
               pBound = NULL;
               printf( "]" );
               pSym = NULL;

            }
         }
      } else if ( pType->findChildren( SymTagCustomType, NULL, nsNone, &pEnum ) == S_OK && pEnum != NULL && SUCCEEDED( pEnum->get_Count( &count ) ) && count > 0 ){
            CComPtr< IDiaSymbol > pSym;
            while ( pEnum->Next( 1, &pSym, &celt ) == S_OK && celt == 1 ) {
               printf( "[" );
               printType( pSym );
               printf( "]" );
               pSym = NULL;
            }
      } else {
         ULONGLONG lenArray;
         ULONGLONG lenElem;
         if ( pType->get_length( &lenArray ) != S_OK
            || pBaseType->get_length( &lenElem ) != S_OK ) {
            Fatal( "No type length." );
         }
         printf( "[%ld]", lenArray/lenElem );
      }
   } else if ( tag == SymTagFunctionType ) {
      printf( "Function Type" );
   } else if ( tag == SymTagCustomType ) {
      printf( "Custom Type: " );
      DWORD id;
      DWORD rec;
      GUID guid;
      if ( pType->get_guid( &guid ) == S_OK ) {
         wchar_t wszGuid[64];
         StringFromGUID2(guid, wszGuid, 64);
         printf( "%ws", wszGuid );
      } else if ( pType->get_oemId( &id ) == S_OK && pType->get_oemSymbolId( &rec ) == S_OK ) {
         printf( "%x:%x", id, rec );
      }
      DWORD len = 0;
      if ( pType->get_types( 0, &len, NULL ) == S_OK && len > 0 ) {
         IDiaSymbol** psyms = new IDiaSymbol*[ len ];
         pType->get_types( len, &len, psyms );
         for ( DWORD i = 0; i < len; ++i ) {
            printf( " <" );
            printType( psyms[i] );
            printf( ">" );
            psyms[i]->Release();
         }
         delete [] psyms;
      }
      len = 0;
      if ( pType->get_dataBytes( 0, &len, NULL ) == S_OK && len > 0 ) {
         BYTE* pdata = new BYTE[ len ];
         pType->get_dataBytes( len, &len, pdata );
         printf( "<data" );
         for ( DWORD i = 0; i < len; ++i ) {
            printf( " %02x", pdata[i] );
         }
         printf( " data>" );
         delete [] pdata;
      }
   } else {
      printf( "No Type.");
   }
}

void dumpFunctionLines( IDiaSymbol* pSymbol, IDiaSession* pSession )
{
   ULONGLONG length = 0;
   DWORD isect = 0;
   DWORD offset = 0;
   pSymbol->get_addressSection( &isect );
   pSymbol->get_addressOffset( &offset );
   pSymbol->get_length( &length );
   if ( isect != 0 && length > 0 ) {
      CComPtr< IDiaEnumLineNumbers > pLines;
      if ( SUCCEEDED( pSession->findLinesByAddr( isect, offset, static_cast<DWORD>( length ), &pLines ) ) ) {
         CComPtr< IDiaLineNumber > pLine;
         DWORD celt;
         bool firstLine = true;
         while ( SUCCEEDED( pLines->Next( 1, &pLine, &celt ) ) && celt == 1 ){
            DWORD offset;
            DWORD seg;
            DWORD linenum;
            CComPtr< IDiaSymbol > pComp;
            CComPtr< IDiaSourceFile > pSrc;
            pLine->get_compiland( &pComp );
            pLine->get_sourceFile( &pSrc );
            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;
            if ( firstLine ) {
               // Sanity check.
               CComPtr< IDiaEnumLineNumbers > pLinesByLineNum;
               if ( SUCCEEDED( pSession->findLinesByLinenum( pComp, pSrc, linenum, 0, &pLinesByLineNum ) ) ) {
                  CComPtr< IDiaLineNumber > pLine;
                  DWORD celt;
                  while ( SUCCEEDED( pLinesByLineNum->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( "\t\tfound line %d at 0x%x:0x%x\n", linenum, seg, offset );
                     pLine = NULL;
                  }
               }
               firstLine = false;
            }
         }
      }
   }
}

wchar_t* szTags[] = {
   L"",
   L"Executable (Global)",
   L"Compiland",
   L"CompilandDetails",
   L"CompilandEnv",
   L"Function",
   L"Block",
   L"Data",
   L"Unused",
   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"Thunk",
   L"CustomType",
   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,
   false,
   false
};

wchar_t* szDataKinds[] = {
   L"Unknown",
   L"Local",
   L"Static Local",
   L"Parameter",
   L"Object Pointer",
   L"File Static",
   L"Global",
   L"Member",
   L"Static Member",
   L"Constant"
};

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 ( pscope->get_symTag( &tag ) != S_OK )
      Fatal( "Internal error, getting SymTag" );
   if ( pscope->get_name( &name ) != S_OK )
      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;
      BSTR bstr;
      if ( pSym->get_symTag( &tag ) != S_OK )
         Fatal( "Internal error, no SymTag" );
      if ( pSym->get_name( &bstr ) != S_OK )
         Fatal( "Internal error, no name" );
      // Tagtype name found in name or scopeTag.
      wprintf( L"\t%ws %ws found in ", szTags[ tag ], bstr );
      printScopeName( pscope );
      wprintf( L"\n" );
      freeString( bstr );
      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( pglobal->findChildren( 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( penumeration->findChildren( SymTagData, name, nsRegularExpression, &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( pclass->findChildren( 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( pclass->findChildren( 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( pclass->findChildren( 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 (  pSym->get_type( &pClass ) == S_OK )
            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( pscope->findChildren( 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( pscope->findChildren( 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;
      // Check if this is 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 dumpLocalVars( DWORD rva )
{
   CComPtr< IDiaSymbol > pBlock;
   if ( FAILED( psession->findSymbolByRVA( rva, SymTagBlock, &pBlock ) ) ) {
      Fatal( "Failed to find symbols by RVA" );
   }
   CComPtr< IDiaSymbol > pscope;
   for ( ; pBlock != NULL; ) {
      CComPtr< IDiaEnumSymbols > pEnum;
      // Local data search
      if ( FAILED( pBlock->findChildren( SymTagNull, NULL, nsNone, &pEnum ) ) )
         Fatal( "Local scope findChildren failed" );
      CComPtr< IDiaSymbol > pSymbol;
      DWORD tag;
      DWORD celt;
      while ( pEnum != NULL && SUCCEEDED( pEnum->Next( 1, &pSymbol, &celt ) ) && celt == 1 ) {
         pSymbol->get_symTag( &tag );
         if ( tag == SymTagData ) {
            BSTR name;
            DWORD kind;
            pSymbol->get_name( &name );
            pSymbol->get_dataKind( &kind );
            if ( name != NULL )
               wprintf( L"\t%s (%s)\n", name, szDataKinds[ kind ] );
         } else if ( tag == SymTagAnnotation ) {
            CComPtr< IDiaEnumSymbols > pValues;
            // Local data search
            wprintf( L"\tAnnotation:\n" );
            if ( FAILED( pSymbol->findChildren( SymTagNull, NULL, nsNone, &pValues ) ) )
               Fatal( "Annotation findChildren failed" );
            pSymbol = NULL;
            while ( pValues != NULL && SUCCEEDED( pValues->Next( 1, &pSymbol, &celt ) ) && celt == 1 ) {
               CComVariant value;
               if ( pSymbol->get_value( &value ) != S_OK )
                  Fatal( "No value for annotation data." );
               wprintf( L"\t\t%ws\n", value.bstrVal );
               pSymbol = NULL;
            }
         }
         pSymbol = NULL;
      }
      pBlock->get_symTag( &tag );
      if ( tag == SymTagFunction )   // Stop at function scope.
         break;
      // Move to lexical parent.
      CComPtr< IDiaSymbol > pParent;
      if ( SUCCEEDED( pBlock->get_lexicalParent( &pParent ) )
         && pParent != NULL ) {
         pBlock = pParent;
      } else {
         Fatal( "Finding lexical parent failed." );
      }
   };
}

DWORD PrintNameAddr( IDiaSymbol* pSym )
{
   DWORD rva;
   if ( pSym->get_relativeVirtualAddress( &rva ) != S_OK )
      rva = 0;   // No RVA; must be an absolute value.
   DWORD tag;
   pSym->get_symTag( &tag );
   BSTR name;
   if ( pSym->get_name( &name ) != S_OK )
      printf( "\t0x%08X (%ws) <no name>\n", rva, szTags[ tag ] );
   else {
      printf( "\t0x%08X (%ws) %ws\n", rva, szTags[ tag ], name );
      freeString( name );
   }
   return rva;
}

void
DumpLex( IDiaSymbol* pscope, int tabs )
{
   HRESULT   hr;

   CComPtr<IDiaEnumSymbols> pSymbols;
   if ( SUCCEEDED( pscope->findChildren( SymTagNull, NULL, nsNone, &pSymbols ) ) ) {
      CComPtr<IDiaSymbol> pSymbol;
      ULONG celt = 0;
      while ( pSymbols != NULL && SUCCEEDED( hr = pSymbols->Next( 1, &pSymbol, &celt ) ) && celt == 1 ) {
         for ( int i = 0; i < tabs; ++i )
            printf( "\t" );
         BSTR name;
         if ( pSymbol->get_name( &name ) == S_OK && name != NULL ) {
            printf( "%ws", name );
            freeString( name );
         }
         DWORD symTag;
         pSymbol->get_symTag( &symTag );
         printf( " : %ws\n", szTags[ symTag ] );
         switch ( symTag ) {
         case SymTagExe:
            assert( false );
            break;
         case SymTagCompiland:
         case SymTagFunction:
         case SymTagBlock:
            DumpLex( pSymbol, tabs+1 );
            break;
         default:
            break;
         }
         pSymbol = NULL;
      }
   }
}

void
Dump(
   char *szFilename,
   IDiaDataSource* pSource,
   wchar_t* szLookup
)
{
   HRESULT   hr;
   wchar_t wszFilename[ _MAX_PATH ];
   mbstowcs( wszFilename, szFilename, sizeof( wszFilename ) );
   if ( FAILED( pSource->loadDataFromPdb( wszFilename ) ) )
      if ( FAILED( pSource->loadDataForExe( wszFilename, NULL, NULL ) ) )
         Fatal( "loadDataFromPdb/Exe" );

   if ( FAILED( pSource->openSession( &psession ) ) )
      Fatal( "openSession" );
   if ( FAILED( psession->get_globalScope( &pglobal) ) )
      Fatal( "get_globalScope" );
   DWORD id = 0;
   pglobal->get_symIndexId( &id );
   if ( id == 0 )
      Fatal( "get_indexId" );

   ULONG celt = 0;

   CComPtr<IDiaEnumSymbols> pEnum;
   CComPtr<IDiaSymbol> pSymbol;

   pglobal->findChildren(SymTagUDT,NULL,nsfCaseInsensitive|nsfUndecoratedName,&pEnum);
   while ( SUCCEEDED( hr = pEnum->Next( 1, &pSymbol, &celt ) ) && celt == 1 ) {
      BSTR name;
      if ( pSymbol->get_name( &name ) != S_OK )
         Fatal( "get_name" );
      printf( "Found UDT: %ws\n", name );
      freeString( name );
      ULONGLONG len = 0;
      pSymbol->get_length( &len );
      if ( len == 0 )
         Fatal( "get_length" );
      pSymbol = 0;
   }

   CComPtr<IDiaEnumTables> pTables;
   if ( FAILED( psession->getEnumTables( &pTables ) ) )
      Fatal( "getEnumTables" );
   CComPtr< IDiaTable > pTable;
   while ( SUCCEEDED( hr = pTables->Next( 1, &pTable, &celt ) ) && celt == 1 ) {
      BSTR name;
      if ( pTable->get_name( &name ) != 0 )
         Fatal( "get_name" );
      printf( "Found table: %ws\n", name );
      freeString( name );
      CComPtr<IDiaEnumSymbols> pSymbols;
      CComPtr<IDiaEnumSourceFiles> pSourceFiles;
      CComPtr<IDiaEnumSegments> pSegments;
      CComPtr<IDiaEnumSectionContribs> pSecContribs;
      if ( SUCCEEDED( pTable->QueryInterface( _uuidof( IDiaEnumSymbols ), (void**)&pSymbols ) ) ) {
         CComPtr<IDiaSymbol> pSymbol;
         while ( SUCCEEDED( hr = pSymbols->Next( 1, &pSymbol, &celt ) ) && celt == 1 ) {
            DWORD symIndex;
            pSymbol->get_symIndexId( &symIndex );
            DWORD symTag;
            pSymbol->get_symTag( &symTag );
            if ( pSymbol->get_name( &name ) == S_OK && name != NULL ) {
               printf( "sym name: %ws", name );
               freeString( name );
               if ( symTag == SymTagPublicSymbol ) {
                  pSymbol->get_undecoratedName( &name );
                  printf( " (%ws)", name );
                  freeString( name );
               }
               CComPtr<IDiaSymbol> pType;
               if ( pSymbol->get_type( &pType ) == S_OK ) {
                  printf( " has type " );
                  printType( pType );

                  DWORD id = 0;
                  CComPtr< IDiaSymbol > ptypeSym;
                  pSymbol->get_typeId( &id );
                  if ( FAILED( psession->symbolById( id, &ptypeSym ) ) ||
                     psession->symsAreEquiv( pType, ptypeSym ) != S_OK ) {
                        Fatal( "Sym type equality" );
                  }
               }
               printf( "\n" );
               if ( symTag == SymTagFunction ) {
                  dumpFunctionLines( pSymbol, psession );
                  DWORD loctype;
                  if ( pSymbol->get_locationType( &loctype ) == S_OK && loctype == LocIsStatic ) {
                     DWORD rva;
                     pSymbol->get_relativeVirtualAddress( &rva );
                     if ( rva != 0 ) {
                        dumpLocalVars( rva );

                        CComPtr< IDiaSymbol > pfuncSym;
                        if ( SUCCEEDED( psession->findSymbolByRVA( rva, SymTagNull, &pfuncSym ) ) ) {
                           if ( psession->symsAreEquiv( pfuncSym, pSymbol ) != S_OK ) {
                              BSTR name;
                              DWORD tag;
                              pfuncSym->get_symTag( &tag );
                              pfuncSym->get_name( &name );
                              printf( "\tfound alt symbol: %ws (%ws)\n", name != NULL ? name : L"", szTags[ tag ] );
                              if ( name )
                                 freeString( name );
                           }
                        } else {
                           Fatal( "No function symbol found by rva." );
                        }
                     }
                  }
               }
            }
            if ( isScopeSym( symTag ) && szLookup ) {
               FindCppNameInScope( szLookup, pSymbol );
            }
            pSymbol = NULL;
         }
      } else if ( SUCCEEDED( pTable->QueryInterface( _uuidof( 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( _uuidof( IDiaEnumSegments ), (void**)&pSegments ) ) ) {
         CComPtr<IDiaSegment> pSegment;
         while ( SUCCEEDED( hr = pSegments->Next( 1, &pSegment, &celt ) ) && celt == 1 ) {
            DWORD rva;
            DWORD seg;
            pSegment->get_addressSection( &seg );
            if ( pSegment->get_relativeVirtualAddress( &rva ) == S_OK ) {
               printf( "Segment %i addr: 0x%.8X\n", seg, rva );
               pSegment = NULL;
               CComPtr<IDiaSymbol> pSym;
               if ( psession->findSymbolByRVA( rva, SymTagNull, &pSym ) == S_OK ) {
                  BSTR name = NULL;
                  DWORD tag;
                  pSym->get_symTag( &tag );
                  pSym->get_name( &name );
                  printf( "\tClosest symbol: %ws (%ws)\n", name != NULL ? name : L"", szTags[ tag ] );
                  if ( name )
                     freeString( name );
               }
            } else {
               printf( "Segment %i \n", seg );
               pSegment = NULL;
               CComPtr<IDiaSymbol> pSym;
               if ( SUCCEEDED( psession->findSymbolByAddr( seg, 0, SymTagNull, &pSym ) ) ) {
                  BSTR name;
                  DWORD tag;
                  pSym->get_symTag( &tag );
                  pSym->get_name( &name );
                  printf( "\tClosest symbol: %ws (%ws)\n", name != NULL ? name : L"", szTags[ tag ] );
                  if ( name )
                     freeString( name );
               }
            }
         }
      } else if ( SUCCEEDED( pTable->QueryInterface( _uuidof( IDiaEnumSectionContribs ), (void**)&pSecContribs ) ) ) {
         printf( "SecContribs\n" );
         CComPtr<IDiaSectionContrib> pSecContrib;
         while ( SUCCEEDED( hr = pSecContribs->Next( 1, &pSecContrib, &celt ) ) && celt == 1 ) {
            DWORD rva;
            if ( pSecContrib->get_relativeVirtualAddress( &rva ) == S_OK ) {
               printf( "\taddr: 0x%.8X", rva );
               pSecContrib = NULL;
               CComPtr<IDiaSymbol> pSym;
               if ( psession->findSymbolByRVA( rva, SymTagNull, &pSym ) == S_OK ) {
                  BSTR name = NULL;
                  DWORD tag;
                  pSym->get_symTag( &tag );
                  pSym->get_name( &name );
                  printf( "    symbol: %ws (%ws)\n", name != NULL ? name : L"", szTags[ tag ] );
                  if ( name )
                     freeString( name );
               } else {
                  printf( "<no symbol found?>\n" );
               }
            } else {
               DWORD isect;
               DWORD offset;
               pSecContrib->get_addressSection( &isect );
               pSecContrib->get_addressOffset( &offset );
               printf( "\taddr: 0x%.4X:0x%.8X", isect, offset );
               pSecContrib = NULL;
               CComPtr<IDiaSymbol> pSym;
               if ( SUCCEEDED( psession->findSymbolByAddr( isect, offset, SymTagNull, &pSym ) ) ) {
                  BSTR name;
                  DWORD tag;
                  pSym->get_symTag( &tag );
                  pSym->get_name( &name );
                  printf( "    symbol: %ws (%ws)\n", name != NULL ? name : L"", szTags[ tag ] );
                  if ( name )
                     freeString( name );
               } else {
                  printf( "<no symbol found?>\n" );
               }
            }
         }
      }

      pTable = NULL;
   }
   CComPtr<IDiaEnumSymbolsByAddr> pEnumByAddr;
   if ( FAILED( psession->getSymbolsByAddr( &pEnumByAddr ) ) )
      Fatal( "getSymbolsByAddr" );
   CComPtr<IDiaSymbol> pSym;
   if ( FAILED( pEnumByAddr->symbolByAddr( 1, 0, &pSym ) ) )
      Fatal( "symbolByAddr" );
   DWORD rvaLast = 0;
   if ( pSym->get_relativeVirtualAddress( &rvaLast ) == S_OK ) {
      pSym = 0;
      if ( FAILED( pEnumByAddr->symbolByRVA( rvaLast, &pSym ) ) )
         Fatal( "symbolByAddr" );
      printf( "Symbols in order\n" );
      do {
         rvaLast = PrintNameAddr( pSym );
         pSym = 0;
         celt = 0;
         if ( FAILED( hr = pEnumByAddr->Next( 1, &pSym, &celt ) ) )
            break;
      } while ( celt == 1 );

      printf( "Symbols in reverse order\n" );
      pSym = 0;
      if ( FAILED( pEnumByAddr->symbolByRVA( rvaLast, &pSym ) ) )
         Fatal( "symbolByRva" );
      printf( "Symbols in order\n" );
      do {
         rvaLast = PrintNameAddr( pSym );
         pSym = 0;
         celt = 0;
         if ( FAILED( hr = pEnumByAddr->Prev( 1, &pSym, &celt ) ) )
            break;
      } while ( celt == 1 );

      if ( FAILED( hr ) )
         Fatal( "Next" );
   }

}

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

const char* diaPaths[] = {
      "msdia20.dll",
      "..\\bin\\msdia20.dll",
      "..\\..\\bin\\msdia20.dll",
      0
};

int main(int argc, char* argv[])
{

   if ( argc < 2 ) {
      usage(argc, argv);
   }

   HRESULT   hr;
#ifndef NOCOM
   hr = CoInitialize(NULL);
   if (FAILED(hr))
   {
      Fatal("CoInitialize failed\n");
   }
#endif

   {

      CComPtr<IDiaDataSource> pSource;
      // Initialize the COM library.

#ifdef NOCOM

#ifdef NOREG
      hr = NoRegCoCreate( "msdia20.dll", _uuidof( DiaSourceAlt ), _uuidof( IDiaDataSource ), (void **) &pSource );
#else
      hr = NoOleCoCreate( _uuidof( DiaSourceAlt ), _uuidof( IDiaDataSource ), (void **) &pSource );
#endif

#else
      // Obtain access to the provider.
      hr = CoCreateInstance(_uuidof( DiaSource ), NULL, CLSCTX_INPROC_SERVER,
         _uuidof( IDiaDataSource ), (void **) &pSource);
      if ( hr == REGDB_E_CLASSNOTREG ) {
         for ( int i = 0; FAILED( hr ) && diaPaths[i] != 0; ++i ) {
            hr = NoRegCoCreate( diaPaths[i], _uuidof( DiaSource ), _uuidof( IDiaDataSource ), (void **) &pSource );
         }
      }
#endif
      if (FAILED(hr))
      {
         Fatal("Could not CoCreate CLSID_DiaSource(Alt). Register msdia20.dll or add its location to your PATH." );
      }
      if ( argc > 2 ) {
         wchar_t name[ 256 ];
         mbstowcs( name, argv[ 2 ], 256 );
         Dump( argv[ 1 ], pSource, name );
         DumpLex( pglobal, 0 );
      } else {
         Dump( argv[ 1 ], pSource, NULL );
      }
   }
   pglobal = 0;
   psession= 0;
#ifndef NOCOM
   CoUninitialize();
#endif
   return 0;
}