ReactOS  0.4.13-dev-52-g0efcfec
typelib.c File Reference
#include "config.h"
#include "wine/port.h"
#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 "wine/unicode.h"
#include "objbase.h"
#include "typelib.h"
#include "wine/debug.h"
#include "variant.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, OLECHAR *szFullPath, OLECHAR *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)
 
static HRESULT userdefined_to_variantvt (ITypeInfo *tinfo, const TYPEDESC *tdesc, VARTYPE *vt)
 
static HRESULT get_iface_guid (ITypeInfo *tinfo, HREFTYPE href, GUID *guid)
 
HRESULT WINAPI DispCallFunc (void *pvInstance, ULONG_PTR oVft, CALLCONV cc, VARTYPE vtReturn, UINT cActuals, VARTYPE *prgvt, VARIANTARG **prgpvarg, VARIANT *pvargResult)
 
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 59 of file typelib.c.

◆ DISPATCH_HREF_MASK

#define DISPATCH_HREF_MASK   0xff000000

Definition at line 133 of file typelib.c.

◆ DISPATCH_HREF_OFFSET

#define DISPATCH_HREF_OFFSET   0x01000000

Definition at line 132 of file typelib.c.

◆ FromLEDWord

#define FromLEDWord (   X)    (X)

Definition at line 129 of file typelib.c.

◆ FromLEDWords

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

Definition at line 169 of file typelib.c.

◆ FromLEWord

#define FromLEWord (   X)    (X)

Definition at line 128 of file typelib.c.

◆ FromLEWords

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

Definition at line 168 of file typelib.c.

◆ INVBUF_ELEMENT_SIZE

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

Definition at line 7140 of file typelib.c.

◆ INVBUF_GET_ARG_ARRAY

#define INVBUF_GET_ARG_ARRAY (   buffer,
  params 
)    (buffer)

Definition at line 7142 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 7145 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 7147 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 7143 of file typelib.c.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 60 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 11502 of file typelib.c.

11503 {
11504  if (lpCust && lpCust->cCustData)
11505  {
11506  if (lpCust->prgCustData)
11507  {
11508  DWORD i;
11509 
11510  for (i = 0; i < lpCust->cCustData; i++)
11511  VariantClear(&lpCust->prgCustData[i].varValue);
11512 
11513  CoTaskMemFree(lpCust->prgCustData);
11514  lpCust->prgCustData = NULL;
11515  }
11516  lpCust->cCustData = 0;
11517  }
11518 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
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
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651

Referenced by test_ClearCustData().

◆ CreateDispTypeInfo()

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

Definition at line 8659 of file typelib.c.

8663 {
8664  ITypeInfoImpl *pTIClass, *pTIIface;
8665  ITypeLibImpl *pTypeLibImpl;
8666  unsigned int param, func;
8667  TLBFuncDesc *pFuncDesc;
8668  TLBRefType *ref;
8669 
8670  TRACE("\n");
8671  pTypeLibImpl = TypeLibImpl_Constructor();
8672  if (!pTypeLibImpl) return E_FAIL;
8673 
8674  pTypeLibImpl->TypeInfoCount = 2;
8675  pTypeLibImpl->typeinfos = heap_alloc_zero(pTypeLibImpl->TypeInfoCount * sizeof(ITypeInfoImpl*));
8676 
8677  pTIIface = pTypeLibImpl->typeinfos[0] = ITypeInfoImpl_Constructor();
8678  pTIIface->pTypeLib = pTypeLibImpl;
8679  pTIIface->index = 0;
8680  pTIIface->Name = NULL;
8681  pTIIface->dwHelpContext = -1;
8682  pTIIface->guid = NULL;
8683  pTIIface->typeattr.lcid = lcid;
8684  pTIIface->typeattr.typekind = TKIND_INTERFACE;
8685  pTIIface->typeattr.wMajorVerNum = 0;
8686  pTIIface->typeattr.wMinorVerNum = 0;
8687  pTIIface->typeattr.cbAlignment = 2;
8688  pTIIface->typeattr.cbSizeInstance = -1;
8689  pTIIface->typeattr.cbSizeVft = -1;
8690  pTIIface->typeattr.cFuncs = 0;
8691  pTIIface->typeattr.cImplTypes = 0;
8692  pTIIface->typeattr.cVars = 0;
8693  pTIIface->typeattr.wTypeFlags = 0;
8694  pTIIface->hreftype = 0;
8695 
8696  pTIIface->funcdescs = TLBFuncDesc_Alloc(pidata->cMembers);
8697  pFuncDesc = pTIIface->funcdescs;
8698  for(func = 0; func < pidata->cMembers; func++) {
8699  METHODDATA *md = pidata->pmethdata + func;
8700  pFuncDesc->Name = TLB_append_str(&pTypeLibImpl->name_list, md->szName);
8701  pFuncDesc->funcdesc.memid = md->dispid;
8702  pFuncDesc->funcdesc.lprgscode = NULL;
8703  pFuncDesc->funcdesc.funckind = FUNC_VIRTUAL;
8704  pFuncDesc->funcdesc.invkind = md->wFlags;
8705  pFuncDesc->funcdesc.callconv = md->cc;
8706  pFuncDesc->funcdesc.cParams = md->cArgs;
8707  pFuncDesc->funcdesc.cParamsOpt = 0;
8708  pFuncDesc->funcdesc.oVft = md->iMeth * sizeof(void *);
8709  pFuncDesc->funcdesc.cScodes = 0;
8710  pFuncDesc->funcdesc.wFuncFlags = 0;
8711  pFuncDesc->funcdesc.elemdescFunc.tdesc.vt = md->vtReturn;
8712  pFuncDesc->funcdesc.elemdescFunc.u.paramdesc.wParamFlags = PARAMFLAG_NONE;
8713  pFuncDesc->funcdesc.elemdescFunc.u.paramdesc.pparamdescex = NULL;
8714  pFuncDesc->funcdesc.lprgelemdescParam = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
8715  md->cArgs * sizeof(ELEMDESC));
8716  pFuncDesc->pParamDesc = TLBParDesc_Constructor(md->cArgs);
8717  for(param = 0; param < md->cArgs; param++) {
8718  pFuncDesc->funcdesc.lprgelemdescParam[param].tdesc.vt = md->ppdata[param].vt;
8719  pFuncDesc->pParamDesc[param].Name = TLB_append_str(&pTypeLibImpl->name_list, md->ppdata[param].szName);
8720  }
8721  pFuncDesc->helpcontext = 0;
8722  pFuncDesc->HelpStringContext = 0;
8723  pFuncDesc->HelpString = NULL;
8724  pFuncDesc->Entry = NULL;
8725  list_init(&pFuncDesc->custdata_list);
8726  pTIIface->typeattr.cFuncs++;
8727  ++pFuncDesc;
8728  }
8729 
8730  dump_TypeInfo(pTIIface);
8731 
8732  pTIClass = pTypeLibImpl->typeinfos[1] = ITypeInfoImpl_Constructor();
8733  pTIClass->pTypeLib = pTypeLibImpl;
8734  pTIClass->index = 1;
8735  pTIClass->Name = NULL;
8736  pTIClass->dwHelpContext = -1;
8737  pTIClass->guid = NULL;
8738  pTIClass->typeattr.lcid = lcid;
8739  pTIClass->typeattr.typekind = TKIND_COCLASS;
8740  pTIClass->typeattr.wMajorVerNum = 0;
8741  pTIClass->typeattr.wMinorVerNum = 0;
8742  pTIClass->typeattr.cbAlignment = 2;
8743  pTIClass->typeattr.cbSizeInstance = -1;
8744  pTIClass->typeattr.cbSizeVft = -1;
8745  pTIClass->typeattr.cFuncs = 0;
8746  pTIClass->typeattr.cImplTypes = 1;
8747  pTIClass->typeattr.cVars = 0;
8748  pTIClass->typeattr.wTypeFlags = 0;
8749  pTIClass->hreftype = sizeof(MSFT_TypeInfoBase);
8750 
8751  pTIClass->impltypes = TLBImplType_Alloc(1);
8752 
8753  ref = heap_alloc_zero(sizeof(*ref));
8754  ref->pImpTLInfo = TLB_REF_INTERNAL;
8755  list_add_head(&pTypeLibImpl->ref_list, &ref->entry);
8756 
8757  dump_TypeInfo(pTIClass);
8758 
8759  *pptinfo = (ITypeInfo *)&pTIClass->ITypeInfo2_iface;
8760 
8761  ITypeInfo_AddRef(*pptinfo);
8762  ITypeLib2_Release(&pTypeLibImpl->ITypeLib2_iface);
8763 
8764  return S_OK;
8765 
8766 }
struct list ref_list
Definition: typelib.c:1135
GLenum func
Definition: glext.h:6028
ITypeLib2 ITypeLib2_iface
Definition: typelib.c:1102
HREFTYPE hreftype
Definition: typelib.c:1255
static TLBString * TLB_append_str(struct list *string_list, BSTR new_str)
Definition: typelib.c:1884
static void dump_TypeInfo(const ITypeInfoImpl *pty)
Definition: typelib.c:1573
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
Definition: list.h:96
METHODDATA * pmethdata
Definition: oleauto.h:919
struct tagITypeInfoImpl ** typeinfos
Definition: typelib.c:1128
TYPEATTR typeattr
Definition: typelib.c:1250
#define E_FAIL
Definition: ddrawi.h:102
Definition: send.c:47
struct list custdata_list
Definition: typelib.c:1216
struct list name_list
Definition: typelib.c:1119
static ITypeInfoImpl * ITypeInfoImpl_Constructor(void)
Definition: typelib.c:5623
GLenum GLint ref
Definition: glext.h:6028
const TLBString * Entry
Definition: typelib.c:1215
smooth NULL
Definition: ftsmooth.c:416
const TLBString * Name
Definition: typelib.c:1210
TLBParDesc * pParamDesc
Definition: typelib.c:1211
ITypeInfo2 ITypeInfo2_iface
Definition: typelib.c:1242
TLBFuncDesc * funcdescs
Definition: typelib.c:1267
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLfloat param
Definition: glext.h:5796
FUNCDESC funcdesc
Definition: typelib.c:1209
static TLBParDesc * TLBParDesc_Constructor(UINT n)
Definition: typelib.c:1770
ITypeLibImpl * pTypeLib
Definition: typelib.c:1253
int HelpStringContext
Definition: typelib.c:1213
static TLBImplType * TLBImplType_Alloc(UINT n)
Definition: typelib.c:1812
DWORD dwHelpContext
Definition: typelib.c:1263
#define S_OK
Definition: intsafe.h:59
#define TLB_REF_INTERNAL
Definition: typelib.c:1196
static TLBFuncDesc * TLBFuncDesc_Alloc(UINT n)
Definition: typelib.c:1791
struct tagMSFT_TypeInfoBase MSFT_TypeInfoBase
TLBImplType * impltypes
Definition: typelib.c:1273
TLBGuid * guid
Definition: typelib.c:1249
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
const TLBString * Name
Definition: typelib.c:1259
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
const TLBString * Name
Definition: typelib.c:1202
#define md
Definition: compat-1.3.h:1989
static ITypeLibImpl * TypeLibImpl_Constructor(void)
Definition: typelib.c:3429
const TLBString * HelpString
Definition: typelib.c:1214

