widl: update import table code
Huw D M Davies
h.davies1 at physics.ox.ac.uk
Wed Jun 29 06:38:36 CDT 2005
Huw Davies <huw at codeweavers.com> for Mandriva
Update the import table code to eliminate a few magic constants.
--
Huw Davies
huw at codeweavers.com
Index: tools/widl/typelib_struct.h
===================================================================
RCS file: /home/wine/wine/tools/widl/typelib_struct.h,v
retrieving revision 1.8
diff -u -p -r1.8 typelib_struct.h
--- tools/widl/typelib_struct.h 28 Jun 2005 13:52:23 -0000 1.8
+++ tools/widl/typelib_struct.h 29 Jun 2005 11:35:31 -0000
@@ -153,17 +153,19 @@ typedef struct tagMSFT_TypeInfoBase {
/* loword is num of inherited interfaces */
INT res18; /* always? 0 */
/*060*/ INT res19; /* always? -1 */
- } MSFT_TypeInfoBase;
+} MSFT_TypeInfoBase;
/* layout of an entry with information on imported types */
typedef struct tagMSFT_ImpInfo {
- INT res0; /* bits 0 - 15: count */
+ INT flags; /* bits 0 - 15: count */
/* bit 16: if set oGuid is an offset to Guid */
/* if clear oGuid is a typeinfo index in the specified typelib */
/* bits 24 - 31: TKIND of reference */
INT oImpFile; /* offset in the Import File table */
INT oGuid; /* offset in Guid table or typeinfo index (see bit 16 of res0) */
- } MSFT_ImpInfo;
+} MSFT_ImpInfo;
+
+#define MSFT_IMPINFO_OFFSET_IS_GUID 0x00010000
/* function description data */
typedef struct {
Index: tools/widl/write_msft.c
===================================================================
RCS file: /home/wine/wine/tools/widl/write_msft.c,v
retrieving revision 1.36
diff -u -p -r1.36 write_msft.c
--- tools/widl/write_msft.c 9 Jun 2005 09:45:26 -0000 1.36
+++ tools/widl/write_msft.c 29 Jun 2005 11:35:31 -0000
@@ -1751,7 +1751,7 @@ static void add_dispatch(msft_typelib_t
guidentry.guid = iid_idispatch;
guidentry.hreftype = 1;
guidentry.next_hash = -1;
- impinfo.res0 = 0x301 << 16;
+ impinfo.flags = TKIND_INTERFACE << 24 | MSFT_IMPINFO_OFFSET_IS_GUID;
impinfo.oImpFile = impfile_offset;
impinfo.oGuid = ctl2_alloc_guid(typelib, &guidentry);
typelib->typelib_header.dispatchpos = alloc_importinfo(typelib, &impinfo) | 0x01;
More information about the wine-patches
mailing list