typelib_struct.h 22 KB

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