Referenced by test_CreateDispTypeInfo().

◆ CreateTypeLib()

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

Definition at line 428 of file typelib.c.

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

◆ CreateTypeLib2()

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

Definition at line 8910 of file typelib.c.

8912 {
8913  ITypeLibImpl *This;
8914  HRESULT hres;
8915 
8916  TRACE("(%d,%s,%p)\n", syskind, debugstr_w(szFile), ppctlib);
8917 
8918  if (!szFile) return E_INVALIDARG;
8919 
8921  if (!This)
8922  return E_OUTOFMEMORY;
8923 
8924  This->lcid = GetSystemDefaultLCID();
8925  This->syskind = syskind;
8926  This->ptr_size = get_ptr_size(syskind);
8927 
8928  This->path = heap_alloc((lstrlenW(szFile) + 1) * sizeof(WCHAR));
8929  if (!This->path) {
8930  ITypeLib2_Release(&This->ITypeLib2_iface);
8931  return E_OUTOFMEMORY;
8932  }
8933  lstrcpyW(This->path, szFile);
8934 
8935  hres = ITypeLib2_QueryInterface(&This->ITypeLib2_iface, &IID_ICreateTypeLib2, (LPVOID*)ppctlib);
8936  ITypeLib2_Release(&This->ITypeLib2_iface);
8937  return hres;
8938 }
#define lstrlenW
Definition: compat.h:407
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define debugstr_w
Definition: kernel32.h:32
#define E_INVALIDARG
Definition: ddrawi.h:101
LCID WINAPI GetSystemDefaultLCID(void)
Definition: lang.c:787
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define lstrcpyW
Definition: compat.h:406
static int get_ptr_size(SYSKIND syskind)
Definition: typelib.c:1339
static ITypeLibImpl * TypeLibImpl_Constructor(void)
Definition: typelib.c:3429

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]) strcatW(buf, spaceW);
3768  MultiByteToWideChar(CP_ACP, 0, p, -1, buf + strlenW(buf), buf_size - strlenW(buf));
3769  }
3770 
3771  tlbstr = TLB_append_str(&lib->string_list, buf);
3772  SysFreeString(buf);
3773 
3774  return tlbstr;
3775 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
static TLBString * TLB_append_str(struct list *string_list, BSTR new_str)
Definition: typelib.c:1884
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:342
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define CP_ACP
Definition: compat.h:99
OLECHAR * BSTR
Definition: compat.h:1927
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
static OLECHAR OLECHAR *static WORD
Definition: typelib.c:80
Definition: parse.h:22
struct list string_list
Definition: typelib.c:1118
unsigned char BYTE
Definition: mem.h:68
static const WCHAR spaceW[]
Definition: mxwriter.c:44
static const char * lookup_code(const BYTE *table, DWORD table_size, struct bitstream *bits)
Definition: typelib.c:3703
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
#define MultiByteToWideChar
Definition: compat.h:100
GLfloat GLfloat p
Definition: glext.h:8902
static DWORD
Definition: typelib.c:87
LOCAL int table_size
Definition: write.c:65

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 6760 of file typelib.c.

