ReactOS 0.4.15-dev-7660-g0086d05
typelib.c File Reference
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#include <ctype.h>
#include "winerror.h"
#include "windef.h"
#include "winbase.h"
#include "winnls.h"
#include "winreg.h"
#include "winuser.h"
#include "winternl.h"
#include "lzexpand.h"
#include "objbase.h"
#include "typelib.h"
#include "wine/debug.h"
#include "variant.h"
#include "wine/asm.h"
#include "wine/heap.h"
#include "wine/list.h"
Include dependency graph for typelib.c:

Go to the source code of this file.

Classes

struct  NE_NAMEINFO
 
struct  NE_TYPEINFO
 
struct  tlibredirect_data
 
struct  tagTLBGuid
 
struct  tagTLBCustData
 
struct  tagTLBImpLib
 
struct  tagTLBString
 
struct  tagITypeLibImpl
 
struct  tagTLBRefType
 
struct  tagTLBParDesc
 
struct  tagTLBFuncDesc
 
struct  tagTLBVarDesc
 
struct  tagTLBImplType
 
struct  tagITypeInfoImpl
 
struct  tagTLBContext
 
struct  TLB_PEFile
 
struct  TLB_NEFile
 
struct  TLB_Mapping
 
struct  bitstream
 
struct  sltg_ref_lookup_t
 
struct  SLTG_InternalOtherTypeInfo
 
struct  search_res_tlb_params
 
struct  tagWMSFT_SegContents
 
struct  tagWMSFT_TLBFile
 
struct  tagWMSFT_RefChunk
 
struct  tagWMSFT_ImpFile
 

Macros

#define COBJMACROS
 
#define NONAMELESSUNION
 
#define FromLEWord(X)   (X)
 
#define FromLEDWord(X)   (X)
 
#define DISPATCH_HREF_OFFSET   0x01000000
 
#define DISPATCH_HREF_MASK   0xff000000
 
#define FromLEWords(X, Y)   /*nothing*/
 
#define FromLEDWords(X, Y)   /*nothing*/
 
#define XX(x)   if (TYPEFLAG_##x & tattr->wTypeFlags) MESSAGE(#x"|");
 
#define TLB_REF_USE_GUID   -2
 
#define TLB_REF_INTERNAL   (void*)-2
 
#define TLB_REF_NOT_FOUND   (void*)-1
 
#define SLTG_SIGNATURE   0x47544c53 /* "SLTG" */
 
#define X(x)   TRACE_(typelib)("tt "#x": %x\n",pTITail->res##x);
 
#define INVBUF_ELEMENT_SIZE    (sizeof(VARIANTARG) + sizeof(VARIANTARG) + sizeof(VARIANTARG *) + sizeof(VARTYPE))
 
#define INVBUF_GET_ARG_ARRAY(buffer, params)   (buffer)
 
#define INVBUF_GET_MISSING_ARG_ARRAY(buffer, params)    ((VARIANTARG *)((char *)(buffer) + sizeof(VARIANTARG) * (params)))
 
#define INVBUF_GET_ARG_PTR_ARRAY(buffer, params)    ((VARIANTARG **)((char *)(buffer) + (sizeof(VARIANTARG) + sizeof(VARIANTARG)) * (params)))
 
#define INVBUF_GET_ARG_TYPE_ARRAY(buffer, params)    ((VARTYPE *)((char *)(buffer) + (sizeof(VARIANTARG) + sizeof(VARIANTARG) + sizeof(VARIANTARG *)) * (params)))
 

Typedefs

typedef struct tagTLBGuid TLBGuid
 
typedef struct tagTLBCustData TLBCustData
 
typedef struct tagTLBImpLib TLBImpLib
 
typedef struct tagTLBString TLBString
 
typedef struct tagITypeLibImpl ITypeLibImpl
 
typedef struct tagTLBRefType TLBRefType
 
typedef struct tagTLBParDesc TLBParDesc
 
typedef struct tagTLBFuncDesc TLBFuncDesc
 
typedef struct tagTLBVarDesc TLBVarDesc
 
typedef struct tagTLBImplType TLBImplType
 
typedef struct tagITypeInfoImpl ITypeInfoImpl
 
typedef struct tagTLBContext TLBContext
 
typedef struct TLB_PEFile TLB_PEFile
 
typedef struct TLB_NEFile TLB_NEFile
 
typedef struct TLB_Mapping TLB_Mapping
 
typedef struct tagWMSFT_SegContents WMSFT_SegContents
 
typedef struct tagWMSFT_TLBFile WMSFT_TLBFile
 
typedef struct tagWMSFT_RefChunk WMSFT_RefChunk
 
typedef struct tagWMSFT_ImpFile WMSFT_ImpFile
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ole)
 
 WINE_DECLARE_DEBUG_CHANNEL (typelib)
 
static HRESULT typedescvt_to_variantvt (ITypeInfo *tinfo, const TYPEDESC *tdesc, VARTYPE *vt)
 
static HRESULT TLB_AllocAndInitVarDesc (const VARDESC *src, VARDESC **dest_ptr)
 
static void TLB_FreeVarDesc (VARDESC *)
 
static BOOL find_typelib_key (REFGUID guid, WORD *wMaj, WORD *wMin)
 
static WCHARget_typelib_key (REFGUID guid, WORD wMaj, WORD wMin, WCHAR *buffer)
 
static WCHARget_interface_key (REFGUID guid, WCHAR *buffer)
 
static WCHARget_lcid_subkey (LCID lcid, SYSKIND syskind, WCHAR *buffer)
 
static HRESULT TLB_ReadTypeLib (LPCWSTR pszFileName, LPWSTR pszPath, UINT cchPath, ITypeLib2 **ppTypeLib)
 
static HRESULT query_typelib_path (REFGUID guid, WORD wMaj, WORD wMin, SYSKIND syskind, LCID lcid, BSTR *path, BOOL redir)
 
HRESULT WINAPI QueryPathOfRegTypeLib (REFGUID guid, WORD wMaj, WORD wMin, LCID lcid, LPBSTR path)
 
HRESULT WINAPI CreateTypeLib (SYSKIND syskind, LPCOLESTR file, ICreateTypeLib **ctlib)
 
HRESULT WINAPI LoadTypeLib (const OLECHAR *szFile, ITypeLib **pptLib)
 
HRESULT WINAPI LoadTypeLibEx (LPCOLESTR szFile, REGKIND regkind, ITypeLib **pptLib)
 
HRESULT WINAPI LoadRegTypeLib (REFGUID rguid, WORD wVerMajor, WORD wVerMinor, LCID lcid, ITypeLib **ppTLib)
 
static void TLB_register_interface (TLIBATTR *libattr, LPOLESTR name, TYPEATTR *tattr, DWORD flag)
 
HRESULT WINAPI RegisterTypeLib (ITypeLib *ptlib, const WCHAR *szFullPath, const WCHAR *szHelpDir)
 
static void TLB_unregister_interface (GUID *guid, REGSAM flag)
 
HRESULT WINAPI UnRegisterTypeLib (REFGUID libid, WORD wVerMajor, WORD wVerMinor, LCID lcid, SYSKIND syskind)
 
HRESULT WINAPI RegisterTypeLibForUser (ITypeLib *ptlib, OLECHAR *szFullPath, OLECHAR *szHelpDir)
 
HRESULT WINAPI UnRegisterTypeLibForUser (REFGUID libid, WORD wVerMajor, WORD wVerMinor, LCID lcid, SYSKIND syskind)
 
static ITypeLibImplimpl_from_ITypeLib2 (ITypeLib2 *iface)
 
static ITypeLibImplimpl_from_ITypeLib (ITypeLib *iface)
 
static ITypeLibImplimpl_from_ITypeComp (ITypeComp *iface)
 
static ITypeLibImplimpl_from_ICreateTypeLib2 (ICreateTypeLib2 *iface)
 
static ITypeLib2ITypeLib2_Constructor_MSFT (LPVOID pLib, DWORD dwTLBLength)
 
static ITypeLib2ITypeLib2_Constructor_SLTG (LPVOID pLib, DWORD dwTLBLength)
 
static ITypeInfoImplinfo_impl_from_ITypeComp (ITypeComp *iface)
 
static ITypeInfoImplimpl_from_ITypeInfo2 (ITypeInfo2 *iface)
 
static ITypeInfoImplimpl_from_ITypeInfo (ITypeInfo *iface)
 
static ITypeInfoImplinfo_impl_from_ICreateTypeInfo2 (ICreateTypeInfo2 *iface)
 
static ITypeInfoImplITypeInfoImpl_Constructor (void)
 
static void ITypeInfoImpl_Destroy (ITypeInfoImpl *This)
 
static BSTR TLB_get_bstr (const TLBString *str)
 
static int TLB_str_memcmp (void *left, const TLBString *str, DWORD len)
 
static const GUIDTLB_get_guidref (const TLBGuid *guid)
 
static const GUIDTLB_get_guid_null (const TLBGuid *guid)
 
static int get_ptr_size (SYSKIND syskind)
 
static void dump_TypeDesc (const TYPEDESC *pTD, char *szVarType)
 
static void dump_ELEMDESC (const ELEMDESC *edesc)
 
static void dump_FUNCDESC (const FUNCDESC *funcdesc)
 
static void dump_TLBFuncDescOne (const TLBFuncDesc *pfd)
 
static void dump_TLBFuncDesc (const TLBFuncDesc *pfd, UINT n)
 
static void dump_TLBVarDesc (const TLBVarDesc *pvd, UINT n)
 
static void dump_TLBImpLib (const TLBImpLib *import)
 
static void dump_TLBRefType (const ITypeLibImpl *pTL)
 
static void dump_TLBImplType (const TLBImplType *impl, UINT n)
 
static void dump_DispParms (const DISPPARAMS *pdp)
 
static void dump_TypeInfo (const ITypeInfoImpl *pty)
 
static void dump_VARDESC (const VARDESC *v)
 
static void TLB_abort (void)
 
static SIZE_T TLB_SizeTypeDesc (const TYPEDESC *tdesc, BOOL alloc_initial_space)
 
static voidTLB_CopyTypeDesc (TYPEDESC *dest, const TYPEDESC *src, void *buffer)
 
static void TLB_FreeCustData (struct list *custdata_list)
 
static BSTR TLB_MultiByteToBSTR (const char *ptr)
 
static TLBFuncDescTLB_get_funcdesc_by_memberid (TLBFuncDesc *funcdescs, UINT n, MEMBERID memid)
 
static TLBVarDescTLB_get_vardesc_by_memberid (TLBVarDesc *vardescs, UINT n, MEMBERID memid)
 
static TLBVarDescTLB_get_vardesc_by_name (TLBVarDesc *vardescs, UINT n, const OLECHAR *name)
 
static TLBCustDataTLB_get_custdata_by_guid (struct list *custdata_list, REFGUID guid)
 
static ITypeInfoImplTLB_get_typeinfo_by_name (ITypeInfoImpl **typeinfos, UINT n, const OLECHAR *name)
 
static void TLBVarDesc_Constructor (TLBVarDesc *var_desc)
 
static TLBVarDescTLBVarDesc_Alloc (UINT n)
 
static TLBParDescTLBParDesc_Constructor (UINT n)
 
static void TLBFuncDesc_Constructor (TLBFuncDesc *func_desc)
 
static TLBFuncDescTLBFuncDesc_Alloc (UINT n)
 
static void TLBImplType_Constructor (TLBImplType *impl)
 
static TLBImplTypeTLBImplType_Alloc (UINT n)
 
static TLBGuidTLB_append_guid (struct list *guid_list, const GUID *new_guid, HREFTYPE hreftype)
 
static HRESULT TLB_set_custdata (struct list *custdata_list, TLBGuid *tlbguid, VARIANT *var)
 
static TLBStringTLB_append_str (struct list *string_list, BSTR new_str)
 
static HRESULT TLB_get_size_from_hreftype (ITypeInfoImpl *info, HREFTYPE href, ULONG *size, WORD *align)
 
static HRESULT TLB_size_instance (ITypeInfoImpl *info, SYSKIND sys, TYPEDESC *tdesc, ULONG *size, WORD *align)
 
static void MSFT_Seek (TLBContext *pcx, LONG where)
 
static DWORD MSFT_Read (void *buffer, DWORD count, TLBContext *pcx, LONG where)
 
static DWORD MSFT_ReadLEDWords (void *buffer, DWORD count, TLBContext *pcx, LONG where)
 
static DWORD MSFT_ReadLEWords (void *buffer, DWORD count, TLBContext *pcx, LONG where)
 
static HRESULT MSFT_ReadAllGuids (TLBContext *pcx)
 
static TLBGuidMSFT_ReadGuid (int offset, TLBContext *pcx)
 
static HREFTYPE MSFT_ReadHreftype (TLBContext *pcx, int offset)
 
static HRESULT MSFT_ReadAllNames (TLBContext *pcx)
 
static TLBStringMSFT_ReadName (TLBContext *pcx, int offset)
 
static TLBStringMSFT_ReadString (TLBContext *pcx, int offset)
 
static void MSFT_ReadValue (VARIANT *pVar, int offset, TLBContext *pcx)
 
static int MSFT_CustData (TLBContext *pcx, int offset, struct list *custdata_list)
 
static void MSFT_GetTdesc (TLBContext *pcx, INT type, TYPEDESC *pTd)
 
static BOOL TLB_is_propgetput (INVOKEKIND invkind)
 
static void MSFT_DoFuncs (TLBContext *pcx, ITypeInfoImpl *pTI, int cFuncs, int cVars, int offset, TLBFuncDesc **pptfd)
 
static void MSFT_DoVars (TLBContext *pcx, ITypeInfoImpl *pTI, int cFuncs, int cVars, int offset, TLBVarDesc **pptvd)
 
static void MSFT_DoImplTypes (TLBContext *pcx, ITypeInfoImpl *pTI, int count, int offset)
 
static ITypeInfoImplMSFT_DoTypeInfo (TLBContext *pcx, int count, ITypeLibImpl *pLibInfo)
 
static HRESULT MSFT_ReadAllStrings (TLBContext *pcx)
 
static HRESULT MSFT_ReadAllRefs (TLBContext *pcx)
 
static TLB_PEFilepefile_impl_from_IUnknown (IUnknown *iface)
 
