Debugging Tools for Windows

GetTypeId

The GetTypeId and GetTypeIdWide methods look up the specified type and return its type ID.

HRESULT
  IDebugSymbols::GetTypeId(
    IN ULONG64  Module,
    IN PCSTR  Name,
    OUT PULONG  TypeId
    );

HRESULT
  IDebugSymbols3::GetTypeIdWide(
    IN ULONG64  Module,
    IN PCWSTR  Name,
    OUT PULONG  TypeId
    );

#ifdef UNICODE
#define GetTypeIdT GetTypeIdWide
#else
#define GetTypeIdT GetTypeId
#endif

Parameters

Module
Specifies the base address of the module to which the type belongs. For more information, see Modules. If Name contains a module name, Module is ignored.
Name
Specifies the name of the type whose type ID is desired. If Name is a module-qualified name (for example mymodule!main), the Module parameter is ignored.
TypeId
Receives the type ID of the symbol.

Return Value

S_OK
The method was successful.

This method may also return error values. See Return Values for more details.

Interface Version

GetTypeId is available in all versions of IDebugSymbols. GetTypeIdWide is available in IDebugSymbols3 and later versions.

Comments

If the specified symbol is a type, these methods return the type ID for that type; otherwise, they return the type ID for the type of the symbol.

A variable whose type was defined using typedef has a type ID that identifies the original type, not the type created by typedef. In the following example, the type ID of MyInstance corresponds to the name MyStruct (this correspondence can be seen by passing the type ID to GetTypeName):

struct MyStruct { int a; };
typedef struct MyStruct MyType;
MyType MyInstance;

Moreover, calling these methods for MyStruct and MyType yields type IDs corresponding to MyStruct and MyType, respectively.

For more information about symbols and symbol names, see Symbols.

Requirements

Headers: Defined in Dbgeng.h. Include Dbgeng.h.

See Also

GetOffsetTypeId, GetSymbolTypeId

Build machine: CAPEBUILD