Currently, stdole2.tlb isn't generated correctly and causes "<failed>"
to appear instead of "FontEvents" in the IFontEventsDisp typedef when
viewed with oleview.
The problem is that the typedef should just generate a VT_USERDEFINED
record, but ends up generating a VT_PTR -> VT_USERDEFINED. So remove
the extra writing of VT_PTR entries.
Fix the skipped pointers checks in encode_type and encode_type to
specifically detect VT_UNKNOWN and VT_DISPATCH types which don't need
one level of pointers, whereas interfaces encoded as VT_USERDEFINED
do.
Descend through as many pointer types as necessary to find the
fundamental type and determine whether it needs a top-level parameter
conformance/variance expression to be written.
Add support for writing top-level parameter conformance/variance
expressions for non-encapsulated unions.
This allows widl to catch type redefinitions and report an error, like MIDL.
However, this does a better job than MIDL since it also reports the location
of the originial definition, like GCC.
The 8 bytes are for the variance and offset and are added just before
the array, as seen in the marshalling code in rpcrt4. No offset needs
to be added for non-varying structures since the buffer mark is set
after the conformance in marshalled or unmarshalled.
Do so by calculating the alignment of members when iterating through
the structures and adding it onto the buffer and memory offsets.
Only call type_memsize once elsewhere in the embedded pointer
processing functions since the return value will be the same from the
second call.
The conformance needs to be added on to the offset in the buffer so
set this before calling each the writer of each class of pointer
description in write_pointer_description.
Pass the passed in offsets to buffer and memory to
write_pointer_description_offsets in
write_varying_array_pointer_descriptions.
Type libraries are currently parsed in host endianness, so byte arrays
that are going to be interpreted as integers need to be written in the
appropriate byte order.
Split up the writing into start and end to eventually support the style
MIDL uses where it writes declared types, etc. between the start and end
of the interface.
Make internal header functions take the file pointer to print to.
Don't write interface IDs for non-object interfaces and always write
handle declarations even if the interface has no methods, like MIDL does.