6763 {
6764 #ifdef __i386__
6765  int argspos = 0, stack_offset;
6766  void *func;
6767  UINT i;
6768  DWORD *args;
6769 
6770  TRACE("(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d))\n",
6771  pvInstance, oVft, cc, vtReturn, cActuals, prgvt, prgpvarg,
6772  pvargResult, V_VT(pvargResult));
6773 
6774  if (cc != CC_STDCALL && cc != CC_CDECL)
6775  {
6776  FIXME("unsupported calling convention %d\n",cc);
6777  return E_INVALIDARG;
6778  }
6779 
6780  /* maximum size for an argument is sizeof(VARIANT) */
6781  args = heap_alloc(sizeof(VARIANT) * cActuals + sizeof(DWORD) * 2 );
6782 
6783  if (pvInstance)
6784  {
6785  const FARPROC *vtable = *(FARPROC **)pvInstance;
6786  func = vtable[oVft/sizeof(void *)];
6787  args[argspos++] = (DWORD)pvInstance; /* the This pointer is always the first parameter */
6788  }
6789  else func = (void *)oVft;
6790 
6791  switch (vtReturn)
6792  {
6793  case VT_DECIMAL:
6794  case VT_VARIANT:
6795  args[argspos++] = (DWORD)pvargResult; /* arg 0 is a pointer to the result */
6796  break;
6797  case VT_HRESULT:
6798  WARN("invalid return type %u\n", vtReturn);
6799  heap_free( args );
6800  return E_INVALIDARG;
6801  default:
6802  break;
6803  }
6804 
6805  for (i = 0; i < cActuals; i++)
6806  {
6807  VARIANT *arg = prgpvarg[i];
6808 
6809  switch (prgvt[i])
6810  {
6811  case VT_EMPTY:
6812  break;
6813  case VT_I8:
6814  case VT_UI8:
6815  case VT_R8:
6816  case VT_DATE:
6817  case VT_CY:
6818  memcpy( &args[argspos], &V_I8(arg), sizeof(V_I8(arg)) );
6819  argspos += sizeof(V_I8(arg)) / sizeof(DWORD);
6820  break;
6821  case VT_DECIMAL:
6822  case VT_VARIANT:
6823  memcpy( &args[argspos], arg, sizeof(*arg) );
6824  argspos += sizeof(*arg) / sizeof(DWORD);
6825  break;
6826  case VT_BOOL: /* VT_BOOL is 16-bit but BOOL is 32-bit, needs to be extended */
6827  args[argspos++] = V_BOOL(arg);
6828  break;
6829  default:
6830  args[argspos++] = V_UI4(arg);
6831  break;
6832  }
6833  TRACE("arg %u: type %s %s\n", i, debugstr_vt(prgvt[i]), debugstr_variant(arg));
6834  }
6835 
6836  switch (vtReturn)
6837  {
6838  case VT_EMPTY:
6839  case VT_DECIMAL:
6840  case VT_VARIANT:
6841  call_method( func, argspos, args, &stack_offset );
6842  break;
6843  case VT_R4:
6844  V_R4(pvargResult) = call_double_method( func, argspos, args, &stack_offset );
6845  break;
6846  case VT_R8:
6847  case VT_DATE:
6848  V_R8(pvargResult) = call_double_method( func, argspos, args, &stack_offset );
6849  break;
6850  case VT_I8:
6851  case VT_UI8:
6852  case VT_CY:
6853  V_UI8(pvargResult) = call_method( func, argspos, args, &stack_offset );
6854  break;
6855  default:
6856  V_UI4(pvargResult) = call_method( func, argspos, args, &stack_offset );
6857  break;
6858  }
6859  heap_free( args );
6860  if (stack_offset && cc == CC_STDCALL)
6861  {
6862  WARN( "stack pointer off by %d\n", stack_offset );
6863  return DISP_E_BADCALLEE;
6864  }
6865  if (vtReturn != VT_VARIANT) V_VT(pvargResult) = vtReturn;
6866  TRACE("retval: %s\n", debugstr_variant(pvargResult));
6867  return S_OK;
6868 
6869 #elif defined(__x86_64__)
6870  int argspos = 0;
6871  UINT i;
6872  DWORD_PTR *args;
6873  void *func;
6874 
6875  TRACE("(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d))\n",
6876  pvInstance, oVft, cc, vtReturn, cActuals, prgvt, prgpvarg,
6877  pvargResult, V_VT(pvargResult));
6878 
6879  if (cc != CC_STDCALL && cc != CC_CDECL)
6880  {
6881  FIXME("unsupported calling convention %d\n",cc);
6882  return E_INVALIDARG;
6883  }
6884 
6885  /* maximum size for an argument is sizeof(DWORD_PTR) */
6886  args = heap_alloc( sizeof(DWORD_PTR) * (cActuals + 2) );
6887 
6888  if (pvInstance)
6889  {
6890  const FARPROC *vtable = *(FARPROC **)pvInstance;
6891  func = vtable[oVft/sizeof(void *)];
6892  args[argspos++] = (DWORD_PTR)pvInstance; /* the This pointer is always the first parameter */
6893  }
6894  else func = (void *)oVft;
6895 
6896  switch (vtReturn)
6897  {
6898  case VT_DECIMAL:
6899  case VT_VARIANT:
6900  args[argspos++] = (DWORD_PTR)pvargResult; /* arg 0 is a pointer to the result */
6901  break;
6902  case VT_HRESULT:
6903  WARN("invalid return type %u\n", vtReturn);
6904  heap_free( args );
6905  return E_INVALIDARG;
6906  default:
6907  break;
6908  }
6909 
6910  for (i = 0; i < cActuals; i++)
6911  {
6912  VARIANT *arg = prgpvarg[i];
6913 
6914  switch (prgvt[i])
6915  {
6916  case VT_DECIMAL:
6917  case VT_VARIANT:
6918  args[argspos++] = (ULONG_PTR)arg;
6919  break;
6920  case VT_BOOL: /* VT_BOOL is 16-bit but BOOL is 32-bit, needs to be extended */
6921  args[argspos++] = V_BOOL(arg);
6922  break;
6923  default:
6924  args[argspos++] = V_UI8(arg);
6925  break;
6926  }
6927  TRACE("arg %u: type %s %s\n", i, debugstr_vt(prgvt[i]), debugstr_variant(arg));
6928  }
6929 
6930  switch (vtReturn)
6931  {
6932  case VT_R4:
6933  V_R4(pvargResult) = call_double_method( func, argspos, args );
6934  break;
6935  case VT_R8:
6936  case VT_DATE:
6937  V_R8(pvargResult) = call_double_method( func, argspos, args );
6938  break;
6939  case VT_DECIMAL:
6940  case VT_VARIANT:
6941  call_method( func, argspos, args );
6942  break;
6943  default:
6944  V_UI8(pvargResult) = call_method( func, argspos, args );
6945  break;
6946  }
6947  heap_free( args );
6948  if (vtReturn != VT_VARIANT) V_VT(pvargResult) = vtReturn;
6949  TRACE("retval: %s\n", debugstr_variant(pvargResult));
6950  return S_OK;
6951 
6952 #elif defined(__arm__)
6953  int argspos;
6954  void *func;
6955  UINT i;
6956  DWORD *args;
6957  struct {
6958 #ifndef __SOFTFP__
6959  union {
6960  float s[16];
6961  double d[8];
6962  } sd;
6963 #endif
6964  DWORD r[4];
6965  } regs;
6966  int rcount; /* 32-bit register index count */
6967 #ifndef __SOFTFP__
6968  int scount = 0; /* single-precision float register index count */
6969  int dcount = 0; /* double-precision float register index count */
6970 #endif
6971 
6972  TRACE("(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d))\n",
6973  pvInstance, oVft, cc, vtReturn, cActuals, prgvt, prgpvarg, pvargResult, V_VT(pvargResult));
6974 
6975  if (cc != CC_STDCALL && cc != CC_CDECL)
6976  {
6977  FIXME("unsupported calling convention %d\n",cc);
6978  return E_INVALIDARG;
6979  }
6980 
6981  argspos = 0;
6982  rcount = 0;
6983 
6984  if (pvInstance)
6985  {
6986  const FARPROC *vtable = *(FARPROC **)pvInstance;
6987  func = vtable[oVft/sizeof(void *)];
6988  regs.r[rcount++] = (DWORD)pvInstance; /* the This pointer is always the first parameter */
6989  }
6990  else func = (void *)oVft;
6991 
6992  /* Determine if we need to pass a pointer for the return value as arg 0. If so, do that */
6993  /* first as it will need to be in the 'r' registers: */
6994  switch (vtReturn)
6995  {
6996  case VT_DECIMAL:
6997  case VT_VARIANT:
6998  regs.r[rcount++] = (DWORD)pvargResult; /* arg 0 is a pointer to the result */
6999  break;
7000  case VT_HRESULT:
7001  WARN("invalid return type %u\n", vtReturn);
7002  return E_INVALIDARG;
7003  default: /* And all others are in 'r', 's', or 'd' registers or have no return value */
7004  break;
7005  }
7006 
7007  /* maximum size for an argument is sizeof(VARIANT). Also allow for return pointer and stack alignment. */
7008  args = heap_alloc( sizeof(VARIANT) * cActuals + sizeof(DWORD) * 4 );
7009 
7010  for (i = 0; i < cActuals; i++)
7011  {
7012  VARIANT *arg = prgpvarg[i];
7013  DWORD *pdwarg = (DWORD *)(arg); /* a reinterpret_cast of the variant, used for copying structures when they are split between registers and stack */
7014  int ntemp; /* Used for counting words split between registers and stack */
7015 
7016  switch (prgvt[i])
7017  {
7018  case VT_EMPTY:
7019  break;
7020  case VT_R8: /* these must be 8-byte aligned, and put in 'd' regs or stack, as they are double-floats */
7021  case VT_DATE:
7022 #ifndef __SOFTFP__
7023  dcount = max( (scount + 1) / 2, dcount );
7024  if (dcount < 8)
7025  {
7026  regs.sd.d[dcount++] = V_R8(arg);
7027  }
7028  else
7029  {
7030  argspos += (argspos % 2); /* align argspos to 8-bytes */
7031  memcpy( &args[argspos], &V_R8(arg), sizeof(V_R8(arg)) );
7032  argspos += sizeof(V_R8(arg)) / sizeof(DWORD);
7033  }
7034  break;
7035 #endif
7036  case VT_I8: /* these must be 8-byte aligned, and put in 'r' regs or stack, as they are long-longs */
7037  case VT_UI8:
7038  case VT_CY:
7039  if (rcount < 3)
7040  {
7041  rcount += (rcount % 2); /* align rcount to 8-byte register pair */
7042  memcpy( &regs.r[rcount], &V_UI8(arg), sizeof(V_UI8(arg)) );
7043  rcount += sizeof(V_UI8(arg)) / sizeof(DWORD);
7044  }
7045  else
7046  {
7047  rcount = 4; /* Make sure we flag that all 'r' regs are full */
7048  argspos += (argspos % 2); /* align argspos to 8-bytes */
7049  memcpy( &args[argspos], &V_UI8(arg), sizeof(V_UI8(arg)) );
7050  argspos += sizeof(V_UI8(arg)) / sizeof(DWORD);
7051  }
7052  break;
7053  case VT_DECIMAL: /* these structures are 8-byte aligned, and put in 'r' regs or stack, can be split between the two */
7054  case VT_VARIANT:
7055  /* 8-byte align 'r' and/or stack: */
7056  if (rcount < 3)
7057  rcount += (rcount % 2);
7058  else
7059  {
7060  rcount = 4;
7061  argspos += (argspos % 2);
7062  }
7063  ntemp = sizeof(*arg) / sizeof(DWORD);
7064  while (ntemp > 0)
7065  {
7066  if (rcount < 4)
7067  regs.r[rcount++] = *pdwarg++;
7068  else
7069  args[argspos++] = *pdwarg++;
7070  --ntemp;
7071  }
7072  break;
7073  case VT_BOOL: /* VT_BOOL is 16-bit but BOOL is 32-bit, needs to be extended */
7074  if (rcount < 4)
7075  regs.r[rcount++] = V_BOOL(arg);
7076  else
7077  args[argspos++] = V_BOOL(arg);
7078  break;
7079  case VT_R4: /* these must be 4-byte aligned, and put in 's' regs or stack, as they are single-floats */
7080 #ifndef __SOFTFP__
7081  if (!(scount % 2)) scount = max( scount, dcount * 2 );
7082  if (scount < 16)
7083  regs.sd.s[scount++] = V_R4(arg);
7084  else
7085  args[argspos++] = V_UI4(arg);
7086  break;
7087 #endif
7088  default:
7089  if (rcount < 4)
7090  regs.r[rcount++] = V_UI4(arg);
7091  else
7092  args[argspos++] = V_UI4(arg);
7093  break;
7094  }
7095  TRACE("arg %u: type %s %s\n", i, debugstr_vt(prgvt[i]), debugstr_variant(arg));
7096  }
7097 
7098  argspos += (argspos % 2); /* Make sure stack function alignment is 8-byte */
7099 
7100  switch (vtReturn)
7101  {
7102  case VT_EMPTY: /* EMPTY = no return value */
7103  case VT_DECIMAL: /* DECIMAL and VARIANT already have a pointer argument passed (see above) */
7104  case VT_VARIANT:
7105  call_method( func, argspos, args, (DWORD*)&regs );
7106  break;
7107  case VT_R4:
7108  V_R4(pvargResult) = call_float_method( func, argspos, args, (DWORD*)&regs );
7109  break;
7110  case VT_R8:
7111  case VT_DATE:
7112  V_R8(pvargResult) = call_double_method( func, argspos, args, (DWORD*)&regs );
7113  break;
7114  case VT_I8:
7115  case VT_UI8:
7116  case VT_CY:
7117  V_UI8(pvargResult) = call_method( func, argspos, args, (DWORD*)&regs );
7118  break;
7119  default:
7120  V_UI4(pvargResult) = call_method( func, argspos, args, (DWORD*)&regs );
7121  break;
7122  }
7123  heap_free( args );
7124  if (vtReturn != VT_VARIANT) V_VT(pvargResult) = vtReturn;
7125  TRACE("retval: %s\n", debugstr_variant(pvargResult));
7126  return S_OK;
7127 
7128 #else
7129  FIXME( "(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d)): not implemented for this CPU\n",
7130  pvInstance, oVft, cc, vtReturn, cActuals, prgvt, prgpvarg, pvargResult, V_VT(pvargResult));
7131  return E_NOTIMPL;
7132 #endif
7133 }
GLenum func
Definition: glext.h:6028
#define max(a, b)
Definition: svc.c:63
static void * vtable[]
Definition: typelib.c:1231
#define DWORD_PTR
Definition: treelist.c:76
Definition: compat.h:1948
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define V_R8(A)
Definition: oleauto.h:262
#define WARN(fmt,...)
Definition: debug.h:111
struct @4007 regs[]
Definition: match.c:390
#define V_UI8(A)
Definition: oleauto.h:272
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
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
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_INVALIDARG
Definition: ddrawi.h:101
#define DISP_E_BADCALLEE
Definition: winerror.h:2525
#define V_I8(A)
Definition: oleauto.h:249
#define V_R4(A)
Definition: oleauto.h:260
#define TRACE(s)
Definition: solgame.cpp:4
#define d
Definition: ke_i.h:81
static unsigned stack_offset(compile_ctx_t *ctx)
Definition: compile.c:349
#define V_BOOL(A)
Definition: oleauto.h:224
unsigned long DWORD
Definition: ntddk_ex.h:95
static ULONG_PTR
Definition: typelib.c:84
#define V_UI4(A)
Definition: oleauto.h:270
static const WCHAR sd[]
Definition: suminfo.c:287
Definition: compat.h:1933
#define V_VT(A)
Definition: oleauto.h:211
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLdouble s
Definition: gl.h:2039
Definition: compat.h:1935
uint32_t DWORD_PTR
Definition: typedefs.h:63
uint32_t cc
Definition: isohybrid.c:75
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
unsigned int UINT
Definition: ndis.h:50
#define args
Definition: format.c:66
int(* FARPROC)()
Definition: compat.h:28
static DWORD
Definition: typelib.c:87
Definition: compat.h:1934
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

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 }
GLuint index
Definition: glext.h:6031
#define TRACE(s)
Definition: solgame.cpp:4
#define index(s, c)
Definition: various.h:29
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 }
#define MESSAGE
Definition: options.h:86
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLbitfield flags
Definition: glext.h:7161
unsigned short USHORT
Definition: pedump.c:61
static void dump_TypeDesc(const TYPEDESC *pTD, char *szVarType)
Definition: typelib.c:1356

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 }
#define MESSAGE
Definition: options.h:86
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
static void dump_ELEMDESC(const ELEMDESC *edesc)
Definition: typelib.c:1405

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 }
GLdouble n
Definition: glext.h:7729
static PIXELFORMATDESCRIPTOR pfd
Definition: ssstars.c:67
static void dump_TLBFuncDescOne(const TLBFuncDesc *pfd)
Definition: typelib.c:1473

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 }
#define MESSAGE
Definition: options.h:86
static void dump_FUNCDESC(const FUNCDESC *funcdesc)
Definition: typelib.c:1421
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
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
static PIXELFORMATDESCRIPTOR pfd
Definition: ssstars.c:67
static BSTR TLB_get_bstr(const TLBString *str)
Definition: typelib.c:1317

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:105
static const GUID * TLB_get_guidref(const TLBGuid *guid)
Definition: typelib.c:1329
TLBGuid * guid
Definition: typelib.c:1080
#define debugstr_w
Definition: kernel32.h:32
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE_(x)
Definition: compat.h:66

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
GLdouble n
Definition: glext.h:7729
static ITypeLib * typelib
Definition: apps.c:105
#define TRACE_(x)
Definition: compat.h:66

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)
1528  TRACE_(typelib)("%s\n", debugstr_guid(TLB_get_guidref(ref->guid)));
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 }
struct list ref_list
Definition: typelib.c:1135
uint8_t entry
Definition: isohybrid.c:63
static ITypeLib * typelib
Definition: apps.c:105
static const GUID * TLB_get_guidref(const TLBGuid *guid)
Definition: typelib.c:1329
Definition: send.c:47
static void dump_TLBImpLib(const TLBImpLib *import)
Definition: typelib.c:1512
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
GLenum GLint ref
Definition: glext.h:6028
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE_(x)
Definition: compat.h:66
#define TLB_REF_NOT_FOUND
Definition: typelib.c:1197
#define TLB_REF_INTERNAL
Definition: typelib.c:1196

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 }
GLdouble n
Definition: glext.h:7729
static ITypeLib * typelib
Definition: apps.c:105
#define debugstr_w
Definition: kernel32.h:32
#define TRACE_(x)
Definition: compat.h:66
static BSTR TLB_get_bstr(const TLBString *str)
Definition: typelib.c:1317
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 }
Definition: compat.h:1932
Definition: compat.h:1944
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define sprintf(buf, format,...)
Definition: sprintf.c:55
Definition: compat.h:1933
Definition: compat.h:1935
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
static void dump_TypeDesc(const TYPEDESC *pTD, char *szVarType)
Definition: typelib.c:1356
Definition: compat.h:1934
Definition: compat.h:1931

