[PATCH 04/13] [DbgHelp]: added HRESULT as new basic type (and some doc about basic types ids)

Eric Pouech eric.pouech at orange.fr
Wed Feb 6 14:55:22 CST 2008




A+
---

 dlls/dbghelp/msc.c     |    2 ++
 include/wine/mscvpdb.h |   12 +++++++++++-
 2 files changed, 13 insertions(+), 1 deletions(-)


diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c
index 1ae725a..b8a7780 100644
--- a/dlls/dbghelp/msc.c
+++ b/dlls/dbghelp/msc.c
@@ -139,6 +139,7 @@ static void codeview_init_basic_types(struct module* module)
     cv_basic_types[T_UINT4]  = &symt_new_basic(module, btUInt,  "UINT4", 4)->symt;
     cv_basic_types[T_INT8]   = &symt_new_basic(module, btInt,   "INT8", 8)->symt;
     cv_basic_types[T_UINT8]  = &symt_new_basic(module, btUInt,  "UINT8", 8)->symt;
+    cv_basic_types[T_HRESULT]= &symt_new_basic(module, btUInt,  "HRESULT", 4)->symt;
 
     cv_basic_types[T_32PVOID]   = &symt_new_pointer(module, cv_basic_types[T_VOID])->symt;
     cv_basic_types[T_32PCHAR]   = &symt_new_pointer(module, cv_basic_types[T_CHAR])->symt;
@@ -163,6 +164,7 @@ static void codeview_init_basic_types(struct module* module)
     cv_basic_types[T_32PUINT4]  = &symt_new_pointer(module, cv_basic_types[T_UINT4])->symt;
     cv_basic_types[T_32PINT8]   = &symt_new_pointer(module, cv_basic_types[T_INT8])->symt;
     cv_basic_types[T_32PUINT8]  = &symt_new_pointer(module, cv_basic_types[T_UINT8])->symt;
+    cv_basic_types[T_32PHRESULT]= &symt_new_pointer(module, cv_basic_types[T_HRESULT])->symt;
 }
 
 static int numeric_leaf(int* value, const unsigned short int* leaf)
diff --git a/include/wine/mscvpdb.h b/include/wine/mscvpdb.h
index 8a22dfd..47a8e72 100644
--- a/include/wine/mscvpdb.h
+++ b/include/wine/mscvpdb.h
@@ -732,6 +732,15 @@ union codeview_fieldtype
  * bit mode.  There are many other types listed in the documents, but these
  * are apparently not used by the compiler, or represent pointer types
  * that are not used.
+ *
+ * Official MS documentation says that type (< 0x4000, so 12 bits) is made of:
+ *        +----------+------+------+----------+------+
+ *        |    11    | 10-8 | 7-4  |     3    | 2-0  |
+ *        +----------+------+------+----------+------+
+ *        | reserved | mode | type | reserved | size |
+ *        +----------+------+------+----------+------+
+ * In recent PDB files, type 8 exists, and is seen as an HRESULT... So we've
+ * added this basic type... as if bit 3 had been integrated into the size field
  */
 
 /* the type number of a built-in type is a 16-bit value specified in the following format:
@@ -818,6 +827,7 @@ union codeview_fieldtype
 #define T_NBASICSTR         0x0005  /* near basic string */
 #define T_FBASICSTR         0x0006  /* far basic string */
 #define T_NOTTRANS          0x0007  /* untranslated type record from MS symbol format */
+#define T_HRESULT           0x0008  /* Hresult - or error code ??? */
 #define T_CHAR              0x0010  /* signed char */
 #define T_SHORT             0x0011  /* short */
 #define T_LONG              0x0012  /* long */
@@ -952,6 +962,7 @@ union codeview_fieldtype
 
 /* 32-bit near pointers to basic types */
 #define T_32PVOID           0x0403  /* 32-bit near pointer to void */
+#define T_32PHRESULT        0x0408  /* 16:32 near pointer to Hresult - or error code ??? */
 #define T_32PCHAR           0x0410  /* 16:32 near pointer to 8-bit signed */
 #define T_32PSHORT          0x0411  /* 16:32 near pointer to 16-bit signed */
 #define T_32PLONG           0x0412  /* 16:32 near pointer to 32-bit signed */
@@ -1033,7 +1044,6 @@ union codeview_fieldtype
 #define T_FAR32PTR_BITS     0x0500
 #define T_NEAR64PTR_BITS    0x0600
 
-
 #define LF_MODIFIER_V1          0x0001
 #define LF_POINTER_V1           0x0002
 #define LF_ARRAY_V1             0x0003





More information about the wine-patches mailing list