static HRESULT WINAPI TLB_PEFile_QueryInterface (IUnknown *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI TLB_PEFile_AddRef (IUnknown *iface)
 
static ULONG WINAPI TLB_PEFile_Release (IUnknown *iface)
 
static HRESULT TLB_PEFile_Open (LPCWSTR path, INT index, LPVOID *ppBase, DWORD *pdwTLBLength, IUnknown **ppFile)
 
static TLB_NEFilenefile_impl_from_IUnknown (IUnknown *iface)
 
static HRESULT WINAPI TLB_NEFile_QueryInterface (IUnknown *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI TLB_NEFile_AddRef (IUnknown *iface)
 
static ULONG WINAPI TLB_NEFile_Release (IUnknown *iface)
 
static int read_xx_header (HFILE lzfd)
 
static BOOL find_ne_resource (HFILE lzfd, LPCSTR typeid, LPCSTR resid, DWORD *resLen, DWORD *resOff)
 
static HRESULT TLB_NEFile_Open (LPCWSTR path, INT index, LPVOID *ppBase, DWORD *pdwTLBLength, IUnknown **ppFile)
 
static TLB_Mappingmapping_impl_from_IUnknown (IUnknown *iface)
 
static HRESULT WINAPI TLB_Mapping_QueryInterface (IUnknown *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI TLB_Mapping_AddRef (IUnknown *iface)
 
static ULONG WINAPI TLB_Mapping_Release (IUnknown *iface)
 
static HRESULT TLB_Mapping_Open (LPCWSTR path, LPVOID *ppBase, DWORD *pdwTLBLength, IUnknown **ppFile)
 
static ITypeLibImplTypeLibImpl_Constructor (void)
 
static BOOL TLB_GUIDFromString (const char *str, GUID *guid)
 
static const charlookup_code (const BYTE *table, DWORD table_size, struct bitstream *bits)
 
static const TLBStringdecode_string (const BYTE *table, const char *stream, DWORD stream_length, ITypeLibImpl *lib)
 
static WORD SLTG_ReadString (const char *ptr, const TLBString **pStr, ITypeLibImpl *lib)
 
static WORD SLTG_ReadStringA (const char *ptr, char **str)
 
static TLBStringSLTG_ReadName (const char *pNameTable, int offset, ITypeLibImpl *lib)
 
static DWORD SLTG_ReadLibBlk (LPVOID pLibBlk, ITypeLibImpl *pTypeLibImpl)
 
static HRESULT sltg_get_typelib_ref (const sltg_ref_lookup_t *table, DWORD typeinfo_ref, HREFTYPE *typelib_ref)
 
static WORDSLTG_DoType (WORD *pType, char *pBlk, TYPEDESC *pTD, const sltg_ref_lookup_t *ref_lookup)
 
static WORDSLTG_DoElem (WORD *pType, char *pBlk, ELEMDESC *pElem, const sltg_ref_lookup_t *ref_lookup)
 
static sltg_ref_lookup_tSLTG_DoRefs (SLTG_RefInfo *pRef, ITypeLibImpl *pTL, char *pNameTable)
 
static charSLTG_DoImpls (char *pBlk, ITypeInfoImpl *pTI, BOOL OneOnly, const sltg_ref_lookup_t *ref_lookup)
 
static void SLTG_DoVars (char *pBlk, char *pFirstItem, ITypeInfoImpl *pTI, unsigned short cVars, const char *pNameTable, const sltg_ref_lookup_t *ref_lookup, const BYTE *hlp_strings)
 
static void SLTG_DoFuncs (char *pBlk, char *pFirstItem, ITypeInfoImpl *pTI, unsigned short cFuncs, char *pNameTable, const sltg_ref_lookup_t *ref_lookup, const BYTE *hlp_strings)
 
static void SLTG_ProcessCoClass (char *pBlk, ITypeInfoImpl *pTI, char *pNameTable, SLTG_TypeInfoHeader *pTIHeader, SLTG_TypeInfoTail *pTITail)
 
static void SLTG_ProcessInterface (char *pBlk, ITypeInfoImpl *pTI, char *pNameTable, SLTG_TypeInfoHeader *pTIHeader, const SLTG_TypeInfoTail *pTITail, const BYTE *hlp_strings)
 
static void SLTG_ProcessRecord (char *pBlk, ITypeInfoImpl *pTI, const char *pNameTable, SLTG_TypeInfoHeader *pTIHeader, const SLTG_TypeInfoTail *pTITail, const BYTE *hlp_strings)
 
static void SLTG_ProcessAlias (char *pBlk, ITypeInfoImpl *pTI, char *pNameTable, SLTG_TypeInfoHeader *pTIHeader, const SLTG_TypeInfoTail *pTITail)
 
static void SLTG_ProcessDispatch (char *pBlk, ITypeInfoImpl *pTI, char *pNameTable, SLTG_TypeInfoHeader *pTIHeader, const SLTG_TypeInfoTail *pTITail, const BYTE *hlp_strings)
 
static void SLTG_ProcessEnum (char *pBlk, ITypeInfoImpl *pTI, const char *pNameTable, SLTG_TypeInfoHeader *pTIHeader, const SLTG_TypeInfoTail *pTITail, const BYTE *hlp_strings)
 
static void SLTG_ProcessModule (char *pBlk, ITypeInfoImpl *pTI, char *pNameTable, SLTG_TypeInfoHeader *pTIHeader, const SLTG_TypeInfoTail *pTITail, const BYTE *hlp_strings)
 
static HRESULT WINAPI ITypeLib2_fnQueryInterface (ITypeLib2 *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ITypeLib2_fnAddRef (ITypeLib2 *iface)
 
static ULONG WINAPI ITypeLib2_fnRelease (ITypeLib2 *iface)
 
static UINT WINAPI ITypeLib2_fnGetTypeInfoCount (ITypeLib2 *iface)
 
static HRESULT WINAPI ITypeLib2_fnGetTypeInfo (ITypeLib2 *iface, UINT index, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI ITypeLib2_fnGetTypeInfoType (ITypeLib2 *iface, UINT index, TYPEKIND *pTKind)
 
static HRESULT WINAPI ITypeLib2_fnGetTypeInfoOfGuid (ITypeLib2 *iface, REFGUID guid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI ITypeLib2_fnGetLibAttr (ITypeLib2 *iface, LPTLIBATTR *attr)
 
static HRESULT WINAPI ITypeLib2_fnGetTypeComp (ITypeLib2 *iface, ITypeComp **ppTComp)
 
static HRESULT WINAPI ITypeLib2_fnGetDocumentation (ITypeLib2 *iface, INT index, BSTR *pBstrName, BSTR *pBstrDocString, DWORD *pdwHelpContext, BSTR *pBstrHelpFile)
 
static HRESULT WINAPI ITypeLib2_fnIsName (ITypeLib2 *iface, LPOLESTR szNameBuf, ULONG lHashVal, BOOL *pfName)
 
static HRESULT WINAPI ITypeLib2_fnFindName (ITypeLib2 *iface, LPOLESTR name, ULONG hash, ITypeInfo **ppTInfo, MEMBERID *memid, UINT16 *found)
 
static VOID WINAPI ITypeLib2_fnReleaseTLibAttr (ITypeLib2 *iface, TLIBATTR *pTLibAttr)
 
static HRESULT WINAPI ITypeLib2_fnGetCustData (ITypeLib2 *iface, REFGUID guid, VARIANT *pVarVal)
 
static HRESULT WINAPI ITypeLib2_fnGetLibStatistics (ITypeLib2 *iface, ULONG *pcUniqueNames, ULONG *pcchUniqueNames)
 
static HRESULT WINAPI ITypeLib2_fnGetDocumentation2 (ITypeLib2 *iface, INT index, LCID lcid, BSTR *pbstrHelpString, DWORD *pdwHelpStringContext, BSTR *pbstrHelpStringDll)
 
static HRESULT TLB_copy_all_custdata (struct list *custdata_list, CUSTDATA *pCustData)
 
static HRESULT WINAPI ITypeLib2_fnGetAllCustData (ITypeLib2 *iface, CUSTDATA *pCustData)
 
static HRESULT WINAPI ITypeLibComp_fnQueryInterface (ITypeComp *iface, REFIID riid, LPVOID *ppv)
 
static ULONG WINAPI ITypeLibComp_fnAddRef (ITypeComp *iface)
 
static ULONG WINAPI ITypeLibComp_fnRelease (ITypeComp *iface)
 
static HRESULT WINAPI ITypeLibComp_fnBind (ITypeComp *iface, OLECHAR *szName, ULONG lHash, WORD wFlags, ITypeInfo **ppTInfo, DESCKIND *pDescKind, BINDPTR *pBindPtr)
 
static HRESULT WINAPI ITypeLibComp_fnBindType (ITypeComp *iface, OLECHAR *szName, ULONG lHash, ITypeInfo **ppTInfo, ITypeComp **ppTComp)
 
static HRESULT WINAPI ITypeInfo_fnQueryInterface (ITypeInfo2 *iface, REFIID riid, VOID **ppvObject)
 
static ULONG WINAPI ITypeInfo_fnAddRef (ITypeInfo2 *iface)
 
static ULONG WINAPI ITypeInfo_fnRelease (ITypeInfo2 *iface)
 
static HRESULT WINAPI ITypeInfo_fnGetTypeAttr (ITypeInfo2 *iface, LPTYPEATTR *ppTypeAttr)
 
static HRESULT WINAPI ITypeInfo_fnGetTypeComp (ITypeInfo2 *iface, ITypeComp **ppTComp)
 
static SIZE_T TLB_SizeElemDesc (const ELEMDESC *elemdesc)
 
static HRESULT TLB_CopyElemDesc (const ELEMDESC *src, ELEMDESC *dest, char **buffer)
 
static HRESULT TLB_SanitizeBSTR (BSTR str)
 
static HRESULT TLB_SanitizeVariant (VARIANT *var)
 
static void TLB_FreeElemDesc (ELEMDESC *elemdesc)
 
static HRESULT TLB_AllocAndInitFuncDesc (const FUNCDESC *src, FUNCDESC **dest_ptr, BOOL dispinterface)
 
HRESULT ITypeInfoImpl_GetInternalFuncDesc (ITypeInfo *iface, UINT index, const FUNCDESC **ppFuncDesc)
 
static HRESULT ITypeInfoImpl_GetInternalDispatchFuncDesc (ITypeInfo *iface, UINT index, const FUNCDESC **ppFuncDesc, UINT *funcs, UINT *hrefoffset)
 
static void ITypeInfoImpl_ElemDescAddHrefOffset (LPELEMDESC pElemDesc, UINT hrefoffset)
 
static void ITypeInfoImpl_FuncDescAddHrefOffset (LPFUNCDESC pFuncDesc, UINT hrefoffset)
 
static HRESULT WINAPI ITypeInfo_fnGetFuncDesc (ITypeInfo2 *iface, UINT index, LPFUNCDESC *ppFuncDesc)
 
static HRESULT WINAPI ITypeInfo_fnGetVarDesc (ITypeInfo2 *iface, UINT index, LPVARDESC *ppVarDesc)
 
static HRESULT WINAPI ITypeInfo_fnGetNames (ITypeInfo2 *iface, MEMBERID memid, BSTR *rgBstrNames, UINT cMaxNames, UINT *pcNames)
 
static HRESULT WINAPI ITypeInfo_fnGetRefTypeOfImplType (ITypeInfo2 *iface, UINT index, HREFTYPE *pRefType)
 
static HRESULT WINAPI ITypeInfo_fnGetImplTypeFlags (ITypeInfo2 *iface, UINT index, INT *pImplTypeFlags)
 
static HRESULT WINAPI ITypeInfo_fnGetIDsOfNames (ITypeInfo2 *iface, LPOLESTR *rgszNames, UINT cNames, MEMBERID *pMemId)
 
HRESULT WINAPI DispCallFunc (void *pvInstance, ULONG_PTR oVft, CALLCONV cc, VARTYPE vtReturn, UINT cActuals, VARTYPE *prgvt, VARIANTARG **prgpvarg, VARIANT *pvargResult)
 
static HRESULT userdefined_to_variantvt (ITypeInfo *tinfo, const TYPEDESC *tdesc, VARTYPE *vt)
 
static HRESULT get_iface_guid (ITypeInfo *tinfo, HREFTYPE href, GUID *guid)
 
static BOOL func_restricted (const FUNCDESC *desc)
 
static HRESULT WINAPI ITypeInfo_fnInvoke (ITypeInfo2 *iface, VOID *pIUnk, MEMBERID memid, UINT16 wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *pArgErr)
 
static HRESULT WINAPI ITypeInfo_fnGetDocumentation (ITypeInfo2 *iface, MEMBERID memid, BSTR *pBstrName, BSTR *pBstrDocString, DWORD *pdwHelpContext, BSTR *pBstrHelpFile)
 
static HRESULT WINAPI ITypeInfo_fnGetDllEntry (ITypeInfo2 *iface, MEMBERID memid, INVOKEKIND invKind, BSTR *pBstrDllName, BSTR *pBstrName, WORD *pwOrdinal)
 
static HRESULT ITypeInfoImpl_GetDispatchRefTypeInfo (ITypeInfo *iface, HREFTYPE *hRefType, ITypeInfo **ppTInfo)
 
static BOOL CALLBACK search_res_tlb (HMODULE hModule, LPCWSTR lpszType, LPWSTR lpszName, LONG_PTR lParam)
 
static HRESULT WINAPI ITypeInfo_fnGetRefTypeInfo (ITypeInfo2 *iface, HREFTYPE hRefType, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI ITypeInfo_fnAddressOfMember (ITypeInfo2 *iface, MEMBERID memid, INVOKEKIND invKind, PVOID *ppv)
 
static HRESULT WINAPI ITypeInfo_fnCreateInstance (ITypeInfo2 *iface, IUnknown *pOuterUnk, REFIID riid, VOID **ppvObj)
 
static HRESULT WINAPI ITypeInfo_fnGetMops (ITypeInfo2 *iface, MEMBERID memid, BSTR *pBstrMops)
 
static HRESULT WINAPI ITypeInfo_fnGetContainingTypeLib (ITypeInfo2 *iface, ITypeLib **ppTLib, UINT *pIndex)
 
static void WINAPI ITypeInfo_fnReleaseTypeAttr (ITypeInfo2 *iface, TYPEATTR *pTypeAttr)
 
static void WINAPI ITypeInfo_fnReleaseFuncDesc (ITypeInfo2 *iface, FUNCDESC *pFuncDesc)
 
static void WINAPI ITypeInfo_fnReleaseVarDesc (ITypeInfo2 *iface, VARDESC *pVarDesc)
 
static HRESULT WINAPI ITypeInfo2_fnGetTypeKind (ITypeInfo2 *iface, TYPEKIND *pTypeKind)
 
static HRESULT WINAPI ITypeInfo2_fnGetTypeFlags (ITypeInfo2 *iface, ULONG *pTypeFlags)
 
static HRESULT WINAPI ITypeInfo2_fnGetFuncIndexOfMemId (ITypeInfo2 *iface, MEMBERID memid, INVOKEKIND invKind, UINT *pFuncIndex)
 
static HRESULT WINAPI ITypeInfo2_fnGetVarIndexOfMemId (ITypeInfo2 *iface, MEMBERID memid, UINT *pVarIndex)
 
static HRESULT WINAPI ITypeInfo2_fnGetCustData (ITypeInfo2 *iface, REFGUID guid, VARIANT *pVarVal)
 
static HRESULT WINAPI ITypeInfo2_fnGetFuncCustData (ITypeInfo2 *iface, UINT index, REFGUID guid, VARIANT *pVarVal)
 
static HRESULT WINAPI ITypeInfo2_fnGetParamCustData (ITypeInfo2 *iface, UINT indexFunc, UINT indexParam, REFGUID guid, VARIANT *pVarVal)
 
static HRESULT WINAPI ITypeInfo2_fnGetVarCustData (ITypeInfo2 *iface, UINT index, REFGUID guid, VARIANT *pVarVal)
 
static HRESULT WINAPI ITypeInfo2_fnGetImplTypeCustData (ITypeInfo2 *iface, UINT index, REFGUID guid, VARIANT *pVarVal)
 
static HRESULT WINAPI ITypeInfo2_fnGetDocumentation2 (ITypeInfo2 *iface, MEMBERID memid, LCID lcid, BSTR *pbstrHelpString, DWORD *pdwHelpStringContext, BSTR *pbstrHelpStringDll)
 
static HRESULT WINAPI ITypeInfo2_fnGetAllCustData (ITypeInfo2 *iface, CUSTDATA *pCustData)
 
static HRESULT WINAPI ITypeInfo2_fnGetAllFuncCustData (ITypeInfo2 *iface, UINT index, CUSTDATA *pCustData)
 
static HRESULT WINAPI ITypeInfo2_fnGetAllParamCustData (ITypeInfo2 *iface, UINT indexFunc, UINT indexParam, CUSTDATA *pCustData)
 
static HRESULT WINAPI ITypeInfo2_fnGetAllVarCustData (ITypeInfo2 *iface, UINT index, CUSTDATA *pCustData)
 
static HRESULT WINAPI ITypeInfo2_fnGetAllImplTypeCustData (ITypeInfo2 *iface, UINT index, CUSTDATA *pCustData)
 
HRESULT WINAPI CreateDispTypeInfo (INTERFACEDATA *pidata, LCID lcid, ITypeInfo **pptinfo)
 
static HRESULT WINAPI ITypeComp_fnQueryInterface (ITypeComp *iface, REFIID riid, LPVOID *ppv)
 
static ULONG WINAPI ITypeComp_fnAddRef (ITypeComp *iface)
 
static ULONG WINAPI ITypeComp_fnRelease (ITypeComp *iface)
 
static HRESULT WINAPI ITypeComp_fnBind (ITypeComp *iface, OLECHAR *szName, ULONG lHash, WORD wFlags, ITypeInfo **ppTInfo, DESCKIND *pDescKind, BINDPTR *pBindPtr)
 
static HRESULT WINAPI ITypeComp_fnBindType (ITypeComp *iface, OLECHAR *szName, ULONG lHash, ITypeInfo **ppTInfo, ITypeComp **ppTComp)
 
HRESULT WINAPI CreateTypeLib2 (SYSKIND syskind, LPCOLESTR szFile, ICreateTypeLib2 **ppctlib)
 
static HRESULT WINAPI ICreateTypeLib2_fnQueryInterface (ICreateTypeLib2 *iface, REFIID riid, void **object)
 
static ULONG WINAPI ICreateTypeLib2_fnAddRef (ICreateTypeLib2 *iface)
 
static ULONG WINAPI ICreateTypeLib2_fnRelease (ICreateTypeLib2 *iface)
 
static HRESULT WINAPI ICreateTypeLib2_fnCreateTypeInfo (ICreateTypeLib2 *iface, LPOLESTR name, TYPEKIND kind, ICreateTypeInfo **ctinfo)
 
static HRESULT WINAPI ICreateTypeLib2_fnSetName (ICreateTypeLib2 *iface, LPOLESTR name)
 
static HRESULT WINAPI ICreateTypeLib2_fnSetVersion (ICreateTypeLib2 *iface, WORD majorVerNum, WORD minorVerNum)
 
static HRESULT WINAPI ICreateTypeLib2_fnSetGuid (ICreateTypeLib2 *iface, REFGUID guid)
 
static HRESULT WINAPI ICreateTypeLib2_fnSetDocString (ICreateTypeLib2 *iface, LPOLESTR doc)
 
static HRESULT WINAPI ICreateTypeLib2_fnSetHelpFileName (ICreateTypeLib2 *iface, LPOLESTR helpFileName)
 
static HRESULT WINAPI ICreateTypeLib2_fnSetHelpContext (ICreateTypeLib2 *iface, DWORD helpContext)
 
static HRESULT WINAPI ICreateTypeLib2_fnSetLcid (ICreateTypeLib2 *iface, LCID lcid)
 
static HRESULT WINAPI ICreateTypeLib2_fnSetLibFlags (ICreateTypeLib2 *iface, UINT libFlags)
 
static HRESULT WMSFT_compile_strings (ITypeLibImpl *This, WMSFT_TLBFile *file)
 
static HRESULT WMSFT_compile_names (ITypeLibImpl *This, WMSFT_TLBFile *file)
 
static int hash_guid (GUID *guid)
 
static HRESULT WMSFT_compile_guids (ITypeLibImpl *This, WMSFT_TLBFile *file)
 
static DWORD WMSFT_encode_variant (VARIANT *value, WMSFT_TLBFile *file)
 
static DWORD WMSFT_append_typedesc (TYPEDESC *desc, WMSFT_TLBFile *file, DWORD *out_mix, INT16 *out_size)
 
static DWORD WMSFT_append_arraydesc (ARRAYDESC *desc, WMSFT_TLBFile *file)
 
static DWORD WMSFT_compile_custdata (struct list *custdata_list, WMSFT_TLBFile *file)
 
static DWORD WMSFT_compile_typeinfo_aux (ITypeInfoImpl *info, WMSFT_TLBFile *file)
 
static DWORD WMSFT_compile_typeinfo_ref (ITypeInfoImpl *info, WMSFT_TLBFile *file)
 
static DWORD WMSFT_compile_typeinfo (ITypeInfoImpl *info, INT16 index, WMSFT_TLBFile *file, char *data)
 
static void WMSFT_compile_typeinfo_seg (ITypeLibImpl *This, WMSFT_TLBFile *file, DWORD *junk)
 
static void WMSFT_compile_impfile (ITypeLibImpl *This, WMSFT_TLBFile *file)
 
static void WMSFT_compile_impinfo (ITypeLibImpl *This, WMSFT_TLBFile *file)
 
static void WMSFT_compile_guidhash (ITypeLibImpl *This, WMSFT_TLBFile *file)
 
static void WMSFT_compile_namehash (ITypeLibImpl *This, WMSFT_TLBFile *file)
 
static void tmp_fill_segdir_seg (MSFT_pSeg *segdir, WMSFT_SegContents *contents, DWORD *running_offset)
 
static void WMSFT_write_segment (HANDLE outfile, WMSFT_SegContents *segment)
 
static HRESULT WMSFT_fixup_typeinfos (ITypeLibImpl *This, WMSFT_TLBFile *file, DWORD file_len)
 
static void WMSFT_free_file (WMSFT_TLBFile *file)
 
static HRESULT WINAPI ICreateTypeLib2_fnSaveAllChanges (ICreateTypeLib2 *iface)
 
static HRESULT WINAPI ICreateTypeLib2_fnDeleteTypeInfo (ICreateTypeLib2 *iface, LPOLESTR name)
 
static HRESULT WINAPI ICreateTypeLib2_fnSetCustData (ICreateTypeLib2 *iface, REFGUID guid, VARIANT *varVal)
 
static HRESULT WINAPI ICreateTypeLib2_fnSetHelpStringContext (ICreateTypeLib2 *iface, ULONG helpStringContext)
 
static HRESULT WINAPI ICreateTypeLib2_fnSetHelpStringDll (ICreateTypeLib2 *iface, LPOLESTR filename)
 
static HRESULT WINAPI ICreateTypeInfo2_fnQueryInterface (ICreateTypeInfo2 *iface, REFIID riid, void **object)
 
static ULONG WINAPI ICreateTypeInfo2_fnAddRef (ICreateTypeInfo2 *iface)
 
static ULONG WINAPI ICreateTypeInfo2_fnRelease (ICreateTypeInfo2 *iface)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetGuid (ICreateTypeInfo2 *iface, REFGUID guid)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetTypeFlags (ICreateTypeInfo2 *iface, UINT typeFlags)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetDocString (ICreateTypeInfo2 *iface, LPOLESTR doc)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetHelpContext (ICreateTypeInfo2 *iface, DWORD helpContext)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetVersion (ICreateTypeInfo2 *iface, WORD majorVerNum, WORD minorVerNum)
 
static HRESULT WINAPI ICreateTypeInfo2_fnAddRefTypeInfo (ICreateTypeInfo2 *iface, ITypeInfo *typeInfo, HREFTYPE *refType)
 
static HRESULT WINAPI ICreateTypeInfo2_fnAddFuncDesc (ICreateTypeInfo2 *iface, UINT index, FUNCDESC *funcDesc)
 
static HRESULT WINAPI ICreateTypeInfo2_fnAddImplType (ICreateTypeInfo2 *iface, UINT index, HREFTYPE refType)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetImplTypeFlags (ICreateTypeInfo2 *iface, UINT index, INT implTypeFlags)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetAlignment (ICreateTypeInfo2 *iface, WORD alignment)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetSchema (ICreateTypeInfo2 *iface, LPOLESTR schema)
 
static HRESULT WINAPI ICreateTypeInfo2_fnAddVarDesc (ICreateTypeInfo2 *iface, UINT index, VARDESC *varDesc)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncAndParamNames (ICreateTypeInfo2 *iface, UINT index, LPOLESTR *names, UINT numNames)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetVarName (ICreateTypeInfo2 *iface, UINT index, LPOLESTR name)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetTypeDescAlias (ICreateTypeInfo2 *iface, TYPEDESC *tdescAlias)
 
static HRESULT WINAPI ICreateTypeInfo2_fnDefineFuncAsDllEntry (ICreateTypeInfo2 *iface, UINT index, LPOLESTR dllName, LPOLESTR procName)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncDocString (ICreateTypeInfo2 *iface, UINT index, LPOLESTR docString)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetVarDocString (ICreateTypeInfo2 *iface, UINT index, LPOLESTR docString)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncHelpContext (ICreateTypeInfo2 *iface, UINT index, DWORD helpContext)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetVarHelpContext (ICreateTypeInfo2 *iface, UINT index, DWORD helpContext)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetMops (ICreateTypeInfo2 *iface, UINT index, BSTR bstrMops)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetTypeIdldesc (ICreateTypeInfo2 *iface, IDLDESC *idlDesc)
 
static HRESULT WINAPI ICreateTypeInfo2_fnLayOut (ICreateTypeInfo2 *iface)
 
static HRESULT WINAPI ICreateTypeInfo2_fnDeleteFuncDesc (ICreateTypeInfo2 *iface, UINT index)
 
static HRESULT WINAPI ICreateTypeInfo2_fnDeleteFuncDescByMemId (ICreateTypeInfo2 *iface, MEMBERID memid, INVOKEKIND invKind)
 
static HRESULT WINAPI ICreateTypeInfo2_fnDeleteVarDesc (ICreateTypeInfo2 *iface, UINT index)
 
static HRESULT WINAPI ICreateTypeInfo2_fnDeleteVarDescByMemId (ICreateTypeInfo2 *iface, MEMBERID memid)
 
static HRESULT WINAPI ICreateTypeInfo2_fnDeleteImplType (ICreateTypeInfo2 *iface, UINT index)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetCustData (ICreateTypeInfo2 *iface, REFGUID guid, VARIANT *varVal)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncCustData (ICreateTypeInfo2 *iface, UINT index, REFGUID guid, VARIANT *varVal)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetParamCustData (ICreateTypeInfo2 *iface, UINT funcIndex, UINT paramIndex, REFGUID guid, VARIANT *varVal)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetVarCustData (ICreateTypeInfo2 *iface, UINT index, REFGUID guid, VARIANT *varVal)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetImplTypeCustData (ICreateTypeInfo2 *iface, UINT index, REFGUID guid, VARIANT *varVal)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetHelpStringContext (ICreateTypeInfo2 *iface, ULONG helpStringContext)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncHelpStringContext (ICreateTypeInfo2 *iface, UINT index, ULONG helpStringContext)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetVarHelpStringContext (ICreateTypeInfo2 *iface, UINT index, ULONG helpStringContext)
 
static HRESULT WINAPI ICreateTypeInfo2_fnInvalidate (ICreateTypeInfo2 *iface)
 
static HRESULT WINAPI ICreateTypeInfo2_fnSetName (ICreateTypeInfo2 *iface, LPOLESTR name)
 
void WINAPI ClearCustData (CUSTDATA *lpCust)
 

Variables

static const WCHAR TypeLibW [] = {'T','y','p','e','L','i','b',0}
 
static const WCHAR FLAGSW [] = {'F','L','A','G','S',0}
 
static const WCHAR HELPDIRW [] = {'H','E','L','P','D','I','R',0}
 
static const WCHAR ProxyStubClsidW [] = {'P','r','o','x','y','S','t','u','b','C','l','s','i','d',0}
 
static const WCHAR ProxyStubClsid32W [] = {'P','r','o','x','y','S','t','u','b','C','l','s','i','d','3','2',0}
 
static const ITypeLib2Vtbl tlbvt
 
static const ITypeCompVtbl tlbtcvt
 
static const ICreateTypeLib2Vtbl CreateTypeLib2Vtbl
 
static const ITypeInfo2Vtbl tinfvt
 
static const ITypeCompVtbl tcompvt
 
static const ICreateTypeInfo2Vtbl CreateTypeInfo2Vtbl
 
static const char *const typekind_desc []
 
static TYPEDESC std_typedesc [VT_LPWSTR+1]
 
static struct list tlb_cache = LIST_INIT(tlb_cache)
 
static CRITICAL_SECTION cache_section = { &cache_section_debug, -1, 0, 0, 0, 0 }
 
static CRITICAL_SECTION_DEBUG cache_section_debug
 
static const IUnknownVtbl TLB_PEFile_Vtable
 
static const IUnknownVtbl TLB_NEFile_Vtable
 
static const IUnknownVtbl TLB_Mapping_Vtable
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 56 of file typelib.c.

◆ DISPATCH_HREF_MASK

#define DISPATCH_HREF_MASK   0xff000000

Definition at line 130 of file typelib.c.

◆ DISPATCH_HREF_OFFSET

#define DISPATCH_HREF_OFFSET   0x01000000

Definition at line 129 of file typelib.c.

◆ FromLEDWord

#define FromLEDWord (   X)    (X)

Definition at line 126 of file typelib.c.

◆ FromLEDWords

#define FromLEDWords (   X,
  Y 
)    /*nothing*/

Definition at line 166 of file typelib.c.

◆ FromLEWord

#define FromLEWord (   X)    (X)

Definition at line 125 of file typelib.c.

◆ FromLEWords

#define FromLEWords (   X,
  Y 
)    /*nothing*/

Definition at line 165 of file typelib.c.

◆ INVBUF_ELEMENT_SIZE

#define INVBUF_ELEMENT_SIZE    (sizeof(VARIANTARG) + sizeof(VARIANTARG) + sizeof(VARIANTARG *) + sizeof(VARTYPE))

Definition at line 7273 of file typelib.c.

◆ INVBUF_GET_ARG_ARRAY

#define INVBUF_GET_ARG_ARRAY (   buffer,
  params 
)    (buffer)

Definition at line 7275 of file typelib.c.

◆ INVBUF_GET_ARG_PTR_ARRAY

#define INVBUF_GET_ARG_PTR_ARRAY (   buffer,
  params 
)     ((VARIANTARG **)((char *)(buffer) + (sizeof(VARIANTARG) + sizeof(VARIANTARG)) * (params)))

Definition at line 7278 of file typelib.c.

◆ INVBUF_GET_ARG_TYPE_ARRAY

#define INVBUF_GET_ARG_TYPE_ARRAY (   buffer,
  params 
)     ((VARTYPE *)((char *)(buffer) + (sizeof(VARIANTARG) + sizeof(VARIANTARG) + sizeof(VARIANTARG *)) * (params)))

Definition at line 7280 of file typelib.c.

◆ INVBUF_GET_MISSING_ARG_ARRAY

#define INVBUF_GET_MISSING_ARG_ARRAY (   buffer,
  params 
)     ((VARIANTARG *)((char *)(buffer) + sizeof(VARIANTARG) * (params)))

Definition at line 7276 of file typelib.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 57 of file typelib.c.

◆ SLTG_SIGNATURE

#define SLTG_SIGNATURE   0x47544c53 /* "SLTG" */

Definition at line 3285 of file typelib.c.

◆ TLB_REF_INTERNAL

#define TLB_REF_INTERNAL   (void*)-2

Definition at line 1196 of file typelib.c.

◆ TLB_REF_NOT_FOUND

#define TLB_REF_NOT_FOUND   (void*)-1

Definition at line 1197 of file typelib.c.

◆ TLB_REF_USE_GUID

#define TLB_REF_USE_GUID   -2

Definition at line 1194 of file typelib.c.

◆ X

#define X (   x)    TRACE_(typelib)("tt "#x": %x\n",pTITail->res##x);

◆ XX

#define XX (   x)    if (TYPEFLAG_##x & tattr->wTypeFlags) MESSAGE(#x"|");

Typedef Documentation

◆ ITypeInfoImpl

◆ ITypeLibImpl

◆ TLB_Mapping

◆ TLB_NEFile

◆ TLB_PEFile

◆ TLBContext

◆ TLBCustData

◆ TLBFuncDesc

◆ TLBGuid

◆ TLBImpLib

◆ TLBImplType

◆ TLBParDesc

◆ TLBRefType

◆ TLBString

◆ TLBVarDesc

◆ WMSFT_ImpFile

◆ WMSFT_RefChunk

◆ WMSFT_SegContents

◆ WMSFT_TLBFile

Function Documentation

◆ ClearCustData()

void WINAPI ClearCustData ( CUSTDATA *  lpCust)

Definition at line 11635 of file typelib.c.

11636{
11637 if (lpCust && lpCust->cCustData)
11638 {
11639 if (lpCust->prgCustData)
11640 {
11641 DWORD i;
11642
11643 for (i = 0; i < lpCust->cCustData; i++)
11644 VariantClear(&lpCust->prgCustData[i].varValue);
11645
11646 CoTaskMemFree(lpCust->prgCustData);
11647 lpCust->prgCustData = NULL;
11648 }
11649 lpCust->cCustData = 0;
11650 }
11651}
#define NULL
Definition: types.h:112
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648

Referenced by test_ClearCustData().

◆ CreateDispTypeInfo()

HRESULT WINAPI CreateDispTypeInfo ( INTERFACEDATA pidata,
LCID  lcid,
ITypeInfo **  pptinfo 
)

Definition at line 8792 of file typelib.c.

8796{
8797 ITypeInfoImpl *pTIClass, *pTIIface;
8798 ITypeLibImpl *pTypeLibImpl;
8799 unsigned int param, func;
8800 TLBFuncDesc *pFuncDesc;
8801 TLBRefType *ref;
8802
8803 TRACE("\n");
8804 pTypeLibImpl = TypeLibImpl_Constructor();
8805 if (!pTypeLibImpl) return E_FAIL;
8806
8807 pTypeLibImpl->TypeInfoCount = 2;
8808 pTypeLibImpl->typeinfos = heap_alloc_zero(pTypeLibImpl->TypeInfoCount * sizeof(ITypeInfoImpl*));
8809
8810 pTIIface = pTypeLibImpl->typeinfos[0] = ITypeInfoImpl_Constructor();
8811 pTIIface->pTypeLib = pTypeLibImpl;
8812 pTIIface->index = 0;
8813 pTIIface->Name = NULL;
8814 pTIIface->dwHelpContext = -1;
8815 pTIIface->guid = NULL;
8816 pTIIface->typeattr.lcid = lcid;
8817 pTIIface->typeattr.typekind = TKIND_INTERFACE;
8818 pTIIface->typeattr.wMajorVerNum = 0;
8819 pTIIface->typeattr.wMinorVerNum = 0;
8820 pTIIface->typeattr.cbAlignment = 2;
8821 pTIIface->typeattr.cbSizeInstance = -1;
8822 pTIIface->typeattr.cbSizeVft = -1;
8823 pTIIface->typeattr.cFuncs = 0;
8824 pTIIface->typeattr.cImplTypes = 0;
8825 pTIIface->typeattr.cVars = 0;
8826 pTIIface->typeattr.wTypeFlags = 0;
8827 pTIIface->hreftype = 0;
8828
8829 pTIIface->funcdescs = TLBFuncDesc_Alloc(pidata->cMembers);
8830 pFuncDesc = pTIIface->funcdescs;
8831 for(func = 0; func < pidata->cMembers; func++) {
8832 METHODDATA *md = pidata->pmethdata + func;
8833 pFuncDesc->Name = TLB_append_str(&pTypeLibImpl->name_list, md->szName);
8834 pFuncDesc->funcdesc.memid = md->dispid;
8835 pFuncDesc->funcdesc.lprgscode = NULL;
8836 pFuncDesc->funcdesc.funckind = FUNC_VIRTUAL;
8837 pFuncDesc->funcdesc.invkind = md->wFlags;
8838 pFuncDesc->funcdesc.callconv = md->cc;
8839 pFuncDesc->funcdesc.cParams = md->cArgs;
8840 pFuncDesc->funcdesc.cParamsOpt = 0;
8841 pFuncDesc->funcdesc.oVft = md->iMeth * sizeof(void *);
8842 pFuncDesc->funcdesc.cScodes = 0;
8843 pFuncDesc->funcdesc.wFuncFlags = 0;
8844 pFuncDesc->funcdesc.elemdescFunc.tdesc.vt = md->vtReturn;
8845 pFuncDesc->funcdesc.elemdescFunc.u.paramdesc.wParamFlags = PARAMFLAG_NONE;
8846 pFuncDesc->funcdesc.elemdescFunc.u.paramdesc.pparamdescex = NULL;
8847 pFuncDesc->funcdesc.lprgelemdescParam = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
8848 md->cArgs * sizeof(ELEMDESC));
8849 pFuncDesc->pParamDesc = TLBParDesc_Constructor(md->cArgs);
8850 for(param = 0; param < md->cArgs; param++) {
8851 pFuncDesc->funcdesc.lprgelemdescParam[param].tdesc.vt = md->ppdata[param].vt;
8852 pFuncDesc->pParamDesc[param].Name = TLB_append_str(&pTypeLibImpl->name_list, md->ppdata[param].szName);
8853 }
8854 pFuncDesc->helpcontext = 0;
8855 pFuncDesc->HelpStringContext = 0;
8856 pFuncDesc->HelpString = NULL;
8857 pFuncDesc->Entry = NULL;
8858 list_init(&pFuncDesc->custdata_list);
8859 pTIIface->typeattr.cFuncs++;
8860 ++pFuncDesc;
8861 }
8862
8863 dump_TypeInfo(pTIIface);
8864
8865 pTIClass = pTypeLibImpl->typeinfos[1] = ITypeInfoImpl_Constructor();
8866 pTIClass->pTypeLib = pTypeLibImpl;
8867 pTIClass->index = 1;
8868 pTIClass->Name = NULL;
8869 pTIClass->dwHelpContext = -1;
8870 pTIClass->guid = NULL;
8871 pTIClass->typeattr.lcid = lcid;
8872 pTIClass->typeattr.typekind = TKIND_COCLASS;
8873 pTIClass->typeattr.wMajorVerNum = 0;
8874 pTIClass->typeattr.wMinorVerNum = 0;
8875 pTIClass->typeattr.cbAlignment = 2;
8876 pTIClass->typeattr.cbSizeInstance = -1;
8877 pTIClass->typeattr.cbSizeVft = -1;
8878 pTIClass->typeattr.cFuncs = 0;
8879 pTIClass->typeattr.cImplTypes = 1;
8880 pTIClass->typeattr.cVars = 0;
8881 pTIClass->typeattr.wTypeFlags = 0;
8882 pTIClass->hreftype = sizeof(MSFT_TypeInfoBase);
8883
8884 pTIClass->impltypes = TLBImplType_Alloc(1);
8885
8886 ref = heap_alloc_zero(sizeof(*ref));
8887 ref->pImpTLInfo = TLB_REF_INTERNAL;
8888 list_add_head(&pTypeLibImpl->ref_list, &ref->entry);
8889
8890 dump_TypeInfo(pTIClass);
8891
8892 *pptinfo = (ITypeInfo *)&pTIClass->ITypeInfo2_iface;
8893
8894 ITypeInfo_AddRef(*pptinfo);
8895 ITypeLib2_Release(&pTypeLibImpl->ITypeLib2_iface);
8896
8897 return S_OK;
8898
8899}
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
static void list_init(struct list_entry *head)
Definition: list.h:51
#define md
Definition: compat-1.3.h:2013
#define E_FAIL
Definition: ddrawi.h:102
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
static TLBImplType * TLBImplType_Alloc(UINT n)
Definition: typelib.c:1812
static void dump_TypeInfo(const ITypeInfoImpl *pty)
Definition: typelib.c:1573
static ITypeLibImpl * TypeLibImpl_Constructor(void)
Definition: typelib.c:3429
static TLBString * TLB_append_str(struct list *string_list, BSTR new_str)
Definition: typelib.c:1884
static ITypeInfoImpl * ITypeInfoImpl_Constructor(void)
Definition: typelib.c:5623
#define TLB_REF_INTERNAL
Definition: typelib.c:1196
static TLBFuncDesc * TLBFuncDesc_Alloc(UINT n)
Definition: typelib.c:1791
static TLBParDesc * TLBParDesc_Constructor(UINT n)
Definition: typelib.c:1770
struct tagMSFT_TypeInfoBase MSFT_TypeInfoBase
GLenum func
Definition: glext.h:6028
GLfloat param
Definition: glext.h:5796
#define S_OK
Definition: intsafe.h:52
#define TRACE(s)
Definition: solgame.cpp:4
Definition: send.c:48
METHODDATA * pmethdata
Definition: oleauto.h:919
DWORD dwHelpContext
Definition: typelib.c:1263
const TLBString * Name
Definition: typelib.c:1259
ITypeInfo2 ITypeInfo2_iface
Definition: typelib.c:1242
TYPEATTR typeattr
Definition: typelib.c:1250
TLBFuncDesc * funcdescs
Definition: typelib.c:1267
ITypeLibImpl * pTypeLib
Definition: typelib.c:1253
TLBGuid * guid
Definition: typelib.c:1249
TLBImplType * impltypes
Definition: typelib.c:1273
HREFTYPE hreftype
Definition: typelib.c:1255
ITypeLib2 ITypeLib2_iface
Definition: typelib.c:1102
struct list name_list
Definition: typelib.c:1119
struct list ref_list
Definition: typelib.c:1135
struct tagITypeInfoImpl ** typeinfos
Definition: typelib.c:1128
int HelpStringContext
Definition: typelib.c:1213
FUNCDESC funcdesc
Definition: typelib.c:1209
const TLBString * Entry
Definition: typelib.c:1215
TLBParDesc * pParamDesc
Definition: typelib.c:1211
const TLBString * Name
Definition: typelib.c:1210
const TLBString * HelpString
Definition: typelib.c:1214
struct list custdata_list
Definition: typelib.c:1216
const TLBString * Name
Definition: typelib.c:1202
@ TKIND_COCLASS
Definition: widltypes.h:224
@ TKIND_INTERFACE
Definition: widltypes.h:222