Referenced by dump_ELEMDESC(), 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);
1576  TRACE("%s %s\n", debugstr_w(TLB_get_bstr(pty->Name)), debugstr_w(TLB_get_bstr(pty->DocString)));
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 }
static const GUID * TLB_get_guidref(const TLBGuid *guid)
Definition: typelib.c:1329
TYPEATTR typeattr
Definition: typelib.c:1250
static void dump_TLBImplType(const TLBImplType *impl, UINT n)
Definition: typelib.c:1540
#define debugstr_w
Definition: kernel32.h:32
#define debugstr_guid
Definition: kernel32.h:35
TLBVarDesc * vardescs
Definition: typelib.c:1270
TLBFuncDesc * funcdescs
Definition: typelib.c:1267
const TLBString * DllName
Definition: typelib.c:1261
#define TRACE(s)
Definition: solgame.cpp:4
ITypeLibImpl * pTypeLib
Definition: typelib.c:1253
const TLBString * DocString
Definition: typelib.c:1260
static BSTR TLB_get_bstr(const TLBString *str)
Definition: typelib.c:1317
TLBImplType * impltypes
Definition: typelib.c:1273
TLBGuid * guid
Definition: typelib.c:1249
static const char *const typekind_desc[]
Definition: typelib.c:1460
const TLBString * Name
Definition: typelib.c:1259
static void dump_TLBVarDesc(const TLBVarDesc *pvd, UINT n)
Definition: typelib.c:1502
static void dump_TLBFuncDesc(const TLBFuncDesc *pfd, UINT n)
Definition: typelib.c:1493
#define TRACE_ON(x)
Definition: compat.h:65

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 }
#define MESSAGE
Definition: options.h:86
#define debugstr_w
Definition: kernel32.h:32
const GLdouble * v
Definition: gl.h:2040
static void dump_ELEMDESC(const ELEMDESC *edesc)
Definition: typelib.c:1405

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) && !strncasecmp( (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) && !strncasecmp( (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 }
#define SEEK_CUR
Definition: util.h:63
#define TRUE
Definition: types.h:120
WORD offset
Definition: typelib.c:84
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLuint GLuint GLsizei count
Definition: gl.h:1545
char * LPSTR
Definition: xmlstorage.h:182
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
WORD id
Definition: typelib.c:87
unsigned char * LPBYTE
Definition: typedefs.h:52
#define strncasecmp
Definition: fake.h:10
#define SEEK_SET
Definition: jmemansi.c:26
#define TRACE(s)
Definition: solgame.cpp:4
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: mem.h:68
LONG WINAPI LZSeek(HFILE fd, LONG off, INT type)
Definition: lzexpand.c:436
INT WINAPI LZRead(HFILE fd, LPSTR vbuf, INT toread)
Definition: lzexpand.c:345
WORD length
Definition: typelib.c:85
WORD count
Definition: typelib.c:95
WORD type_id
Definition: typelib.c:94
GLfloat GLfloat p
Definition: glext.h:8902
#define LOWORD(l)
Definition: pedump.c:82
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by TLB_NEFile_Open().

◆ find_typelib_key()

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

Definition at line 175 of file typelib.c.

176 {
177  static const WCHAR typelibW[] = {'T','y','p','e','l','i','b','\\',0};
178  WCHAR buffer[60];
179  char key_name[16];
180  DWORD len, i;
181  INT best_maj = -1, best_min = -1;
182  HKEY hkey;
183 
184  memcpy( buffer, typelibW, sizeof(typelibW) );
186 
188  return FALSE;
189 
190  len = sizeof(key_name);
191  i = 0;
192  while (RegEnumKeyExA(hkey, i++, key_name, &len, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
193  {
194  INT v_maj, v_min;
195 
196  if (sscanf(key_name, "%x.%x", &v_maj, &v_min) == 2)
197  {
198  TRACE("found %s: %x.%x\n", debugstr_w(buffer), v_maj, v_min);
199 
200  if (*wMaj == 0xffff && *wMin == 0xffff)
201  {
202  if (v_maj > best_maj) best_maj = v_maj;
203  if (v_min > best_min) best_min = v_min;
204  }
205  else if (*wMaj == v_maj)
206  {
207  best_maj = v_maj;
208 
209  if (*wMin == v_min)
210  {
211  best_min = v_min;
212  break; /* exact match */
213  }
214  if (*wMin != 0xffff && v_min > best_min) best_min = v_min;
215  }
216  }
217  len = sizeof(key_name);
218  }
219  RegCloseKey( hkey );
220 
221  TRACE("found best_maj %d, best_min %d\n", best_maj, best_min);
222 
223  if (*wMaj == 0xffff && *wMin == 0xffff)
224  {
225  if (best_maj >= 0 && best_min >= 0)
226  {
227  *wMaj = best_maj;
228  *wMin = best_min;
229  return TRUE;
230  }
231  }
232 
233  if (*wMaj == best_maj && best_min >= 0)
234  {
235  *wMin = best_min;
236  return TRUE;
237  }
238  return FALSE;
239 }
#define TRUE
Definition: types.h:120
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define ERROR_SUCCESS
Definition: deptool.c:10
#define KEY_READ
Definition: nt_native.h:1023
GLuint buffer
Definition: glext.h:5915
int32_t INT
Definition: typedefs.h:56
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
const GUID * guid
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2343
unsigned long DWORD
Definition: ntddk_ex.h:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
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:2456
static const WCHAR typelibW[]
Definition: actctx.c:595

Referenced by query_typelib_path().

◆ func_restricted()

static BOOL func_restricted ( const FUNCDESC *  desc)
inlinestatic

Definition at line 7135 of file typelib.c.

7136 {
7137  return (desc->wFuncFlags & FUNCFLAG_FRESTRICTED) && (desc->memid >= 0);
7138 }
const struct builtin_class_descr * desc
Definition: regcontrol.c:48

Referenced by ITypeInfo_fnInvoke().

◆ get_iface_guid()

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

Definition at line 6668 of file typelib.c.

6669 {
6670  ITypeInfo *tinfo2;
6671  TYPEATTR *tattr;
6672  HRESULT hres;
6673  int flags, i;
6674 
6675  hres = ITypeInfo_GetRefTypeInfo(tinfo, href, &tinfo2);
6676  if(FAILED(hres))
6677  return hres;
6678 
6679  hres = ITypeInfo_GetTypeAttr(tinfo2, &tattr);
6680  if(FAILED(hres)) {
6681  ITypeInfo_Release(tinfo2);
6682  return hres;
6683  }
6684 
6685  switch(tattr->typekind) {
6686  case TKIND_ALIAS:
6687  hres = get_iface_guid(tinfo2, tattr->tdescAlias.u.hreftype, guid);
6688  break;
6689 
6690  case TKIND_INTERFACE:
6691  case TKIND_DISPATCH:
6692  *guid = tattr->guid;
6693  break;
6694 
6695  case TKIND_COCLASS:
6696  for (i = 0; i < tattr->cImplTypes; i++)
6697  {
6698  ITypeInfo_GetImplTypeFlags(tinfo2, i, &flags);
6699  if (flags & IMPLTYPEFLAG_FDEFAULT)
6700  break;
6701  }
6702 
6703  if (i == tattr->cImplTypes)
6704  i = 0;
6705 
6706  hres = ITypeInfo_GetRefTypeOfImplType(tinfo2, i, &href);
6707  if (SUCCEEDED(hres))
6708  hres = get_iface_guid(tinfo2, href, guid);
6709  break;
6710 
6711  default:
6712  ERR("Unexpected typekind %d\n", tattr->typekind);
6713  hres = E_UNEXPECTED;
6714  }
6715 
6716  ITypeInfo_ReleaseTypeAttr(tinfo2, tattr);
6717  ITypeInfo_Release(tinfo2);
6718  return hres;
6719 }
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
const GUID * guid
static HRESULT get_iface_guid(ITypeInfo *tinfo, HREFTYPE href, GUID *guid)
Definition: typelib.c:6668
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GLbitfield flags
Definition: glext.h:7161
#define ERR(fmt,...)
Definition: debug.h:109
#define E_UNEXPECTED
Definition: winerror.h:2456
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by ITypeInfo_fnInvoke().

◆ get_interface_key()

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

Definition at line 256 of file typelib.c.

257 {
258  static const WCHAR InterfaceW[] = {'I','n','t','e','r','f','a','c','e','\\',0};
259 
260  memcpy( buffer, InterfaceW, sizeof(InterfaceW) );
262  return buffer;
263 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
GLuint buffer
Definition: glext.h:5915
const GUID * guid
__wchar_t WCHAR
Definition: xmlstorage.h:180
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2343
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878

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 267 of file typelib.c.

268 {
269  static const WCHAR LcidFormatW[] = {'%','l','x','\\',0};
270  static const WCHAR win16W[] = {'w','i','n','1','6',0};
271  static const WCHAR win32W[] = {'w','i','n','3','2',0};
272  static const WCHAR win64W[] = {'w','i','n','6','4',0};
273 
274  sprintfW( buffer, LcidFormatW, lcid );
275  switch(syskind)
276  {
277  case SYS_WIN16: strcatW( buffer, win16W ); break;
278  case SYS_WIN32: strcatW( buffer, win32W ); break;
279  case SYS_WIN64: strcatW( buffer, win64W ); break;
280  default:
281  TRACE("Typelib is for unsupported syskind %i\n", syskind);
282  return NULL;
283  }
284  return buffer;
285 }
GLuint buffer
Definition: glext.h:5915
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR win32W[]
Definition: cache.c:42
#define sprintfW
Definition: unicode.h:58
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242

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:111

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 243 of file typelib.c.

244 {
245  static const WCHAR TypelibW[] = {'T','y','p','e','l','i','b','\\',0};
246  static const WCHAR VersionFormatW[] = {'\\','%','x','.','%','x',0};
247 
248  memcpy( buffer, TypelibW, sizeof(TypelibW) );
250  sprintfW( buffer + strlenW(buffer), VersionFormatW, wMaj, wMin );
251  return buffer;
252 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
GLuint buffer
Definition: glext.h:5915
const GUID * guid
__wchar_t WCHAR
Definition: xmlstorage.h:180
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
Definition: compobj.c:2343
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define sprintfW
Definition: unicode.h:58

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

◆ hash_guid()

static int hash_guid ( GUID guid)
inlinestatic

Definition at line 9293 of file typelib.c.

9294 {
9295  int i, hash = 0;
9296 
9297  for (i = 0; i < 8; i ++)
9298  hash ^= ((const short *)guid)[i];
9299 
9300  return hash & 0x1f;
9301 }
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
const GUID * guid
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 10678 of file typelib.c.

10680 {
10682  TLBFuncDesc tmp_func_desc, *func_desc;
10683  int buf_size, i;
10684  char *buffer;
10685  HRESULT hres;
10686 
10687  TRACE("%p %u %p\n", This, index, funcDesc);
10688 
10689  if (!funcDesc || funcDesc->oVft & 3)
10690  return E_INVALIDARG;
10691 
10692  switch (This->typeattr.typekind) {
10693  case TKIND_MODULE:
10694  if (funcDesc->funckind != FUNC_STATIC)
10695  return TYPE_E_BADMODULEKIND;
10696  break;
10697  case TKIND_DISPATCH:
10698  if (funcDesc->funckind != FUNC_DISPATCH)
10699  return TYPE_E_BADMODULEKIND;
10700  break;
10701  default:
10702  if (funcDesc->funckind != FUNC_PUREVIRTUAL)
10703  return TYPE_E_BADMODULEKIND;
10704  }
10705 
10706  if (index > This->typeattr.cFuncs)
10707  return TYPE_E_ELEMENTNOTFOUND;
10708 
10709  if (funcDesc->invkind & (INVOKE_PROPERTYPUT | INVOKE_PROPERTYPUTREF) &&
10710  !funcDesc->cParams)
10712 
10713 #ifdef _WIN64
10714  if(This->pTypeLib->syskind == SYS_WIN64 &&
10715  funcDesc->oVft % 8 != 0)
10716  return E_INVALIDARG;
10717 #endif
10718 
10719  memset(&tmp_func_desc, 0, sizeof(tmp_func_desc));
10720  TLBFuncDesc_Constructor(&tmp_func_desc);
10721 
10722  tmp_func_desc.funcdesc = *funcDesc;
10723 
10724  if (tmp_func_desc.funcdesc.oVft != 0)
10725  tmp_func_desc.funcdesc.oVft |= 1;
10726 
10727  if (funcDesc->cScodes && funcDesc->lprgscode) {
10728  tmp_func_desc.funcdesc.lprgscode = heap_alloc(sizeof(SCODE) * funcDesc->cScodes);
10729  memcpy(tmp_func_desc.funcdesc.lprgscode, funcDesc->lprgscode, sizeof(SCODE) * funcDesc->cScodes);
10730  } else {
10731  tmp_func_desc.funcdesc.lprgscode = NULL;
10732  tmp_func_desc.funcdesc.cScodes = 0;
10733  }
10734 
10735  buf_size = TLB_SizeElemDesc(&funcDesc->elemdescFunc);
10736  for (i = 0; i < funcDesc->cParams; ++i) {
10737  buf_size += sizeof(ELEMDESC);
10738  buf_size += TLB_SizeElemDesc(funcDesc->lprgelemdescParam + i);
10739  }
10740  tmp_func_desc.funcdesc.lprgelemdescParam = heap_alloc(buf_size);
10741  buffer = (char*)(tmp_func_desc.funcdesc.lprgelemdescParam + funcDesc->cParams);
10742 
10743  hres = TLB_CopyElemDesc(&funcDesc->elemdescFunc, &tmp_func_desc.funcdesc.elemdescFunc, &buffer);
10744  if (FAILED(hres)) {
10745  heap_free(tmp_func_desc.funcdesc.lprgelemdescParam);
10746  heap_free(tmp_func_desc.funcdesc.lprgscode);
10747  return hres;
10748  }
10749 
10750  for (i = 0; i < funcDesc->cParams; ++i) {
10751  hres = TLB_CopyElemDesc(funcDesc->lprgelemdescParam + i,
10752  tmp_func_desc.funcdesc.lprgelemdescParam + i, &buffer);
10753  if (FAILED(hres)) {
10754  heap_free(tmp_func_desc.funcdesc.lprgelemdescParam);
10755  heap_free(tmp_func_desc.funcdesc.lprgscode);
10756  return hres;
10757  }
10758  if (tmp_func_desc.funcdesc.lprgelemdescParam[i].u.paramdesc.wParamFlags & PARAMFLAG_FHASDEFAULT &&
10759  tmp_func_desc.funcdesc.lprgelemdescParam[i].tdesc.vt != VT_VARIANT &&
10760  tmp_func_desc.funcdesc.lprgelemdescParam[i].tdesc.vt != VT_USERDEFINED){
10761  hres = TLB_SanitizeVariant(&tmp_func_desc.funcdesc.lprgelemdescParam[i].u.paramdesc.pparamdescex->varDefaultValue);
10762  if (FAILED(hres)) {
10763  heap_free(tmp_func_desc.funcdesc.lprgelemdescParam);
10764  heap_free(tmp_func_desc.funcdesc.lprgscode);
10765  return hres;
10766  }
10767  }
10768  }
10769 
10770  tmp_func_desc.pParamDesc = TLBParDesc_Constructor(funcDesc->cParams);
10771 
10772  if (This->funcdescs) {
10773  This->funcdescs = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->funcdescs,
10774  sizeof(TLBFuncDesc) * (This->typeattr.cFuncs + 1));
10775 
10776  if (index < This->typeattr.cFuncs) {
10777  memmove(This->funcdescs + index + 1, This->funcdescs + index,
10778  (This->typeattr.cFuncs - index) * sizeof(TLBFuncDesc));
10779  func_desc = This->funcdescs + index;
10780  } else
10781  func_desc = This->funcdescs + This->typeattr.cFuncs;
10782 
10783  /* move custdata lists to the new memory location */
10784  for(i = 0; i < This->typeattr.cFuncs + 1; ++i){
10785  if(index != i){
10786  TLBFuncDesc *fd = &This->funcdescs[i];
10787  if(fd->custdata_list.prev == fd->custdata_list.next)
10788  list_init(&fd->custdata_list);
10789  else{
10790  fd->custdata_list.prev->next = &fd->custdata_list;
10791  fd->custdata_list.next->prev = &fd->custdata_list;
10792  }
10793  }
10794  }
10795  } else
10796  func_desc = This->funcdescs = heap_alloc(sizeof(TLBFuncDesc));
10797 
10798  memcpy(func_desc, &tmp_func_desc, sizeof(tmp_func_desc));
10799  list_init(&func_desc->custdata_list);
10800 
10801  ++This->typeattr.cFuncs;
10802 
10803  This->needs_layout = TRUE;
10804 
10805  return S_OK;
10806 }
static ITypeInfoImpl * info_impl_from_ICreateTypeInfo2(ICreateTypeInfo2 *iface)
Definition: typelib.c:1294
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
#define TRUE
Definition: types.h:120
GLuint buffer
Definition: glext.h:5915
static int fd
Definition: io.c:51
#define TYPE_E_BADMODULEKIND
Definition: winerror.h:2544
static SIZE_T TLB_SizeElemDesc(const ELEMDESC *elemdesc)
Definition: typelib.c:5816
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
struct list custdata_list
Definition: typelib.c:1216
#define TYPE_E_INCONSISTENTPROPFUNCS
Definition: winerror.h:2553
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
LONG SCODE
Definition: compat.h:1886
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
GLuint index
Definition: glext.h:6031
TLBParDesc * pParamDesc
Definition: typelib.c:1211
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
#define GetProcessHeap()
Definition: compat.h:395
LONG HRESULT
Definition: typedefs.h:77
FUNCDESC funcdesc
Definition: typelib.c:1209
static TLBParDesc * TLBParDesc_Constructor(UINT n)
Definition: typelib.c:1770
static HRESULT TLB_CopyElemDesc(const ELEMDESC *src, ELEMDESC *dest, char **buffer)
Definition: typelib.c:5824
#define index(s, c)
Definition: various.h:29
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static void TLBFuncDesc_Constructor(TLBFuncDesc *func_desc)
Definition: typelib.c:1786
#define S_OK
Definition: intsafe.h:59
#define HeapReAlloc
Definition: compat.h:393
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
#define TYPE_E_ELEMENTNOTFOUND
Definition: winerror.h:2539
static HRESULT TLB_SanitizeVariant(VARIANT *var)
Definition: typelib.c:5853
#define memset(x, y, z)
Definition: compat.h:39
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ICreateTypeInfo2_fnAddImplType()

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

Definition at line 10808 of file typelib.c.

10810 {
10812  TLBImplType *impl_type;
10813  HRESULT hres;
10814 
10815  TRACE("%p %u %d\n", This, index, refType);
10816 
10817  switch(This->typeattr.typekind){
10818  case TKIND_COCLASS: {
10819  if (index == -1) {
10820  FIXME("Unhandled index: -1\n");
10821  return E_NOTIMPL;
10822  }
10823 
10824  if(index != This->typeattr.cImplTypes)
10825  return TYPE_E_ELEMENTNOTFOUND;
10826 
10827  break;
10828  }
10829  case TKIND_INTERFACE:
10830  case TKIND_DISPATCH:
10831  if (index != 0 || This->typeattr.cImplTypes)
10832  return TYPE_E_ELEMENTNOTFOUND;
10833  break;
10834  default:
10835  FIXME("Unimplemented typekind: %d\n", This->typeattr.typekind);
10836  return E_NOTIMPL;
10837  }
10838 
10839  if (This->impltypes){
10840  UINT i;
10841 
10842  This->impltypes = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->impltypes,
10843  sizeof(TLBImplType) * (This->typeattr.cImplTypes + 1));
10844 
10845  if (index < This->typeattr.cImplTypes) {
10846  memmove(This->impltypes + index + 1, This->impltypes + index,
10847  (This->typeattr.cImplTypes - index) * sizeof(TLBImplType));
10848  impl_type = This->impltypes + index;
10849  } else
10850  impl_type = This->impltypes + This->typeattr.cImplTypes;
10851 
10852  /* move custdata lists to the new memory location */
10853  for(i = 0; i < This->typeattr.cImplTypes + 1; ++i){
10854  if(index != i){
10855  TLBImplType *it = &This->impltypes[i];
10856  if(it->custdata_list.prev == it->custdata_list.next)
10857  list_init(&it->custdata_list);
10858  else{
10859  it->custdata_list.prev->next = &it->custdata_list;
10860  it->custdata_list.next->prev = &it->custdata_list;
10861  }
10862  }
10863  }
10864  } else
10865  impl_type = This->impltypes = heap_alloc(sizeof(TLBImplType));
10866 
10867  memset(impl_type, 0, sizeof(TLBImplType));
10868  TLBImplType_Constructor(impl_type);
10869  impl_type->hRef = refType;
10870 
10871  ++This->typeattr.cImplTypes;
10872 
10873  if((refType & (~0x3)) == (This->pTypeLib->dispatch_href & (~0x3)))
10874  This->typeattr.wTypeFlags |= TYPEFLAG_FDISPATCHABLE;
10875 
10876  hres = ICreateTypeInfo2_LayOut(iface);
10877  if (FAILED(hres))
10878  return hres;
10879 
10880  return S_OK;
10881 }
static ITypeInfoImpl * info_impl_from_ICreateTypeInfo2(ICreateTypeInfo2 *iface)
Definition: typelib.c:1294
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
HREFTYPE hRef
Definition: typelib.c:1234
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
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
#define FIXME(fmt,...)
Definition: debug.h:110
static void TLBImplType_Constructor(TLBImplType *impl)
Definition: typelib.c:1807
GLuint index
Definition: glext.h:6031
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
#define GetProcessHeap()
Definition: compat.h:395
LONG HRESULT
Definition: typedefs.h:77
#define index(s, c)
Definition: various.h:29
#define S_OK
Definition: intsafe.h:59
#define HeapReAlloc
Definition: compat.h:393
#define E_NOTIMPL
Definition: ddrawi.h:99
unsigned int UINT
Definition: ndis.h:50
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
#define TYPE_E_ELEMENTNOTFOUND
Definition: winerror.h:2539
#define memset(x, y, z)
Definition: compat.h:39
struct list custdata_list
Definition: typelib.c:1236

◆ ICreateTypeInfo2_fnAddRef()

static ULONG WINAPI ICreateTypeInfo2_fnAddRef ( ICreateTypeInfo2 iface)
static

Definition at line 10461 of file typelib.c.

10462 {
10464 
10465  return ITypeInfo2_AddRef(&This->ITypeInfo2_iface);
10466 }
static ITypeInfoImpl * info_impl_from_ICreateTypeInfo2(ICreateTypeInfo2 *iface)
Definition: typelib.c:1294

◆ ICreateTypeInfo2_fnAddRefTypeInfo()

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

Definition at line 10570 of file typelib.c.

10572 {
10574  UINT index;
10576  TLBRefType *ref_type;
10577  TLBImpLib *implib;
10578  TYPEATTR *typeattr;
10579  TLIBATTR *libattr;
10580  HRESULT hres;
10581 
10582  TRACE("%p %p %p\n", This, typeInfo, refType);
10583 
10584  if (!typeInfo || !refType)
10585  return E_INVALIDARG;
10586 
10587  hres = ITypeInfo_GetContainingTypeLib(typeInfo, &container, &index);
10588  if (FAILED(hres))
10589  return hres;
10590 
10591  if (container == (ITypeLib*)&This->pTypeLib->ITypeLib2_iface) {
10593 
10594  ITypeLib_Release(container);
10595 
10596  *refType = target->hreftype;
10597 
10598  return S_OK;
10599  }
10600 
10601  hres = ITypeLib_GetLibAttr(container, &libattr);
10602  if (FAILED(hres)) {
10603  ITypeLib_Release(container);
10604  return hres;
10605  }
10606 
10607  LIST_FOR_EACH_ENTRY(implib, &This->pTypeLib->implib_list, TLBImpLib, entry){
10608  if(IsEqualGUID(&implib->guid->guid, &libattr->guid) &&
10609  implib->lcid == libattr->lcid &&
10610  implib->wVersionMajor == libattr->wMajorVerNum &&
10611  implib->wVersionMinor == libattr->wMinorVerNum)
10612  break;
10613  }
10614 
10615  if(&implib->entry == &This->pTypeLib->implib_list){
10616  implib = heap_alloc_zero(sizeof(TLBImpLib));
10617 
10618  if((ITypeLib2Vtbl*)container->lpVtbl == &tlbvt){
10619  const ITypeLibImpl *our_container = impl_from_ITypeLib2((ITypeLib2*)container);
10620  implib->name = SysAllocString(our_container->path);
10621  }else{
10622  hres = QueryPathOfRegTypeLib(&libattr->guid, libattr->wMajorVerNum,
10623  libattr->wMinorVerNum, libattr->lcid, &implib->name);
10624  if(FAILED(hres)){
10625  implib->name = NULL;
10626  TRACE("QueryPathOfRegTypeLib failed, no name stored: %08x\n", hres);
10627  }
10628  }
10629 
10630  implib->guid = TLB_append_guid(&This->pTypeLib->guid_list, &libattr->guid, 2);
10631  implib->lcid = libattr->lcid;
10632  implib->wVersionMajor = libattr->wMajorVerNum;
10633  implib->wVersionMinor = libattr->wMinorVerNum;
10634 
10635  list_add_tail(&This->pTypeLib->implib_list, &implib->entry);
10636  }
10637 
10638  ITypeLib_ReleaseTLibAttr(container, libattr);
10639  ITypeLib_Release(container);
10640 
10641  hres = ITypeInfo_GetTypeAttr(typeInfo, &typeattr);
10642  if (FAILED(hres))
10643  return hres;
10644 
10645  index = 0;
10646  LIST_FOR_EACH_ENTRY(ref_type, &This->pTypeLib->ref_list, TLBRefType, entry){
10647  if(ref_type->index == TLB_REF_USE_GUID &&
10648  IsEqualGUID(&ref_type->guid->guid, &typeattr->guid) &&
10649  ref_type->tkind == typeattr->typekind)
10650  break;
10651  ++index;
10652  }
10653 
10654  if(&ref_type->entry == &This->pTypeLib->ref_list){
10655  ref_type = heap_alloc_zero(sizeof(TLBRefType));
10656 
10657  ref_type->tkind = typeattr->typekind;
10658  ref_type->pImpTLInfo = implib;
10659  ref_type->reference = index * sizeof(MSFT_ImpInfo);
10660 
10661  ref_type->index = TLB_REF_USE_GUID;
10662 
10663  ref_type->guid = TLB_append_guid(&This->pTypeLib->guid_list, &typeattr->guid, ref_type->reference+1);
10664 
10665  list_add_tail(&This->pTypeLib->ref_list, &ref_type->entry);
10666  }
10667 
10668  ITypeInfo_ReleaseTypeAttr(typeInfo, typeattr);
10669 
10670  *refType = ref_type->reference | 0x1;
10671 
10672  if(IsEqualGUID(&ref_type->guid->guid, &IID_IDispatch))
10673  This->pTypeLib->dispatch_href = *refType;
10674 
10675  return S_OK;
10676 }
static ITypeInfoImpl * info_impl_from_ICreateTypeInfo2(ICreateTypeInfo2 *iface)
Definition: typelib.c:1294
WCHAR * path
Definition: typelib.c:1141
TLBGuid * guid
Definition: typelib.c:1183
#define TLB_REF_USE_GUID
Definition: typelib.c:1194
TLBImpLib * pImpTLInfo
Definition: typelib.c:1187
uint8_t entry
Definition: isohybrid.c:63
static ITypeInfoImpl * impl_from_ITypeInfo(ITypeInfo *iface)
Definition: typelib.c:1289
HRESULT WINAPI QueryPathOfRegTypeLib(REFGUID guid, WORD wMaj, WORD wMin, LCID lcid, LPBSTR path)
Definition: typelib.c:409
TLBGuid * guid
Definition: typelib.c:1080
struct tagMSFT_ImpInfo MSFT_ImpInfo
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
struct container container
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
GLuint index
Definition: glext.h:6031
struct list entry
Definition: typelib.c:1191
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
struct list entry
Definition: typelib.c:1090
const GUID IID_IDispatch
static ITypeLibImpl * impl_from_ITypeLib2(ITypeLib2 *iface)
Definition: typelib.c:1149
#define index(s, c)
Definition: various.h:29
static const ITypeLib2Vtbl tlbvt
Definition: typelib.c:1145
TYPEKIND tkind
Definition: typelib.c:1182
#define S_OK
Definition: intsafe.h:59
WORD wVersionMinor
Definition: typelib.c:1086
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
static TLBGuid * TLB_append_guid(struct list *guid_list, const GUID *new_guid, HREFTYPE hreftype)
Definition: typelib.c:1828
HREFTYPE reference
Definition: typelib.c:1186
GLenum target
Definition: glext.h:7315
WORD wVersionMajor
Definition: typelib.c:1085
GUID guid
Definition: typelib.c:1060

◆ ICreateTypeInfo2_fnAddVarDesc()

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

Definition at line 10931 of file typelib.c.

10933 {
10935  TLBVarDesc *var_desc;
10936 
10937  TRACE("%p %u %p\n", This, index, varDesc);
10938 
10939  if (This->vardescs){
10940  UINT i;
10941 
10942  This->vardescs = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->vardescs,
10943  sizeof(TLBVarDesc) * (This->typeattr.cVars + 1));
10944 
10945  if (index < This->typeattr.cVars) {
10946  memmove(This->vardescs + index + 1, This->vardescs + index,
10947  (This->typeattr.cVars - index) * sizeof(TLBVarDesc));
10948  var_desc = This->vardescs + index;
10949  } else
10950  var_desc = This->vardescs + This->typeattr.cVars;
10951 
10952  /* move custdata lists to the new memory location */
10953  for(i = 0; i < This->typeattr.cVars + 1; ++i){
10954  if(index != i){
10955  TLBVarDesc *var = &This->vardescs[i];
10956  if(var->custdata_list.prev == var->custdata_list.next)
10957  list_init(&var->custdata_list);
10958  else{
10959  var->custdata_list.prev->next = &var->custdata_list;
10960  var->custdata_list.next->prev = &var->custdata_list;
10961  }
10962  }
10963  }
10964  } else
10965  var_desc = This->vardescs = heap_alloc_zero(sizeof(TLBVarDesc));
10966 
10967  TLBVarDesc_Constructor(var_desc);
10968  TLB_AllocAndInitVarDesc(varDesc, &var_desc->vardesc_create);
10969  var_desc->vardesc = *var_desc->vardesc_create;
10970 
10971  ++This->typeattr.cVars;
10972 
10973  This->needs_layout = TRUE;
10974 
10975  return S_OK;
10976 }
static ITypeInfoImpl * info_impl_from_ICreateTypeInfo2(ICreateTypeInfo2 *iface)
Definition: typelib.c:1294
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
#define TRUE
Definition: types.h:120
VARDESC * vardesc_create
Definition: typelib.c:1223
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
GLuint index
Definition: glext.h:6031
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
VARDESC vardesc
Definition: typelib.c:1222
struct list custdata_list
Definition: typelib.c:1228
static void TLBVarDesc_Constructor(TLBVarDesc *var_desc)
Definition: typelib.c:1749
#define index(s, c)
Definition: various.h:29
#define S_OK
Definition: intsafe.h:59
#define HeapReAlloc
Definition: compat.h:393
unsigned int UINT
Definition: ndis.h:50
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
static HRESULT TLB_AllocAndInitVarDesc(const VARDESC *src, VARDESC **dest_ptr)
Definition: typelib.c:6110
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149

◆ ICreateTypeInfo2_fnDefineFuncAsDllEntry()

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

Definition at line 11063 of file typelib.c.

11065 {
11067  FIXME("%p %u %s %s - stub\n", This, index, wine_dbgstr_w(dllName), wine_dbgstr_w(procName));
11068  return E_NOTIMPL;
11069 }
static ITypeInfoImpl * info_impl_from_ICreateTypeInfo2(ICreateTypeInfo2 *iface)
Definition: typelib.c:1294
#define wine_dbgstr_w
Definition: kernel32.h:34
#define FIXME(fmt,...)
Definition: debug.h:110
GLuint index
Definition: glext.h:6031
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ICreateTypeInfo2_fnDeleteFuncDesc()

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

Definition at line 11308 of file typelib.c.

11310 {
11312  FIXME("%p %u - stub\n", This, index);
11313  return E_NOTIMPL;
11314 }
static ITypeInfoImpl * info_impl_from_ICreateTypeInfo2(ICreateTypeInfo2 *iface)
Definition: typelib.c:1294
#define FIXME(fmt,...)
Definition: debug.h:110
GLuint index
Definition: glext.h:6031
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ICreateTypeInfo2_fnDeleteFuncDescByMemId()

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

Definition at line 11316 of file typelib.c.

11318 {
11320  FIXME("%p %x %d - stub\n", This, memid, invKind);
11321  return E_NOTIMPL;
11322 }
static ITypeInfoImpl * info_impl_from_ICreateTypeInfo2(ICreateTypeInfo2 *iface)
Definition: typelib.c:1294
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ICreateTypeInfo2_fnDeleteImplType()

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

Definition at line 11340 of file typelib.c.

11342 {
11344  FIXME("%p %u - stub\n", This, index);
11345  return E_NOTIMPL;
11346 }
static ITypeInfoImpl * info_impl_from_ICreateTypeInfo2(ICreateTypeInfo2 *iface)
Definition: typelib.c:1294
#define FIXME(fmt,...)
Definition: debug.h:110
GLuint index
Definition: glext.h:6031
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ICreateTypeInfo2_fnDeleteVarDesc()

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

Definition at line 11324 of file typelib.c.

11326 {
11328  FIXME("%p %u - stub\n", This, index);
11329  return E_NOTIMPL;
11330 }
static ITypeInfoImpl * info_impl_from_ICreateTypeInfo2(ICreateTypeInfo2 *iface)
Definition: typelib.c:1294
#define FIXME(fmt,...)
Definition: debug.h:110
GLuint index
Definition: glext.h:6031
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ICreateTypeInfo2_fnDeleteVarDescByMemId()

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

Definition at line 11332 of file typelib.c.

11334 {
11336  FIXME("%p %x - stub\n", This, memid);
11337  return E_NOTIMPL;
11338 }
static ITypeInfoImpl * info_impl_from_ICreateTypeInfo2(ICreateTypeInfo2 *iface)
Definition: typelib.c:1294
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ICreateTypeInfo2_fnInvalidate()

static HRESULT WINAPI ICreateTypeInfo2_fnInvalidate ( ICreateTypeInfo2 iface)
static

Definition at line 11425 of file typelib.c.

11426 {
11428  FIXME("%p - stub\n", This);
11429  return E_NOTIMPL;
11430 }
static ITypeInfoImpl * info_impl_from_ICreateTypeInfo2(ICreateTypeInfo2 *iface)
Definition: typelib.c:1294
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ICreateTypeInfo2_fnLayOut()

static HRESULT WINAPI ICreateTypeInfo2_fnLayOut ( ICreateTypeInfo2 iface)
static

Definition at line 11165 of file typelib.c.

11166 {
11168  ITypeInfo *tinfo;
11169  TLBFuncDesc *func_desc;
11170  UINT user_vft = 0, i, depth = 0;
11171  HRESULT hres = S_OK;
11172 
11173  TRACE("%p\n", This);
11174 
11175  This->needs_layout = FALSE;
11176 
11177  hres = ICreateTypeInfo2_QueryInterface(iface, &IID_ITypeInfo, (LPVOID*)&tinfo);
11178  if (FAILED(hres))
11179  return hres;
11180 
11181  if (This->typeattr.typekind == TKIND_INTERFACE) {
11182  ITypeInfo *inh;
11183  TYPEATTR *attr;
11184  HREFTYPE inh_href;
11185 
11186  hres = ITypeInfo_GetRefTypeOfImplType(tinfo, 0, &inh_href);
11187 
11188  if (SUCCEEDED(hres)) {
11189  hres = ITypeInfo_GetRefTypeInfo(tinfo, inh_href, &inh);
11190 
11191  if (SUCCEEDED(hres)) {
11192  hres = ITypeInfo_GetTypeAttr(inh, &attr);
11193  if (FAILED(hres)) {
11194  ITypeInfo_Release(inh);
11195  ITypeInfo_Release(tinfo);
11196  return hres;
11197  }
11198  This->typeattr.cbSizeVft = attr->cbSizeVft;
11199  ITypeInfo_ReleaseTypeAttr(inh, attr);
11200 
11201  do{
11202  ++depth;
11203  hres = ITypeInfo_GetRefTypeOfImplType(inh, 0, &inh_href);
11204  if(SUCCEEDED(hres)){
11205  ITypeInfo *next;
11206  hres = ITypeInfo_GetRefTypeInfo(inh, inh_href, &next);
11207  if(SUCCEEDED(hres)){
11208  ITypeInfo_Release(inh);
11209  inh = next;
11210  }
11211  }
11212  }while(SUCCEEDED(hres));
11213  hres = S_OK;
11214 
11215  ITypeInfo_Release(inh);
11216  } else if (hres == TYPE_E_ELEMENTNOTFOUND) {
11217  This->typeattr.cbSizeVft = 0;
11218  hres = S_OK;
11219  } else {
11220  ITypeInfo_Release(tinfo);
11221  return hres;
11222  }
11223  } else if (hres == TYPE_E_ELEMENTNOTFOUND) {
11224  This->typeattr.cbSizeVft = 0;
11225  hres = S_OK;
11226  } else {
11227  ITypeInfo_Release(tinfo);
11228  return hres;
11229  }
11230  } else if (This->typeattr.typekind == TKIND_DISPATCH)
11231  This->typeattr.cbSizeVft = 7 * This->pTypeLib->ptr_size;
11232  else
11233  This->typeattr.cbSizeVft = 0;
11234 
11235  func_desc = This->funcdescs;
11236  i = 0;
11237  while (i < This->typeattr.cFuncs) {
11238  if (!(func_desc->funcdesc.oVft & 0x1))
11239  func_desc->funcdesc.oVft = This->typeattr.cbSizeVft;
11240 
11241  if ((func_desc->funcdesc.oVft & 0xFFFC) > user_vft)
11242  user_vft = func_desc->funcdesc.oVft & 0xFFFC;
11243 
11244  This->typeattr.cbSizeVft += This->pTypeLib->ptr_size;
11245 
11246  if (func_desc->funcdesc.memid == MEMBERID_NIL) {
11247  TLBFuncDesc *iter;
11248  UINT j = 0;
11249  BOOL reset = FALSE;
11250 
11251  func_desc->funcdesc.memid = 0x60000000 + (depth << 16) + i;
11252 
11253  iter = This->funcdescs;
11254  while (j < This->typeattr.cFuncs) {
11255  if (iter != func_desc && iter->funcdesc.memid == func_desc->funcdesc.memid) {
11256  if (!reset) {
11257  func_desc->funcdesc.memid = 0x60000000 + (depth << 16) + This->typeattr.cFuncs;
11258  reset = TRUE;
11259  } else
11260  ++func_desc->funcdesc.memid;
11261  iter = This->funcdescs;
11262  j = 0;
11263  } else {
11264  ++iter;
11265  ++j;
11266  }