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