Referenced by test_CreateDispTypeInfo().

◆ CreateTypeLib()

HRESULT WINAPI CreateTypeLib ( SYSKIND  syskind,
LPCOLESTR  file,
ICreateTypeLib **  ctlib 
)

Definition at line 425 of file typelib.c.

426{
427 ICreateTypeLib2 *typelib2;
429
430 FIXME("(%d, %s, %p): forwarding to CreateTypeLib2\n", syskind, debugstr_w(file), ctlib);
431
432 hres = CreateTypeLib2(syskind, file, &typelib2);
433 if(SUCCEEDED(hres))
434 {
435 hres = ICreateTypeLib2_QueryInterface(typelib2, &IID_ICreateTypeLib, (void **)&ctlib);
436 ICreateTypeLib2_Release(typelib2);
437 }
438
439 return hres;
440}
#define FIXME(fmt,...)
Definition: debug.h:111
HRESULT WINAPI CreateTypeLib2(SYSKIND syskind, LPCOLESTR szFile, ICreateTypeLib2 **ppctlib)
Definition: typelib.c:9043
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define debugstr_w
Definition: kernel32.h:32
HRESULT hres
Definition: protocol.c:465
Definition: fci.c:127

◆ CreateTypeLib2()

HRESULT WINAPI CreateTypeLib2 ( SYSKIND  syskind,
LPCOLESTR  szFile,
ICreateTypeLib2 **  ppctlib 
)

Definition at line 9043 of file typelib.c.

