[PATCH] [DbgHelp]: function

Eric Pouech eric.pouech at wanadoo.fr
Sun Mar 5 14:48:07 CST 2006


- implemented TI_GET_COUNT in SymGetTypeInfo for function

A+
---

 dlls/dbghelp/type.c |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/dlls/dbghelp/type.c b/dlls/dbghelp/type.c
index e739be1..799916e 100644
--- a/dlls/dbghelp/type.c
+++ b/dlls/dbghelp/type.c
@@ -551,13 +551,20 @@ BOOL symt_get_info(const struct symt* ty
         break;
 
     case TI_GET_COUNT:
-        /* it seems that FunctionType also react to GET_COUNT (same value as
-         * GET_CHILDREN_COUNT ?, except for C++ methods, where it seems to
-         * also include 'this' (GET_CHILDREN_COUNT+1)
-         */
-        if (type->tag != SymTagArrayType) return FALSE;
-        X(DWORD) = ((const struct symt_array*)type)->end - 
-            ((const struct symt_array*)type)->start + 1;
+        switch (type->tag)
+        {
+        case SymTagArrayType:
+            X(DWORD) = ((const struct symt_array*)type)->end - 
+                ((const struct symt_array*)type)->start + 1;
+            break;
+        case SymTagFunctionType:
+            /* this seems to be wrong for (future) C++ methods, where 'this' parameter
+             * should be included in this value (and not in GET_CHILDREN_COUNT)
+             */
+            X(DWORD) = vector_length(&((const struct symt_function_signature*)type)->vchildren);
+            break;
+        default: return FALSE;
+        }
         break;
 
     case TI_GET_DATAKIND:





More information about the wine-patches mailing list