Add support for dispinterfaces (slightly hacked because we force the
[wine] / tools / widl / typelib_struct.h
1 /*
2  * typelib_struct.h  internal wine data structures
3  * used to decode typelib's
4  *
5  * Copyright 1999 Rein KLazes
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  */
21 #ifndef _WIDL_TYPELIB_STRUCT_H
22 #define _WIDL_TYPELIB_STRUCT_H
23
24 #define HELPDLLFLAG (0x0100)
25 #define DO_NOT_SEEK (-1)
26
27 #define MSFT_HREFTYPE_INTHISFILE(href) (!((href) & 3))
28 #define MSFT_HREFTYPE_INDEX(href) ((href) /sizeof(MSFT_TypeInfoBase))
29
30 /*-------------------------FILE STRUCTURES-----------------------------------*/
31
32 /* There are two known file formats, those created with ICreateTypeLib
33  * have the signature "SLTG" as their first four bytes, while those created
34  * with ICreateTypeLib2 have "MSFT".
35  */
36
37 /*****************************************************
38  *                MSFT typelibs
39  *
40  * These are TypeLibs created with ICreateTypeLib2
41  *
42  */
43
44 /*
45  * structure of the typelib type2 header
46  * it is at the beginning of a type lib file
47  *
48  */
49 typedef struct tagMSFT_Header {
50 /*0x00*/INT   magic1;       /* 0x5446534D "MSFT" */
51         INT   magic2;       /* 0x00010002 version nr? */
52         INT   posguid;      /* position of libid in guid table  */
53                             /* (should be,  else -1) */
54         INT   lcid;         /* locale id */
55 /*0x10*/INT   lcid2;
56         INT   varflags;     /* (largely) unknown flags */
57                             /* the lower nibble is syskind */
58                             /* 0x40 always seems to be set */
59                             /* 0x10 set with a helpfile defined */
60                             /* 0x100 set with a helpstringdll defined - in this
61                                   case the offset to the name in the stringtable
62                                   appears right after this struct, before the
63                                   typeinfo offsets */
64         INT   version;      /* set with SetVersion() */
65         INT   flags;        /* set with SetFlags() */
66 /*0x20*/INT   nrtypeinfos;  /* number of typeinfo's (till so far) */
67         INT   helpstring;   /* position of help string in stringtable */
68         INT   helpstringcontext;
69         INT   helpcontext;
70 /*0x30*/INT   nametablecount;   /* number of names in name table */
71         INT   nametablechars;   /* nr of characters in name table */
72         INT   NameOffset;       /* offset of name in name table */
73         INT   helpfile;         /* position of helpfile in stringtable */
74 /*0x40*/INT   CustomDataOffset; /* if -1 no custom data, else it is offset */
75                                 /* in customer data/guid offset table */
76         INT   res44;            /* unknown always: 0x20 (guid hash size?) */
77         INT   res48;            /* unknown always: 0x80 (name hash size?) */
78         INT   dispatchpos;      /* HREFTYPE to IDispatch, or -1 if no IDispatch */
79 /*0x50*/INT   res50;            /* is zero becomes one when an interface is derived */
80 } MSFT_Header;
81
82 /* segments in the type lib file have a structure like this: */
83 typedef struct tagMSFT_pSeg {
84         INT   offset;       /* absolute offset in file */
85         INT   length;       /* length of segment */
86         INT   res08;        /* unknown always -1 */
87         INT   res0c;        /* unknown always 0x0f in the header */
88                             /* 0x03 in the typeinfo_data */
89 } MSFT_pSeg;
90
91 /* layout of the main segment directory */
92 typedef struct tagMSFT_SegDir {
93 /*1*/MSFT_pSeg pTypeInfoTab; /* each type info get an entry of 0x64 bytes */
94                              /* (25 ints) */
95 /*2*/MSFT_pSeg pImpInfo;     /* table with info for imported types */
96 /*3*/MSFT_pSeg pImpFiles;    /* import libaries */
97 /*4*/MSFT_pSeg pRefTab;      /* References table */
98 /*5*/MSFT_pSeg pLibtab;      /* always exists, alway same size (0x80) */
99                              /* hash table w offsets to guid????? */
100 /*6*/MSFT_pSeg pGuidTab;     /* all guids are stored here together with  */
101                              /* offset in some table???? */
102 /*7*/MSFT_pSeg res07;        /* always created, alway same size (0x200) */
103                              /* purpose largely unknown */
104 /*8*/MSFT_pSeg pNametab;     /* name tables */
105 /*9*/MSFT_pSeg pStringtab;   /* string table */
106 /*A*/MSFT_pSeg pTypdescTab;  /* table with type descriptors */
107 /*B*/MSFT_pSeg pArrayDescriptions;
108 /*C*/MSFT_pSeg pCustData;    /* data table, used for custom data and default */
109                              /* parameter values */
110 /*D*/MSFT_pSeg pCDGuids;     /* table with offsets for the guids and into */
111                              /* the customer data table */
112 /*E*/MSFT_pSeg res0e;        /* unknown */
113 /*F*/MSFT_pSeg res0f;        /* unknown  */
114 } MSFT_SegDir;
115
116
117 /* base type info data */
118 typedef struct tagMSFT_TypeInfoBase {
119 /*000*/ INT   typekind;             /*  it is the TKIND_xxx */
120                                     /* some byte alignment stuf */
121         INT     memoffset;          /* points past the file, if no elements */
122         INT     res2;               /* zero if no element, N*0x40 */
123         INT     res3;               /* -1 if no lement, (N-1)*0x38 */
124 /*010*/ INT     res4;               /* always? 3 */
125         INT     res5;               /* always? zero */
126         INT     cElement;           /* counts elements, HI=cVars, LO=cFuncs */
127         INT     res7;               /* always? zero */
128 /*020*/ INT     res8;               /* always? zero */
129         INT     res9;               /* always? zero */
130         INT     resA;               /* always? zero */
131         INT     posguid;            /* position in guid table */
132 /*030*/ INT     flags;              /* Typeflags */
133         INT     NameOffset;         /* offset in name table */
134         INT     version;            /* element version */
135         INT     docstringoffs;      /* offset of docstring in string tab */
136 /*040*/ INT     helpstringcontext;  /*  */
137         INT     helpcontext;    /* */
138         INT     oCustData;          /* offset in customer data table */
139 #ifdef WORDS_BIGENDIAN
140         INT16   cbSizeVft;      /* virtual table size, including inherits */
141         INT16   cImplTypes;     /* nr of implemented interfaces */
142 #else
143         INT16   cImplTypes;     /* nr of implemented interfaces */
144         INT16   cbSizeVft;      /* virtual table size, including inherits */
145 #endif
146 /*050*/ INT     size;           /* size in bytes, at least for structures */
147         /* FIXME: name of this field */
148         INT     datatype1;      /* position in type description table */
149                                 /* or in base intefaces */
150                                 /* if coclass: offset in reftable */
151                                 /* if interface: reference to inherited if */
152         INT     datatype2;      /* for interfaces: hiword is num of inherited funcs */
153                                 /*                 loword is num of inherited interfaces */
154         INT     res18;          /* always? 0 */
155 /*060*/ INT     res19;          /* always? -1 */
156     } MSFT_TypeInfoBase;
157
158 /* layout of an entry with information on imported types */
159 typedef struct tagMSFT_ImpInfo {
160     INT     res0;           /* unknown */
161     INT     oImpFile;       /* offset inthe Import File table */
162     INT     oGuid;          /* offset in Guid table */
163     } MSFT_ImpInfo;
164
165 /* function description data */
166 typedef struct {
167 /*  INT   recsize;       record size including some xtra stuff */
168     INT   DataType;     /* data type of the memeber, eg return of function */
169     INT   Flags;        /* something to do with attribute flags (LOWORD) */
170 #ifdef WORDS_BIGENDIAN
171     INT16 funcdescsize; /* size of reconstituted FUNCDESC and related structs */
172     INT16 VtableOffset; /* offset in vtable */
173 #else
174     INT16 VtableOffset; /* offset in vtable */
175     INT16 funcdescsize; /* size of reconstituted FUNCDESC and related structs */
176 #endif
177     INT   FKCCIC;       /* bit string with the following  */
178                         /* meaning (bit 0 is the lsb): */
179                         /* bits 0 - 2: FUNCKIND */
180                         /* bits 3 - 6: INVOKEKIND */
181                         /* bit  7: custom data present */
182                         /* bits 8 - 11: CALLCONV */
183                         /* bit  12: parameters have default values */
184                         /* bit  13: oEntry is numeric */
185                         /* bits 16 - 31: index of next function with same id */
186 #ifdef WORDS_BIGENDIAN
187     INT16 nroargs;      /* nr of optional arguments */
188     INT16 nrargs;       /* number of arguments (including optional ????) */
189 #else
190     INT16 nrargs;       /* number of arguments (including optional ????) */
191     INT16 nroargs;      /* nr of optional arguments */
192 #endif
193     /* optional attribute fields, the number of them is variable */
194     INT   OptAttr[1];
195 /*
196 0*  INT   helpcontext;
197 1*  INT   oHelpString;
198 2*  INT   oEntry;       // either offset in string table or numeric as it is (see bit 13 of FKCCIC) //
199 3*  INT   res9;         // unknown (-1) //
200 4*  INT   resA;         // unknown (-1) //
201 5*  INT   HelpStringContext;
202     // these are controlled by a bit set in the FKCCIC field  //
203 6*  INT   oCustData;        // custom data for function //
204 7*  INT   oArgCustData[1];  // custom data per argument //
205 */
206 } MSFT_FuncRecord;
207
208 /* after this may follow an array with default value pointers if the
209  * appropriate bit in the FKCCIC field has been set:
210  * INT   oDefautlValue[nrargs];
211  */
212
213     /* Parameter info one per argument*/
214 typedef struct {
215         INT   DataType;
216         INT   oName;
217         INT   Flags;
218     } MSFT_ParameterInfo;
219
220 /* Variable description data */
221 typedef struct {
222 /*  INT   recsize;      // record size including some xtra stuff */
223     INT   DataType;     /* data type of the variable */
224     INT   Flags;        /* VarFlags (LOWORD) */
225 #ifdef WORDS_BIGENDIAN
226     INT16 vardescsize;  /* size of reconstituted VARDESC and related structs */
227     INT16 VarKind;      /* VarKind */
228 #else
229     INT16 VarKind;      /* VarKind */
230     INT16 vardescsize;  /* size of reconstituted VARDESC and related structs */
231 #endif
232     INT   OffsValue;    /* value of the variable or the offset  */
233                         /* in the data structure */
234     /* optional attribute fields, the number of them is variable */
235     /* controlled by record length */
236     INT   HelpContext;
237     INT   oHelpString;
238     INT   res9;         /* unknown (-1) */
239     INT   oCustData;        /* custom data for variable */
240     INT   HelpStringContext;
241
242 } MSFT_VarRecord;
243
244 /* Structure of the reference data  */
245 typedef struct {
246     INT   reftype;  /* either offset in type info table, then it's */
247                     /* a multiple of 64 */
248                     /* or offset in the external reference table */
249                     /* with an offset of 1 */
250     INT   flags;
251     INT   oCustData;    /* custom data */
252     INT   onext;    /* next offset, -1 if last */
253 } MSFT_RefRecord;
254
255 /* this is how a guid is stored */
256 typedef struct {
257     GUID guid;
258     INT   hreftype;     /* -2 for the typelib guid, typeinfo offset
259                            for typeinfo guid, low two bits are 01 if
260                            this is an imported typeinfo, low two bits
261                            are 10 if this is an imported typelib (used
262                            by imported typeinfos) */
263     INT   next_hash;    /* offset to next guid in the hash bucket */
264 } MSFT_GuidEntry;
265 /* some data preceding entries in the name table */
266 typedef struct {
267     INT   hreftype;     /* is -1 if name is for neither a typeinfo,
268                            a variable, or a function (that is, name
269                            is for a typelib or a function parameter).
270                            otherwise is the offset of the first
271                            typeinfo that this name refers to (either
272                            to the typeinfo itself or to a member of
273                            the typeinfo */
274     INT   next_hash;    /* offset to next name in the hash bucket */
275     INT   namelen;      /* only lower 8 bits are valid */
276                         /* 0x1000 if name is only used once as a variable name */
277                         /* 0x2000 if name is a variable in an enumeration */
278                         /* 0x3800 if name is typeinfo name */
279                         /* upper 16 bits are hash code */
280 } MSFT_NameIntro;
281 /* the custom data table directory has enties like this */
282 typedef struct {
283     INT   GuidOffset;
284     INT   DataOffset;
285     INT   next;     /* next offset in the table, -1 if it's the last */
286 } MSFT_CDGuid;
287
288
289 /***********************************************************
290  *
291  *                SLTG typelibs.
292  *
293  * These are created with ICreateTypeLib
294  *
295  */
296
297 #include "pshpack1.h"
298
299 typedef struct {
300 /*00*/  DWORD SLTG_magic;       /* 0x47544c53  == "SLTG" */
301 /*04*/  WORD nrOfFileBlks;      /* no of SLTG_BlkEntry's + 1 */
302 /*06*/  WORD res06;             /* ?? always 9 */
303 /*08*/  WORD res08;             /* some kind of len/offset ?? */
304 /*0a*/  WORD first_blk;         /* 1 based index into blk entries that
305                                    corresponds to first block in file */
306 /*0c*/  DWORD res0c;            /* always 0x000204ff */
307 /*10*/  DWORD res10;            /* always 0x00000000 */
308 /*14*/  DWORD res14;            /* always 0x000000c0 */
309 /*18*/  DWORD res18;            /* always 0x46000000 */
310 /*1c*/  DWORD res1c;            /* always 0x00000044 */
311 /*20*/  DWORD res20;            /* always 0xffff0000 */
312 } SLTG_Header;
313
314 /* This gets followed by a list of block entries */
315 typedef struct {
316 /*00*/  DWORD len;
317 /*04*/  WORD index_string; /* offs from start of SLTG_Magic to index string */
318 /*06*/  WORD next;
319 } SLTG_BlkEntry;
320
321 /* The order of the blocks in the file is given by starting at Block
322    entry firt_blk and stepping through using the next pointer */
323
324 /* These then get followed by this magic */
325 typedef struct {
326 /*00*/ BYTE res00;              /* always 0x01 */
327 /*01*/ CHAR CompObj_magic[8];   /* always "CompObj" */
328 /*09*/ CHAR dir_magic[4];       /* always "dir" */
329 } SLTG_Magic;
330
331 #define SLTG_COMPOBJ_MAGIC "CompObj"
332 #define SLTG_DIR_MAGIC "dir"
333
334 /* Next we have SLTG_Header.nrOfFileBlks - 2 of Index strings.  These
335 are presumably unique to within the file and look something like
336 "AAAAAAAAAA" with the first character incremented from 'A' to ensure
337 uniqueness.  I guess successive chars increment when we need to wrap
338 the first one. */
339
340 typedef struct {
341 /*00*/ CHAR string[11];
342 } SLTG_Index;
343
344
345 /* This is followed by SLTG_pad9 */
346 typedef struct {
347 /*00*/ CHAR pad[9];     /* 9 '\0's */
348 } SLTG_Pad9;
349
350
351 /* Now we have the noOfFileBlks - 1 worth of blocks. The length of
352 each block is given by its entry in SLTG_BlkEntry. */
353
354 /* type SLTG_NAME in rather like a BSTR except that the length in
355 bytes is given by the first WORD and the string contains 8bit chars */
356
357 typedef WORD SLTG_Name;
358
359 /* The main library block looks like this.  This one seems to come last */
360
361 typedef struct {
362 /*00*/  WORD magic;             /* 0x51cc */
363 /*02*/  WORD res02;             /* 0x0003, 0x0004 */
364 /*04*/  WORD name;              /* offset to name in name table */
365 /*06*/  SLTG_Name res06;        /* maybe this is just WORD == 0xffff */
366         SLTG_Name helpstring;
367         SLTG_Name helpfile;
368         DWORD helpcontext;
369         WORD syskind;           /* == 1 for win32, 0 for win16 */
370         WORD lcid;              /* == 0x409, 0x809 etc */
371         DWORD res12;            /* == 0 */
372         WORD libflags;          /* LIBFLAG_* */
373         WORD maj_vers;
374         WORD min_vers;
375         GUID uuid;
376 } SLTG_LibBlk;
377
378 #define SLTG_LIBBLK_MAGIC 0x51cc
379
380 /* we then get 0x40 bytes worth of 0xffff or small numbers followed by
381    nrOfFileBlks - 2 of these */
382 typedef struct {
383         WORD small_no;
384         SLTG_Name index_name; /* This refers to a name in the directory */
385         SLTG_Name other_name; /* Another one of these weird names */
386         WORD res1a;           /* 0xffff */
387         WORD name_offs;       /* offset to name in name table */
388         WORD more_bytes;      /* if this is non-zero we get this many
389                                  bytes before the next element, which seem
390                                  to reference the docstring of the type ? */
391         WORD res20;           /* 0xffff */
392         DWORD helpcontext;
393         WORD res26;           /* 0xffff */
394         GUID uuid;
395 } SLTG_OtherTypeInfo;
396
397 /* Next we get WORD 0x0003 followed by a DWORD which if we add to
398 0x216 gives the offset to the name table from the start of the LibBlk
399 struct */
400
401 typedef struct {
402 /*00*/  WORD magic;             /* 0x0501 */
403 /*02*/  DWORD href_table;       /* if not 0xffffffff, then byte offset from
404                                    beginning of struct to href table */
405 /*06*/  DWORD res06;            /* 0xffffffff */
406 /*0a*/  DWORD elem_table;       /* offset to members */
407 /*0e*/  DWORD res0e;            /* 0xffffffff */
408 /*12*/  WORD major_version;     /* major version number */
409 /*14*/  WORD minor_version;     /* minor version number */
410 /*16*/  DWORD res16;    /* 0xfffe0000 */
411 /*1a*/  BYTE typeflags1;/* 0x02 | top 5 bits hold l5sbs of TYPEFLAGS */
412 /*1b*/  BYTE typeflags2;/* TYPEFLAGS >> 5 */
413 /*1c*/  BYTE typeflags3;/* 0x02*/
414 /*1d*/  BYTE typekind;  /* 0x03 == TKIND_INTERFACE etc. */
415 /*1e*/  DWORD res1e;    /* 0x00000000 or 0xffffffff */
416 } SLTG_TypeInfoHeader;
417
418 #define SLTG_TIHEADER_MAGIC 0x0501
419
420 typedef struct {
421 /*00*/  WORD cFuncs;
422 /*02*/  WORD cVars;
423 /*04*/  WORD cImplTypes;
424 /*06*/  WORD res06;
425 /*08*/  WORD res08;
426 /*0a*/  WORD res0a;
427 /*0c*/  WORD res0c;
428 /*0e*/  WORD res0e;
429 /*10*/  WORD res10;
430 /*12*/  WORD res12;
431 /*14*/  WORD tdescalias_vt; /* for TKIND_ALIAS */
432 /*16*/  WORD res16;
433 /*18*/  WORD res18;
434 /*1a*/  WORD res1a;
435 /*1c*/  WORD res1c;
436 /*1e*/  WORD res1e;
437 /*20*/  WORD cbSizeInstance;
438 /*22*/  WORD cbAlignment;
439 /*24*/  WORD res24;
440 /*26*/  WORD res26;
441 /*28*/  WORD cbSizeVft;
442 /*2a*/  WORD res2a;
443 /*2c*/  WORD res2c;
444 /*2e*/  WORD res2e;
445 /*30*/  WORD res30;
446 /*32*/  WORD res32;
447 /*34*/  WORD res34;
448 } SLTG_TypeInfoTail;
449
450 typedef struct {
451 /*00*/ WORD res00; /* 0x0001 sometimes 0x0003 ?? */
452 /*02*/ WORD res02; /* 0xffff */
453 /*04*/ BYTE res04; /* 0x01 */
454 /*05*/ DWORD cbExtra; /* No of bytes that follow */
455 } SLTG_MemberHeader;
456
457 typedef struct {
458 /*00*/  WORD magic;     /* 0x120a */
459 /*02*/  WORD next;      /* offset in bytes to next block from start of block
460                            group, 0xffff if last item */
461 /*04*/  WORD name;      /* offset to name within name table */
462 /*06*/  WORD value;     /* offset to value from start of block group */
463 /*08*/  WORD res08;     /* 0x56 */
464 /*0a*/  DWORD memid;    /* memid */
465 /*0e*/  WORD helpcontext;/* 0xfffe == no context, 0x0001 == stored in EnumInfo struct, else offset
466                             to value from start of block group */
467 /*10*/  WORD helpstring;/* offset from start of block group to string offset */
468 } SLTG_EnumItem;
469
470 #define SLTG_ENUMITEM_MAGIC 0x120a
471
472 typedef struct {
473 /*00*/  WORD vt;        /* vartype, 0xffff marks end. */
474 /*02*/  WORD res02;     /* ?, 0xffff marks end */
475 } SLTG_AliasItem;
476
477 #define SLTG_ALIASITEM_MAGIC 0x001d
478
479
480 typedef struct {
481         BYTE magic;     /* 0x4c or 0x6c */
482         BYTE inv;       /* high nibble is INVOKE_KIND, low nibble = 2 */
483         WORD next;      /* byte offset from beginning of group to next fn */
484         WORD name;      /* Offset within name table to name */
485         DWORD dispid;   /* dispid */
486         WORD helpcontext; /* helpcontext (again 1 is special) */
487         WORD helpstring;/* helpstring offset to offset */
488         WORD arg_off;   /* offset to args from start of block */
489         BYTE nacc;      /* lowest 3bits are CALLCONV, rest are no of args */
490         BYTE retnextopt;/* if 0x80 bit set ret type follows else next WORD
491                            is offset to ret type. No of optional args is
492                            middle 6 bits */
493         WORD rettype;   /* return type VT_?? or offset to ret type */
494         WORD vtblpos;   /* position in vtbl? */
495         WORD funcflags; /* present if magic == 0x6c */
496 /* Param list starts, repeat next two as required */
497 #if 0
498         WORD  name;     /* offset to 2nd letter of name */
499         WORD+ type;     /* VT_ of param */
500 #endif
501 } SLTG_Function;
502
503 #define SLTG_FUNCTION_MAGIC 0x4c
504 #define SLTG_FUNCTION_WITH_FLAGS_MAGIC 0x6c
505
506 typedef struct {
507 /*00*/  BYTE magic;             /* 0xdf */
508 /*01*/  BYTE res01;             /* 0x00 */
509 /*02*/  DWORD res02;            /* 0xffffffff */
510 /*06*/  DWORD res06;            /* 0xffffffff */
511 /*0a*/  DWORD res0a;            /* 0xffffffff */
512 /*0e*/  DWORD res0e;            /* 0xffffffff */
513 /*12*/  DWORD res12;            /* 0xffffffff */
514 /*16*/  DWORD res16;            /* 0xffffffff */
515 /*1a*/  DWORD res1a;            /* 0xffffffff */
516 /*1e*/  DWORD res1e;            /* 0xffffffff */
517 /*22*/  DWORD res22;            /* 0xffffffff */
518 /*26*/  DWORD res26;            /* 0xffffffff */
519 /*2a*/  DWORD res2a;            /* 0xffffffff */
520 /*2e*/  DWORD res2e;            /* 0xffffffff */
521 /*32*/  DWORD res32;            /* 0xffffffff */
522 /*36*/  DWORD res36;            /* 0xffffffff */
523 /*3a*/  DWORD res3a;            /* 0xffffffff */
524 /*3e*/  DWORD res3e;            /* 0xffffffff */
525 /*42*/  WORD  res42;            /* 0xffff */
526 /*44*/  DWORD number;           /* this is 8 times the number of refs */
527 /*48*/  /* Now we have number bytes (8 for each ref) of SLTG_UnknownRefInfo */
528
529 /*50*/  WORD res50;             /* 0xffff */
530 /*52*/  BYTE res52;             /* 0x01 */
531 /*53*/  DWORD res53;            /* 0x00000000 */
532 /*57*/  SLTG_Name names[1];
533   /*    Now we have number/8 SLTG_Names (first WORD is no of bytes in the ascii
534    *    string).  Strings look like "*\Rxxxx*#n".  If xxxx == ffff then the
535    *    ref refers to the nth type listed in this library (0 based).  Else
536    *    the xxxx (which maybe fewer than 4 digits) is the offset into the name
537    *    table to a string "*\G{<guid>}#1.0#0#C:\WINNT\System32\stdole32.tlb#"
538    *    The guid is the typelib guid; the ref again refers to the nth type of
539    *    the imported typelib.
540    */
541
542 /*xx*/ BYTE resxx;              /* 0xdf */
543
544 } SLTG_RefInfo;
545
546 #define SLTG_REF_MAGIC 0xdf
547
548 typedef struct {
549         WORD res00;     /* 0x0001 */
550         BYTE res02;     /* 0x02 */
551         BYTE res03;     /* 0x40 if internal ref, 0x00 if external ? */
552         WORD res04;     /* 0xffff */
553         WORD res06;     /* 0x0000, 0x0013 or 0xffff ?? */
554 } SLTG_UnknownRefInfo;
555
556 typedef struct {
557   WORD res00; /* 0x004a */
558   WORD next;  /* byte offs to next interface */
559   WORD res04; /* 0xffff */
560   BYTE impltypeflags; /* IMPLTYPEFLAG_* */
561   BYTE res07; /* 0x80 */
562   WORD res08; /* 0x0012, 0x0028 ?? */
563   WORD ref;   /* number in ref table ? */
564   WORD res0c; /* 0x4000 */
565   WORD res0e; /* 0xfffe */
566   WORD res10; /* 0xffff */
567   WORD res12; /* 0x001d */
568   WORD pos_in_table; /* 0x0, 0x4, ? */
569 } SLTG_ImplInfo;
570
571 #define SLTG_IMPL_MAGIC 0x004a
572
573 typedef struct {
574   BYTE magic; /* 0x0a */
575   BYTE typepos;
576   WORD next;
577   WORD name;
578   WORD byte_offs; /* pos in struct */
579   WORD type; /* if typepos == 0x02 this is the type, else offset to type */
580   DWORD memid;
581   WORD helpcontext; /* ?? */
582   WORD helpstring; /* ?? */
583 } SLTG_RecordItem;
584
585 #define SLTG_RECORD_MAGIC 0x0a
586
587
588 /* CARRAYs look like this
589 WORD type == VT_CARRAY
590 WORD offset from start of block to SAFEARRAY
591 WORD typeofarray
592 */
593
594 #include "poppack.h"
595
596 /*---------------------------END--------------------------------------------*/
597 #endif