9045{
9047 HRESULT hres;
9048
9049 TRACE("(%d,%s,%p)\n", syskind, debugstr_w(szFile), ppctlib);
9050
9051 if (!szFile) return E_INVALIDARG;
9052
9054 if (!This)
9055 return E_OUTOFMEMORY;
9056
9057 This->lcid = GetSystemDefaultLCID();
9058 This->syskind = syskind;
9059 This->ptr_size = get_ptr_size(syskind);
9060
9061 This->path = heap_alloc((lstrlenW(szFile) + 1) * sizeof(WCHAR));
9062 if (!This->path) {
9063 ITypeLib2_Release(&This->ITypeLib2_iface);
9064 return E_OUTOFMEMORY;
9065 }
9066 lstrcpyW(This->path, szFile);
9067
9068 hres = ITypeLib2_QueryInterface(&This->ITypeLib2_iface, &IID_ICreateTypeLib2, (LPVOID*)ppctlib);
9069 ITypeLib2_Release(&This->ITypeLib2_iface);
9070 return hres;
9071}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
static int get_ptr_size(SYSKIND syskind)
Definition: typelib.c:1339
LCID WINAPI GetSystemDefaultLCID(void)
Definition: lang.c:797
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by CreateTypeLib(), test_create_typelib_lcid(), test_CreateTypeLib(), test_dep(), test_SetDocString(), test_SetFuncAndParamNames(), test_SetTypeDescAlias(), test_SetVarHelpContext(), test_stub(), and test_TypeInfo2_GetContainingTypeLib().

◆ decode_string()

static const TLBString * decode_string ( const BYTE table,
const char stream,
DWORD  stream_length,
ITypeLibImpl lib 
)
static

Definition at line 3742 of file typelib.c.

3743{
3744 DWORD buf_size, table_size;
3745 const char *p;
3746 struct bitstream bits;
3747 BSTR buf;
3748 TLBString *tlbstr;
3749
3750 if (!stream_length) return NULL;
3751
3752 bits.buffer = (const BYTE *)stream;
3753 bits.length = stream_length;
3754 bits.current = 0;
3755
3756 buf_size = *(const WORD *)table;
3757 table += sizeof(WORD);
3758 table_size = *(const DWORD *)table;
3759 table += sizeof(DWORD);
3760
3761 buf = SysAllocStringLen(NULL, buf_size);
3762 buf[0] = 0;
3763
3764 while ((p = lookup_code(table, table_size, &bits)))
3765 {
3766 static const WCHAR spaceW[] = { ' ',0 };
3767 if (buf[0]) lstrcatW(buf, spaceW);
3768 MultiByteToWideChar(CP_ACP, 0, p, -1, buf + lstrlenW(buf), buf_size - lstrlenW(buf));
3769 }
3770
3771 tlbstr = TLB_append_str(&lib->string_list, buf);
3773
3774 return tlbstr;
3775}
#define CP_ACP
Definition: compat.h:109
OLECHAR * BSTR
Definition: compat.h:2293
#define MultiByteToWideChar
Definition: compat.h:110
static const char * lookup_code(const BYTE *table, DWORD table_size, struct bitstream *bits)
Definition: typelib.c:3703
unsigned short WORD
Definition: ntddk_ex.h:93
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
GLfloat GLfloat p
Definition: glext.h:8902
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
static const WCHAR spaceW[]
Definition: mxwriter.c:44
#define DWORD
Definition: nt_native.h:44
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
LOCAL int table_size
Definition: write.c:65
Definition: parse.h:23
struct list string_list
Definition: typelib.c:1118
unsigned char BYTE
Definition: xxhash.c:193

Referenced by ITypeLib2_Constructor_SLTG(), SLTG_DoFuncs(), and SLTG_DoVars().

◆ DispCallFunc()

HRESULT WINAPI DispCallFunc ( void pvInstance,
ULONG_PTR  oVft,
CALLCONV  cc,
VARTYPE  vtReturn,
UINT  cActuals,
VARTYPE prgvt,
VARIANTARG **  prgpvarg,
VARIANT pvargResult 
)

Definition at line 7071 of file typelib.c.

7073{
7074 FIXME( "(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d)): not implemented for this CPU\n",
7075 pvInstance, oVft, cc, vtReturn, cActuals, prgvt, prgpvarg, pvargResult, V_VT(pvargResult));
7076 return E_NOTIMPL;
7077}
#define E_NOTIMPL
Definition: ddrawi.h:99
uint32_t cc
Definition: isohybrid.c:75
#define V_VT(A)
Definition: oleauto.h:211

Referenced by invoke_builtin_function(), ITypeInfo_fnInvoke(), and test_DispCallFunc().

◆ dump_DispParms()

static void dump_DispParms ( const DISPPARAMS *  pdp)
static

Definition at line 1552 of file typelib.c.

1553{
1554 unsigned int index;
1555
1556 TRACE("args=%u named args=%u\n", pdp->cArgs, pdp->cNamedArgs);
1557
1558 if (pdp->cNamedArgs && pdp->rgdispidNamedArgs)
1559 {
1560 TRACE("named args:\n");
1561 for (index = 0; index < pdp->cNamedArgs; index++)
1562 TRACE( "\t0x%x\n", pdp->rgdispidNamedArgs[index] );
1563 }
1564
1565 if (pdp->cArgs && pdp->rgvarg)
1566 {
1567 TRACE("args:\n");
1568 for (index = 0; index < pdp->cArgs; index++)
1569 TRACE(" [%d] %s\n", index, debugstr_variant(pdp->rgvarg+index));
1570 }
1571}
#define index(s, c)
Definition: various.h:29
GLuint index
Definition: glext.h:6031
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46

Referenced by ITypeInfo_fnInvoke().

◆ dump_ELEMDESC()

static void dump_ELEMDESC ( const ELEMDESC *  edesc)
static

Definition at line 1405 of file typelib.c.

1405 {
1406 char buf[200];
1407 USHORT flags = edesc->u.paramdesc.wParamFlags;
1408 dump_TypeDesc(&edesc->tdesc,buf);
1409 MESSAGE("\t\ttdesc.vartype %d (%s)\n",edesc->tdesc.vt,buf);
1410 MESSAGE("\t\tu.paramdesc.wParamFlags");
1411 if (!flags) MESSAGE(" PARAMFLAGS_NONE");
1412 if (flags & PARAMFLAG_FIN) MESSAGE(" PARAMFLAG_FIN");
1413 if (flags & PARAMFLAG_FOUT) MESSAGE(" PARAMFLAG_FOUT");
1414 if (flags & PARAMFLAG_FLCID) MESSAGE(" PARAMFLAG_FLCID");
1415 if (flags & PARAMFLAG_FRETVAL) MESSAGE(" PARAMFLAG_FRETVAL");
1416 if (flags & PARAMFLAG_FOPT) MESSAGE(" PARAMFLAG_FOPT");
1417 if (flags & PARAMFLAG_FHASDEFAULT) MESSAGE(" PARAMFLAG_FHASDEFAULT");
1418 if (flags & PARAMFLAG_FHASCUSTDATA) MESSAGE(" PARAMFLAG_FHASCUSTDATA");
1419 MESSAGE("\n\t\tu.paramdesc.lpex %p\n",edesc->u.paramdesc.pparamdescex);
1420}
static void dump_TypeDesc(const TYPEDESC *pTD, char *szVarType)
Definition: typelib.c:1356
GLbitfield flags
Definition: glext.h:7161
#define MESSAGE
Definition: options.h:86
unsigned short USHORT
Definition: pedump.c:61

Referenced by dump_FUNCDESC(), dump_VARDESC(), and TLB_AllocAndInitFuncDesc().

◆ dump_FUNCDESC()

static void dump_FUNCDESC ( const FUNCDESC *  funcdesc)
static

Definition at line 1421 of file typelib.c.

1421 {
1422 int i;
1423 MESSAGE("memid is %08x\n",funcdesc->memid);
1424 for (i=0;i<funcdesc->cParams;i++) {
1425 MESSAGE("Param %d:\n",i);
1426 dump_ELEMDESC(funcdesc->lprgelemdescParam+i);
1427 }
1428 MESSAGE("\tfunckind: %d (",funcdesc->funckind);
1429 switch (funcdesc->funckind) {
1430 case FUNC_VIRTUAL: MESSAGE("virtual");break;
1431 case FUNC_PUREVIRTUAL: MESSAGE("pure virtual");break;
1432 case FUNC_NONVIRTUAL: MESSAGE("nonvirtual");break;
1433 case FUNC_STATIC: MESSAGE("static");break;
1434 case FUNC_DISPATCH: MESSAGE("dispatch");break;
1435 default: MESSAGE("unknown");break;
1436 }
1437 MESSAGE(")\n\tinvkind: %d (",funcdesc->invkind);
1438 switch (funcdesc->invkind) {
1439 case INVOKE_FUNC: MESSAGE("func");break;
1440 case INVOKE_PROPERTYGET: MESSAGE("property get");break;
1441 case INVOKE_PROPERTYPUT: MESSAGE("property put");break;
1442 case INVOKE_PROPERTYPUTREF: MESSAGE("property put ref");break;
1443 }
1444 MESSAGE(")\n\tcallconv: %d (",funcdesc->callconv);
1445 switch (funcdesc->callconv) {
1446 case CC_CDECL: MESSAGE("cdecl");break;
1447 case CC_PASCAL: MESSAGE("pascal");break;
1448 case CC_STDCALL: MESSAGE("stdcall");break;
1449 case CC_SYSCALL: MESSAGE("syscall");break;
1450 default:break;
1451 }
1452 MESSAGE(")\n\toVft: %d\n", funcdesc->oVft);
1453 MESSAGE("\tcParamsOpt: %d\n", funcdesc->cParamsOpt);
1454 MESSAGE("\twFlags: %x\n", funcdesc->wFuncFlags);
1455
1456 MESSAGE("\telemdescFunc (return value type):\n");
1457 dump_ELEMDESC(&funcdesc->elemdescFunc);
1458}
static void dump_ELEMDESC(const ELEMDESC *edesc)
Definition: typelib.c:1405
@ CC_CDECL
Definition: spec2def.c:93
@ CC_STDCALL
Definition: spec2def.c:92

Referenced by dump_TLBFuncDescOne().

◆ dump_TLBFuncDesc()

static void dump_TLBFuncDesc ( const TLBFuncDesc pfd,
UINT  n 
)
static

Definition at line 1493 of file typelib.c.

1494{
1495 while (n)
1496 {
1498 ++pfd;
1499 --n;
1500 }
1501}
static void dump_TLBFuncDescOne(const TLBFuncDesc *pfd)
Definition: typelib.c:1473
GLdouble n
Definition: glext.h:7729
static PIXELFORMATDESCRIPTOR pfd
Definition: ssstars.c:67

Referenced by dump_TypeInfo(), SLTG_ProcessDispatch(), and SLTG_ProcessInterface().

◆ dump_TLBFuncDescOne()

static void dump_TLBFuncDescOne ( const TLBFuncDesc pfd)
static

Definition at line 1473 of file typelib.c.

1474{
1475 int i;
1476 MESSAGE("%s(%u)\n", debugstr_w(TLB_get_bstr(pfd->Name)), pfd->funcdesc.cParams);
1477 for (i=0;i<pfd->funcdesc.cParams;i++)
1478 MESSAGE("\tparm%d: %s\n",i,debugstr_w(TLB_get_bstr(pfd->pParamDesc[i].Name)));
1479
1480
1481 dump_FUNCDESC(&(pfd->funcdesc));
1482
1483 MESSAGE("\thelpstring: %s\n", debugstr_w(TLB_get_bstr(pfd->HelpString)));
1484 if(pfd->Entry == NULL)
1485 MESSAGE("\tentry: (null)\n");
1486 else if(pfd->Entry == (void*)-1)
1487 MESSAGE("\tentry: invalid\n");
1488 else if(IS_INTRESOURCE(pfd->Entry))
1489 MESSAGE("\tentry: %p\n", pfd->Entry);
1490 else
1491 MESSAGE("\tentry: %s\n", debugstr_w(TLB_get_bstr(pfd->Entry)));
1492}
static BSTR TLB_get_bstr(const TLBString *str)
Definition: typelib.c:1317
static void dump_FUNCDESC(const FUNCDESC *funcdesc)
Definition: typelib.c:1421
#define IS_INTRESOURCE(i)
Definition: winuser.h:580

Referenced by dump_TLBFuncDesc(), ITypeInfo_fnGetDllEntry(), and ITypeInfo_fnInvoke().

◆ dump_TLBImpLib()

static void dump_TLBImpLib ( const TLBImpLib import)
static

Definition at line 1512 of file typelib.c.

1513{
1514 TRACE_(typelib)("%s %s\n", debugstr_guid(TLB_get_guidref(import->guid)),
1515 debugstr_w(import->name));
1516 TRACE_(typelib)("v%d.%d lcid=%x offset=%x\n", import->wVersionMajor,
1517 import->wVersionMinor, import->lcid, import->offset);
1518}
static ITypeLib * typelib
Definition: apps.c:108
#define TRACE_(x)
Definition: compat.h:76
static const GUID * TLB_get_guidref(const TLBGuid *guid)
Definition: typelib.c:1329
#define debugstr_guid
Definition: kernel32.h:35
TLBGuid * guid
Definition: typelib.c:1080

Referenced by dump_TLBRefType().

◆ dump_TLBImplType()

static void dump_TLBImplType ( const TLBImplType impl,
UINT  n 
)
static

Definition at line 1540 of file typelib.c.

1541{
1542 if(!impl)
1543 return;
1544 while (n) {
1545 TRACE_(typelib)("implementing/inheriting interface hRef = %x implflags %x\n",
1546 impl->hRef, impl->implflags);
1547 ++impl;
1548 --n;
1549 }
1550}
HREFTYPE hRef
Definition: typelib.c:1234

Referenced by dump_TypeInfo().

◆ dump_TLBRefType()

static void dump_TLBRefType ( const ITypeLibImpl pTL)
static

Definition at line 1520 of file typelib.c.

1521{
1522 TLBRefType *ref;
1523
1525 {
1526 TRACE_(typelib)("href:0x%08x\n", ref->reference);
1527 if(ref->index == -1)
1529 else
1530 TRACE_(typelib)("type no: %d\n", ref->index);
1531
1532 if(ref->pImpTLInfo != TLB_REF_INTERNAL && ref->pImpTLInfo != TLB_REF_NOT_FOUND)
1533 {
1534 TRACE_(typelib)("in lib\n");
1535 dump_TLBImpLib(ref->pImpTLInfo);
1536 }
1537 }
1538}
static void dump_TLBImpLib(const TLBImpLib *import)
Definition: typelib.c:1512
#define TLB_REF_NOT_FOUND
Definition: typelib.c:1197
uint32_t entry
Definition: isohybrid.c:63
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198

Referenced by SLTG_DoRefs().

◆ dump_TLBVarDesc()

static void dump_TLBVarDesc ( const TLBVarDesc pvd,
UINT  n 
)
static

Definition at line 1502 of file typelib.c.

1503{
1504 while (n)
1505 {
1506 TRACE_(typelib)("%s\n", debugstr_w(TLB_get_bstr(pvd->Name)));
1507 ++pvd;
1508 --n;
1509 }
1510}
const TLBString * Name
Definition: typelib.c:1224

Referenced by dump_TypeInfo().

◆ dump_TypeDesc()

static void dump_TypeDesc ( const TYPEDESC *  pTD,
char szVarType 
)
static

Definition at line 1356 of file typelib.c.

1356 {
1357 if (pTD->vt & VT_RESERVED)
1358 szVarType += strlen(strcpy(szVarType, "reserved | "));
1359 if (pTD->vt & VT_BYREF)
1360 szVarType += strlen(strcpy(szVarType, "ref to "));
1361 if (pTD->vt & VT_ARRAY)
1362 szVarType += strlen(strcpy(szVarType, "array of "));
1363 if (pTD->vt & VT_VECTOR)
1364 szVarType += strlen(strcpy(szVarType, "vector of "));
1365 switch(pTD->vt & VT_TYPEMASK) {
1366 case VT_UI1: sprintf(szVarType, "VT_UI1"); break;
1367 case VT_I2: sprintf(szVarType, "VT_I2"); break;
1368 case VT_I4: sprintf(szVarType, "VT_I4"); break;
1369 case VT_R4: sprintf(szVarType, "VT_R4"); break;
1370 case VT_R8: sprintf(szVarType, "VT_R8"); break;
1371 case VT_BOOL: sprintf(szVarType, "VT_BOOL"); break;
1372 case VT_ERROR: sprintf(szVarType, "VT_ERROR"); break;
1373 case VT_CY: sprintf(szVarType, "VT_CY"); break;
1374 case VT_DATE: sprintf(szVarType, "VT_DATE"); break;
1375 case VT_BSTR: sprintf(szVarType, "VT_BSTR"); break;
1376 case VT_UNKNOWN: sprintf(szVarType, "VT_UNKNOWN"); break;
1377 case VT_DISPATCH: sprintf(szVarType, "VT_DISPATCH"); break;
1378 case VT_I1: sprintf(szVarType, "VT_I1"); break;
1379 case VT_UI2: sprintf(szVarType, "VT_UI2"); break;
1380 case VT_UI4: sprintf(szVarType, "VT_UI4"); break;
1381 case VT_INT: sprintf(szVarType, "VT_INT"); break;
1382 case VT_UINT: sprintf(szVarType, "VT_UINT"); break;
1383 case VT_VARIANT: sprintf(szVarType, "VT_VARIANT"); break;
1384 case VT_VOID: sprintf(szVarType, "VT_VOID"); break;
1385 case VT_HRESULT: sprintf(szVarType, "VT_HRESULT"); break;
1386 case VT_USERDEFINED: sprintf(szVarType, "VT_USERDEFINED ref = %x",
1387 pTD->u.hreftype); break;
1388 case VT_LPSTR: sprintf(szVarType, "VT_LPSTR"); break;
1389 case VT_LPWSTR: sprintf(szVarType, "VT_LPWSTR"); break;
1390 case VT_PTR: sprintf(szVarType, "ptr to ");
1391 dump_TypeDesc(pTD->u.lptdesc, szVarType + 7);
1392 break;
1393 case VT_SAFEARRAY: sprintf(szVarType, "safearray of ");
1394 dump_TypeDesc(pTD->u.lptdesc, szVarType + 13);
1395 break;
1396 case VT_CARRAY: sprintf(szVarType, "%d dim array of ",
1397 pTD->u.lpadesc->cDims); /* FIXME print out sizes */
1398 dump_TypeDesc(&pTD->u.lpadesc->tdescElem, szVarType + strlen(szVarType));
1399 break;
1400
1401 default: sprintf(szVarType, "unknown(%d)", pTD->vt & VT_TYPEMASK); break;
1402 }
1403}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
@ VT_BSTR
Definition: compat.h:2303
@ VT_VOID
Definition: compat.h:2318
@ VT_INT
Definition: compat.h:2316
@ VT_LPSTR
Definition: compat.h:2324
@ VT_R4
Definition: compat.h:2299
@ VT_UNKNOWN
Definition: compat.h:2308
@ VT_TYPEMASK
Definition: compat.h:2346
@ VT_RESERVED
Definition: compat.h:2343
@ VT_BYREF
Definition: compat.h:2342
@ VT_PTR
Definition: compat.h:2320
@ VT_UI2
Definition: compat.h:2312
@ VT_ERROR
Definition: compat.h:2305
@ VT_ARRAY
Definition: compat.h:2341
@ VT_SAFEARRAY
Definition: compat.h:2321
@ VT_LPWSTR
Definition: compat.h:2325
@ VT_R8
Definition: compat.h:2300
@ VT_CY
Definition: compat.h:2301
@ VT_VARIANT
Definition: compat.h:2307
@ VT_I1
Definition: compat.h:2310
@ VT_I4
Definition: compat.h:2298
@ VT_USERDEFINED
Definition: compat.h:2323
@ VT_HRESULT
Definition: compat.h:2319
@ VT_DATE
Definition: compat.h:2302
@ VT_BOOL
Definition: compat.h:2306
@ VT_I2
Definition: compat.h:2297
@ VT_UI4
Definition: compat.h:2313
@ VT_UINT
Definition: compat.h:2317
@ VT_CARRAY
Definition: compat.h:2322
@ VT_VECTOR
Definition: compat.h:2340
@ VT_DISPATCH
Definition: compat.h:2304
@ VT_UI1
Definition: compat.h:2311
#define sprintf(buf, format,...)
Definition: sprintf.c:55

