+-----------------------------------------------------+ | | +-----------------------------------------------------+Other diagrams are outlined like so:
+=====================================================+ | | +=====================================================+Optional Data
Byte | 8 |
Word | 16 |
Dword | 32 |
Short Integer | ±16 |
Long Integer | ±32 |
+-----------------------------------------------------+ | Field Name ±32[16]| +-----------------------------------------------------+
+=====================================================+ | TypeLib Header | +=====================================================+ | Offsets to TypeInfos | +=====================================================+ | Segment Directory |-->------->------+ +=====================================================+ \ +<--| TypeInfo Table |<-+ | / +=====================================================+ \ | | | ImportInfo Table |<---+ | | +=====================================================+ \ | | | Imported Type Lib Table |<-----+ | | +=====================================================+ \ | | | References Table |<-------+ | | +=====================================================+ \ | | | Lib Table |<---------+ | | +=====================================================+ \ | | | GUID Table |<-----------+ | | +=====================================================+ \ | | | Unknown 01 |<-------------+ | | +=====================================================+ \ / | | Name Table |<---------------|+ | +=====================================================+ / | | String Table |<-------------+ | +=====================================================+ / | | Type Descriptors |<-----------+ | +=====================================================+ / | | Array Descriptors |<---------+ | +=====================================================+ / | | Custom Data |<-------+ | +=====================================================+ / | | GUID Offsets |<-----+ | +=====================================================+ / | | Unknown 02 |<---+ | +=====================================================+ / | | Unknown 03 |<-+ \ +=====================================================+ +-->| Function and Property Records | +=====================================================+Those sections marked with a question mark may be absent in some files. All
+-----------------------------------------------------+ | Magic1 ±32 | +-----------------------------------------------------+ | Magic2 ±32 | +-----------------------------------------------------+ | GUID ==> ±32 | +-----------------------------------------------------+ | Locale ID ±32 | +-----------------------------------------------------+ | Locale ID 2 ±32 | +-----------------------------------------------------+ | Varflags ±32 | +-----------------------------------------------------+ | Version ±32 | +-----------------------------------------------------+ | Flags ±32 | +-----------------------------------------------------+ | TypeInfo Count ±32 | +-----------------------------------------------------+ | Help String ==> ±32 | +-----------------------------------------------------+ | Help String Context ±32 | +-----------------------------------------------------+ | Help Context ±32 | +-----------------------------------------------------+ | Name Table Count ±32 | +-----------------------------------------------------+ | Name Table Chars ±32 | +-----------------------------------------------------+ | TypeLib Name ==> ±32 | +-----------------------------------------------------+ | Help File Name ==> ±32 | +-----------------------------------------------------+ | Custom Data ==> ±32 | +-----------------------------------------------------+ | Reserved1 ±32 | +-----------------------------------------------------+ | Reserved2 ±32 | +-----------------------------------------------------+ | Dispatch Position ±32 | +-----------------------------------------------------+ | ImportInfo Count ±32 | +-----------------------------------------------------+ | TypeLib File Name ==> ±32 | +-----------------------------------------------------+Magic1
This contains the string "MSFT" (0x5446534D) and is used to identify the file's
format. A value of "SLGT" indicates the file is of another TypeLib format which
is not nearly as common and which is not documented in this file.
= 0x00010002 (the format's version number?)
GUID OffsetOffset into the GUID Table of the Lib ID, otherwise -1
Locale IDThe locale ID, for example 0x0409 = "USA", "English United States"
Locale ID 2Flags (largely unknown)
+-+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ / | | | | | / | 15 14 13 12| 11 10 9 8 | 7 6 5 4 | 3 2 1 0 | \ +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ | | ? | ? | ? | ? | ? | ? | D | F | ? | ? | H | ? | | | | | / | | l | i | | e | | | | | | l | l | | l | | SysKind | / | | | e | | p | | | \ | | H | N | | F | | | \ | | e | a | | i | | | / | | l | m | | l | | | \ | | | | | | | p | e | | | e | | | | | | +--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+Version
Set with SetVersion()
FlagsSet with SetFlags()
TypeInfo CountThe number of TypeInfo structures present.
Help String OffsetOffset into String Table of help string.
Help String ContextNumber of names in the Name Table.
Name Table CharsNumber of characters in the Name Table.
TypeLib Name OffsetOffset into the String Table of the TypeLib's name.
Help File Name OffsetOffset into the String Table of the help file's name.
Custom Data OffsetFile offset to Custom Data/GUID Table, if present, otherwise -1
Reserved1Unknown, always 0x20 (GUID hash size?)
Reserved2Unknown, always 0x80 (name hash size?)
Dispatch PositionhRefType to IDispatch, or -1 if there's no IDispatch
ImportInfo CountNumber of ImpInfo structures.
TypeLib File Name Offset
Offset into String Table of TypeLib file name. This field is only present if
bit 8 of the VarFlags field is set.
+-----------------------------------------------------+ | Offset[1] ±32 | +-----------------------------------------------------+ | Offset[2] ±32 | +-----------------------------------------------------+ ....... +-----------------------------------------------------+ | Offset[TypeInfoCount] ±32 | +-----------------------------------------------------+
+-----------------------------------------------------+ | Offset ±32 | +-----------------------------------------------------+ | Length ±32 | +-----------------------------------------------------+ | Reserved1 ±32 | +-----------------------------------------------------+ | Reserved2 ±32 | +-----------------------------------------------------+Offset
File offset to segment.
LengthLength of segment.
Reserved1Unknown, always -1
Reserved2Unknown, always 0x0F, though someone reported seeing a value of 0x03.
Note:
A SegDesc for any segment which is not present has an offset value of -1
(0xFFFFFFFF) and a length value of zero.
+=====================================================+ | TypeInfo Table | +=====================================================+ | Import Info | +=====================================================+ | Imported Files | +=====================================================+ | References Table | +=====================================================+ | Lib Table | +=====================================================+ | GUID Table | +=====================================================+ | Unknown 01 | +=====================================================+ | Name Table | +=====================================================+ | String Table | +=====================================================+ | Type Descriptors | +=====================================================+ | Array Descriptors | +=====================================================+ | Custom Data | +=====================================================+ | GUID Offsets | +=====================================================+ | Unknown 02 | +=====================================================+ | Unknown 03 | +=====================================================+Each of the segments is described in its own section of this document.
+-----------------------------------------------------+ | TypeKind ±32 | +-----------------------------------------------------+ | Function Records ±32 | +-----------------------------------------------------+ | Memory Allocation ±32 | +-----------------------------------------------------+ | Reconstituted Size ±32 | +-----------------------------------------------------+ | Reserved1 ±32 | +-----------------------------------------------------+ | Reserved2 ±32 | +-----------------------------------------------------+ | Function Count ±16 | +-----------------------------------------------------+ | Property Count ±16 | +-----------------------------------------------------+ | Reserved3 ±32 | +-----------------------------------------------------+ | Reserved4 ±32 | +-----------------------------------------------------+ | Reserved5 ±32 | +-----------------------------------------------------+ | Reserved6 ±32 | +-----------------------------------------------------+ | GUID ==> ±32 | +-----------------------------------------------------+ | Type Flags ±32 | +-----------------------------------------------------+ | Name ==> ±32 | +-----------------------------------------------------+ | Version ±32 | +-----------------------------------------------------+ | DocString ==> ±32 | +-----------------------------------------------------+ | Help String Context ±32 | +-----------------------------------------------------+ | Help Context ±32 | +-----------------------------------------------------+ | Custom Data ==> ±32 | +-----------------------------------------------------+ | Implemented Interfaces ±16 | +-----------------------------------------------------+ | Virtual Table Size ±16 | +-----------------------------------------------------+ | Unknown3 ±32 | +-----------------------------------------------------+ | DataType1 ±32 | +-----------------------------------------------------+ | DataType2 ±32 | +-----------------------------------------------------+ | Reserved7 ±32 | +-----------------------------------------------------+ | Reserved8 ±32 | +-----------------------------------------------------+TypeKind
+-+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ / | | | | | / | 15 14 13 12| 11 10 9 8 | 7 6 5 4 | 3 2 1 0 | \ +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ | | | | | | | ? | ? | ? | ? | ? | ? | ? | | | | | / | Alignment | | TypeKind | | | | | Code | \ | | | | +--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+The lower 4 bits are the Type Kind code.
TypeInfo's zero-based index is left-shifted 16 places.
The alignment value (currently of unknown origin) is left-shifted 6 places, then left-shifted again 11 places.
Please, note that the alignment value appears twice in TypeKind; once left-shifted by 6 places, and twice by 11 places.
"Zero if no element, N*0x40."
There's no indication of what is N, though.
"-1 if no element, (N-1)*0x38."
There's no indication of what is N, though.
Always? 3
Reserved2Always? zero
Function CountCount of functions in array
Property CountCount of properties in array
Reserved3 through Reserved6Always? zero
GUID OffsetOffset into GUID Table of GUID
Type FlagsSee the "Type Flags" section
Name OffsetOffset into the Name Table of the name
VersionOffset into String Table of the DocString
Help String ContextOffset into the Custom Data Table of custom data
Implemented InterfacesNumber of implemented interfaces
Virtual Table Size
Virtual table size, not including inherits
"Virtual table size, including inherits (field cbSizeVft.)"
"Size in bytes, at least for structures."
Offset into Type Descriptor Table, or in base interfaces.
If 0x8000, entry above is valid, else it is zero?
"
For interfaces:
hiword is num of inherited funcs,
loword is num of inherited interfaces
"
Always? 0
Reserved8Always? -1
Note:
The order of the "Implemented Interfaces" and "Virtual Table Size" are
reversed for bigendian format.
+-----------------------------------------------------+ | Count ±16 | +-----------------------------------------------------+ | Flags 8 | +-----------------------------------------------------+ | Type Kind 8 | +-----------------------------------------------------+ | Import File ==> ±32 | +-----------------------------------------------------+ | GUID ==> ±32 | +-----------------------------------------------------+Count
Bit 0 = 1 if "GUID Offset" is an offset to a GUID, or zero if it's a TypeInfo
index in the specified typelib
TypeKind of the reference
Import File OffsetOffset into the Import File table
GUID OffsetOffset into GUID table or TypeInfo index (see bit 0 of Flags)
+-----------------------------------------------------+
| GUID ==> ±32 |
+-----------------------------------------------------+
| LCID ±32 |
+-----------------------------------------------------+
| MajVer 16 |
+-----------------------------------------------------+
| MinVer 16 |
+-----------------------------------------------------+
| Size (times 4) 16 |
+-----------------------------------------------------+
| File name |
+-----------------------------------------------------+
| Padding "W"[?]|
+-----------------------------------------------------+
GUID OffsetOffset into the GUID table of the GUID
LCIDDivide this value by 4 to get the actual length of the file name.
File name
A file name is always a multiple of fourteen bytes long. When its length needs
adjusting, it is padded with the letter "W".
From zero to thriteen W's, as needed, to make the structure a multiple of fourteen bytes.
+-----------------------------------------------------+ | RefType ±32 | +-----------------------------------------------------+ | Flags ±32 | +-----------------------------------------------------+ | CustData ==> ±32 | +-----------------------------------------------------+ | Next ==> ±32 | +-----------------------------------------------------+RefType
According to ReactOS:
If it's a multiple of 4, then it's an offset into the TypeInfo Table, other-
wise it's an offset into the external reference table with an offset of 1.
?
Offset into the Custom Data Table of the custom data, if any.
Next OffsetNext offset, or -1 if it's the last one.
+-----------------------------------------------------+ | GUID 8[16]| +-----------------------------------------------------+ | hRefType ±32 | +-----------------------------------------------------+ | Next Hash ±32 | +-----------------------------------------------------+GUID
A 16-character string containing the GUID.
hRefType
= -2 for a TypeLib GUID TypeInfo offset for TypeInfo GUID.
Otherwise, the low two bits:
Offset to next GUID in the hash bucket
+-----------------------------------------------------+ | hRefType ±32 | +-----------------------------------------------------+ | Next Hash ±32 | +-----------------------------------------------------+ | Name Length 8 | +-----------------------------------------------------+ | Flags? 8 | +-----------------------------------------------------+ | Hash Code 16 | +-----------------------------------------------------+ | Name String 8[Name Length]| +-----------------------------------------------------+ | Padding "W"[?]| +-----------------------------------------------------+hRefType
Is -1 if name is for neither a TypeInfo, a variable, or a function (that is,
the name is for a typelib or a function parameter). Otherwise it's the offset
of the first TypeInfo that this name refers to (either to the TypeInfo itself
or to a member of the TypeInfo.
Offset to next name in the hash bucket
Name Length
A one-byte field containing the length of the name in bytes, not counting any
padding.
"0x10 if name is only used once as a variable name
0x20 if name is a variable in an enumeration
0x38 if name is typeinfo name"
The ASCII text of the name. They are not NULL-terminated.
Padding
From zero to three W's, as needed, to make the structure's length a multiple
of four bytes.
+-----------------------------------------------------+ | Length 16 | +-----------------------------------------------------+ | String Text 8[Length]| +-----------------------------------------------------+ | Padding "W"[?]| +-----------------------------------------------------+Length
The length of the text of the string only.
String TextThe ASCII text of the string. They are not NULL-terminated.
Padding
From zero to five W's, as needed, to make the structure at least eight bytes
and also a multiple of four bytes.
+-----------------------------------------------------+ | Value1 (DataType1) ±16 | +-----------------------------------------------------+ | Value2 (Flags) ±16 | +-----------------------------------------------------+ | Value3 ±16 | +-----------------------------------------------------+ | Value4 ±16 | +-----------------------------------------------------+Value1
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ | 15 14 13 12| 11 10 9 8 | 7 6 5 4 | 3 2 1 0 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ | | | | | | | undefined | Primary Data Type | | | | | | | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ | 15 14 13 12| 11 10 9 8 | 7 6 5 4 | 3 2 1 0 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ | R | B | A | V | | | e | y | r | e | | | s | R | r | c | Base Data Type | | e | e | a | t | | | r | f | y | o | | | v | | | r | | | e | | | | | | d | | | | | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+As mentioned above, if (Value2 AND 0x7FFE) = 0x7FFE then Value1 is the only
Offset | Value1 | Value2 | Value3 | Value4 | Compound Address |
Remark | Data Type |
---|---|---|---|---|---|---|---|
0 | 1C | 7FFE | 0 | 0 | 0 | Offset into the Array Descriptor array | |
8 | 1A | 400C | C | 800C | Data type code is in Value3 | VT_Variant | |
10 | 1A | 4003 | 3 | 8003 | Data type code is in Value3 | VT_I4 | |
18 | 1A | 4000 | 18 | 8000 | Data type code is in Value3 | VT_Void | |
20 | 1D | 7FFF | 0 | 0 | 0 | Offset into the TypeInfo table | GUID |
28 | 1A | 7FFF | 20 | 0 | 20 | Offset to another Type Descriptor | |
30 | 1A | 7FFE | 18 | 0 | 18 | Offset to another Type Descriptor | |
38 | 1A | 4013 | 17 | 8013 | Data type code is in Value3 | VT_UInt | |
40 | 1A | 4010 | 10 | 8010 | Data type code is in Value3 | VT_I1 | |
48 | 1A | 7FFE | 40 | 0 | 40 | Offset to another Type Descriptor | |
50 | 1D | 7FFF | 64 | 0 | 64 | Offset into the TypeInfo table | DISPPARAMS |
58 | 1A | 7FFF | 50 | 0 | 50 | Offset to another Type Descriptor | |
60 | 1D | 7FFF | C8 | 0 | C8 | Offset into the TypeInfo table | EXCEPINFO |
68 | 1A | 7FFF | 60 | 0 | 60 | Offset to another Type Descriptor | |
70 | 1A | 4013 | 13 | 8013 | Data type code is in Value3 | VT_UI4 | |
78 | 1D | 7FFF | 1F4 | 0 | 1F4 | Offset into the TypeInfo table | IEnumVARIANT |
80 | 1A | 7FFF | 78 | 0 | 78 | Offset to another Type Descriptor | |
88 | 1A | 7FFF | 80 | 0 | 80 | Offset to another Type Descriptor | |
90 | 1A | 4008 | 8 | 8008 | Data type code is in Value3 | VT_Bstr | |
98 | 1A | 4006 | 6 | 8006 | Data type code is in Value3 | VT_Cy | |
A0 | 1A | 400B | B | 800B | Data type code is in Value3 | VT_Bool | |
A8 | 1A | 4002 | 2 | 8002 | Data type code is in Value3 | VT_I2 | |
B0 | 1D | 7FFF | 76C | 0 | 76C | Offset into the TypeInfo table | OLE_HANDLE |
B8 | 1A | 7FFF | B0 | 0 | B0 | Offset to another Type Descriptor | |
C0 | 1D | 7FFF | BB8 | 0 | BB8 | Offset into the TypeInfo table | IFont |
C8 | 1A | 7FFF | C0 | 0 | C0 | Offset to another Type Descriptor | |
D0 | 1A | 7FFF | C8 | 0 | C8 | Offset to another Type Descriptor | |
D8 | 1D | 7FFF | C1C | 0 | C1C | Offset into the TypeInfo table | Font |
E0 | 1D | 7FFF | 514 | 0 | 514 | Offset into the TypeInfo table | OLE_XSIZE_HIMETRIC |
E8 | 1A | 7FFF | E0 | 0 | E0 | Offset to another Type Descriptor | |
F0 | 1D | 7FFF | 578 | 0 | 578 | Offset into the TypeInfo table | OLE_YSIZE_HIMETRIC |
F8 | 1A | 7FFF | F0 | 0 | F0 | Offset to another Type Descriptor | |
100 | 1D | 7FFF | 44C | 0 | 44C | Offset into the TypeInfo table | OLE_XPOS_HIMETRIC |
108 | 1D | 7FFF | 4B0 | 0 | 480 | Offset into the TypeInfo table | OLE_YPOS_HIMETRIC |
110 | 1A | 4003 | 16 | 8003 | Data type code is in Value3 | VT_Int | |
118 | 1D | 7FFF | DAC | 0 | DAC | Offset into the TypeInfo table | Picture |
120 | 1D | 3 | ED8 | 0 | ED8 | Offset into the TypeInfo table | LoadPictureConstants |
128 | 1D | 7FFF | E10 | 0 | E10 | Offset into the TypeInfo table | IPictureDisp |
130 | 1A | 7FFF | 128 | 0 | 128 | Offset to another Type Descriptor | |
138 | 1A | 7FFF | 130 | 0 | 130 | Offset to another Type Descriptor | |
140 | 1D | 7FFF | FA0 | 0 | FA0 | Offset into the TypeInfo table | FontEvents |
+-----------------------------------------------------+ | Type Descriptor 32 | +-----------------------------------------------------+ | Dimensions 16 | +-----------------------------------------------------+ | Data Type 16 | +-----------------------------------------------------+ | Bound's SafeArrayBound[Dimensions]| +-----------------------------------------------------+Type Descriptor
If < 0 then the low-word contains the variable-type code, otherwise it's an
offset to another array descriptor.
The number of dimensions in the array.
Data Type
If the low-byte > 0, it contains the datatype code of the data which is stored
in the array, otherwise the datatype code is in the high-byte.
Contains one SafeArrayBound structure for each dimension of the array, telling
how many elements are in the dimension and its lower bound.
+-----------------------------------------------------+ | Elements in Array 32 | +-----------------------------------------------------+ | Lower Bound of Array ±32 | +-----------------------------------------------------+Elements in Array
The number of elements in the array
Lower Bound of ArrayThe lower bound of the array
+=====================================================+ | Size of FuncRecord Array ±32 | +=====================================================+ <-+ | Function Record FuncRecord[FunctionCount]| ? \ +=====================================================+ | | Property Record PropRecord[PropertyCount]| ? | +=====================================================+ \ Size of | Method / Property ID 32[Func+Prop Cnt]| |<----- +=====================================================+ / FuncRecord | Name Offsets 32[Func+Prop Cnt]| | Array +=====================================================+ | | Offsets to Records 32[Func+Prop Cnt]| / +=====================================================+ <-+Size of FuncRecord Array
Method / Property ID | 32[Function Count + Property Count] |
Name Offsets | 32[Function Count + Property Count] |
Offsets to Records | 32[Function Count + Property Count] |
+-----------------------------------------------------+ <--+ | RecordSize 16 | \ +-----------------------------------------------------+ | | Unknown 16 | | +-----------------------------------------------------+ | | DataType ±16 | | +-----------------------------------------------------+ | | Flags ±16 | | +-----------------------------------------------------+ | | Reserved1 ±32 | | +-----------------------------------------------------+ | | Virtual Table ==> ±16 | | +-----------------------------------------------------+ | | Func Desc Size ±16 | | +-----------------------------------------------------+ | | FKCCIC ±32 | \ +-----------------------------------------------------+ \ RecordSize | Parameter Count ±16 | |<----- +-----------------------------------------------------+ / | Unknown2 ±16 | / +-----------------------------------------------------+ | | HelpContext ±32 | | +-----------------------------------------------------+ | | HelpString ±32 | | +-----------------------------------------------------+ | | Entry ±32 | | +-----------------------------------------------------+ | | Reserved2 ±32 | | +-----------------------------------------------------+ | | Reserved3 ±32 | | +-----------------------------------------------------+ | | HelpStringContext ±32 | | +-----------------------------------------------------+ | | Custom Data ±32 | | +-----------------------------------------------------+ | | Custom Data for Arguments ==> ±32[ParamCount]| | +-----------------------------------------------------+ | | Parameter Info ParamInfo[ParamCount]| / +-----------------------------------------------------+ <--+RecordSize
The size of the FuncRecord structure, including optional fields and
ParamInfo's
Data type returned by the function
Flags
If the MSB = 1, then the low byte is valid. So far it seems to always be
valid, except for pointers. When MSB does equal 1, the low byte is the code
for a data type that's equivalent to or compatible with that in DataType.
From ReactOS: Size of the reconstituted FUNCDESC and related structs.
The "structs" refered to are those used by the operating system for run-time
storage, and aren't a part of the TypeLib format.
This field is 32 bits wide, but only the meanings of the lower thirteen bits
are known.
+-+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ / | | | | | / | 15 14 13 12| 11 10 9 8 | 7 6 5 4 | 3 2 1 0 | \ +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ | | ? | ? | I | D | | | | | C | | | | | | | | / | | | s | e | | u | | | | | | | I | f | Calling | s | Invocation | Function | / | | | n | V | Convention | t | Kind | Kind | \ | | | t | a | | D | | | \ | | | R | l | | a | | | / | | | e | u | | t | | | \ | | | s | e | | | | | a | | | | | | | | +--+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
Offset into the Custom Data Table of Custom Data for the function
Custom Data for Arguments
An array of Custom Data with one element for each parameter. If the MSB = 1,
then the default value is in the lower three bytes, otherwise, it's an offset
into the Custom Data Table where the default value can be found. The only time
an offset is resorted to, is when the default value can't fit into the lower
24 bits.
If a parameter has a default value, bit 5 (PARAMFLAG_FHASDEFAULT) of the
ParamFlags field of its ParamInfo structure will be set, but the existence of
a set bit 5 of a ParamFlags field alone, might not reliably indicate the
presence of a "Custom Data for Arguments" array. To determine if this (optional)
array is present, one should make sure that there's enough room for it to fit.
+-------------------------+ | Data type code 16| +-------------------------+ | Length 16| +-------------------------+ | Null 16| +-------------------------+ | Data 8[Length]| +-------------------------+ | Padding "W"[?]| +-------------------------+
Data type code for the entry, i.e. 0008 (BSTR).
LengthLength of the string.
Null
Alway(?) zero.
It may not exist if Length is zero.
A string is always a multiple of four bytes long (counting Null). When its
length needs adjusting, it is padded with the letter "W".
From zero to three W's, as needed, to make the structure a multiple of four bytes.
+-----------------------------------------------------+ | DataType ±16 | +-----------------------------------------------------+ | Flags ±16 | +-----------------------------------------------------+ | Name ==> ±32 | +-----------------------------------------------------+ | ParamFlags ±32 | +-----------------------------------------------------+DataType
The data-type code for the parameter.
?
Name OffsetOffset to the parameter's name in the Name Table
ParamFlags+-+---+---+---+---+---+---+---+---+ / | | | / | 7 6 5 4 | 3 2 1 0 | \ +---+---+---+---+---+---+---+---+ | | ? | H | H | O | R | L | O | I | / | | a | a | p | e | C | u | n | | | | s | s | t | t | I | t | | / | | C | D | i | V | D | | | \ | | u | e | o | a | | | | \ | | s | f | n | l | | | | / | | t | a | a | | | | | / | | o | u | l | | | | | \ | | m | l | | | | | | | | | D | t | | | | | | / | | a | | | | | | | | | | t | | | | | | | \ | | a | | | | | | | +--+---+---+---+---+---+---+---+---+As shown in the diagram, the lower seven bits contain flags describing the
Bit# 0: | In |
Bit# 1: | Out |
Bit# 2: | LCID |
Bit# 3: | RetVal |
Bit# 4: | Opt |
Bit# 5: | HasDefault |
Bit# 6: | HasCustData |
+-----------------------------------------------------+ <---+ | RecordSize 16 | \ +-----------------------------------------------------+ | | PropNum 16 | | +-----------------------------------------------------+ | | DataType ±16 | | +-----------------------------------------------------+ \ | Flags ±16 | \ RecordSize +-----------------------------------------------------+ |<------ | VarKind ±16 | / +-----------------------------------------------------+ / | Var Desc Size ±16 | | +-----------------------------------------------------+ | | OffsValue ±32 | | +-----------------------------------------------------+ | | Unknown ±32 | | +-----------------------------------------------------+ | | HelpContext ±32 | | +-----------------------------------------------------+ | | HelpString ±32 | | +-----------------------------------------------------+ | | Reserved ±32 | | +-----------------------------------------------------+ | | Custom Data ==> ±32 | | +-----------------------------------------------------+ | | HelpStringContext ±32 | / +-----------------------------------------------------+ <---+RecordSize
Size of PropRecord
PropNumProperty number?
DataTypeData type of the variable
VarKind --- %VAR and %VarFlags
Var Desc Size
From ReactOS: Size of the reconstituted VARDESC and related structs.
The "structs" refered to are those used by the operating system for run-time
storage, and aren't a part of the TypeLib format.
Value of the variable or the offset in the data structure
UnknownUnknown (-1)
Custom Data offsetCustom data for variable
HelpStringContext+-----------------------------------------------------+ | Method/Property ID 1 32 | +-----------------------------------------------------+ | Method/Property ID 2 32 | +-----------------------------------------------------+ ..... +-----------------------------------------------------+ | Method/Property ID[Func+Prop Cnt] 32 | +-----------------------------------------------------+Offsets to names in Name Table
+-----------------------------------------------------+ | Name 1 ==> 32 | +-----------------------------------------------------+ | Name 2 ==> 32 | +-----------------------------------------------------+ ..... +-----------------------------------------------------+ | Name[Func+Prop Cnt] ==> 32 | +-----------------------------------------------------+Offsets to Records
+-----------------------------------------------------+ | Record 1 ==> 32 | +-----------------------------------------------------+ | Record 2 ==> 32 | +-----------------------------------------------------+ ..... +-----------------------------------------------------+ | Record[Func+Prop Cnt] ==> 32 | +-----------------------------------------------------+
Language | ||
ID | Abbr. | Locality |
0x0401 | ARA | Arabic Saudi Arabia |
0x0801 | ARI | Arabic Iraq |
0x0C01 | ARE | Arabic Egypt |
0x1001 | ARL | Arabic Libya |
0x1401 | ARG | Arabic Algeria |
0x1801 | ARM | Arabic Morocco |
0x1C01 | ART | Arabic Tunisia |
0x2001 | ARO | Arabic Oman |
0x2401 | ARY | Arabic Yemen |
0x2801 | ARS | Arabic Syria |
0x2C01 | ARJ | Arabic Jordan |
0x3001 | ARB | Arabic Lebanon |
0x3401 | ARK | Arabic Kuwait |
0x3801 | ARU | Arabic U.A.E. |
0x3C01 | ARH | Arabic Bahrain |
0x4001 | ARQ | Arabic Qatar |
0x0402 | BGR | Bulgarian Bulgaria |
0x0403 | CAT | Catalan Spain |
0x0404 | CHT | Chinese Taiwan |
0x0804 | CHS | Chinese PRC |
0x0C04 | ZHH | Chinese Hong Kong |
0x1004 | ZHI | Chinese Singapore |
0x1404 | ZHM | Chinese Macau |
0x0405 | CSY | Czech Czech Republic |
0x0406 | DAN | Danish Denmark |
0x0407 | GERMANY | German Germany |
0x0807 | DES | German Switzerland |
0x0C07 | DEA | German Austria |
0x1007 | DEL | German Luxembourg |
0x1407 | DEC | German Liechtenstein |
0x0408 | ELL | Greek Greece |
0x0409 | USA | English United States |
0x0809 | ENG | English United Kingdom |
0x0C09 | ENA | English Australia |
0x1009 | ENC | English Canada |
0x1409 | ENZ | English New Zealand |
0x1809 | ENI | English Ireland |
0x1C09 | ENS | English South Africa |
0x2009 | ENJ | English Jamaica |
0x2409 | ENB | English Caribbean |
0x2809 | ENL | English Belize |
0x2C09 | ENT | English Trinidad |
0x3009 | ENW | English Zimbabwe |
0x3409 | ENP | English Philippines |
0x040A | SPAIN | Spanish Spain |
0x080A | ESM | Spanish Mexico |
0x0C0A | ESN | Spanish Spain (International Sort) |
0x100A | ESG | Spanish Guatemala |
0x140A | ESC | Spanish Costa Rica |
0x180A | ESA | Spanish Panama |
0x1C0A | ESD | Spanish Dominican Republic |
0x200A | ESV | Spanish Venezuela |
0x240A | ESO | Spanish Colombia |
0x280A | ESR | Spanish Peru |
0x2C0A | ESS | Spanish Argentina |
0x300A | ESF | Spanish Ecuador |
0x340A | ESL | Spanish Chile |
0x380A | ESY | Spanish Uruguay |
0x3C0A | ESZ | Spanish Paraguay |
0x400A | ESB | Spanish Bolivia |
0x440A | ESE | Spanish El Salvador |
0x480A | ESH | Spanish Honduras |
0x4C0A | ESI | Spanish Nicaragua |
0x500A | ESU | Spanish Puerto Rico |
0x040B | FIN | Finnish Finland |
0x040C | FRANCE | French France |
0x080C | FRB | French Belgium |
0x0C0C | FRC | French Canada |
0x100C | FRS | French Switzerland |
0x140C | FRL | French Luxembourg |
0x180C | FRM | French Monaco |
0x040D | HEB | Hebrew Israel |
0x040E | HUN | Hungarian Hungary |
0x040F | ISL | Icelandic Iceland |
0x0410 | ITALY | Italian Italy |
0x0810 | ITS | Italian Switzerland |
0x0411 | JAPAN | Japanese Japan |
0x0412 | KOREA | Korean Korea |
0x0413 | NLD | Dutch Netherlands |
0x0813 | NLB | Dutch Belgium |
0x0414 | NOR | Norwegian Norway (Bokmål) |
0x0814 | NON | Norwegian Norway (Nynorsk) |
0x0415 | PLK | Polish Poland |
0x0416 | BRAZIL | Portuguese Brazil |
0x0816 | PTG | Portuguese Portugal |
0x0418 | ROM | Romanian Romania |
0x0419 | RUS | Russian Russia |
0x041A | HRV | Croatian Croatia |
0x081A | SRL | Serbian Serbia (Latin) |
0x0C1A | SRB | Serbian Serbia (Cyrillic) |
0x041B | SKY | Slovak Slovakia |
0x041C | SQI | Albanian Albania |
0x041D | SVE | Swedish Sweden |
0x081D | SVF | Swedish Finland |
0x041E | THA | Thai Thailand |
0x041F | TRK | Turkish Turkey |
0x0420 | URP | Urdu Pakistan |
0x0421 | IND | Indonesian Indonesia |
0x0422 | UKR | Ukrainian Ukraine |
0x0423 | BEL | Belarusian Belarus |
0x0424 | SLV | Slovene Slovenia |
0x0425 | ETI | Estonian Estonia |
0x0426 | LVI | Latvian Latvia |
0x0427 | LTH | Lithuanian Lithuania |
0x0827 | LTC | Classic Lithuanian Lithuania |
0x0429 | FAR | Farsi Iran |
0x042A | VIT | Vietnamese Viet Nam |
0x042B | HYE | Armenian Armenia |
0x042C | AZE | Azeri Azerbaijan (Latin) |
0x082C | AZE | Azeri Azerbaijan (Cyrillic) |
0x042D | EUQ | Basque Spain |
0x042F | MKI | Macedonian Macedonia |
0x0436 | AFK | Afrikaans South Africa |
0x0437 | KAT | Georgian Georgia |
0x0438 | FOS | Faeroese Faeroe Islands |
0x0439 | HIN | Hindi India |
0x043E | MSL | Malay Malaysia |
0x083E | MSB | Malay Brunei Darussalam |
0x043F | KAZ | Kazak Kazakstan |
0x0441 | SWK | Swahili Kenya |
0x0443 | UZB | Uzbek Uzbekistan (Latin) |
0x0843 | UZB | Uzbek Uzbekistan (Cyrillic) |
0x0444 | TAT | Tatar Tatarstan |
0x0445 | BEN | Bengali India |
0x0446 | PAN | Punjabi India |
0x0447 | GUJ | Gujarati India |
0x0448 | ORI | Oriya India |
0x0449 | TAM | Tamil India |
0x044A | TEL | Telugu India |
0x044B | KAN | Kannada India |
0x044C | MAL | Malayalam India |
0x044D | ASM | Assamese India |
0x044E | MAR | Marathi India |
0x044F | SAN | Sanskrit India |
0x0457 | KOK | Konkani India |
0x0000 | Language-Neutral, | Language-Neutral |
0x0400 | Process Default Language | Process Default Language |
VT_Empty | 0 |
VT_Null | 1 |
VT_I2 | 2 |
VT_I4 | 3 |
VT_R4 | 4 |
VT_R8 | 5 |
VT_Cy | 6 |
VT_Date | 7 |
VT_BStr | 8 |
VT_Dispatch | 9 |
VT_Error | 10 |
VT_Bool | 11 |
VT_Variant | 12 |
VT_Unknown | 13 |
VT_Decimal | 14 |
VT_I1 | 16 |
VT_UI1 | 17 |
VT_UI2 | 18 |
VT_UI4 | 19 |
VT_I8 | 20 |
VT_UI8 | 21 |
VT_Int | 22 |
VT_UInt | 23 |
VT_Void | 24 |
VT_HResult | 25 |
VT_Ptr | 26 |
VT_SafeArray | 27 |
VT_CArray | 28 |
VT_UserDefined | 29 |
VT_LPStr | 30 |
VT_LPWStr | 31 |
VT_Record | 36 |
VT_FileTime | 64 |
VT_Blob | 65 |
VT_Stream | 66 |
VT_Storage | 67 |
VT_Streamed_Object | 68 |
VT_Stored_Object | 69 |
VT_Blob_Object | 70 |
VT_CF | 71 |
VT_ClsID | 72 |
VT_Bstr_Blob | 0x0FFF |
VT_Vector | 0x1000 |
VT_Array | 0x2000 |
VT_ByRef | 0x4000 |
VT_Reserved | 0x8000 |
VT_Illegal | 0xFFFF |
VT_IllegalMasked | 0x0FFF |
VT_TypeMask | 0x0FFF |
CC_FASTCALL | 0 |
CC_CDECL | 1 |
CC_MSCPASCAL | 2 |
CC_PASCAL | 2 |
CC_MACPASCAL | 3 |
CC_STDCALL | 4 |
CC_FPFASTCALL | 5 |
CC_SYSCALL | 6 |
CC_MPWCDECL | 7 |
CC_MPWPASCAL | 8 |
CC_MAX | 9 |
FUNC_VIRTUAL | 0 |
FUNC_PUREVIRTUAL | 1 |
FUNC_NONVIRTUAL | 2 |
FUNC_STATIC | 3 |
FUNC_DISPATCH | 4 |
FUNCFLAG_FRESTRICTED | 0x000001 |
FUNCFLAG_FSOURCE | 0x000002 |
FUNCFLAG_FBINDABLE | 0x000004 |
FUNCFLAG_FREQUESTEDIT | 0x000008 |
FUNCFLAG_FDISPLAYBIND | 0x000010 |
FUNCFLAG_FDEFAULTBIND | 0x000020 |
FUNCFLAG_FHIDDEN | 0x000040 |
FUNCFLAG_FUSESGETLASTERROR | 0x000080 |
FUNCFLAG_FDEFAULTCOLLELEM | 0x000100 |
FUNCFLAG_FUIDEFAULT | 0x000200 |
FUNCFLAG_FNONBROWSABLE | 0x000400 |
FUNCFLAG_FREPLACEABLE | 0x000800 |
FUNCFLAG_FIMMEDIATEBIND | 0x001000 |
#If Def(MAC) FUNCFLAG_FORCELONG #Endif |
0x7FFFFFFF |
INVOKE_FUNC | 1 |
INVOKE_PROPERTYGET | 2 |
INVOKE_PROPERTYPUT | 4 |
INVOKE_PROPERTYPUTREF | 8 |
INVOKE_FUNC | 0 |
INVOKE_PROPERTYGET | 1 |
INVOKE_PROPERTYPUT | 2 |
INVOKE_PROPERTYPUTREF | 4 |
PARAMFLAG_NONE | 0x0000 |
PARAMFLAG_FIN | 0x0001 |
PARAMFLAG_FOUT | 0x0002 |
PARAMFLAG_FLCID | 0x0004 |
PARAMFLAG_FRETVAL | 0x0008 |
PARAMFLAG_FOPT | 0x0010 |
PARAMFLAG_FHASDEFAULT | 0x0020 |
PARAMFLAG_FHASCUSTDATA | 0x0040 |
SYS_WIN16 | 0 |
SYS_WIN32 | 1 |
SYS_MAC | 2 |
SYS_WIN64 | 3 |
TKIND_ENUM | 0 |
TKIND_RECORD | 1 |
TKIND_MODULE | 2 |
TKIND_INTERFACE | 3 |
TKIND_DISPATCH | 4 |
TKIND_COCLASS | 5 |
TKIND_ALIAS | 6 |
TKIND_UNION | 7 |
TKIND_MAX | 8 |
TYPEFLAG_FAPPOBJECT | 0x00001 |
TYPEFLAG_FCANCREATE | 0x00002 |
TYPEFLAG_FLICENSED | 0x00004 |
TYPEFLAG_FPREDECLID | 0x00008 |
TYPEFLAG_FHIDDEN | 0x00010 |
TYPEFLAG_FCONTROL | 0x00020 |
TYPEFLAG_FDUAL | 0x00040 |
TYPEFLAG_FNONEXTENSIBLE | 0x00080 |
TYPEFLAG_FOLEAUTOMATION | 0x00100 |
TYPEFLAG_FRESTRICTED | 0x00200 |
TYPEFLAG_FAGGREGATABLE | 0x00400 |
TYPEFLAG_FREPLACEABLE | 0x00800 |
TYPEFLAG_FDISPATCHABLE | 0x01000 |
TYPEFLAG_FREVERSEBIND | 0x02000 |
Virtual | 0 |
PureVirtual | 1 |
NonVirtual | 2 |
Static | 3 |
Dispatch | 4 |