Author: cwittich
Date: Sun Sep 4 08:54:06 2016
New Revision: 72567
URL:
http://svn.reactos.org/svn/reactos?rev=72567&view=rev
Log:
[SDK] sync undname.c to wine 1.9.16
Modified:
trunk/reactos/sdk/lib/crt/wine/undname.c
Modified: trunk/reactos/sdk/lib/crt/wine/undname.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/sdk/lib/crt/wine/undname.c…
==============================================================================
--- trunk/reactos/sdk/lib/crt/wine/undname.c [iso-8859-1] (original)
+++ trunk/reactos/sdk/lib/crt/wine/undname.c [iso-8859-1] Sun Sep 4 08:54:06 2016
@@ -857,14 +857,55 @@
case 'P': /* Pointer */
if (isdigit((unsigned char)*sym->current))
{
- /* FIXME: P6 = Function pointer, others who knows.. */
- if (*sym->current++ == '6')
+ /* FIXME:
+ * P6 = Function pointer
+ * P8 = Member function pointer
+ * others who knows.. */
+ if (*sym->current == '8')
{
char* args = NULL;
const char* call_conv;
const char* exported;
struct datatype_t sub_ct;
unsigned mark = sym->stack.num;
+ const char* class;
+ const char* modifier;
+ const char* ptr_modif;
+
+ sym->current++;
+
+ if (!(class = get_class_name(sym)))
+ goto done;
+ if (!get_modifier(sym, &modifier, &ptr_modif))
+ goto done;
+ if (modifier)
+ modifier = str_printf(sym, "%s %s", modifier, ptr_modif);
+ else if(ptr_modif[0])
+ modifier = str_printf(sym, " %s", ptr_modif);
+ if (!get_calling_convention(*sym->current++,
+ &call_conv, &exported,
+ sym->flags & ~UNDNAME_NO_ALLOCATION_LANGUAGE))
+ goto done;
+ if (!demangle_datatype(sym, &sub_ct, pmt_ref, FALSE))
+ goto done;
+
+ args = get_args(sym, pmt_ref, TRUE, '(', ')');
+ if (!args) goto done;
+ sym->stack.num = mark;
+
+ ct->left = str_printf(sym, "%s%s (%s %s::*",
+ sub_ct.left, sub_ct.right, call_conv, class);
+ ct->right = str_printf(sym, ")%s%s", args, modifier);
+ }
+ else if (*sym->current == '6')
+ {
+ char* args = NULL;
+ const char* call_conv;
+ const char* exported;
+ struct datatype_t sub_ct;
+ unsigned mark = sym->stack.num;
+
+ sym->current++;
if (!get_calling_convention(*sym->current++,
&call_conv, &exported,
@@ -902,6 +943,7 @@
case '5': case '6': case '7': case '8': case
'9':
/* Referring back to previously parsed type */
/* left and right are pushed as two separate strings */
+ if (!pmt_ref) goto done;
ct->left = str_array_get_ref(pmt_ref, (dt - '0') * 2);
ct->right = str_array_get_ref(pmt_ref, (dt - '0') * 2 + 1);
if (!ct->left) goto done;
@@ -948,7 +990,37 @@
}
break;
case '$':
- if (*sym->current == 'C')
+ if (*sym->current == 'B')
+ {
+ unsigned mark = sym->stack.num;
+ struct datatype_t sub_ct;
+ const char* arr = NULL;
+ sym->current++;
+
+ /* multidimensional arrays */
+ if (*sym->current == 'Y')
+ {
+ const char* n1;
+ int num;
+
+ sym->current++;
+ if (!(n1 = get_number(sym))) goto done;
+ num = atoi(n1);
+
+ while (num--)
+ arr = str_printf(sym, "%s[%s]", arr, get_number(sym));
+ }
+
+ if (!demangle_datatype(sym, &sub_ct, pmt_ref, FALSE)) goto done;
+
+ if (arr)
+ ct->left = str_printf(sym, "%s %s", sub_ct.left, arr);
+ else
+ ct->left = sub_ct.left;
+ ct->right = sub_ct.right;
+ sym->stack.num = mark;
+ }
+ else if (*sym->current == 'C')
{
const char *ptr, *ptr_modif;
@@ -1377,6 +1449,8 @@
sym->current++;
str_array_init(&pmt);
demangle_datatype(sym, &ct, &pmt, FALSE);
+ if (!demangle_datatype(sym, &ct, NULL, FALSE))
+ goto done;
function_name = str_printf(sym, "%s%s `RTTI Type
Descriptor'",
ct.left, ct.right);
sym->current--;