Referenced by dump_ELEMDESC(), dump_TypeDesc(), and SLTG_DoVars().

◆ dump_TypeInfo()

static void dump_TypeInfo ( const ITypeInfoImpl pty)
static

Definition at line 1573 of file typelib.c.

1574{
1575 TRACE("%p ref=%u\n", pty, pty->ref);
1577 TRACE("attr:%s\n", debugstr_guid(TLB_get_guidref(pty->guid)));
1578 TRACE("kind:%s\n", typekind_desc[pty->typeattr.typekind]);
1579 TRACE("fct:%u var:%u impl:%u\n", pty->typeattr.cFuncs, pty->typeattr.cVars, pty->typeattr.cImplTypes);
1580 TRACE("wTypeFlags: 0x%04x\n", pty->typeattr.wTypeFlags);
1581 TRACE("parent tlb:%p index in TLB:%u\n",pty->pTypeLib, pty->index);
1582 if (pty->typeattr.typekind == TKIND_MODULE) TRACE("dllname:%s\n", debugstr_w(TLB_get_bstr(pty->DllName)));
1583 if (TRACE_ON(ole))
1584 dump_TLBFuncDesc(pty->funcdescs, pty->typeattr.cFuncs);
1585 dump_TLBVarDesc(pty->vardescs, pty->typeattr.cVars);
1586 dump_TLBImplType(pty->impltypes, pty->typeattr.cImplTypes);
1587}
#define TRACE_ON(x)
Definition: compat.h:75
static void dump_TLBVarDesc(const TLBVarDesc *pvd, UINT n)
Definition: typelib.c:1502
static void dump_TLBImplType(const TLBImplType *impl, UINT n)
Definition: typelib.c:1540
static const char *const typekind_desc[]
Definition: typelib.c:1460
static void dump_TLBFuncDesc(const TLBFuncDesc *pfd, UINT n)
Definition: typelib.c:1493
const TLBString * DocString
Definition: typelib.c:1260
const TLBString * DllName
Definition: typelib.c:1261
TLBVarDesc * vardescs
Definition: typelib.c:1270
@ TKIND_MODULE
Definition: widltypes.h:221

Referenced by CreateDispTypeInfo(), ITypeInfo_fnGetDllEntry(), ITypeInfo_fnGetRefTypeOfImplType(), MSFT_DoTypeInfo(), and SLTG_ProcessModule().

◆ dump_VARDESC()

static void dump_VARDESC ( const VARDESC *  v)
static

Definition at line 1589 of file typelib.c.

1590{
1591 MESSAGE("memid %d\n",v->memid);
1592 MESSAGE("lpstrSchema %s\n",debugstr_w(v->lpstrSchema));
1593 MESSAGE("oInst %d\n",v->u.oInst);
1594 dump_ELEMDESC(&(v->elemdescVar));
1595 MESSAGE("wVarFlags %x\n",v->wVarFlags);
1596 MESSAGE("varkind %d\n",v->varkind);
1597}
const GLdouble * v
Definition: gl.h:2040

Referenced by ITypeInfo_fnInvoke().

◆ find_ne_resource()

static BOOL find_ne_resource ( HFILE  lzfd,
LPCSTR  typeid,
LPCSTR  resid,
DWORD resLen,
DWORD resOff 
)
static

Definition at line 3049 of file typelib.c.

3051{
3052 IMAGE_OS2_HEADER nehd;
3053 NE_TYPEINFO *typeInfo;
3054 NE_NAMEINFO *nameInfo;
3055 DWORD nehdoffset;
3056 LPBYTE resTab;
3057 DWORD resTabSize;
3058 int count;
3059
3060 /* Read in NE header */
3061 nehdoffset = LZSeek( lzfd, 0, SEEK_CUR );
3062 if ( sizeof(nehd) != LZRead( lzfd, (LPSTR)&nehd, sizeof(nehd) ) ) return FALSE;
3063
3064 resTabSize = nehd.ne_restab - nehd.ne_rsrctab;
3065 if ( !resTabSize )
3066 {
3067 TRACE("No resources in NE dll\n" );
3068 return FALSE;
3069 }
3070
3071 /* Read in resource table */
3072 resTab = heap_alloc( resTabSize );
3073 if ( !resTab ) return FALSE;
3074
3075 LZSeek( lzfd, nehd.ne_rsrctab + nehdoffset, SEEK_SET );
3076 if ( resTabSize != LZRead( lzfd, (char*)resTab, resTabSize ) )
3077 {
3078 heap_free( resTab );
3079 return FALSE;
3080 }
3081
3082 /* Find resource */
3083 typeInfo = (NE_TYPEINFO *)(resTab + 2);
3084
3085 if (!IS_INTRESOURCE(typeid)) /* named type */
3086 {
3087 BYTE len = strlen( typeid );
3088 while (typeInfo->type_id)
3089 {
3090 if (!(typeInfo->type_id & 0x8000))
3091 {
3092 BYTE *p = resTab + typeInfo->type_id;
3093 if ((*p == len) && !_strnicmp( (char*)p+1, typeid, len )) goto found_type;
3094 }
3095 typeInfo = (NE_TYPEINFO *)((char *)(typeInfo + 1) +
3096 typeInfo->count * sizeof(NE_NAMEINFO));
3097 }
3098 }
3099 else /* numeric type id */
3100 {
3101 WORD id = LOWORD(typeid) | 0x8000;
3102 while (typeInfo->type_id)
3103 {
3104 if (typeInfo->type_id == id) goto found_type;
3105 typeInfo = (NE_TYPEINFO *)((char *)(typeInfo + 1) +
3106 typeInfo->count * sizeof(NE_NAMEINFO));
3107 }
3108 }
3109 TRACE("No typeid entry found for %p\n", typeid );
3110 heap_free( resTab );
3111 return FALSE;
3112
3113 found_type:
3114 nameInfo = (NE_NAMEINFO *)(typeInfo + 1);
3115
3116 if (!IS_INTRESOURCE(resid)) /* named resource */
3117 {
3118 BYTE len = strlen( resid );
3119 for (count = typeInfo->count; count > 0; count--, nameInfo++)
3120 {
3121 BYTE *p = resTab + nameInfo->id;
3122 if (nameInfo->id & 0x8000) continue;
3123 if ((*p == len) && !_strnicmp( (char*)p+1, resid, len )) goto found_name;
3124 }
3125 }
3126 else /* numeric resource id */
3127 {
3128 WORD id = LOWORD(resid) | 0x8000;
3129 for (count = typeInfo->count; count > 0; count--, nameInfo++)
3130 if (nameInfo->id == id) goto found_name;
3131 }
3132 TRACE("No resid entry found for %p\n", typeid );
3133 heap_free( resTab );
3134 return FALSE;
3135
3136 found_name:
3137 /* Return resource data */
3138 if ( resLen ) *resLen = nameInfo->length << *(WORD *)resTab;
3139 if ( resOff ) *resOff = nameInfo->offset << *(WORD *)resTab;
3140
3141 heap_free( resTab );
3142 return TRUE;
3143}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define _strnicmp(_String1, _String2, _MaxCount)
Definition: compat.h:23
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLenum GLsizei len
Definition: glext.h:6722
#define SEEK_SET
Definition: jmemansi.c:26
LONG WINAPI LZSeek(HFILE fd, LONG off, INT type)
Definition: lzexpand.c:431
INT WINAPI LZRead(HFILE fd, LPSTR vbuf, INT toread)
Definition: lzexpand.c:345
#define SEEK_CUR
Definition: util.h:63
#define LOWORD(l)
Definition: pedump.c:82
WORD offset
Definition: typelib.c:81
WORD length
Definition: typelib.c:82
WORD id
Definition: typelib.c:84
WORD type_id
Definition: typelib.c:91
WORD count
Definition: typelib.c:92
unsigned char * LPBYTE
Definition: typedefs.h:53
char * LPSTR
Definition: xmlstorage.h:182

Referenced by TLB_NEFile_Open().

◆ find_typelib_key()

static BOOL find_typelib_key ( REFGUID  guid,
WORD wMaj,
WORD wMin 
)
static

Definition at line 172 of file typelib.c.

