-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathundname.h
More file actions
39 lines (33 loc) · 2.95 KB
/
Copy pathundname.h
File metadata and controls
39 lines (33 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Access to CRT C++ demangler/undecorator function
#pragma once
// Online: http://demangler.com/
typedef PVOID (__cdecl * _Alloc)(UINT32);
typedef void (__cdecl * _Free)(PVOID);
const UINT32 UNDNAME_COMPLETE = 0x00000; // Enable full undecoration
const UINT32 UNDNAME_NO_LEADING_UNDERSCORES = 0x00001; // Remove leading underscores from MS extended keywords
const UINT32 UNDNAME_NO_MS_KEYWORDS = 0x00002; // Disable expansion of MS extended keywords
const UINT32 UNDNAME_NO_FUNCTION_RETURNS = 0x00004; // Disable expansion of return type for primary declaration
const UINT32 UNDNAME_NO_ALLOCATION_MODEL = 0x00008; // Disable expansion of the declaration model
const UINT32 UNDNAME_NO_ALLOCATION_LANGUAGE = 0x00010; // Disable expansion of the declaration language specifier
const UINT32 UNDNAME_NO_MS_THISTYPE = 0x00020; // Disable expansion of MS keywords on the 'this' type for primary declaration
const UINT32 UNDNAME_NO_CV_THISTYPE = 0x00040; // Disable expansion of CV modifiers on the 'this' type for primary declaration
const UINT32 UNDNAME_NO_THISTYPE = 0x00060; // Disable all modifiers on the 'this' type
const UINT32 UNDNAME_NO_ACCESS_SPECIFIERS = 0x00080; // Disable expansion of access specifiers for members
const UINT32 UNDNAME_NO_THROW_SIGNATURES = 0x00100; // Disable expansion of 'throw-signatures' for functions and pointers to functions
const UINT32 UNDNAME_NO_MEMBER_TYPE = 0x00200; // Disable expansion of 'static' or 'virtual'ness of members
const UINT32 UNDNAME_NO_RETURN_UDT_MODEL = 0x00400; // Disable expansion of MS model for UDT returns
const UINT32 UNDNAME_32_BIT_DECODE = 0x00800; // Undecorate 32-bit decorated names
const UINT32 UNDNAME_NAME_ONLY = 0x01000; // Crack only the name for primary declaration; return just [scope::]name. Does expand template params
const UINT32 UNDNAME_TYPE_ONLY = 0x02000; // Input is just a type encoding; compose an abstract declarator
const UINT32 UNDNAME_HAVE_PARAMETERS = 0x04000; // The real templates parameters are available
const UINT32 UNDNAME_NO_ECSU = 0x08000; // Suppress enum/class/struct/union
const UINT32 UNDNAME_NO_IDENT_CHAR_CHECK = 0x10000; // Suppress check for IsValidIdentChar
inline PVOID mallocWrap(UINT32 size) { return malloc((UINT32) size); }
/*
To supply a buffer to use use 'buffer' and 'sizeBuffer', else for a allocated buffer
'buffer' = NULL, 'sizeBuffer' = 0, and use the return string.
Call Free on the return result when done with the string.
Note: CRT documentation error, the Allocator and Free must be supplied regardless if supplied or allocation buffer method desired.
*/
// https://www.winehq.org/pipermail/wine-patches/2004-January/009183.html
extern "C" LPSTR __cdecl __unDName(__out LPSTR buffer, __in LPCSTR name, int sizeBuffer, _Alloc allocator, _Free _free, UINT32 flags);