Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

UnDecorateSymbolName (dbghlp32)
 
.
Summary
Undecorates symbols from C++ mangled names into readable signatures:

eg.

?StringListCopy@@$$J0YAHPAPAUStringListType_s@@0@Z

into:

int __cdecl StringListCopy(struct StringListType_s * *,struct StringListType_s * *)

C++ Signature:

    DWORD WINAPI UnDecorateSymbolName(
      __in   PCTSTR DecoratedName,
      __out  PTSTR UnDecoratedName,
      __in   DWORD UndecoratedLength,
      __in   DWORD Flags
    );

C# Signature:

    [Flags]
    enum UnDecorateFlags
    {
        UNDNAME_COMPLETE         = (0x0000),  // Enable full undecoration
        UNDNAME_NO_LEADING_UNDERSCORES   = (0x0001),  // Remove leading underscores from MS extended keywords
        UNDNAME_NO_MS_KEYWORDS       = (0x0002),  // Disable expansion of MS extended keywords
        UNDNAME_NO_FUNCTION_RETURNS      = (0x0004),  // Disable expansion of return type for primary declaration
        UNDNAME_NO_ALLOCATION_MODEL      = (0x0008),  // Disable expansion of the declaration model
        UNDNAME_NO_ALLOCATION_LANGUAGE   = (0x0010),  // Disable expansion of the declaration language specifier
        UNDNAME_NO_MS_THISTYPE       = (0x0020),  // NYI Disable expansion of MS keywords on the 'this' type for primary declaration
        UNDNAME_NO_CV_THISTYPE       = (0x0040),  // NYI Disable expansion of CV modifiers on the 'this' type for primary declaration
        UNDNAME_NO_THISTYPE          = (0x0060),  // Disable all modifiers on the 'this' type
        UNDNAME_NO_ACCESS_SPECIFIERS     = (0x0080),  // Disable expansion of access specifiers for members
        UNDNAME_NO_THROW_SIGNATURES      = (0x0100),  // Disable expansion of 'throw-signatures' for functions and pointers to functions
        UNDNAME_NO_MEMBER_TYPE       = (0x0200),  // Disable expansion of 'static' or 'virtual'ness of members
        UNDNAME_NO_RETURN_UDT_MODEL      = (0x0400),  // Disable expansion of MS model for UDT returns
        UNDNAME_32_BIT_DECODE        = (0x0800),  // Undecorate 32-bit decorated names
        UNDNAME_NAME_ONLY        = (0x1000),  // Crack only the name for primary declaration;
                              // return just [scope::]name.  Does expand template params
        UNDNAME_NO_ARGUMENTS         = (0x2000),  // Don't undecorate arguments to function
        UNDNAME_NO_SPECIAL_SYMS      = (0x4000),  // Don't undecorate special names (v-table, vcall, vector xxx, metatype, etc)
    }

    [DllImport("dbghelp.dll", SetLastError=true, PreserveSig=true)]
    static extern int UnDecorateSymbolName(
        [In] [MarshalAs(UnmanagedType.LPStr)] string DecoratedName,
        [Out] StringBuilder UnDecoratedName,
        [In] [MarshalAs(UnmanagedType.U4)] int UndecoratedLength,
        [In] [MarshalAs(UnmanagedType.U4)] UnDecorateFlags Flags);

VB Signature:

User-Defined Types:

None.

Alternative Managed API:

Notes:

None.

Tips & Tricks:

Sample Code:

StringBuilder builder = new StringBuilder(255);
UnDecorateSymbolName("Mangled String", builder, builder.Capacity, UnDecorateFlags.UNDNAME_COMPLETE);

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Find References
Show Printable Version
Revisions