173{
174 static const WCHAR typelibW[] = {'T','y','p','e','l','i','b','\\',0};
175 WCHAR buffer[60];
176 char key_name[16];
177 DWORD len, i;
178 INT best_maj = -1, best_min = -1;
179 HKEY hkey;
180
181 memcpy( buffer, typelibW, sizeof(typelibW) );
183
185 return FALSE;
186
187 len = sizeof(key_name);
188 i = 0;
189 while (RegEnumKeyExA(hkey, i++, key_name, &len, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
190 {
191 INT v_maj, v_min;
192
193 if (sscanf(key_name, "%x.%x", &v_maj, &v_min) == 2)
194 {
195 TRACE("found %s: %x.%x\n", debugstr_w(buffer), v_maj, v_min);
196
197 if (*wMaj == 0xffff && *wMin == 0xffff)
198 {
199 if (v_maj > best_maj) best_maj = v_maj;
200 if (v_min > best_min) best_min = v_min;
201 }
202 else if (*wMaj == v_maj)
203 {
204 best_maj = v_maj;
205
206 if (*wMin == v_min)
207 {
208 best_min = v_min;
209 break; /* exact match */
210 }
211 if (*wMin != 0xffff && v_min > best_min) best_min = v_min;
212 }
213 }
214 len = sizeof(key_name);
215 }
216 RegCloseKey( hkey );
217
218 TRACE("found best_maj %d, best_min %d\n", best_maj, best_min);
219
220 if (*wMaj == 0xffff && *wMin == 0xffff)
221 {
222 if (best_maj >= 0 && best_min >= 0)
223 {
224 *wMaj = best_maj;
225 *wMin = best_min;
226 return TRUE;
227 }
228 }
229
230 if (*wMaj == best_maj && best_min >= 0)
231 {
232 *wMin = best_min;
233 return TRUE;
234 }
235 return FALSE;
236}
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3362
LONG WINAPI RegEnumKeyExA(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2448
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2434
GLuint buffer
Definition: glext.h:5915
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
const GUID * guid
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define KEY_READ
Definition: nt_native.h:1023
static const WCHAR typelibW[]
Definition: actctx.c:632
int32_t INT
Definition: typedefs.h:58
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10

Referenced by query_typelib_path().

◆ func_restricted()

static BOOL func_restricted ( const FUNCDESC *  desc)
inlinestatic

Definition at line 7268 of file typelib.c.

7269{
7270 return (desc->wFuncFlags & FUNCFLAG_FRESTRICTED) && (desc->memid >= 0);
7271}
static const WCHAR desc[]
Definition: protectdata.c:36

Referenced by ITypeInfo_fnInvoke().

◆ get_iface_guid()

static HRESULT get_iface_guid ( ITypeInfo tinfo,
HREFTYPE  href,
GUID guid 
)
static

Definition at line 7215 of file typelib.c.

7216{
7217 ITypeInfo *tinfo2;
7218 TYPEATTR *tattr;
7219 HRESULT hres;
7220 int flags, i;
7221
7222 hres = ITypeInfo_GetRefTypeInfo(tinfo, href, &tinfo2);
7223 if(FAILED(hres))
7224 return hres;
7225
7226 hres = ITypeInfo_GetTypeAttr(tinfo2, &tattr);
7227 if(FAILED(hres)) {
7228 ITypeInfo_Release(tinfo2);
7229 return hres;
7230 }
7231
7232 switch(tattr->typekind) {
7233 case TKIND_ALIAS:
7234 hres = get_iface_guid(tinfo2, tattr->tdescAlias.u.hreftype, guid);
7235 break;
7236
7237 case TKIND_INTERFACE:
7238 case TKIND_DISPATCH:
7239 *guid = tattr->guid;
7240 break;
7241
7242 case TKIND_COCLASS:
7243 for (i = 0; i < tattr->cImplTypes; i++)
7244 {
7245 ITypeInfo_GetImplTypeFlags(tinfo2, i, &flags);
7246 if (flags & IMPLTYPEFLAG_FDEFAULT)
7247 break;
7248 }
7249
7250 if (i == tattr->cImplTypes)
7251 i = 0;
7252
7253 hres = ITypeInfo_GetRefTypeOfImplType(tinfo2, i, &href);
7254 if (SUCCEEDED(hres))
7255 hres = get_iface_guid(tinfo2, href, guid);
7256 break;
7257
7258 default:
7259 ERR("Unexpected typekind %d\n", tattr->typekind);
7261 }
7262
7263 ITypeInfo_ReleaseTypeAttr(tinfo2, tattr);
7264 ITypeInfo_Release(tinfo2);
7265 return hres;
7266}
#define ERR(fmt,...)
Definition: debug.h:110
static HRESULT get_iface_guid(ITypeInfo *tinfo, HREFTYPE href, GUID *guid)
Definition: typelib.c:7215
#define FAILED(hr)
Definition: intsafe.h:51
@ TKIND_ALIAS
Definition: widltypes.h:225
@ TKIND_DISPATCH
Definition: widltypes.h:223
#define E_UNEXPECTED
Definition: winerror.h:2456

Referenced by get_iface_guid(), and ITypeInfo_fnInvoke().

◆ get_interface_key()

static WCHAR * get_interface_key ( REFGUID  guid,
WCHAR buffer 
)
static

Definition at line 253 of file typelib.c.

254{
255 static const WCHAR InterfaceW[] = {'I','n','t','e','r','f','a','c','e','\\',0};
256
257 memcpy( buffer, InterfaceW, sizeof(InterfaceW) );
259 return buffer;
260}

Referenced by TLB_register_interface(), and TLB_unregister_interface().

◆ get_lcid_subkey()

static WCHAR * get_lcid_subkey ( LCID  lcid,
SYSKIND  syskind,
WCHAR buffer 
)
static

Definition at line 264 of file typelib.c.

265{
266 static const WCHAR LcidFormatW[] = {'%','l','x','\\',0};
267 static const WCHAR win16W[] = {'w','i','n','1','6',0};
268 static const WCHAR win32W[] = {'w','i','n','3','2',0};
269 static const WCHAR win64W[] = {'w','i','n','6','4',0};
270
271 swprintf( buffer, LcidFormatW, lcid );
272 switch(syskind)
273 {
274 case SYS_WIN16: lstrcatW( buffer, win16W ); break;
275 case SYS_WIN32: lstrcatW( buffer, win32W ); break;
276 case SYS_WIN64: lstrcatW( buffer, win64W ); break;
277 default:
278 TRACE("Typelib is for unsupported syskind %i\n", syskind);
279 return NULL;
280 }
281 return buffer;
282}
static const WCHAR win32W[]
Definition: cache.c:44
#define swprintf
Definition: precomp.h:40
@ SYS_WIN16
Definition: widltypes.h:551
@ SYS_WIN32
Definition: widltypes.h:552
@ SYS_WIN64
Definition: widltypes.h:554

Referenced by query_typelib_path(), RegisterTypeLib(), and UnRegisterTypeLib().

◆ get_ptr_size()

static int get_ptr_size ( SYSKIND  syskind)
static

Definition at line 1339 of file typelib.c.

1340{
1341 switch(syskind){
1342 case SYS_WIN64:
1343 return 8;
1344 case SYS_WIN32:
1345 case SYS_MAC:
1346 case SYS_WIN16:
1347 return 4;
1348 }
1349 WARN("Unhandled syskind: 0x%x\n", syskind);
1350 return 4;
1351}
#define WARN(fmt,...)
Definition: debug.h:112
@ SYS_MAC
Definition: widltypes.h:553

Referenced by CreateTypeLib2(), ITypeLib2_Constructor_MSFT(), SLTG_ReadLibBlk(), and TLB_size_instance().

◆ get_typelib_key()

static WCHAR * get_typelib_key ( REFGUID  guid,
WORD  wMaj,
WORD  wMin,
WCHAR buffer 
)
static

Definition at line 240 of file typelib.c.

241{
242 static const WCHAR TypelibW[] = {'T','y','p','e','l','i','b','\\',0};
243 static const WCHAR VersionFormatW[] = {'\\','%','x','.','%','x',0};
244
245 memcpy( buffer, TypelibW, sizeof(TypelibW) );
247 swprintf( buffer + lstrlenW(buffer), VersionFormatW, wMaj, wMin );
248 return buffer;
249}

Referenced by query_typelib_path(), RegisterTypeLib(), and UnRegisterTypeLib().

◆ hash_guid()

static int hash_guid ( GUID guid)
inlinestatic

Definition at line 9426 of file typelib.c.

9427{
9428 int i, hash = 0;
9429
9430 for (i = 0; i < 8; i ++)
9431 hash ^= ((const short *)guid)[i];
9432
9433 return hash & 0x1f;
9434}
Definition: _hash_fun.h:40

Referenced by WMSFT_compile_guids().

◆ ICreateTypeInfo2_fnAddFuncDesc()

static HRESULT WINAPI ICreateTypeInfo2_fnAddFuncDesc ( ICreateTypeInfo2 iface,
UINT  index,
FUNCDESC *  funcDesc 
)
static

Definition at line 10811 of file typelib.c.

10813{
10815 TLBFuncDesc tmp_func_desc, *func_desc;
10816 int buf_size, i;
10817 char *buffer;
10818 HRESULT hres;
10819
10820 TRACE("%p %u %p\n", This, index, funcDesc);
10821
10822 if (!funcDesc || funcDesc->oVft & 3)
10823 return E_INVALIDARG;
10824
10825 switch (This->typeattr.typekind) {
10826 case TKIND_MODULE:
10827 if (funcDesc->funckind != FUNC_STATIC)
10828 return TYPE_E_BADMODULEKIND;
10829 break;
10830 case TKIND_DISPATCH:
10831 if (funcDesc->funckind != FUNC_DISPATCH)
10832 return TYPE_E_BADMODULEKIND;
10833 break;
10834 default:
10835 if (funcDesc->funckind != FUNC_PUREVIRTUAL)
10836 return TYPE_E_BADMODULEKIND;
10837 }
10838
10839 if (index > This->typeattr.cFuncs)
10841
10842 if (funcDesc->invkind & (INVOKE_PROPERTYPUT | INVOKE_PROPERTYPUTREF) &&
10843 !funcDesc->cParams)
10845
10846#ifdef _WIN64
10847 if(This->pTypeLib->syskind == SYS_WIN64 &&
10848 funcDesc->oVft % 8 != 0)
10849 return E_INVALIDARG;
10850#endif
10851
10852 memset(&tmp_func_desc, 0, sizeof(tmp_func_desc));
10853 TLBFuncDesc_Constructor(&tmp_func_desc);
10854
10855 tmp_func_desc.funcdesc = *funcDesc;
10856
10857 if (tmp_func_desc.funcdesc.oVft != 0)
10858 tmp_func_desc.funcdesc.oVft |= 1;
10859
10860 if (funcDesc->cScodes && funcDesc->lprgscode) {
10861 tmp_func_desc.funcdesc.lprgscode = heap_alloc(sizeof(SCODE) * funcDesc->cScodes);
10862 memcpy(tmp_func_desc.funcdesc.lprgscode, funcDesc->lprgscode, sizeof(SCODE) * funcDesc->cScodes);
10863 } else {
10864 tmp_func_desc.funcdesc.lprgscode = NULL;
10865 tmp_func_desc.funcdesc.cScodes = 0;
10866 }
10867
10868 buf_size = TLB_SizeElemDesc(&funcDesc->elemdescFunc);
10869 for (i = 0; i < funcDesc->cParams; ++i) {
10870 buf_size += sizeof(ELEMDESC);
10871 buf_size += TLB_SizeElemDesc(funcDesc->lprgelemdescParam + i);
10872 }
10873 tmp_func_desc.funcdesc.lprgelemdescParam = heap_alloc(buf_size);
10874 buffer = (char*)(tmp_func_desc.funcdesc.lprgelemdescParam + funcDesc->cParams);
10875
10876 hres = TLB_CopyElemDesc(&funcDesc->elemdescFunc, &tmp_func_desc.funcdesc.elemdescFunc, &buffer);
10877 if (FAILED(hres)) {
10878 heap_free(tmp_func_desc.funcdesc.lprgelemdescParam);
10879 heap_free(tmp_func_desc.funcdesc.lprgscode);
10880 return hres;
10881 }
10882
10883 for (i = 0; i < funcDesc->cParams; ++i) {
10884 hres = TLB_CopyElemDesc(funcDesc->lprgelemdescParam + i,
10885 tmp_func_desc.funcdesc.lprgelemdescParam + i, &buffer);
10886 if (FAILED(hres)) {
10887 heap_free(tmp_func_desc.funcdesc.lprgelemdescParam);
10888 heap_free(tmp_func_desc.funcdesc.lprgscode);
10889 return hres;
10890 }
10891 if (tmp_func_desc.funcdesc.lprgelemdescParam[i].u.paramdesc.wParamFlags & PARAMFLAG_FHASDEFAULT &&
10892 tmp_func_desc.funcdesc.lprgelemdescParam[i].tdesc.vt != VT_VARIANT &&
10893 tmp_func_desc.funcdesc.lprgelemdescParam[i].tdesc.vt != VT_USERDEFINED){
10894 hres = TLB_SanitizeVariant(&tmp_func_desc.funcdesc.lprgelemdescParam[i].u.paramdesc.pparamdescex->varDefaultValue);
10895 if (FAILED(hres)) {
10896 heap_free(tmp_func_desc.funcdesc.lprgelemdescParam);
10897 heap_free(tmp_func_desc.funcdesc.lprgscode);
10898 return hres;
10899 }
10900 }
10901 }
10902
10903 tmp_func_desc.pParamDesc = TLBParDesc_Constructor(funcDesc->cParams);
10904
10905 if (This->funcdescs) {
10906 This->funcdescs = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->funcdescs,
10907 sizeof(TLBFuncDesc) * (This->typeattr.cFuncs + 1));
10908
10909 if (index < This->typeattr.cFuncs) {
10910 memmove(This->funcdescs + index + 1, This->funcdescs + index,
10911 (This->typeattr.cFuncs - index) * sizeof(TLBFuncDesc));
10912 func_desc = This->funcdescs + index;
10913 } else
10914 func_desc = This->funcdescs + This->typeattr.cFuncs;
10915
10916 /* move custdata lists to the new memory location */
10917 for(i = 0; i < This->typeattr.cFuncs + 1; ++i){
10918 if(index != i){
10919 TLBFuncDesc *fd = &This->funcdescs[i];
10920 if(fd->custdata_list.prev == fd->custdata_list.next)
10921 list_init(&fd->custdata_list);
10922 else{
10923 fd->custdata_list.prev->next = &fd->custdata_list;
10924 fd->custdata_list.next->prev = &fd->custdata_list;
10925 }
10926 }
10927 }
10928 } else
10929 func_desc = This->funcdescs = heap_alloc(sizeof(TLBFuncDesc));
10930
10931 memcpy(func_desc, &tmp_func_desc, sizeof(tmp_func_desc));
10932 list_init(&func_desc->custdata_list);
10933
10934 ++This->typeattr.cFuncs;
10935
10936 This->needs_layout = TRUE;
10937
10938 return S_OK;
10939}
#define HeapReAlloc
Definition: compat.h:734
LONG SCODE
Definition: compat.h:2252
static ITypeInfoImpl * info_impl_from_ICreateTypeInfo2(ICreateTypeInfo2 *iface)
Definition: typelib.c:1294
static void TLBFuncDesc_Constructor(TLBFuncDesc *func_desc)
Definition: typelib.c:1786
static SIZE_T TLB_SizeElemDesc(const ELEMDESC *elemdesc)
Definition: typelib.c:5816
static HRESULT TLB_CopyElemDesc(const ELEMDESC *src, ELEMDESC *dest, char **buffer)
Definition: typelib.c:5824
static HRESULT TLB_SanitizeVariant(VARIANT *var)
Definition: typelib.c:5853
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
static int fd
Definition: io.c:51
#define memset(x, y, z)
Definition: compat.h:39
#define TYPE_E_BADMODULEKIND
Definition: winerror.h:2544
#define TYPE_E_ELEMENTNOTFOUND
Definition: winerror.h:2539
#define TYPE_E_INCONSISTENTPROPFUNCS
Definition: winerror.h:2553

◆ ICreateTypeInfo2_fnAddImplType()

static HRESULT WINAPI ICreateTypeInfo2_fnAddImplType ( ICreateTypeInfo2 iface,
UINT  index,
HREFTYPE  refType 
)
static

Definition at line 10941 of file typelib.c.

10943{
10945 TLBImplType *impl_type;
10946 HRESULT hres;
10947
10948 TRACE("%p %u %d\n", This, index, refType);
10949
10950 switch(This->typeattr.typekind){
10951 case TKIND_COCLASS: {
10952 if (index == -1) {
10953 FIXME("Unhandled index: -1\n");
10954 return E_NOTIMPL;
10955 }
10956
10957 if(index != This->typeattr.cImplTypes)
10959
10960 break;
10961 }
10962 case TKIND_INTERFACE:
10963 case TKIND_DISPATCH:
10964 if (index != 0 || This->typeattr.cImplTypes)
10966 break;
10967 default:
10968 FIXME("Unimplemented typekind: %d\n", This->typeattr.typekind);
10969 return E_NOTIMPL;
10970 }
10971
10972 if (This->impltypes){
10973 UINT i;
10974
10975 This->impltypes = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->impltypes,
10976 sizeof(TLBImplType) * (This->typeattr.cImplTypes + 1));
10977
10978 if (index < This->typeattr.cImplTypes) {
10979 memmove(This->impltypes + index + 1, This->impltypes + index,
10980 (This->typeattr.cImplTypes - index) * sizeof(TLBImplType));
10981 impl_type = This->impltypes + index;
10982 } else
10983 impl_type = This->impltypes + This->typeattr.cImplTypes;
10984
10985 /* move custdata lists to the new memory location */
10986 for(i = 0; i < This->typeattr.cImplTypes + 1; ++i){
10987 if(index != i){
10988 TLBImplType *it = &This->impltypes[i];
10989 if(it->custdata_list.prev == it->custdata_list.next)
10991 else{
10992 it->custdata_list.prev->next = &it->custdata_list;
10993 it->custdata_list.next->prev = &it->custdata_list;
10994 }
10995 }
10996 }
10997 } else
10998 impl_type = This->impltypes = heap_alloc(sizeof(TLBImplType));
10999
11000 memset(impl_type, 0, sizeof(TLBImplType));
11001 TLBImplType_Constructor(impl_type);
11002 impl_type->hRef = refType;
11003
11004 ++This->typeattr.cImplTypes;
11005
11006 if((refType & (~0x3)) == (This->pTypeLib->dispatch_href & (~0x3)))
11007 This->typeattr.wTypeFlags |= TYPEFLAG_FDISPATCHABLE;
11008
11009 hres = ICreateTypeInfo2_LayOut(iface);
11010 if (FAILED(hres))
11011 return hres;
11012
11013 return S_OK;
11014}
static void TLBImplType_Constructor(TLBImplType *impl)
Definition: typelib.c:1807
unsigned int UINT
Definition: ndis.h:50
struct list custdata_list
Definition: typelib.c:1236

◆ ICreateTypeInfo2_fnAddRef()

static ULONG WINAPI ICreateTypeInfo2_fnAddRef ( ICreateTypeInfo2 iface)
static

Definition at line 10594 of file typelib.c.

10595{
10597
10598 return ITypeInfo2_AddRef(&This->ITypeInfo2_iface);
10599}

◆ ICreateTypeInfo2_fnAddRefTypeInfo()

static HRESULT WINAPI ICreateTypeInfo2_fnAddRefTypeInfo ( ICreateTypeInfo2 iface,
ITypeInfo typeInfo,
HREFTYPE *  refType 
)
static

Definition at line 10703 of file typelib.c.

10705{
10707 UINT index;
10709 TLBRefType *ref_type;
10710 TLBImpLib *implib;
10711 TYPEATTR *typeattr;
10712 TLIBATTR *libattr;
10713 HRESULT hres;
10714
10715 TRACE("%p %p %p\n", This, typeInfo, refType);
10716
10717 if (!typeInfo || !refType)
10718 return E_INVALIDARG;
10719
10720 hres = ITypeInfo_GetContainingTypeLib(typeInfo, &container, &index);
10721 if (FAILED(hres))
10722 return hres;
10723
10724 if (container == (ITypeLib*)&This->pTypeLib->ITypeLib2_iface) {
10726
10727 ITypeLib_Release(container);
10728
10729 *refType = target->hreftype;
10730
10731 return S_OK;
10732 }
10733
10734 hres = ITypeLib_GetLibAttr(container, &libattr);
10735 if (FAILED(hres)) {
10736 ITypeLib_Release(container);
10737 return hres;
10738 }
10739
10740 LIST_FOR_EACH_ENTRY(implib, &This->pTypeLib->implib_list, TLBImpLib, entry){
10741 if(IsEqualGUID(&implib->guid->guid, &libattr->guid) &&
10742 implib->lcid == libattr->lcid &&
10743 implib->wVersionMajor == libattr->wMajorVerNum &&
10744 implib->wVersionMinor == libattr->wMinorVerNum)
10745 break;
10746 }
10747
10748 if(&implib->entry == &This->pTypeLib->implib_list){
10749 implib = heap_alloc_zero(sizeof(TLBImpLib));
10750
10751 if((ITypeLib2Vtbl*)container->lpVtbl == &tlbvt){
10752 const ITypeLibImpl *our_container = impl_from_ITypeLib2((ITypeLib2*)container);
10753 implib->name = SysAllocString(our_container->path);
10754 }else{
10755 hres = QueryPathOfRegTypeLib(&libattr->guid, libattr->wMajorVerNum,
10756 libattr->wMinorVerNum, libattr->lcid, &implib->name);
10757 if(FAILED(hres)){
10758 implib->name = NULL;
10759 TRACE("QueryPathOfRegTypeLib failed, no name stored: %08x\n", hres);
10760 }
10761 }
10762
10763 implib->guid = TLB_append_guid(&This->pTypeLib->guid_list, &libattr->guid, 2);
10764 implib->lcid = libattr->lcid;
10765 implib->wVersionMajor = libattr->wMajorVerNum;
10766 implib->wVersionMinor = libattr->wMinorVerNum;
10767
10768 list_add_tail(&This->pTypeLib->implib_list, &implib->entry);
10769 }
10770
10771 ITypeLib_ReleaseTLibAttr(container, libattr);
10772 ITypeLib_Release(container);
10773
10774 hres = ITypeInfo_GetTypeAttr(typeInfo, &typeattr);
10775 if (FAILED(hres))
10776 return hres;
10777
10778 index = 0;
10779 LIST_FOR_EACH_ENTRY(ref_type, &This->pTypeLib->ref_list, TLBRefType, entry){
10780 if(ref_type->index == TLB_REF_USE_GUID &&
10781 IsEqualGUID(&ref_type->guid->guid, &typeattr->guid) &&
10782 ref_type->tkind == typeattr->typekind)
10783 break;
10784 ++index;
10785 }
10786
10787 if(&ref_type->entry == &This->pTypeLib->ref_list){
10788 ref_type = heap_alloc_zero(sizeof(TLBRefType));
10789
10790 ref_type->tkind = typeattr->typekind;
10791 ref_type->pImpTLInfo = implib;
10792 ref_type->reference = index * sizeof(MSFT_ImpInfo);
10793
10794 ref_type->index = TLB_REF_USE_GUID;
10795
10796 ref_type->guid = TLB_append_guid(&This->pTypeLib->guid_list, &typeattr->guid, ref_type->reference+1);
10797
10798 list_add_tail(&This->pTypeLib->ref_list, &ref_type->entry);
10799 }
10800
10801 ITypeInfo_ReleaseTypeAttr(typeInfo, typeattr);
10802
10803 *refType = ref_type->reference | 0x1;
10804
10805 if(IsEqualGUID(&ref_type->guid->guid, &IID_IDispatch))
10806 This->pTypeLib->dispatch_href = *refType;
10807
10808 return S_OK;
10809}
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static TLBGuid * TLB_append_guid(struct list *guid_list, const GUID *new_guid, HREFTYPE hreftype)
Definition: typelib.c:1828
HRESULT WINAPI QueryPathOfRegTypeLib(REFGUID guid, WORD wMaj, WORD wMin, LCID lcid, LPBSTR path)
Definition: typelib.c:406
#define TLB_REF_USE_GUID
Definition: typelib.c:1194
static ITypeLibImpl * impl_from_ITypeLib2(ITypeLib2 *iface)
Definition: typelib.c:1149
static const ITypeLib2Vtbl tlbvt
Definition: typelib.c:1145
static ITypeInfoImpl * impl_from_ITypeInfo(ITypeInfo *iface)
Definition: typelib.c:1289
struct tagMSFT_ImpInfo MSFT_ImpInfo
GLenum target
Definition: glext.h:7315
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
const GUID IID_IDispatch
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
WCHAR * path
Definition: typelib.c:1141
GUID guid
Definition: typelib.c:1060
WORD wVersionMinor
Definition: typelib.c:1086
WORD wVersionMajor
Definition: typelib.c:1085
struct list entry
Definition: typelib.c:1090
TLBGuid * guid
Definition: typelib.c:1183
HREFTYPE reference
Definition: typelib.c:1186
TLBImpLib * pImpTLInfo
Definition: typelib.c:1187
TYPEKIND tkind
Definition: typelib.c:1182
struct list entry
Definition: typelib.c:1191

◆ ICreateTypeInfo2_fnAddVarDesc()

static HRESULT WINAPI ICreateTypeInfo2_fnAddVarDesc ( ICreateTypeInfo2 iface,
UINT  index,
VARDESC *  varDesc 
)
static

Definition at line 11064 of file typelib.c.

11066{
11068 TLBVarDesc *var_desc;
11069
11070 TRACE("%p %u %p\n", This, index, varDesc);
11071
11072 if (This->vardescs){
11073 UINT i;
11074
11075 This->vardescs = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->vardescs,
11076 sizeof(TLBVarDesc) * (This->typeattr.cVars + 1));
11077
11078 if (index < This->typeattr.cVars) {
11079 memmove(This->vardescs + index + 1, This->vardescs + index,
11080 (This->typeattr.cVars - index) * sizeof(TLBVarDesc));
11081 var_desc = This->vardescs + index;
11082 } else
11083 var_desc = This->vardescs + This->typeattr.cVars;
11084
11085 /* move custdata lists to the new memory location */
11086 for(i = 0; i < This->typeattr.cVars + 1; ++i){
11087 if(index != i){
11088 TLBVarDesc *var = &This->vardescs[i];
11089 if(var->custdata_list.prev == var->custdata_list.next)
11090 list_init(&var->custdata_list);
11091 else{
11092 var->custdata_list.prev->next = &var->custdata_list;
11093 var->custdata_list.next->prev = &var->custdata_list;
11094 }
11095 }
11096 }
11097 } else
11098 var_desc = This->vardescs = heap_alloc_zero(sizeof(TLBVarDesc));
11099
11100 TLBVarDesc_Constructor(var_desc);
11101 TLB_AllocAndInitVarDesc(varDesc, &var_desc->vardesc_create);
11102 var_desc->vardesc = *var_desc->vardesc_create;
11103
11104 ++This->typeattr.cVars;
11105
11106 This->needs_layout = TRUE;
11107
11108 return S_OK;
11109}
static void TLBVarDesc_Constructor(TLBVarDesc *var_desc)
Definition: typelib.c:1749
static HRESULT TLB_AllocAndInitVarDesc(const VARDESC *src, VARDESC **dest_ptr)
Definition: typelib.c:6110
const char * var
Definition: shader.c:5666
VARDESC * vardesc_create
Definition: typelib.c:1223
VARDESC vardesc
Definition: typelib.c:1222

◆ ICreateTypeInfo2_fnDefineFuncAsDllEntry()

static HRESULT WINAPI ICreateTypeInfo2_fnDefineFuncAsDllEntry ( ICreateTypeInfo2 iface,
UINT  index,
LPOLESTR  dllName,
LPOLESTR  procName 
)
static

Definition at line 11196 of file typelib.c.

11198{
11200 FIXME("%p %u %s %s - stub\n", This, index, wine_dbgstr_w(dllName), wine_dbgstr_w(procName));
11201 return E_NOTIMPL;
11202}
#define wine_dbgstr_w
Definition: kernel32.h:34

◆ ICreateTypeInfo2_fnDeleteFuncDesc()

static HRESULT WINAPI ICreateTypeInfo2_fnDeleteFuncDesc ( ICreateTypeInfo2 iface,
UINT  index 
)
static

Definition at line 11441 of file typelib.c.

11443{
11445 FIXME("%p %u - stub\n", This, index);
11446 return E_NOTIMPL;
11447}

◆ ICreateTypeInfo2_fnDeleteFuncDescByMemId()

static HRESULT WINAPI ICreateTypeInfo2_fnDeleteFuncDescByMemId ( ICreateTypeInfo2 iface,
MEMBERID  memid,
INVOKEKIND  invKind 
)
static

Definition at line 11449 of file typelib.c.

11451{
11453 FIXME("%p %x %d - stub\n", This, memid, invKind);
11454 return E_NOTIMPL;
11455}

◆ ICreateTypeInfo2_fnDeleteImplType()

static HRESULT WINAPI ICreateTypeInfo2_fnDeleteImplType ( ICreateTypeInfo2 iface,
UINT  index 
)
static

Definition at line 11473 of file typelib.c.

11475{
11477 FIXME("%p %u - stub\n", This, index);
11478 return E_NOTIMPL;
11479}

◆ ICreateTypeInfo2_fnDeleteVarDesc()

static HRESULT WINAPI ICreateTypeInfo2_fnDeleteVarDesc ( ICreateTypeInfo2 iface,
UINT  index 
)
static

Definition at line 11457 of file typelib.c.

11459{
11461 FIXME("%p %u - stub\n", This, index);
11462 return E_NOTIMPL;
11463}

◆ ICreateTypeInfo2_fnDeleteVarDescByMemId()

static HRESULT WINAPI ICreateTypeInfo2_fnDeleteVarDescByMemId ( ICreateTypeInfo2 iface,
MEMBERID  memid 
)
static

Definition at line 11465 of file typelib.c.

11467{
11469 FIXME("%p %x - stub\n", This, memid);
11470 return E_NOTIMPL;
11471}

◆ ICreateTypeInfo2_fnInvalidate()

static HRESULT WINAPI ICreateTypeInfo2_fnInvalidate ( ICreateTypeInfo2 iface)
static

Definition at line 11558 of file typelib.c.

11559{
11561 FIXME("%p - stub\n", This);
11562 return E_NOTIMPL;
11563}

◆ ICreateTypeInfo2_fnLayOut()

static HRESULT WINAPI ICreateTypeInfo2_fnLayOut ( ICreateTypeInfo2 iface)
static

Definition at line 11298 of file typelib.c.

11299{
11301 ITypeInfo *tinfo;
11302 TLBFuncDesc *func_desc;
11303 UINT user_vft = 0, i, depth = 0;
11304 HRESULT hres = S_OK;
11305
11306 TRACE("%p\n", This);
11307
11308 This->needs_layout = FALSE;
11309
11310 hres = ICreateTypeInfo2_QueryInterface(iface, &IID_ITypeInfo, (LPVOID*)&tinfo);
11311 if (FAILED(hres))
11312 return hres;
11313
11314 if (This->typeattr.typekind == TKIND_INTERFACE) {
11315 ITypeInfo *inh;
11316 TYPEATTR *attr;
11317 HREFTYPE inh_href;
11318
11319 hres = ITypeInfo_GetRefTypeOfImplType(tinfo, 0, &inh_href);
11320
11321 if (SUCCEEDED(hres)) {
11322 hres = ITypeInfo_GetRefTypeInfo(tinfo, inh_href, &inh);
11323
11324 if (SUCCEEDED(hres)) {
11325 hres = ITypeInfo_GetTypeAttr(inh, &attr);
11326 if (FAILED(hres)) {
11327 ITypeInfo_Release(inh);
11328 ITypeInfo_Release(tinfo);
11329 return hres;
11330 }
11331 This->typeattr.cbSizeVft = attr->cbSizeVft;
11332 ITypeInfo_ReleaseTypeAttr(inh, attr);
11333
11334 do{
11335 ++depth;
11336 hres = ITypeInfo_GetRefTypeOfImplType(inh, 0, &inh_href);
11337 if(SUCCEEDED(hres)){
11338 ITypeInfo *next;
11339 hres = ITypeInfo_GetRefTypeInfo(inh, inh_href, &next);
11340 if(SUCCEEDED(hres)){
11341 ITypeInfo_Release(inh);
11342 inh = next;
11343 }
11344 }
11345 }while(SUCCEEDED(hres));
11346 hres = S_OK;
11347
11348 ITypeInfo_Release(inh);
11349 } else if (hres == TYPE_E_ELEMENTNOTFOUND) {
11350 This->typeattr.cbSizeVft = 0;
11351 hres = S_OK;
11352 } else {
11353 ITypeInfo_Release(tinfo);
11354 return hres;
11355 }
11356 } else if (hres == TYPE_E_ELEMENTNOTFOUND) {
11357 This->typeattr.cbSizeVft = 0;
11358 hres = S_OK;
11359 } else {
11360 ITypeInfo_Release(tinfo);
11361 return hres;
11362 }
11363 } else if (This->typeattr.typekind == TKIND_DISPATCH)
11364 This->typeattr.cbSizeVft = 7 * This->pTypeLib->ptr_size;
11365 else
11366 This->typeattr.cbSizeVft = 0;
11367
11368 func_desc = This->funcdescs;
11369 i = 0;
11370 while (i < This->typeattr.cFuncs) {
11371 if (!(func_desc->funcdesc.oVft & 0x1))
11372 func_desc->funcdesc.oVft = This->typeattr.cbSizeVft;
11373
11374 if ((func_desc->funcdesc.oVft & 0xFFFC) > user_vft)
11375 user_vft = func_desc->funcdesc.oVft & 0xFFFC;
11376
11377 This->typeattr.cbSizeVft += This->pTypeLib->ptr_size;
11378
11379 if (func_desc->funcdesc.memid == MEMBERID_NIL) {
11380 TLBFuncDesc *iter;
11381 UINT j = 0;
11382 BOOL reset = FALSE;
11383
11384 func_desc->funcdesc.memid = 0x60000000 + (depth << 16) + i;
11385
11386 iter = This->funcdescs;
11387 while (j < This->typeattr.cFuncs) {
11388 if (iter != func_desc && iter->funcdesc.memid == func_desc->funcdesc.memid) {
11389 if (!reset) {
11390 func_desc->funcdesc.memid = 0x60000000 + (depth << 16) + This->typeattr.cFuncs;
11391 reset = TRUE;
11392 } else
11393 ++func_desc->funcdesc.memid;
11394 iter = This->funcdescs;
11395 j = 0;
11396 } else {
11397 ++iter;
11398 ++j;
11399 }
11400 }
11401 }
11402
11403 ++func_desc;
11404 ++i;
11405 }
11406
11407 if (user_vft > This->typeattr.cbSizeVft)
11408 This->typeattr.cbSizeVft = user_vft + This->pTypeLib->ptr_size;
11409
11410 for(i = 0; i < This->typeattr.cVars; ++i){
11411 TLBVarDesc *var_desc = &This->vardescs[i];
11412 if(var_desc->vardesc.memid == MEMBERID_NIL){
11413 UINT j = 0;
11414 BOOL reset = FALSE;
11415 TLBVarDesc *iter;
11416
11417 var_desc->vardesc.memid = 0x40000000 + (depth << 16) + i;
11418
11419 iter = This->vardescs;
11420 while (j < This->typeattr.cVars) {
11421 if (iter != var_desc && iter->vardesc.memid == var_desc->vardesc.memid) {
11422 if (!reset) {
11423 var_desc->vardesc.memid = 0x40000000 + (depth << 16) + This->typeattr.cVars;
11424 reset = TRUE;
11425 } else
11426 ++var_desc->vardesc.memid;
11427 iter = This->vardescs;
11428 j = 0;
11429 } else {
11430 ++iter;
11431 ++j;
11432 }
11433 }
11434 }
11435 }
11436
11437 ITypeInfo_Release(tinfo);
11438 return hres;
11439}
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
GLboolean reset
Definition: glext.h:5666
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define MEMBERID_NIL
Definition: oleauto.h:1003
static unsigned __int64 next
Definition: rand_nt.c:6
Definition: cookie.c:202

◆ ICreateTypeInfo2_fnQueryInterface()

static HRESULT WINAPI ICreateTypeInfo2_fnQueryInterface ( ICreateTypeInfo2 iface,
REFIID  riid,
void **  object 
)
static

Definition at line 10586 of file typelib.c.

10588{
10590
10591 return ITypeInfo2_QueryInterface(&This->ITypeInfo2_iface, riid, object);
10592}
REFIID riid
Definition: atlbase.h:39

◆ ICreateTypeInfo2_fnRelease()

static ULONG WINAPI ICreateTypeInfo2_fnRelease ( ICreateTypeInfo2 iface)
static

Definition at line 10601 of file typelib.c.

10602{
10604
10605 return ITypeInfo2_Release(&This->ITypeInfo2_iface);
10606}

◆ ICreateTypeInfo2_fnSetAlignment()

static HRESULT WINAPI ICreateTypeInfo2_fnSetAlignment ( ICreateTypeInfo2 iface,
WORD  alignment 
)
static

Definition at line 11035 of file typelib.c.

11037{
11039
11040 TRACE("%p %d\n", This, alignment);
11041
11042 This->typeattr.cbAlignment = alignment;
11043
11044 return S_OK;
11045}

◆ ICreateTypeInfo2_fnSetCustData()

static HRESULT WINAPI ICreateTypeInfo2_fnSetCustData ( ICreateTypeInfo2 iface,
REFGUID  guid,
VARIANT varVal 
)
static

Definition at line 11481 of file typelib.c.

11483{
11484 TLBGuid *tlbguid;
11485
11487
11488 TRACE("%p %s %p\n", This, debugstr_guid(guid), varVal);
11489
11490 if (!guid || !varVal)
11491 return E_INVALIDARG;
11492
11493 tlbguid = TLB_append_guid(&This->pTypeLib->guid_list, guid, -1);
11494
11495 return TLB_set_custdata(This->pcustdata_list, tlbguid, varVal);
11496}
static HRESULT TLB_set_custdata(struct list *custdata_list, TLBGuid *tlbguid, VARIANT *var)
Definition: typelib.c:1850

◆ ICreateTypeInfo2_fnSetDocString()

static HRESULT WINAPI ICreateTypeInfo2_fnSetDocString ( ICreateTypeInfo2 iface,
LPOLESTR  doc 
)
static

Definition at line 10663 of file typelib.c.

10665{
10667
10668 TRACE("%p %s\n", This, wine_dbgstr_w(doc));
10669
10670 if (!doc)
10671 return E_INVALIDARG;
10672
10673 This->DocString = TLB_append_str(&This->pTypeLib->string_list, doc);
10674
10675 return S_OK;
10676}

◆ ICreateTypeInfo2_fnSetFuncAndParamNames()

static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncAndParamNames ( ICreateTypeInfo2 iface,
UINT  index,
LPOLESTR names,
UINT  numNames 
)
static

Definition at line 11111 of file typelib.c.

11113{
11115 TLBFuncDesc *func_desc = &This->funcdescs[index];
11116 int i;
11117
11118 TRACE("%p %u %p %u\n", This, index, names, numNames);
11119
11120 if (!names)
11121 return E_INVALIDARG;
11122
11123 if (index >= This->typeattr.cFuncs || numNames == 0)
11125
11126 if (func_desc->funcdesc.invkind & (INVOKE_PROPERTYPUT | INVOKE_PROPERTYPUTREF)){
11127 if(numNames > func_desc->funcdesc.cParams)
11129 } else
11130 if(numNames > func_desc->funcdesc.cParams + 1)
11132
11133 for(i = 0; i < This->typeattr.cFuncs; ++i) {
11134 TLBFuncDesc *iter = &This->funcdescs[i];
11135 if (iter->Name && !wcscmp(TLB_get_bstr(iter->Name), *names)) {
11136 if (iter->funcdesc.invkind & (INVOKE_PROPERTYPUT | INVOKE_PROPERTYPUTREF | INVOKE_PROPERTYGET) &&
11137 func_desc->funcdesc.invkind & (INVOKE_PROPERTYPUT | INVOKE_PROPERTYPUTREF | INVOKE_PROPERTYGET) &&
11138 func_desc->funcdesc.invkind != iter->funcdesc.invkind)
11139 continue;
11140 return TYPE_E_AMBIGUOUSNAME;
11141 }
11142 }
11143
11144 func_desc->Name = TLB_append_str(&This->pTypeLib->name_list, *names);
11145
11146 for (i = 1; i < numNames; ++i) {
11147 TLBParDesc *par_desc = func_desc->pParamDesc + i - 1;
11148 par_desc->Name = TLB_append_str(&This->pTypeLib->name_list, *(names + i));
11149 }
11150
11151 return S_OK;
11152}
GLuint GLuint * names
Definition: glext.h:11545
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define TYPE_E_AMBIGUOUSNAME
Definition: winerror.h:2540

◆ ICreateTypeInfo2_fnSetFuncCustData()

static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncCustData ( ICreateTypeInfo2 iface,
UINT  index,
REFGUID  guid,
VARIANT varVal 
)
static

Definition at line 11498 of file typelib.c.

11500{
11502 FIXME("%p %u %s %p - stub\n", This, index, debugstr_guid(guid), varVal);
11503 return E_NOTIMPL;
11504}

◆ ICreateTypeInfo2_fnSetFuncDocString()

static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncDocString ( ICreateTypeInfo2 iface,
UINT  index,
LPOLESTR  docString 
)
static

Definition at line 11204 of file typelib.c.

11206{
11208 TLBFuncDesc *func_desc = &This->funcdescs[index];
11209
11210 TRACE("%p %u %s\n", This, index, wine_dbgstr_w(docString));
11211
11212 if(!docString)
11213 return E_INVALIDARG;
11214
11215 if(index >= This->typeattr.cFuncs)
11217
11218 func_desc->HelpString = TLB_append_str(&This->pTypeLib->string_list, docString);
11219
11220 return S_OK;
11221}

◆ ICreateTypeInfo2_fnSetFuncHelpContext()

static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncHelpContext ( ICreateTypeInfo2 iface,
UINT  index,
DWORD  helpContext 
)
static

Definition at line 11242 of file typelib.c.

11244{
11246 TLBFuncDesc *func_desc = &This->funcdescs[index];
11247
11248 TRACE("%p %u %d\n", This, index, helpContext);
11249
11250 if(index >= This->typeattr.cFuncs)
11252
11253 func_desc->helpcontext = helpContext;
11254
11255 return S_OK;
11256}

◆ ICreateTypeInfo2_fnSetFuncHelpStringContext()

static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncHelpStringContext ( ICreateTypeInfo2 iface,
UINT  index,
ULONG  helpStringContext 
)
static

Definition at line 11542 of file typelib.c.

11544{
11546 FIXME("%p %u %u - stub\n", This, index, helpStringContext);
11547 return E_NOTIMPL;
11548}

◆ ICreateTypeInfo2_fnSetGuid()

static HRESULT WINAPI ICreateTypeInfo2_fnSetGuid ( ICreateTypeInfo2 iface,
REFGUID  guid 
)
static

Definition at line 10608 of file typelib.c.

10610{
10612
10613 TRACE("%p %s\n", This, debugstr_guid(guid));
10614
10615 This->guid = TLB_append_guid(&This->pTypeLib->guid_list, guid, This->hreftype);
10616
10617 return S_OK;
10618}

◆ ICreateTypeInfo2_fnSetHelpContext()

static HRESULT WINAPI ICreateTypeInfo2_fnSetHelpContext ( ICreateTypeInfo2 iface,
DWORD  helpContext 
)
static

Definition at line 10678 of file typelib.c.

10680{
10682
10683 TRACE("%p %d\n", This, helpContext);
10684
10685 This->dwHelpContext = helpContext;
10686
10687 return S_OK;
10688}

◆ ICreateTypeInfo2_fnSetHelpStringContext()

static HRESULT WINAPI ICreateTypeInfo2_fnSetHelpStringContext ( ICreateTypeInfo2 iface,
ULONG  helpStringContext 
)
static

Definition at line 11530 of file typelib.c.

11532{
11534
11535 TRACE("%p %u\n", This, helpStringContext);
11536
11537 This->dwHelpStringContext = helpStringContext;
11538
11539 return S_OK;
11540}

◆ ICreateTypeInfo2_fnSetImplTypeCustData()

static HRESULT WINAPI ICreateTypeInfo2_fnSetImplTypeCustData ( ICreateTypeInfo2 iface,
UINT  index,
REFGUID  guid,
VARIANT varVal 
)
static

Definition at line 11522 of file typelib.c.

11524{
11526 FIXME("%p %u %s %p - stub\n", This, index, debugstr_guid(guid), varVal);
11527 return E_NOTIMPL;
11528}

◆ ICreateTypeInfo2_fnSetImplTypeFlags()

static HRESULT WINAPI ICreateTypeInfo2_fnSetImplTypeFlags ( ICreateTypeInfo2 iface,
UINT  index,
INT  implTypeFlags 
)
static

Definition at line 11016 of file typelib.c.

11018{
11020 TLBImplType *impl_type = &This->impltypes[index];
11021
11022 TRACE("%p %u %x\n", This, index, implTypeFlags);
11023
11024 if (This->typeattr.typekind != TKIND_COCLASS)
11025 return TYPE_E_BADMODULEKIND;
11026
11027 if (index >= This->typeattr.cImplTypes)
11029
11030 impl_type->implflags = implTypeFlags;
11031
11032 return S_OK;
11033}

◆ ICreateTypeInfo2_fnSetMops()

static HRESULT WINAPI ICreateTypeInfo2_fnSetMops ( ICreateTypeInfo2 iface,
UINT  index,
BSTR  bstrMops 
)
static

Definition at line 11274 of file typelib.c.

11276{
11278 FIXME("%p %u %s - stub\n", This, index, wine_dbgstr_w(bstrMops));
11279 return E_NOTIMPL;
11280}

◆ ICreateTypeInfo2_fnSetName()

static HRESULT WINAPI ICreateTypeInfo2_fnSetName ( ICreateTypeInfo2 iface,
LPOLESTR  name 
)
static

Definition at line 11565 of file typelib.c.

11567{
11569
11570 TRACE("%p %s\n", This, wine_dbgstr_w(name));
11571
11572 if (!name)
11573 return E_INVALIDARG;
11574
11575 This->Name = TLB_append_str(&This->pTypeLib->name_list, name);
11576
11577 return S_OK;
11578}
Definition: name.c:39

◆ ICreateTypeInfo2_fnSetParamCustData()

static HRESULT WINAPI ICreateTypeInfo2_fnSetParamCustData ( ICreateTypeInfo2 iface,
UINT  funcIndex,
UINT  paramIndex,
REFGUID  guid,
VARIANT varVal 
)
static

Definition at line 11506 of file typelib.c.

11508{
11510 FIXME("%p %u %u %s %p - stub\n", This, funcIndex, paramIndex, debugstr_guid(guid), varVal);
11511 return E_NOTIMPL;
11512}

◆ ICreateTypeInfo2_fnSetSchema()

static HRESULT WINAPI ICreateTypeInfo2_fnSetSchema ( ICreateTypeInfo2 iface,
LPOLESTR  schema 
)
static

Definition at line 11047 of file typelib.c.

11049{
11051
11052 TRACE("%p %s\n", This, wine_dbgstr_w(schema));
11053
11054 if (!schema)
11055 return E_INVALIDARG;
11056
11057 This->Schema = TLB_append_str(&This->pTypeLib->string_list, schema);
11058
11059 This->typeattr.lpstrSchema = This->Schema->str;
11060
11061 return S_OK;
11062}
const WCHAR * schema

◆ ICreateTypeInfo2_fnSetTypeDescAlias()

static HRESULT WINAPI ICreateTypeInfo2_fnSetTypeDescAlias ( ICreateTypeInfo2 iface,
TYPEDESC *  tdescAlias 
)
static

Definition at line 11171 of file typelib.c.

11173{
11175 HRESULT hr;
11176
11177 TRACE("%p %p\n", This, tdescAlias);
11178
11179 if(!tdescAlias)
11180 return E_INVALIDARG;
11181
11182 if(This->typeattr.typekind != TKIND_ALIAS)
11183 return TYPE_E_BADMODULEKIND;
11184
11185 hr = TLB_size_instance(This, This->pTypeLib->syskind, tdescAlias, &This->typeattr.cbSizeInstance, &This->typeattr.cbAlignment);
11186 if(FAILED(hr))
11187 return hr;
11188
11189 heap_free(This->tdescAlias);
11190 This->tdescAlias = heap_alloc(TLB_SizeTypeDesc(tdescAlias, TRUE));
11191 TLB_CopyTypeDesc(NULL, tdescAlias, This->tdescAlias);
11192
11193 return S_OK;
11194}
static SIZE_T TLB_SizeTypeDesc(const TYPEDESC *tdesc, BOOL alloc_initial_space)
Definition: typelib.c:1619
static HRESULT TLB_size_instance(ITypeInfoImpl *info, SYSKIND sys, TYPEDESC *tdesc, ULONG *size, WORD *align)
Definition: typelib.c:1939
static void * TLB_CopyTypeDesc(TYPEDESC *dest, const TYPEDESC *src, void *buffer)
Definition: typelib.c:1641
HRESULT hr
Definition: shlfolder.c:183

◆ ICreateTypeInfo2_fnSetTypeFlags()

static HRESULT WINAPI ICreateTypeInfo2_fnSetTypeFlags ( ICreateTypeInfo2 iface,
UINT  typeFlags 
)
static

Definition at line 10620 of file typelib.c.

10622{
10624 WORD old_flags;
10625 HRESULT hres;
10626
10627 TRACE("%p %x\n", This, typeFlags);
10628
10629 if (typeFlags & TYPEFLAG_FDUAL) {
10630 static const WCHAR stdole2tlb[] = { 's','t','d','o','l','e','2','.','t','l','b',0 };
10633 HREFTYPE hreftype;
10634 HRESULT hres;
10635
10636 hres = LoadTypeLib(stdole2tlb, &stdole);
10637 if(FAILED(hres))
10638 return hres;
10639
10640 hres = ITypeLib_GetTypeInfoOfGuid(stdole, &IID_IDispatch, &dispatch);
10641 ITypeLib_Release(stdole);
10642 if(FAILED(hres))
10643 return hres;
10644
10645 hres = ICreateTypeInfo2_AddRefTypeInfo(iface, dispatch, &hreftype);
10646 ITypeInfo_Release(dispatch);
10647 if(FAILED(hres))
10648 return hres;
10649 }
10650
10651 old_flags = This->typeattr.wTypeFlags;
10652 This->typeattr.wTypeFlags = typeFlags;
10653
10654 hres = ICreateTypeInfo2_LayOut(iface);
10655 if (FAILED(hres)) {
10656 This->typeattr.wTypeFlags = old_flags;
10657 return hres;
10658 }
10659
10660 return S_OK;
10661}
void dispatch(HANDLE hStopEvent)
Definition: dispatch.c:70
HRESULT WINAPI LoadTypeLib(const OLECHAR *szFile, ITypeLib **pptLib)
Definition: typelib.c:458

◆ ICreateTypeInfo2_fnSetTypeIdldesc()

static HRESULT WINAPI ICreateTypeInfo2_fnSetTypeIdldesc ( ICreateTypeInfo2 iface,
IDLDESC *  idlDesc 
)
static

Definition at line 11282 of file typelib.c.

11284{
11286
11287 TRACE("%p %p\n", This, idlDesc);
11288
11289 if (!idlDesc)
11290 return E_INVALIDARG;
11291
11292 This->typeattr.idldescType.dwReserved = idlDesc->dwReserved;
11293 This->typeattr.idldescType.wIDLFlags = idlDesc->wIDLFlags;
11294
11295 return S_OK;
11296}

◆ ICreateTypeInfo2_fnSetVarCustData()

static HRESULT WINAPI ICreateTypeInfo2_fnSetVarCustData ( ICreateTypeInfo2 iface,
UINT  index,
REFGUID  guid,
VARIANT varVal 
)
static

Definition at line 11514 of file typelib.c.

11516{
11518 FIXME("%p %u %s %p - stub\n", This, index, debugstr_guid(guid), varVal);
11519 return E_NOTIMPL;
11520}

◆ ICreateTypeInfo2_fnSetVarDocString()

static HRESULT WINAPI ICreateTypeInfo2_fnSetVarDocString ( ICreateTypeInfo2 iface,
UINT  index,
LPOLESTR  docString 
)
static

Definition at line 11223 of file typelib.c.

11225{
11227 TLBVarDesc *var_desc = &This->vardescs[index];
11228
11229 TRACE("%p %u %s\n", This, index, wine_dbgstr_w(docString));
11230
11231 if(!docString)
11232 return E_INVALIDARG;
11233
11234 if(index >= This->typeattr.cVars)
11236
11237 var_desc->HelpString = TLB_append_str(&This->pTypeLib->string_list, docString);
11238
11239 return S_OK;
11240}
const TLBString * HelpString
Definition: typelib.c:1227

◆ ICreateTypeInfo2_fnSetVarHelpContext()

static HRESULT WINAPI ICreateTypeInfo2_fnSetVarHelpContext ( ICreateTypeInfo2 iface,
UINT  index,
DWORD  helpContext 
)
static

Definition at line 11258 of file typelib.c.

11260{
11262 TLBVarDesc *var_desc = &This->vardescs[index];
11263
11264 TRACE("%p %u %d\n", This, index, helpContext);
11265
11266 if(index >= This->typeattr.cVars)
11268
11269 var_desc->HelpContext = helpContext;
11270
11271 return S_OK;
11272}
int HelpContext
Definition: typelib.c:1225

◆ ICreateTypeInfo2_fnSetVarHelpStringContext()

static HRESULT WINAPI ICreateTypeInfo2_fnSetVarHelpStringContext ( ICreateTypeInfo2 iface,
UINT  index,
ULONG  helpStringContext 
)
static

Definition at line 11550 of file typelib.c.

11552{
11554 FIXME("%p %u %u - stub\n", This, index, helpStringContext);
11555 return E_NOTIMPL;
11556}

◆ ICreateTypeInfo2_fnSetVarName()

static HRESULT WINAPI ICreateTypeInfo2_fnSetVarName ( ICreateTypeInfo2 iface,
UINT  index,
LPOLESTR  name 
)
static

Definition at line 11154 of file typelib.c.

11156{
11158
11159 TRACE("%p %u %s\n", This, index, wine_dbgstr_w(name));
11160
11161 if(!name)
11162 return E_INVALIDARG;
11163
11164 if(index >= This->typeattr.cVars)
11166
11167 This->vardescs[index].Name = TLB_append_str(&This->pTypeLib->name_list, name);
11168 return S_OK;
11169}

◆ ICreateTypeInfo2_fnSetVersion()

static HRESULT WINAPI ICreateTypeInfo2_fnSetVersion ( ICreateTypeInfo2 iface,
WORD  majorVerNum,
WORD  minorVerNum 
)
static

Definition at line 10690 of file typelib.c.

10692{
10694
10695 TRACE("%p %d %d\n", This, majorVerNum, minorVerNum);
10696
10697 This->typeattr.wMajorVerNum = majorVerNum;
10698 This->typeattr.wMinorVerNum = minorVerNum;
10699
10700 return S_OK;
10701}

◆ ICreateTypeLib2_fnAddRef()

static ULONG WINAPI ICreateTypeLib2_fnAddRef ( ICreateTypeLib2 iface)
static

Definition at line 9081 of file typelib.c.

9082{
9084
9085 return ITypeLib2_AddRef(&This->ITypeLib2_iface);
9086}
static ITypeLibImpl * impl_from_ICreateTypeLib2(ICreateTypeLib2 *iface)
Definition: typelib.c:1164

◆ ICreateTypeLib2_fnCreateTypeInfo()

static HRESULT WINAPI ICreateTypeLib2_fnCreateTypeInfo ( ICreateTypeLib2 iface,
LPOLESTR  name,
TYPEKIND  kind,
ICreateTypeInfo **  ctinfo 
)
static

Definition at line 9095 of file typelib.c.

9097{
9100 HRESULT hres;
9101
9102 TRACE("%p %s %d %p\n", This, wine_dbgstr_w(name), kind, ctinfo);
9103
9104 if (!ctinfo || !name)
9105 return E_INVALIDARG;
9106
9107 info = TLB_get_typeinfo_by_name(This->typeinfos, This->TypeInfoCount, name);
9108 if (info)
9109 return TYPE_E_NAMECONFLICT;
9110
9111 if (This->typeinfos)
9112 This->typeinfos = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->typeinfos,
9113 sizeof(ITypeInfoImpl*) * (This->TypeInfoCount + 1));
9114 else
9115 This->typeinfos = heap_alloc_zero(sizeof(ITypeInfoImpl*));
9116
9117 info = This->typeinfos[This->TypeInfoCount] = ITypeInfoImpl_Constructor();
9118
9119 info->pTypeLib = This;
9120 info->Name = TLB_append_str(&This->name_list, name);
9121 info->index = This->TypeInfoCount;
9122 info->typeattr.typekind = kind;
9123 info->typeattr.cbAlignment = 4;
9124
9125 switch (info->typeattr.typekind) {
9126 case TKIND_ENUM:
9127 case TKIND_INTERFACE:
9128 case TKIND_DISPATCH:
9129 case TKIND_COCLASS:
9130 info->typeattr.cbSizeInstance = This->ptr_size;
9131 break;
9132 case TKIND_RECORD:
9133 case TKIND_UNION:
9134 info->typeattr.cbSizeInstance = 0;
9135 break;
9136 case TKIND_MODULE:
9137 info->typeattr.cbSizeInstance = 2;
9138 break;
9139 case TKIND_ALIAS:
9140 info->typeattr.cbSizeInstance = -0x75;
9141 break;
9142 default:
9143 FIXME("unrecognized typekind %d\n", info->typeattr.typekind);
9144 info->typeattr.cbSizeInstance = 0xdeadbeef;
9145 break;
9146 }
9147
9148 hres = ITypeInfo2_QueryInterface(&info->ITypeInfo2_iface,
9149 &IID_ICreateTypeInfo, (void **)ctinfo);
9150 if (FAILED(hres)) {
9151 ITypeInfo2_Release(&info->ITypeInfo2_iface);
9152 return hres;
9153 }
9154
9155 info->hreftype = info->index * sizeof(MSFT_TypeInfoBase);
9156
9157 ++This->TypeInfoCount;
9158
9159 return S_OK;
9160}
static ITypeInfoImpl * TLB_get_typeinfo_by_name(ITypeInfoImpl **typeinfos, UINT n, const OLECHAR *name)
Definition: typelib.c:1737
unsigned int index
Definition: notification.c:65
@ TKIND_RECORD
Definition: widltypes.h:220
@ TKIND_ENUM
Definition: widltypes.h:219
@ TKIND_UNION
Definition: widltypes.h:226
#define TYPE_E_NAMECONFLICT
Definition: winerror.h:2541

◆ ICreateTypeLib2_fnDeleteTypeInfo()

static HRESULT WINAPI ICreateTypeLib2_fnDeleteTypeInfo ( ICreateTypeLib2 iface,
LPOLESTR  name 
)
static

Definition at line 10520 of file typelib.c.

10522{
10524 FIXME("%p %s - stub\n", This, wine_dbgstr_w(name));
10525 return E_NOTIMPL;
10526}

◆ ICreateTypeLib2_fnQueryInterface()

static HRESULT WINAPI ICreateTypeLib2_fnQueryInterface ( ICreateTypeLib2 iface,
REFIID  riid,
void **  object 
)
static

Definition at line 9073 of file typelib.c.

9075{
9077
9078 return ITypeLib2_QueryInterface(&This->ITypeLib2_iface, riid, object);
9079}

◆ ICreateTypeLib2_fnRelease()

static ULONG WINAPI ICreateTypeLib2_fnRelease ( ICreateTypeLib2 iface)
static

Definition at line 9088 of file typelib.c.

9089{
9091
9092 return ITypeLib2_Release(&This->ITypeLib2_iface);
9093}

◆ ICreateTypeLib2_fnSaveAllChanges()

static HRESULT WINAPI ICreateTypeLib2_fnSaveAllChanges ( ICreateTypeLib2 iface)
static

Definition at line 10306 of file typelib.c.

10307{
10310 DWORD written, junk_size, junk_offs, running_offset;
10311 BOOL br;
10313 HRESULT hres;
10314 DWORD *junk;
10315 UINT i;
10316
10317 TRACE("%p\n", This);
10318
10319 for(i = 0; i < This->TypeInfoCount; ++i)
10320 if(This->typeinfos[i]->needs_layout)
10321 ICreateTypeInfo2_LayOut(&This->typeinfos[i]->ICreateTypeInfo2_iface);
10322
10323 memset(&file, 0, sizeof(file));
10324
10325 file.header.magic1 = 0x5446534D;
10326 file.header.magic2 = 0x00010002;
10327 file.header.lcid = This->set_lcid ? This->set_lcid : MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US);
10328 file.header.lcid2 = This->set_lcid;
10329 file.header.varflags = 0x40 | This->syskind;
10330 if (This->HelpFile)
10331 file.header.varflags |= 0x10;
10332 if (This->HelpStringDll)
10333 file.header.varflags |= HELPDLLFLAG;
10334 file.header.version = (This->ver_minor << 16) | This->ver_major;
10335 file.header.flags = This->libflags;
10336 file.header.helpstringcontext = 0; /* TODO - SetHelpStringContext not implemented yet */
10337 file.header.helpcontext = This->dwHelpContext;
10338 file.header.res44 = 0x20;
10339 file.header.res48 = 0x80;
10340 file.header.dispatchpos = This->dispatch_href;
10341
10343 /* do name and string compilation to get offsets for other compilations */
10345 if (FAILED(hres)){
10347 return hres;
10348 }
10349
10351 if (FAILED(hres)){
10353 return hres;
10354 }
10355
10358 if (FAILED(hres)){
10360 return hres;
10361 }
10362
10363 if(This->HelpFile)
10364 file.header.helpfile = This->HelpFile->offset;
10365 else
10366 file.header.helpfile = -1;
10367
10368 if(This->DocString)
10369 file.header.helpstring = This->DocString->offset;
10370 else
10371 file.header.helpstring = -1;
10372
10373 /* do some more segment compilation */
10374 file.header.nimpinfos = list_count(&This->ref_list);
10375 file.header.nrtypeinfos = This->TypeInfoCount;
10376
10377 if(This->Name)
10378 file.header.NameOffset = This->Name->offset;
10379 else
10380 file.header.NameOffset = -1;
10381
10382 file.header.CustomDataOffset = WMSFT_compile_custdata(&This->custdata_list, &file);
10383
10384 if(This->guid)
10385 file.header.posguid = This->guid->offset;
10386 else
10387 file.header.posguid = -1;
10388
10389 junk_size = file.header.nrtypeinfos * sizeof(DWORD);
10390 if(file.header.varflags & HELPDLLFLAG)
10391 junk_size += sizeof(DWORD);
10392 if(junk_size){
10393 junk = heap_alloc_zero(junk_size);
10394 if(file.header.varflags & HELPDLLFLAG){
10395 *junk = This->HelpStringDll->offset;
10396 junk_offs = 1;
10397 }else
10398 junk_offs = 0;
10399 }else{
10400 junk = NULL;
10401 junk_offs = 0;
10402 }
10403
10404 WMSFT_compile_typeinfo_seg(This, &file, junk + junk_offs);
10406
10407 running_offset = 0;
10408
10409 TRACE("header at: 0x%x\n", running_offset);
10410 running_offset += sizeof(file.header);
10411
10412 TRACE("junk at: 0x%x\n", running_offset);
10413 running_offset += junk_size;
10414
10415 TRACE("segdir at: 0x%x\n", running_offset);
10416 running_offset += sizeof(file.segdir);
10417
10418 TRACE("typeinfo at: 0x%x\n", running_offset);
10419 tmp_fill_segdir_seg(&file.segdir.pTypeInfoTab, &file.typeinfo_seg, &running_offset);
10420
10421 TRACE("guidhashtab at: 0x%x\n", running_offset);
10422 tmp_fill_segdir_seg(&file.segdir.pGuidHashTab, &file.guidhash_seg, &running_offset);
10423
10424 TRACE("guidtab at: 0x%x\n", running_offset);
10425 tmp_fill_segdir_seg(&file.segdir.pGuidTab, &file.guid_seg, &running_offset);
10426
10427 TRACE("reftab at: 0x%x\n", running_offset);
10428 tmp_fill_segdir_seg(&file.segdir.pRefTab, &file.ref_seg, &running_offset);
10429
10430 TRACE("impinfo at: 0x%x\n", running_offset);
10431 tmp_fill_segdir_seg(&file.segdir.pImpInfo, &file.impinfo_seg, &running_offset);
10432
10433 TRACE("impfiles at: 0x%x\n", running_offset);
10434 tmp_fill_segdir_seg(&file.segdir.pImpFiles, &file.impfile_seg, &running_offset);
10435
10436 TRACE("namehashtab at: 0x%x\n", running_offset);
10437 tmp_fill_segdir_seg(&file.segdir.pNameHashTab, &file.namehash_seg, &running_offset);
10438
10439 TRACE("nametab at: 0x%x\n", running_offset);
10440 tmp_fill_segdir_seg(&file.segdir.pNametab, &file.name_seg, &running_offset);
10441
10442 TRACE("stringtab at: 0x%x\n", running_offset);
10443 tmp_fill_segdir_seg(&file.segdir.pStringtab, &file.string_seg, &running_offset);
10444
10445 TRACE("typdesc at: 0x%x\n", running_offset);
10446 tmp_fill_segdir_seg(&file.segdir.pTypdescTab, &file.typdesc_seg, &running_offset);
10447
10448 TRACE("arraydescriptions at: 0x%x\n", running_offset);
10449 tmp_fill_segdir_seg(&file.segdir.pArrayDescriptions, &file.arraydesc_seg, &running_offset);
10450
10451 TRACE("custdata at: 0x%x\n", running_offset);
10452 tmp_fill_segdir_seg(&file.segdir.pCustData, &file.custdata_seg, &running_offset);
10453
10454 TRACE("cdguids at: 0x%x\n", running_offset);
10455 tmp_fill_segdir_seg(&file.segdir.pCDGuids, &file.cdguids_seg, &running_offset);
10456
10457 TRACE("res0e at: 0x%x\n", running_offset);
10458 tmp_fill_segdir_seg(&file.segdir.res0e, NULL, &running_offset);
10459
10460 TRACE("res0f at: 0x%x\n", running_offset);
10461 tmp_fill_segdir_seg(&file.segdir.res0f, NULL, &running_offset);
10462
10463 TRACE("aux_seg at: 0x%x\n", running_offset);
10464
10465 WMSFT_fixup_typeinfos(This, &file, running_offset);
10466
10471 heap_free(junk);
10472 return TYPE_E_IOERROR;
10473 }
10474
10475 br = WriteFile(outfile, &file.header, sizeof(file.header), &written, NULL);
10476 if (!br) {
10479 heap_free(junk);
10480 return TYPE_E_IOERROR;
10481 }
10482
10483 br = WriteFile(outfile, junk, junk_size, &written, NULL);
10484 heap_free(junk);
10485 if (!br) {
10488 return TYPE_E_IOERROR;
10489 }
10490
10491 br = WriteFile(outfile, &file.segdir, sizeof(file.segdir), &written, NULL);
10492 if (!br) {
10495 return TYPE_E_IOERROR;
10496 }
10497
10498 WMSFT_write_segment(outfile, &file.typeinfo_seg);
10499 WMSFT_write_segment(outfile, &file.guidhash_seg);
10500 WMSFT_write_segment(outfile, &file.guid_seg);
10501 WMSFT_write_segment(outfile, &file.ref_seg);
10502 WMSFT_write_segment(outfile, &file.impinfo_seg);
10503 WMSFT_write_segment(outfile, &file.impfile_seg);
10504 WMSFT_write_segment(outfile, &file.namehash_seg);
10505 WMSFT_write_segment(outfile, &file.name_seg);
10506 WMSFT_write_segment(outfile, &file.string_seg);
10507 WMSFT_write_segment(outfile, &file.typdesc_seg);
10508 WMSFT_write_segment(outfile, &file.arraydesc_seg);
10509 WMSFT_write_segment(outfile, &file.custdata_seg);
10510 WMSFT_write_segment(outfile, &file.cdguids_seg);
10511 WMSFT_write_segment(outfile, &file.aux_seg);
10512
10514
10516
10517 return S_OK;