57#define NONAMELESSUNION
109#ifdef WORDS_BIGENDIAN
112 return (((p_iVal & 0x00FF) << 8) |
113 ((p_iVal & 0xFF00) >> 8));
119 return (((p_iVal & 0x000000FF) << 24) |
120 ((p_iVal & 0x0000FF00) << 8) |
121 ((p_iVal & 0x00FF0000) >> 8) |
122 ((p_iVal & 0xFF000000) >> 24));
125#define FromLEWord(X) (X)
126#define FromLEDWord(X) (X)
129#define DISPATCH_HREF_OFFSET 0x01000000
130#define DISPATCH_HREF_MASK 0xff000000
137#ifdef WORDS_BIGENDIAN
142 p_iSize /=
sizeof(
WORD);
156 p_iSize /=
sizeof(
DWORD);
165#define FromLEWords(X,Y)
166#define FromLEDWords(X,Y)
174 static const WCHAR typelibW[] = {
'T',
'y',
'p',
'e',
'l',
'i',
'b',
'\\',0};
178 INT best_maj = -1, best_min = -1;
197 if (*wMaj == 0xffff && *wMin == 0xffff)
199 if (v_maj > best_maj) best_maj = v_maj;
200 if (v_min > best_min) best_min = v_min;
202 else if (*wMaj == v_maj)
211 if (*wMin != 0xffff && v_min > best_min) best_min = v_min;
218 TRACE(
"found best_maj %d, best_min %d\n", best_maj, best_min);
220 if (*wMaj == 0xffff && *wMin == 0xffff)
222 if (best_maj >= 0 && best_min >= 0)
230 if (*wMaj == best_maj && best_min >= 0)
242 static const WCHAR TypelibW[] = {
'T',
'y',
'p',
'e',
'l',
'i',
'b',
'\\',0};
243 static const WCHAR VersionFormatW[] = {
'\\',
'%',
'x',
'.',
'%',
'x',0};
255 static const WCHAR InterfaceW[] = {
'I',
'n',
't',
'e',
'r',
'f',
'a',
'c',
'e',
'\\',0};
266 static const WCHAR LcidFormatW[] = {
'%',
'l',
'x',
'\\',0};
267 static const WCHAR win16W[] = {
'w',
'i',
'n',
'1',
'6',0};
268 static const WCHAR win32W[] = {
'w',
'i',
'n',
'3',
'2',0};
269 static const WCHAR win64W[] = {
'w',
'i',
'n',
'6',
'4',0};
278 TRACE(
"Typelib is for unsupported syskind %i\n", syskind);
315 ACTCTX_SECTION_KEYED_DATA
data;
362 else if (myLCID == lcid)
367 else if ((myLCID ==
SUBLANGID(lcid)) && myLCID)
435 hres = ICreateTypeLib2_QueryInterface(typelib2, &IID_ICreateTypeLib, (
void **)&ctlib);
436 ICreateTypeLib2_Release(typelib2);
483 if (!szFile || !pptLib)
495 if (((szFile[0] ==
'\\') && (szFile[1] ==
'\\')) ||
496 (szFile[0] && (szFile[1] ==
':')))
break;
502 ITypeLib_Release(*pptLib);
550 if ((wVerMajor!=0xffff || wVerMinor!=0xffff) && *ppTLib)
554 res = ITypeLib_GetLibAttr(*ppTLib, &
attr);
558 ITypeLib_ReleaseTLibAttr(*ppTLib,
attr);
562 ITypeLib_Release(*ppTLib);
580static const WCHAR ProxyStubClsidW[] = {
'P',
'r',
'o',
'x',
'y',
'S',
't',
'u',
'b',
'C',
'l',
's',
'i',
'd',0};
581static const WCHAR ProxyStubClsid32W[] = {
'P',
'r',
'o',
'x',
'y',
'S',
't',
'u',
'b',
'C',
'l',
's',
'i',
'd',
'3',
'2',0};
588 static const WCHAR typelib_proxy_clsid[] = {
'{',
'0',
'0',
'0',
'2',
'0',
'4',
'2',
'4',
'-',
589 '0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'C',
'0',
'0',
'0',
'-',
590 '0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'4',
'6',
'}',0};
591 static const WCHAR dispatch_proxy_clsid[] = {
'{',
'0',
'0',
'0',
'2',
'0',
'4',
'2',
'0',
'-',
592 '0',
'0',
'0',
'0',
'-',
'0',
'0',
'0',
'0',
'-',
'C',
'0',
'0',
'0',
'-',
593 '0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'0',
'4',
'6',
'}',0};
599 const WCHAR *proxy_clsid;
601 if (tattr->typekind ==
TKIND_INTERFACE || (tattr->wTypeFlags & TYPEFLAG_FDUAL))
602 proxy_clsid = typelib_proxy_clsid;
604 proxy_clsid = dispatch_proxy_clsid;
613 (
const BYTE *)proxy_clsid,
sizeof(typelib_proxy_clsid));
620 (
const BYTE *)proxy_clsid,
sizeof(typelib_proxy_clsid));
628 static const WCHAR fmtver[] = {
'%',
'x',
'.',
'%',
'x',0 };
629 static const WCHAR VersionW[] = {
'V',
'e',
'r',
's',
'i',
'o',
'n',0};
634 swprintf(
buffer, fmtver, libattr->wMajorVerNum, libattr->wMinorVerNum);
667 if (ptlib ==
NULL || szFullPath ==
NULL)
670 if (
FAILED(ITypeLib_GetLibAttr(ptlib, &
attr)))
718 static const WCHAR formatW[] = {
'%',
'u',0};
742 pIndexStr =
wcsrchr(szHelpDir,
'\\');
749 if (szHelpDir !=
NULL) {
768 types = ITypeLib_GetTypeInfoCount(ptlib);
769 for (tidx=0; tidx<
types; tidx++) {
770 if (
SUCCEEDED(ITypeLib_GetTypeInfoType(ptlib, tidx, &kind))) {
779 ITypeLib_GetTypeInfo(ptlib, tidx, &tinfo);
784 ITypeLib_GetTypeInfo(ptlib, tidx, &tinfo);
793 TYPEATTR *tattr =
NULL;
794 ITypeInfo_GetTypeAttr(tinfo, &tattr);
802#define XX(x) if (TYPEFLAG_##x & tattr->wTypeFlags) MESSAGE(#x"|");
824 if ((kind ==
TKIND_INTERFACE && (tattr->wTypeFlags & TYPEFLAG_FOLEAUTOMATION)) ||
839 ITypeInfo_ReleaseTypeAttr(tinfo, tattr);
842 ITypeInfo_Release(tinfo);
849 ITypeLib_ReleaseTLibAttr(ptlib,
attr);
856 WCHAR subKeyName[50];
892 WCHAR subKeyName[50];
895 BOOL deleteOtherStuff;
897 TYPEATTR* typeAttr =
NULL;
910 TRACE(
"Unsupported syskind %i\n", syskind);
934 numTypes = ITypeLib_GetTypeInfoCount(typeLib);
935 for (
i=0;
i<numTypes;
i++) {
937 if (ITypeLib_GetTypeInfoType(typeLib,
i, &kind) !=
S_OK) {
945 if (ITypeLib_GetTypeInfo(typeLib,
i, &typeInfo) !=
S_OK) {
948 if (ITypeInfo_GetTypeAttr(typeInfo, &typeAttr) !=
S_OK) {
952 if ((kind ==
TKIND_INTERFACE && (typeAttr->wTypeFlags & TYPEFLAG_FOLEAUTOMATION)) ||
968 if (typeAttr) ITypeInfo_ReleaseTypeAttr(typeInfo, typeAttr);
970 if (typeInfo) ITypeInfo_Release(typeInfo);
977 *
wcsrchr( subKeyName,
'\\' ) = 0;
983 deleteOtherStuff =
TRUE;
991 deleteOtherStuff =
FALSE;
996 if (deleteOtherStuff) {
1003 *
wcsrchr( keyName,
'\\' ) = 0;
1009 if (typeLib) ITypeLib_Release(typeLib);
1032 FIXME(
"(%p, %s, %s) registering the typelib system-wide\n", ptlib,
1052 FIXME(
"(%s, %u, %u, %u, %u) unregistering the typelib system-wide\n",
1194#define TLB_REF_USE_GUID -2
1196#define TLB_REF_INTERNAL (void*)-2
1197#define TLB_REF_NOT_FOUND (void*)-1
1349 WARN(
"Unhandled syskind: 0x%x\n", syskind);
1387 pTD->u.hreftype);
break;
1397 pTD->u.lpadesc->cDims);
1409 MESSAGE(
"\t\ttdesc.vartype %d (%s)\n",edesc->tdesc.vt,
buf);
1410 MESSAGE(
"\t\tu.paramdesc.wParamFlags");
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);
1423 MESSAGE(
"memid is %08x\n",funcdesc->memid);
1424 for (
i=0;
i<funcdesc->cParams;
i++) {
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;
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;
1444 MESSAGE(
")\n\tcallconv: %d (",funcdesc->callconv);
1445 switch (funcdesc->callconv) {
1447 case CC_PASCAL:
MESSAGE(
"pascal");
break;
1449 case CC_SYSCALL:
MESSAGE(
"syscall");
break;
1452 MESSAGE(
")\n\toVft: %d\n", funcdesc->oVft);
1453 MESSAGE(
"\tcParamsOpt: %d\n", funcdesc->cParamsOpt);
1454 MESSAGE(
"\twFlags: %x\n", funcdesc->wFuncFlags);
1456 MESSAGE(
"\telemdescFunc (return value type):\n");
1477 for (
i=0;
i<
pfd->funcdesc.cParams;
i++)
1486 else if(
pfd->Entry == (
void*)-1)
1487 MESSAGE(
"\tentry: invalid\n");
1516 TRACE_(
typelib)(
"v%d.%d lcid=%x offset=%x\n",
import->wVersionMajor,
1517 import->wVersionMinor,
import->lcid,
import->offset);
1527 if(
ref->index == -1)
1545 TRACE_(
typelib)(
"implementing/inheriting interface hRef = %x implflags %x\n",
1556 TRACE(
"args=%u named args=%u\n", pdp->cArgs, pdp->cNamedArgs);
1558 if (pdp->cNamedArgs && pdp->rgdispidNamedArgs)
1560 TRACE(
"named args:\n");
1562 TRACE(
"\t0x%x\n", pdp->rgdispidNamedArgs[
index] );
1565 if (pdp->cArgs && pdp->rgvarg)
1575 TRACE(
"%p ref=%u\n", pty, pty->
ref);
1595 MESSAGE(
"wVarFlags %x\n",
v->wVarFlags);
1596 MESSAGE(
"varkind %d\n",
v->varkind);
1623 if (alloc_initial_space)
1624 size +=
sizeof(TYPEDESC);
1693 UINT n, MEMBERID memid)
1696 if(funcdescs->
funcdesc.memid == memid)
1705 UINT n, MEMBERID memid)
1708 if(vardescs->
vardesc.memid == memid)
1829 const GUID *new_guid, HREFTYPE hreftype)
1843 guid->hreftype = hreftype;
1874 cust_data->
guid = tlbguid;
1918 hr = ITypeInfo2_GetRefTypeInfo(&
info->ITypeInfo2_iface, href, &
other);
1924 ITypeInfo_Release(
other);
1934 ITypeInfo_Release(
other);
2001 for(
i = 0;
i < tdesc->u.lpadesc->cDims; ++
i)
2002 *
size += tdesc->u.lpadesc->rgbounds[
i].cElements;
2011 FIXME(
"Unsized VT: 0x%x\n", tdesc->vt);
2038 ERR(
"seek beyond end (%d/%d)\n", where, pcx->
length );
2048 TRACE_(
typelib)(
"pos=0x%08x len=0x%08x 0x%08x 0x%08x 0x%08x\n",
2095 guid->offset = offs;
2140 int offs = 0, lengthInChars;
2153 len_piece = (len_piece + 4) & ~0x3;
2162 string, -1,
NULL, 0);
2163 if (!lengthInChars) {
2227 switch (
V_VT(pVar)){
2289 FIXME(
"VARTYPE %d is not supported, setting pointer to NULL\n",
2334 return (invkind == INVOKE_PROPERTYGET ||
2335 invkind == INVOKE_PROPERTYPUT ||
2336 invkind == INVOKE_PROPERTYPUTREF);
2372 int infolen, nameoffset, reclength,
i;
2385 for (
i = 0;
i < cFuncs ;
i++ )
2391 offset + infolen + (cFuncs + cVars +
i + 1) *
sizeof(
INT));
2396 reclength &= 0xffff;
2402 if (pFuncRec->
FKCCIC & 0x1000)
2413 if (pFuncRec->
FKCCIC & 0x2000 )
2416 ERR(
"ordinal 0x%08x invalid, IS_INTRESOURCE is false\n", pFuncRec->
oEntry);
2435 ptfd->funcdesc.funckind = (pFuncRec->
FKCCIC) & 0x7;
2436 ptfd->funcdesc.invkind = (pFuncRec->
FKCCIC) >> 3 & 0xF;
2437 ptfd->funcdesc.callconv = (pFuncRec->
FKCCIC) >> 8 & 0xF;
2438 ptfd->funcdesc.cParams = pFuncRec->
nrargs ;
2439 ptfd->funcdesc.cParamsOpt = pFuncRec->
nroargs ;
2441 ptfd->funcdesc.wFuncFlags =
LOWORD(pFuncRec->
Flags) ;
2445 if ((nameoffset == -1) && (
i > 0) &&
2448 ptfd->Name = ptfd_prev->
Name;
2454 &ptfd->funcdesc.elemdescFunc.tdesc);
2462 ptfd->funcdesc.lprgelemdescParam =
2463 heap_alloc_zero(pFuncRec->
nrargs * (
sizeof(ELEMDESC) +
sizeof(PARAMDESCEX)));
2470 for (
j = 0 ;
j < pFuncRec->
nrargs ;
j++ )
2472 ELEMDESC *elemdesc = &ptfd->funcdesc.lprgelemdescParam[
j];
2478 elemdesc->u.paramdesc.wParamFlags = paraminfo.
Flags;
2481 if (paraminfo.
oName != -1)
2482 ptfd->pParamDesc[
j].Name =
2487 if ( (elemdesc->u.paramdesc.wParamFlags & PARAMFLAG_FHASDEFAULT) &&
2488 (pFuncRec->
FKCCIC & 0x1000) )
2490 INT* pInt = (
INT *)((
char *)pFuncRec +
2494 PARAMDESC* pParamDesc = &elemdesc->u.paramdesc;
2496 pParamDesc->pparamdescex = (PARAMDESCEX*)(ptfd->funcdesc.lprgelemdescParam+pFuncRec->
nrargs)+
j;
2497 pParamDesc->pparamdescex->cBytes =
sizeof(PARAMDESCEX);
2503 elemdesc->u.paramdesc.pparamdescex =
NULL;
2508 pFuncRec->
FKCCIC & 0x80 )
2512 &ptfd->pParamDesc[
j].custdata_list);
2521 recoffset + reclength - ((pFuncRec->
nrargs -
j - 1)
2527 ptfd->funcdesc.cScodes = 0 ;
2528 ptfd->funcdesc.lprgscode =
NULL ;
2532 recoffset += reclength;
2540 int infolen, nameoffset, reclength;
2552 ((cFuncs+cVars)*2+cFuncs + 1)*
sizeof(
INT));
2554 for(
i=0;
i<cVars;
i++, ++ptvd){
2557 offset + infolen + (2*cFuncs + cVars +
i + 1) *
sizeof(
INT));
2576 offset + infolen + (cFuncs +
i + 1) *
sizeof(
INT));
2580 &ptvd->
vardesc.elemdescVar.tdesc);
2582 if(pVarRec->
VarKind == VAR_CONST ){
2588 recoffset += reclength;
2621 switch(
info->tdescAlias->vt){
2629 info->typeattr.cbSizeInstance =
sizeof(
void*);
2630 info->typeattr.cbAlignment =
sizeof(
void*);
2638 info->typeattr.cbAlignment = 8;
2640 if(
info->typeattr.cbSizeInstance <
sizeof(
void*))
2641 info->typeattr.cbAlignment =
info->typeattr.cbSizeInstance;
2643 info->typeattr.cbAlignment =
sizeof(
void*);
2649 info->typeattr.cbSizeInstance =
sizeof(
void*);
2650 info->typeattr.cbAlignment =
sizeof(
void*);
2724 if(ptiRet->
typeattr.cImplTypes >0 ) {
2765 INT16 len_str, len_piece;
2766 int offs = 0, lengthInChars;
2776 len_piece = len_str +
sizeof(
INT16);
2778 len_piece = (len_piece + 4) & ~0x3;
2784 string[len_str] =
'\0';
2787 string, -1,
NULL, 0);
2788 if (!lengthInChars) {
2813 while (offs < pcx->pTblDir->pImpInfo.length) {
2827 ref->reference = offs;
2828 ref->pImpTLInfo = pImpLib;
2836 ERR(
"Cannot find a reference\n");
2837 ref->reference = -1;
2841 offs +=
sizeof(impinfo);
2858 0, 0, { (
DWORD_PTR)(__FILE__
": typelib loader cache") }
2883 IUnknown_AddRef(iface);
2902 if (
This->typelib_global)
2939 static const WCHAR TYPELIBW[] = {
'T',
'Y',
'P',
'E',
'L',
'I',
'B',0};
2941 if (
This->typelib_resource)
2944 if (
This->typelib_global)
2948 if (
This->typelib_base)
2951 *ppBase =
This->typelib_base;
2952 *ppFile = &
This->IUnknown_iface;
2958 TRACE(
"No TYPELIB resource found\n");
2983 IUnknown_AddRef(iface);
3024 if (
sizeof(mzh) !=
LZRead( lzfd, (
LPSTR)&mzh,
sizeof(mzh) ) )
3041 WARN(
"Can't handle %s files.\n",
magic );
3062 if (
sizeof(nehd) !=
LZRead( lzfd, (
LPSTR)&nehd,
sizeof(nehd) ) )
return FALSE;
3067 TRACE(
"No resources in NE dll\n" );
3073 if ( !resTab )
return FALSE;
3076 if ( resTabSize !=
LZRead( lzfd, (
char*)resTab, resTabSize ) )
3090 if (!(typeInfo->
type_id & 0x8000))
3095 typeInfo = (
NE_TYPEINFO *)((
char *)(typeInfo + 1) +
3104 if (typeInfo->
type_id ==
id)
goto found_type;
3105 typeInfo = (
NE_TYPEINFO *)((
char *)(typeInfo + 1) +
3109 TRACE(
"No typeid entry found for %p\n",
typeid );
3121 BYTE *
p = resTab + nameInfo->
id;
3122 if (nameInfo->
id & 0x8000)
continue;
3130 if (nameInfo->
id ==
id)
goto found_name;
3132 TRACE(
"No resid entry found for %p\n",
typeid );
3138 if ( resLen ) *resLen = nameInfo->
length << *(
WORD *)resTab;
3139 if ( resOff ) *resOff = nameInfo->
offset << *(
WORD *)resTab;
3166 if( !
This->typelib_base )
3173 *ppBase =
This->typelib_base;
3175 *ppFile = &
This->IUnknown_iface;
3181 if( lzfd >= 0)
LZClose( lzfd );
3205 IUnknown_AddRef(iface);
3224 if (
This->typelib_base)
3263 if(
This->typelib_base)
3267 *ppBase =
This->typelib_base;
3268 *ppFile = &
This->IUnknown_iface;
3274 IUnknown_Release(&
This->IUnknown_iface);
3285#define SLTG_SIGNATURE 0x47544c53
3293 DWORD dwTLBLength = 0;
3300 if(index_str && *++index_str !=
'\0')
3304 if(*end_ptr ==
'\0')
3323 pszPath[
len] =
'\\';
3364 TRACE(
"cache hit\n");
3365 *ppTypeLib = &
entry->ITypeLib2_iface;
3366 ITypeLib2_AddRef(*ppTypeLib);
3382 if (dwTLBLength >= 4)
3391 FIXME(
"Header type magic 0x%08x not supported.\n",dwSignature);
3397 IUnknown_Release(
pFile);
3403 TRACE(
"adding to cache\n");
3434 if (!pTypeLibImpl)
return NULL;
3439 pTypeLibImpl->
ref = 1;
3449 return pTypeLibImpl;
3466 TRACE(
"%p, TLB length = %d\n", pLib, dwTLBLength);
3469 if (!pTypeLibImpl)
return NULL;
3475 cx.pLibInfo = pTypeLibImpl;
3476 cx.length = dwTLBLength;
3483 FIXME(
"Header type magic 0x%08x not supported.\n",tlbHeader.
magic1);
3494 TRACE(
"read segment directory (at %d)\n",lPSegDir);
3496 cx.pTblDir = &tlbSegDir;
3501 ERR(
"cannot find the table directory, ptr=0x%x\n",lPSegDir);
3521 pTypeLibImpl->
lcid = tlbHeader.
lcid;
3551 pTypeLibImpl->
pTypeDesc = heap_alloc_zero( cTD *
sizeof(TYPEDESC));
3589 pTypeLibImpl->
pTypeDesc[
i].u.lpadesc->tdescElem =
cx.pLibInfo->pTypeDesc[td[0]/(2*
sizeof(
INT))];
3591 pTypeLibImpl->
pTypeDesc[
i].u.lpadesc->cDims = td[2];
3593 for(
j = 0;
j<td[2];
j++)
3604 ERR(
"didn't find array description data\n");
3620 pImpLib = heap_alloc_zero(
sizeof(
TLBImpLib));
3665 TLB_fix_32on64_typeinfo(pTypeLibImpl->
typeinfos[
i]);
3669 TRACE(
"(%p)\n", pTypeLibImpl);
3685 guid->Data4[0] =
s >> 8;
3686 guid->Data4[1] =
s & 0xff;
3689 for(
i = 0;
i < 6;
i++) {
3711 if (!(
bits->current & 0xff))
3714 bits->current = (*
bits->buffer << 8) | 1;
3719 if (
bits->current & 0x8000)
3725 p =
table + (*(
p + 2) | (*(
p + 1) << 8));
3728 bits->current <<= 1;
3750 if (!stream_length)
return NULL;
3753 bits.length = stream_length;
3785 if(bytelen == 0xffff)
return 2;
3803 if(bytelen == 0xffff)
return 2;
3806 (*str)[bytelen] =
'\0';
3829 char *
ptr = pLibBlk;
3833 FIXME(
"libblk magic = %04x\n",
w);
3839 FIXME(
"LibBlk.res06 = %04x. Assumung string and skipping\n",
w);
3875 return ptr - (
char*)pLibBlk;
3886 HREFTYPE *typelib_ref)
3888 if(
table && typeinfo_ref < table->
num)
3890 *typelib_ref =
table->
refs[typeinfo_ref];
3904 if((*pType & 0xe00) == 0xe00) {
3906 pTD->u.lptdesc = heap_alloc_zero(
sizeof(TYPEDESC));
3907 pTD = pTD->u.lptdesc;
3909 switch(*pType & 0x3f) {
3912 pTD->u.lptdesc = heap_alloc_zero(
sizeof(TYPEDESC));
3913 pTD = pTD->u.lptdesc;
3930 pTD->u.lpadesc = heap_alloc_zero(
sizeof(ARRAYDESC) + (pSA->
cDims - 1) *
sizeof(
SAFEARRAYBOUND));
3931 pTD->u.lpadesc->cDims = pSA->
cDims;
3935 pTD = &pTD->u.lpadesc->tdescElem;
3946 pTD->u.lptdesc = heap_alloc_zero(
sizeof(TYPEDESC));
3947 pTD = pTD->u.lptdesc;
3951 pTD->vt = *pType & 0x3f;
3964 if((*pType & 0xc000) == 0xc000)
3965 pElem->u.paramdesc.wParamFlags = PARAMFLAG_NONE;
3966 else if(*pType & 0x8000)
3967 pElem->u.paramdesc.wParamFlags = PARAMFLAG_FIN | PARAMFLAG_FOUT;
3968 else if(*pType & 0x4000)
3969 pElem->u.paramdesc.wParamFlags = PARAMFLAG_FOUT;
3971 pElem->u.paramdesc.wParamFlags = PARAMFLAG_FIN;
3974 pElem->u.paramdesc.wParamFlags |= PARAMFLAG_FLCID;
3977 pElem->u.paramdesc.wParamFlags |= PARAMFLAG_FRETVAL;
3979 return SLTG_DoType(pType, pBlk, &pElem->tdesc, ref_lookup);
3990 HREFTYPE typelib_ref;
4008 unsigned int lib_offs, type_num;
4010 ref_type = heap_alloc_zero(
sizeof(
TLBRefType));
4013 if(
sscanf(refname,
"*\\R%x*#%x", &lib_offs, &type_num) != 2)
4015 if(lib_offs != 0xffff) {
4019 if(import->offset == lib_offs)
4027 import = heap_alloc_zero(
sizeof(*
import));
4028 import->offset = lib_offs;
4031 if(
sscanf(pNameTable + lib_offs + 40,
"}#%hd.%hd#%x#%s",
4032 &import->wVersionMajor,
4033 &import->wVersionMinor,
4034 &import->lcid, fname) != 4) {
4036 pNameTable + lib_offs + 40);
4039 if(fname[
len-1] !=
'#')
4040 FIXME(
"fname = %s\n", fname);
4041 fname[
len-1] =
'\0';
4055 ref_type->
index = type_num;
4084 if(
info->next == 0xffff)
4097 if(
info->next == 0xffff)
4100 FIXME_(
typelib)(
"Interface inheriting more than one interface\n");
4129 if (pItem->
name == 0xfffe)
4130 pVarDesc->
Name = prevName;
4144 if(pItem->
flags & 0x02)
4145 pType = &pItem->
type;
4147 pType = (
WORD*)(pBlk + pItem->
type);
4149 if (pItem->
flags & ~0xda)
4153 &pVarDesc->
vardesc.elemdescVar, ref_lookup);
4161 if (pItem->
flags & 0x40) {
4163 pVarDesc->
vardesc.varkind = VAR_DISPATCH;
4165 else if (pItem->
flags & 0x10) {
4167 pVarDesc->
vardesc.varkind = VAR_CONST;
4170 if (pItem->
flags & 0x08)
4173 switch (pVarDesc->
vardesc.elemdescVar.tdesc.vt)
4182 if (
len == 0xffff) {
4203 FIXME_(
typelib)(
"VAR_CONST unimplemented for type %d\n", pVarDesc->
vardesc.elemdescVar.tdesc.vt);
4210 pVarDesc->
vardesc.varkind = VAR_PERINSTANCE;
4216 if (pItem->
flags & 0x80)
4217 pVarDesc->
vardesc.wVarFlags |= VARFLAG_FREADONLY;
4219 prevName = pVarDesc->
Name;
4226 const BYTE *hlp_strings)
4243 pFuncDesc->
funcdesc.funckind = FUNC_PUREVIRTUAL;
4246 pFuncDesc->
funcdesc.funckind = FUNC_DISPATCH;
4249 pFuncDesc->
funcdesc.funckind = FUNC_STATIC;
4276 pFuncDesc->
funcdesc.lprgelemdescParam =
4277 heap_alloc_zero(pFuncDesc->
funcdesc.cParams *
sizeof(ELEMDESC));
4283 char *paramName = pNameTable + (*pArg & ~1);
4294 if(*pArg == 0xffff || *pArg == 0xfffe)
4297 HaveOffs = !(*pArg & 1);
4304 pType = (
WORD*)(pBlk + *pArg);
4316 pFuncDesc->
funcdesc.lprgelemdescParam[
param].u.paramdesc.wParamFlags |= PARAMFLAG_FOPT;
4320 paramName - pNameTable, pTI->
pTypeLib);
4393 pTI->
tdescAlias = heap_alloc_zero(
sizeof(TYPEDESC));
4498 char *pNameTable, *
ptr;
4499 const BYTE *hlp_strings;
4504 TRACE_(
typelib)(
"%p, TLB length = %d\n", pLib, dwTLBLength);
4508 if (!pTypeLibImpl)
return NULL;
4516 FIXME_(
typelib)(
"Header type magic 0x%08x not supported.\n",
4546 pFirstBlk = pPad9 + 1;
4553 pBlk = (
char*)pBlk + pBlkEntry[
order].
len;
4568 pOtherTypeInfoBlks = heap_alloc_zero(
sizeof(*pOtherTypeInfoBlks) * pTypeLibImpl->
TypeInfoCount);
4570 ptr = (
char*)pLibBlk +
len;
4580 memcpy(pOtherTypeInfoBlks[
i].index_name,
ptr + 2,
w);
4612 TRACE(
"max help string length %#x, help strings length %#x\n",
4613 *(
WORD *)hlp_strings, *(
DWORD *)(hlp_strings + 2));
4620 pNameTable = (
char*)pLibBlk +
len;
4622 switch(*(
WORD*)pNameTable) {
4633 pNameTable += 0x216;
4648 ppTypeInfoImpl = pTypeLibImpl->
typeinfos;
4650 for(pBlk = pFirstBlk,
order =
pHeader->first_blk - 1,
i = 0;
4658 if(
strcmp(pBlkEntry[
order].index_string + (
char*)pMagic, pOtherTypeInfoBlks[
i].index_name)) {
4670 TRACE_(
typelib)(
"pTIHeader->res06 = %x, pTIHeader->res0e = %x, "
4671 "pTIHeader->res16 = %x, pTIHeader->res1e = %x\n",
4675 (*ppTypeInfoImpl)->pTypeLib = pTypeLibImpl;
4676 (*ppTypeInfoImpl)->
index =
i;
4677 (*ppTypeInfoImpl)->Name =
SLTG_ReadName(pNameTable, pOtherTypeInfoBlks[
i].name_offs, pTypeLibImpl);
4678 (*ppTypeInfoImpl)->dwHelpContext = pOtherTypeInfoBlks[
i].
helpcontext;
4679 (*ppTypeInfoImpl)->DocString =
decode_string(hlp_strings, pOtherTypeInfoBlks[
i].
extra, pOtherTypeInfoBlks[
i].hlpstr_len, pTypeLibImpl);
4681 (*ppTypeInfoImpl)->typeattr.typekind = pTIHeader->
typekind;
4682 (*ppTypeInfoImpl)->typeattr.wMajorVerNum = pTIHeader->
major_version;
4683 (*ppTypeInfoImpl)->typeattr.wMinorVerNum = pTIHeader->
minor_version;
4684 (*ppTypeInfoImpl)->typeattr.wTypeFlags =
4687 if((*ppTypeInfoImpl)->typeattr.wTypeFlags & TYPEFLAG_FDUAL)
4695 TRACE_(
typelib)(
"TypeInfo %s of kind %s guid %s typeflags %04x\n",
4699 (*ppTypeInfoImpl)->typeattr.wTypeFlags);
4706 (*ppTypeInfoImpl)->typeattr.cbSizeInstance = pTITail->
cbSizeInstance;
4707 (*ppTypeInfoImpl)->typeattr.cbSizeVft = pTITail->
cbSizeVft;
4712 pTIHeader, pTITail, hlp_strings);
4717 pTIHeader, pTITail, hlp_strings);
4722 pTIHeader, pTITail, hlp_strings);
4727 pTIHeader, pTITail);
4732 pTIHeader, pTITail);
4737 pTIHeader, pTITail, hlp_strings);
4742 pTIHeader, pTITail, hlp_strings);
4753#define X(x) TRACE_(typelib)("tt "#x": %x\n",pTITail->res##x);
4769 pBlk = (
char*)pBlk + pBlkEntry[
order].
len;
4773 FIXME(
"Somehow processed %d TypeInfos\n",
i);
4792 *
ppv = &
This->ITypeLib2_iface;
4797 *
ppv = &
This->ICreateTypeLib2_iface;
4802 TRACE(
"-- Interface: E_NOINTERFACE\n");
4832 TLBGuid *tlbguid, *tlbguid_next;
4838 TRACE(
"removing from cache list\n");
4840 if(
This->entry.next)
4845 TRACE(
" destroying ITypeLib(%p)\n",
This);
4866 for (
i = 0;
i <
This->ctTypeDesc;
i++)
4875 ITypeLib2_Release(&pImpLib->
pImpTypeLib->ITypeLib2_iface);
4888 for (
i = 0;
i <
This->TypeInfoCount; ++
i){
4908 return This->TypeInfoCount;
4931 ITypeInfo_AddRef(*ppTInfo);
4956 *pTKind =
This->typeinfos[
index]->typeattr.typekind;
4976 for(
i = 0;
i <
This->TypeInfoCount; ++
i){
4979 ITypeInfo_AddRef(*ppTInfo);
5006 (*attr)->lcid =
This->set_lcid;
5007 (*attr)->syskind =
This->syskind;
5008 (*attr)->wMajorVerNum =
This->ver_major;
5009 (*attr)->wMinorVerNum =
This->ver_minor;
5010 (*attr)->wLibFlags =
This->libflags;
5028 *ppTComp = &
This->ITypeComp_iface;
5029 ITypeComp_AddRef(*ppTComp);
5047 BSTR *pBstrDocString,
5048 DWORD *pdwHelpContext,
5049 BSTR *pBstrHelpFile)
5055 TRACE(
"(%p) index %d Name(%p) DocString(%p) HelpContext(%p) HelpFile(%p)\n",
5057 pBstrName, pBstrDocString,
5058 pdwHelpContext, pBstrHelpFile);
5075 if (
This->DocString)
5081 *pBstrDocString =
NULL;
5085 *pdwHelpContext =
This->dwHelpContext;
5095 *pBstrHelpFile =
NULL;
5107 result = ITypeInfo_GetDocumentation(pTInfo,
5111 pdwHelpContext, pBstrHelpFile);
5113 ITypeInfo_Release(pTInfo);
5145 for(tic = 0; tic <
This->TypeInfoCount; ++tic){
5147 if(!
TLB_str_memcmp(szNameBuf, pTInfo->
Name, nNameBufLen))
goto ITypeLib2_fnIsName_exit;
5148 for(fdc = 0; fdc < pTInfo->
typeattr.cFuncs; ++fdc) {
5151 if(!
TLB_str_memcmp(szNameBuf, pFInfo->
Name, nNameBufLen))
goto ITypeLib2_fnIsName_exit;
5152 for(pc=0; pc < pFInfo->
funcdesc.cParams; pc++){
5154 goto ITypeLib2_fnIsName_exit;
5157 for(vrc = 0; vrc < pTInfo->
typeattr.cVars; ++vrc){
5159 if(!
TLB_str_memcmp(szNameBuf, pVInfo->
Name, nNameBufLen))
goto ITypeLib2_fnIsName_exit;
5165ITypeLib2_fnIsName_exit:
5166 TRACE(
"(%p)slow! search for %s: %sfound!\n",
This,
5167 debugstr_w(szNameBuf), *pfName ?
"" :
"NOT ");
5193 if ((!
name &&
hash == 0) || !ppTInfo || !memid || !found)
5197 for(tic = 0;
count < *found && tic <
This->TypeInfoCount; ++tic) {
5204 goto ITypeLib2_fnFindName_exit;
5207 for(fdc = 0; fdc < pTInfo->
typeattr.cFuncs; ++fdc) {
5212 goto ITypeLib2_fnFindName_exit;
5219 goto ITypeLib2_fnFindName_exit;
5223ITypeLib2_fnFindName_exit:
5242 TLIBATTR *pTLibAttr)
5281 ULONG *pcUniqueNames,
5282 ULONG *pcchUniqueNames)
5288 if(pcUniqueNames) *pcUniqueNames=1;
5289 if(pcchUniqueNames) *pcchUniqueNames=1;
5304 BSTR *pbstrHelpString,
5305 DWORD *pdwHelpStringContext,
5306 BSTR *pbstrHelpStringDll)
5312 FIXME(
"(%p) index %d lcid %d half implemented stub!\n",
This,
index, lcid);
5323 if(pdwHelpStringContext)
5324 *pdwHelpStringContext=
This->dwHelpContext;
5325 if(pbstrHelpStringDll)
5333 result=ITypeLib2_GetTypeInfo(iface,
index, &pTInfo);
5338 result = ITypeInfo_QueryInterface(pTInfo,
5344 result = ITypeInfo2_GetDocumentation2(pTInfo2,
5348 pdwHelpStringContext,
5349 pbstrHelpStringDll);
5351 ITypeInfo2_Release(pTInfo2);
5354 ITypeInfo_Release(pTInfo);
5368 pCustData->prgCustData =
CoTaskMemAlloc(ct *
sizeof(CUSTDATAITEM));
5369 if(!pCustData->prgCustData)
5372 pCustData->cCustData = ct;
5374 cdi = pCustData->prgCustData;
5392 CUSTDATA *pCustData)
5399static const ITypeLib2Vtbl
tlbvt = {
5425 return ITypeLib2_QueryInterface(&
This->ITypeLib2_iface,
riid,
ppv);
5432 return ITypeLib2_AddRef(&
This->ITypeLib2_iface);
5439 return ITypeLib2_Release(&
This->ITypeLib2_iface);
5448 DESCKIND * pDescKind,
5455 TRACE(
"(%p)->(%s, 0x%x, 0x%x, %p, %p, %p)\n",
This,
debugstr_w(
szName), lHash,
wFlags, ppTInfo, pDescKind, pBindPtr);
5457 *pDescKind = DESCKIND_NONE;
5458 pBindPtr->lptcomp =
NULL;
5461 for(
i = 0;
i <
This->TypeInfoCount; ++
i){
5473 *pDescKind = DESCKIND_TYPECOMP;
5475 ITypeComp_AddRef(pBindPtr->lptcomp);
5487 hr = ITypeComp_Bind(pSubTypeComp,
szName, lHash,
wFlags, ppTInfo, pDescKind, pBindPtr);
5488 if (
SUCCEEDED(
hr) && (*pDescKind != DESCKIND_NONE))
5494 typemismatch =
TRUE;
5498 (pTypeInfo->
typeattr.wTypeFlags & TYPEFLAG_FAPPOBJECT))
5504 DESCKIND subdesckind;
5507 &subtypeinfo, &subdesckind, &subbindptr);
5508 if (
SUCCEEDED(
hr) && (subdesckind != DESCKIND_NONE))
5510 TYPEDESC tdesc_appobject;
5511 const VARDESC vardesc_appobject =
5532 tdesc_appobject.u.hreftype = pTypeInfo->
hreftype;
5539 switch (subdesckind)
5541 case DESCKIND_FUNCDESC:
5542 ITypeInfo_ReleaseFuncDesc(subtypeinfo, subbindptr.lpfuncdesc);
5544 case DESCKIND_VARDESC:
5545 ITypeInfo_ReleaseVarDesc(subtypeinfo, subbindptr.lpvardesc);
5550 if (subtypeinfo) ITypeInfo_Release(subtypeinfo);
5553 FIXME(
"no hreftype for interface %p\n", pTypeInfo);
5559 *pDescKind = DESCKIND_IMPLICITAPPOBJ;
5561 ITypeInfo_AddRef(*ppTInfo);
5565 typemismatch =
TRUE;
5593 if(!
szName || !ppTInfo || !ppTComp)
5604 ITypeInfo_AddRef(*ppTInfo);
5605 *ppTComp = &
info->ITypeComp_iface;
5606 ITypeComp_AddRef(*ppTComp);
5611static const ITypeCompVtbl
tlbtcvt =
5633 pTypeInfoImpl->
ref = 0;
5640 TRACE(
"(%p)\n", pTypeInfoImpl);
5641 return pTypeInfoImpl;
5671 TRACE(
"-- Interface: E_NOINTERFACE\n");
5685 ITypeLib2_AddRef(&
This->pTypeLib->ITypeLib2_iface);
5694 TRACE(
"destroying ITypeInfo(%p)\n",
This);
5696 for (
i = 0;
i <
This->typeattr.cFuncs; ++
i)
5702 ELEMDESC *elemdesc = &pFInfo->
funcdesc.lprgelemdescParam[
j];
5703 if (elemdesc->u.paramdesc.wParamFlags & PARAMFLAG_FHASDEFAULT)
5704 VariantClear(&elemdesc->u.paramdesc.pparamdescex->varDefaultValue);
5713 for(
i = 0;
i <
This->typeattr.cVars; ++
i)
5718 }
else if (pVInfo->
vardesc.varkind == VAR_CONST) {
5726 if(
This->impltypes){
5727 for (
i = 0;
i <
This->typeattr.cImplTypes; ++
i){
5750 BOOL not_attached_to_typelib =
This->not_attached_to_typelib;
5751 ITypeLib2_Release(&
This->pTypeLib->ITypeLib2_iface);
5752 if (not_attached_to_typelib)
5767 LPTYPEATTR *ppTypeAttr)
5774 size =
sizeof(**ppTypeAttr);
5782 **ppTypeAttr =
This->typeattr;
5785 if (
This->tdescAlias)
5790 (*ppTypeAttr)->cFuncs = (*ppTypeAttr)->cbSizeVft /
This->pTypeLib->ptr_size;
5792 (*ppTypeAttr)->cbSizeVft =
sizeof(IDispatchVtbl);
5793 (*ppTypeAttr)->wTypeFlags &= ~TYPEFLAG_FOLEAUTOMATION;
5811 *ppTComp = &
This->ITypeComp_iface;
5812 ITypeComp_AddRef(*ppTComp);
5819 if (elemdesc->u.paramdesc.wParamFlags & PARAMFLAG_FHASDEFAULT)
5820 size +=
sizeof(*elemdesc->u.paramdesc.pparamdescex);
5828 if (
src->u.paramdesc.wParamFlags & PARAMFLAG_FHASDEFAULT)
5830 const PARAMDESCEX *pparamdescex_src =
src->u.paramdesc.pparamdescex;
5831 PARAMDESCEX *pparamdescex_dest =
dest->u.paramdesc.pparamdescex = (PARAMDESCEX *)*
buffer;
5832 *
buffer +=
sizeof(PARAMDESCEX);
5833 *pparamdescex_dest = *pparamdescex_src;
5834 pparamdescex_dest->cBytes =
sizeof(PARAMDESCEX);
5836 return VariantCopy(&pparamdescex_dest->varDefaultValue,
5837 (
VARIANTARG *)&pparamdescex_src->varDefaultValue);
5840 dest->u.paramdesc.pparamdescex =
NULL;
5847 for (
i = 0;
i <
len; ++
i)
5867 if (elemdesc->u.paramdesc.wParamFlags & PARAMFLAG_FHASDEFAULT)
5868 VariantClear(&elemdesc->u.paramdesc.pparamdescex->varDefaultValue);
5879 size +=
sizeof(*
src->lprgscode) *
src->cScodes;
5881 for (
i = 0;
i <
src->cParams;
i++)
5883 size +=
sizeof(ELEMDESC);
5892 dest->funckind = FUNC_DISPATCH;
5897 if (
dest->cScodes) {
5911 if (
dest->cParams) {
5912 dest->lprgelemdescParam = (ELEMDESC *)
buffer;
5913 buffer +=
sizeof(ELEMDESC) *
src->cParams;
5923 for (
i =
i - 1;
i >= 0;
i--)
5937 if (
dest->cParams &&
5938 (
dest->lprgelemdescParam[
dest->cParams - 1].u.paramdesc.wParamFlags & PARAMFLAG_FRETVAL))
5940 ELEMDESC *elemdesc = &
dest->lprgelemdescParam[
dest->cParams - 1];
5941 if (elemdesc->tdesc.vt !=
VT_PTR)
5943 ERR(
"elemdesc should have started with VT_PTR instead of:\n");
5952 dest->elemdescFunc.tdesc = *elemdesc->tdesc.u.lptdesc;
5971 if (var_desc->varkind == VAR_CONST)
5983 *ppFuncDesc = &
This->funcdescs[
index].funcdesc;
5994 UINT implemented_funcs = 0;
6006 hr = ITypeInfo_GetRefTypeInfo(iface,
This->impltypes[0].hRef, &pSubTypeInfo);
6013 &sub_funcs, hrefoffset);
6014 implemented_funcs += sub_funcs;
6015 ITypeInfo_Release(pSubTypeInfo);
6022 *
funcs = implemented_funcs +
This->typeattr.cFuncs;
6026 if (
index < implemented_funcs)
6034 TYPEDESC *pTypeDesc = &pElemDesc->tdesc;
6037 switch (pTypeDesc->vt)
6040 pTypeDesc->u.hreftype += hrefoffset;
6044 pTypeDesc = pTypeDesc->u.lptdesc;
6047 pTypeDesc = &pTypeDesc->u.lpadesc->tdescElem;
6058 for (
i = 0;
i < pFuncDesc->cParams;
i++)
6070 LPFUNCDESC *ppFuncDesc)
6073 const FUNCDESC *internal_funcdesc;
6075 UINT hrefoffset = 0;
6082 if (
This->needs_layout)
6083 ICreateTypeInfo2_LayOut(&
This->ICreateTypeInfo2_iface);
6087 &internal_funcdesc,
NULL,
6091 &internal_funcdesc);
6094 WARN(
"description for function %d not found\n",
index);
6118 if (
src->varkind == VAR_CONST)
6127 if (
src->lpstrSchema)
6136 if (
src->varkind == VAR_CONST)
6141 *
dest->u.lpvarValue = *
src->u.lpvarValue;
6154 if (
src->varkind == VAR_CONST)
6169 LPVARDESC *ppVarDesc)
6179 if (
This->needs_layout)
6180 ICreateTypeInfo2_LayOut(&
This->ICreateTypeInfo2_iface);
6198 TRACE(
"(%p) memid=0x%08x Maxname=%d\n",
This, memid, cMaxNames);
6208 if(!cMaxNames || !pFDesc->
Name)
6231 if(
This->impltypes &&
6236 result = ITypeInfo2_GetRefTypeInfo(iface,
This->impltypes[0].hRef, &pTInfo);
6239 result=ITypeInfo_GetNames(pTInfo, memid, rgBstrNames, cMaxNames, pcNames);
6240 ITypeInfo_Release(pTInfo);
6243 WARN(
"Could not search inherited interface!\n");
6247 WARN(
"no names found\n");
6281 if (
This->typeattr.wTypeFlags & TYPEFLAG_FDUAL)
6293 *pRefType =
This->pTypeLib->dispatch_href;
6300 *pRefType =
This->impltypes[
index].hRef;
6309 TRACE(
"SUCCESS -- hRef = 0x%08x\n", *pRefType );
6311 TRACE(
"FAILURE -- hresult = 0x%08x\n",
hr);
6333 *pImplTypeFlags = 0;
6340 *pImplTypeFlags =
This->impltypes[
index].implflags;
6361 for (
i = 0;
i < cNames;
i++)
6364 for (fdc = 0; fdc <
This->typeattr.cFuncs; ++fdc) {
6368 if(cNames) *pMemId=pFDesc->
funcdesc.memid;
6369 for(
i=1;
i < cNames;
i++){
6373 if( j<pFDesc->funcdesc.cParams)
6385 *pMemId = pVDesc->
vardesc.memid;
6389 if(
This->impltypes) {
6392 ret = ITypeInfo2_GetRefTypeInfo(iface,
This->impltypes[0].hRef, &pTInfo);
6394 ret=ITypeInfo_GetIDsOfNames(pTInfo, rgszNames, cNames, pMemId );
6395 ITypeInfo_Release(pTInfo);
6398 WARN(
"Could not search inherited interface!\n");
6400 WARN(
"no names found\n");
6411 __ASM_CFI(
".cfi_adjust_cfa_offset 4\n\t")
6413 "movl %esp,%ebp\n\t"
6414 __ASM_CFI(
".cfi_def_cfa_register %ebp\n\t")
6416 __ASM_CFI(
".cfi_rel_offset %esi,-4\n\t")
6418 __ASM_CFI(
".cfi_rel_offset %edi,-8\n\t")
6419 "movl 12(%ebp),%edx\n\t"
6420 "movl %esp,%edi\n\t"
6423 "subl %edx,%edi\n\t"
6424 "andl $~15,%edi\n\t"
6425 "movl %edi,%esp\n\t"
6426 "movl 12(%ebp),%ecx\n\t"
6427 "movl 16(%ebp),%esi\n\t"
6430 "1:\tcall *8(%ebp)\n\t"
6431 "subl %esp,%edi\n\t"
6432 "movl 20(%ebp),%ecx\n\t"
6433 "movl %edi,(%ecx)\n\t"
6434 "leal -8(%ebp),%esp\n\t"
6454 TRACE(
"(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d))\n",
6455 pvInstance, oVft,
cc, vtReturn, cActuals, prgvt, prgpvarg,
6456 pvargResult,
V_VT(pvargResult));
6460 FIXME(
"unsupported calling convention %d\n",
cc);
6473 else func = (
void *)oVft;
6482 WARN(
"invalid return type %u\n", vtReturn);
6489 for (
i = 0;
i < cActuals;
i++)
6508 argspos +=
sizeof(*arg) /
sizeof(
DWORD);
6554#elif defined(__x86_64__)
6561 __ASM_CFI(
".cfi_adjust_cfa_offset 8\n\t")
6563 "movq %rsp,%rbp\n\t"
6565 __ASM_CFI(
".cfi_def_cfa_register %rbp\n\t")
6568 __ASM_CFI(
".cfi_rel_offset %rsi,-8\n\t")
6571 __ASM_CFI(
".cfi_rel_offset %rdi,-16\n\t")
6573 "movq %rcx,%rax\n\t"
6576 "cmovgq %rdx,%rcx\n\t"
6577 "leaq 0(,%rcx,8),%rdx\n\t"
6578 "subq %rdx,%rsp\n\t"
6579 "andq $~15,%rsp\n\t"
6580 "movq %rsp,%rdi\n\t"
6583 "movq 0(%rsp),%rcx\n\t"
6584 "movq 8(%rsp),%rdx\n\t"
6585 "movq 16(%rsp),%r8\n\t"
6586 "movq 24(%rsp),%r9\n\t"
6587 "movq 0(%rsp),%xmm0\n\t"
6588 "movq 8(%rsp),%xmm1\n\t"
6589 "movq 16(%rsp),%xmm2\n\t"
6590 "movq 24(%rsp),%xmm3\n\t"
6592 "leaq -16(%rbp),%rsp\n\t"
6597 __ASM_CFI(
".cfi_def_cfa_register %rsp\n\t")
6599 __ASM_CFI(
".cfi_adjust_cfa_offset -8\n\t")
6613 TRACE(
"(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d))\n",
6614 pvInstance, oVft,
cc, vtReturn, cActuals, prgvt, prgpvarg,
6615 pvargResult,
V_VT(pvargResult));
6619 FIXME(
"unsupported calling convention %d\n",
cc);
6632 else func = (
void *)oVft;
6641 WARN(
"invalid return type %u\n", vtReturn);
6648 for (
i = 0;
i < cActuals;
i++)
6671 V_R4(pvargResult) = call_double_method(
func, argspos,
args );
6675 V_R8(pvargResult) = call_double_method(
func, argspos,
args );
6679 call_method(
func, argspos,
args );
6691#elif defined(__arm__)
6694extern float CDECL call_float_method(
void *
func,
int nb_stk_args,
const DWORD *stk_args,
const DWORD *reg_args );
6695extern double CDECL call_double_method(
void *
func,
int nb_stk_args,
const DWORD *stk_args,
const DWORD *reg_args );
6706 "lsls r1, r1, #2\n\t"
6709 "2:\tldr ip, [r2, #-4]!\n\t"
6710 "str ip, [sp, #-4]!\n\t"
6711 "subs r1, r1, #4\n\t"
6716 "vldm r3!, {s0-s15}\n\t"
6719 "ldm r3, {r0-r3}\n\t"
6753 TRACE(
"(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d))\n",
6754 pvInstance, oVft,
cc, vtReturn, cActuals, prgvt, prgpvarg, pvargResult,
V_VT(pvargResult));
6758 FIXME(
"unsupported calling convention %d\n",
cc);
6771 else func = (
void *)oVft;
6782 WARN(
"invalid return type %u\n", vtReturn);
6791 for (
i = 0;
i < cActuals;
i++)
6804 dcount =
max( (scount + 1) / 2, dcount );
6811 argspos += (argspos % 2);
6822 rcount += (rcount % 2);
6829 argspos += (argspos % 2);
6838 rcount += (rcount % 2);
6842 argspos += (argspos % 2);
6844 ntemp =
sizeof(*arg) /
sizeof(
DWORD);
6848 regs.r[rcount++] = *pdwarg++;
6850 args[argspos++] = *pdwarg++;
6862 if (!(scount % 2)) scount =
max( scount, dcount * 2 );
6879 argspos += (argspos % 2);
6910#elif defined(__aarch64__)
6916 "stp x29, x30, [sp, #-16]!\n\t"
6918 "sub sp, sp, x1, lsl #3\n\t"
6920 "1:\tsub x1, x1, #1\n\t"
6921 "ldr x4, [x2, x1, lsl #3]\n\t"
6922 "str x4, [sp, x1, lsl #3]\n\t"
6924 "2:\tmov x16, x0\n\t"
6926 "ldp d0, d1, [x9]\n\t"
6927 "ldp d2, d3, [x9, #0x10]\n\t"
6928 "ldp d4, d5, [x9, #0x20]\n\t"
6929 "ldp d6, d7, [x9, #0x30]\n\t"
6930 "ldp x0, x1, [x9, #0x40]\n\t"
6931 "ldp x2, x3, [x9, #0x50]\n\t"
6932 "ldp x4, x5, [x9, #0x60]\n\t"
6933 "ldp x6, x7, [x9, #0x70]\n\t"
6934 "ldr x8, [x9, #0x80]\n\t"
6937 "ldp x29, x30, [sp], #16\n\t"
6963 TRACE(
"(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d))\n",
6968 FIXME(
"unsupported calling convention %d\n",
cc);
6992 WARN(
"invalid return type %u\n", ret_type);
7010 if (fpcount < 8)
regs.fp[fpcount++].f =
V_R4(
arg);
7015 if (fpcount < 8)
regs.fp[fpcount++].d =
V_R8(
arg);
7043 argspos += (argspos % 2);
7074 FIXME(
"(%p, %ld, %d, %d, %d, %p, %p, %p (vt=%d)): not implemented for this CPU\n",
7075 pvInstance, oVft,
cc, vtReturn, cActuals, prgvt, prgpvarg, pvargResult,
V_VT(pvargResult));
7085 TYPEATTR *tattr =
NULL;
7087 hr = ITypeInfo_GetRefTypeInfo(tinfo, tdesc->u.hreftype, &tinfo2);
7090 ERR(
"Could not get typeinfo of hreftype %x for VT_USERDEFINED, "
7092 tdesc->u.hreftype,
hr);
7095 hr = ITypeInfo_GetTypeAttr(tinfo2, &tattr);
7098 ERR(
"ITypeInfo_GetTypeAttr failed, hr = 0x%08x\n",
hr);
7099 ITypeInfo_Release(tinfo2);
7103 switch (tattr->typekind)
7114 if (tattr->wTypeFlags & TYPEFLAG_FDISPATCHABLE)
7129 FIXME(
"TKIND_RECORD unhandled.\n");
7134 FIXME(
"TKIND_UNION unhandled.\n");
7139 FIXME(
"TKIND %d unhandled.\n",tattr->typekind);
7143 ITypeInfo_ReleaseTypeAttr(tinfo2, tattr);
7144 ITypeInfo_Release(tinfo2);
7155 tdesc = tdesc->u.lptdesc;
7164 const TYPEDESC *tdesc_userdefined = tdesc;
7168 tdesc_userdefined = tdesc->u.lptdesc;
7175 *
vt |= vt_userdefined;
7195 ERR(
"cannot convert type %d into variant VT\n", tdesc->vt);
7222 hres = ITypeInfo_GetRefTypeInfo(tinfo, href, &tinfo2);
7226 hres = ITypeInfo_GetTypeAttr(tinfo2, &tattr);
7228 ITypeInfo_Release(tinfo2);
7232 switch(tattr->typekind) {
7239 *
guid = tattr->guid;
7243 for (
i = 0;
i < tattr->cImplTypes;
i++)
7245 ITypeInfo_GetImplTypeFlags(tinfo2,
i, &
flags);
7246 if (
flags & IMPLTYPEFLAG_FDEFAULT)
7250 if (
i == tattr->cImplTypes)
7253 hres = ITypeInfo_GetRefTypeOfImplType(tinfo2,
i, &href);
7259 ERR(
"Unexpected typekind %d\n", tattr->typekind);
7263 ITypeInfo_ReleaseTypeAttr(tinfo2, tattr);
7264 ITypeInfo_Release(tinfo2);
7270 return (
desc->wFuncFlags & FUNCFLAG_FRESTRICTED) && (
desc->memid >= 0);
7273#define INVBUF_ELEMENT_SIZE \
7274 (sizeof(VARIANTARG) + sizeof(VARIANTARG) + sizeof(VARIANTARG *) + sizeof(VARTYPE))
7275#define INVBUF_GET_ARG_ARRAY(buffer, params) (buffer)
7276#define INVBUF_GET_MISSING_ARG_ARRAY(buffer, params) \
7277 ((VARIANTARG *)((char *)(buffer) + sizeof(VARIANTARG) * (params)))
7278#define INVBUF_GET_ARG_PTR_ARRAY(buffer, params) \
7279 ((VARIANTARG **)((char *)(buffer) + (sizeof(VARIANTARG) + sizeof(VARIANTARG)) * (params)))
7280#define INVBUF_GET_ARG_TYPE_ARRAY(buffer, params) \
7281 ((VARTYPE *)((char *)(buffer) + (sizeof(VARIANTARG) + sizeof(VARIANTARG) + sizeof(VARIANTARG *)) * (params)))
7288 DISPPARAMS *pDispParams,
7290 EXCEPINFO *pExcepInfo,
7295 unsigned int var_index;
7301 TRACE(
"(%p)(%p,id=%d,flags=0x%08x,%p,%p,%p,%p)\n",
7302 This,pIUnk,memid,
wFlags,pDispParams,pVarResult,pExcepInfo,pArgErr
7305 if(
This->typeattr.wTypeFlags & TYPEFLAG_FRESTRICTED )
7310 ERR(
"NULL pDispParams not allowed\n");
7316 if (pDispParams->cNamedArgs > pDispParams->cArgs)
7318 ERR(
"named argument array cannot be bigger than argument array (%d/%d)\n",
7319 pDispParams->cNamedArgs, pDispParams->cArgs);
7325 for (fdc = 0; fdc <
This->typeattr.cFuncs; ++fdc){
7326 pFuncInfo = &
This->funcdescs[fdc];
7327 if ((memid == pFuncInfo->
funcdesc.memid) &&
7333 if (fdc < This->typeattr.cFuncs) {
7334 const FUNCDESC *func_desc = &pFuncInfo->
funcdesc;
7338 TRACE(
"invoking:\n");
7342 switch (func_desc->funckind) {
7343 case FUNC_PUREVIRTUAL:
7344 case FUNC_VIRTUAL: {
7351 UINT cNamedArgs = pDispParams->cNamedArgs;
7352 DISPID *rgdispidNamedArgs = pDispParams->rgdispidNamedArgs;
7353 UINT vargs_converted=0;
7357 if (func_desc->invkind & (INVOKE_PROPERTYPUT|INVOKE_PROPERTYPUTREF))
7359 if (!cNamedArgs || (rgdispidNamedArgs[0] != DISPID_PROPERTYPUT))
7361 ERR(
"first named arg for property put invocation must be DISPID_PROPERTYPUT\n");
7367 if (func_desc->cParamsOpt < 0 && cNamedArgs)
7369 ERR(
"functions with the vararg attribute do not support named arguments\n");
7374 for (
i = 0;
i < func_desc->cParams;
i++)
7376 TYPEDESC *tdesc = &func_desc->lprgelemdescParam[
i].tdesc;
7382 TRACE(
"changing args\n");
7383 for (
i = 0;
i < func_desc->cParams;
i++)
7385 USHORT wParamFlags = func_desc->lprgelemdescParam[
i].u.paramdesc.wParamFlags;
7386 TYPEDESC *tdesc = &func_desc->lprgelemdescParam[
i].tdesc;
7389 if (wParamFlags & PARAMFLAG_FLCID)
7392 arg = prgpvarg[
i] = &rgvarg[
i];
7403 for (
j = 0;
j < cNamedArgs;
j++)
7404 if (rgdispidNamedArgs[
j] ==
i || (
i == func_desc->cParams-1 && rgdispidNamedArgs[
j] == DISPID_PROPERTYPUT))
7406 src_arg = &pDispParams->rgvarg[
j];
7411 if (!src_arg && vargs_converted + cNamedArgs < pDispParams->cArgs)
7413 src_arg = &pDispParams->rgvarg[pDispParams->cArgs - 1 - vargs_converted];
7417 if (wParamFlags & PARAMFLAG_FRETVAL)
7424 if ((i < pDispParams->cArgs) &&
7425 ((func_desc->cParams != 1) || !pVarResult ||
7426 !(func_desc->invkind & INVOKE_PROPERTYGET)))
7435 if (
i == func_desc->cParams - 1)
7438 arg = prgpvarg[
i] = &rgvarg[
i];
7441 memset(&retval, 0,
sizeof(retval));
7446 ERR(
"[retval] parameter must be the last parameter of the method (%d/%d)\n",
i, func_desc->cParams);
7451 else if (src_arg && !((wParamFlags & PARAMFLAG_FOPT) &&
7456 if(rgvt[
i]!=
V_VT(src_arg))
7462 if (rgvt[
i] ==
V_VT(src_arg))
7467 if (wParamFlags & PARAMFLAG_FIN)
7471 V_VT(&rgvarg[
i]) = rgvt[
i];
7483 ERR(
"SafeArrayCreate failed\n");
7489 ERR(
"SafeArrayAccessData failed with %x\n",
hres);
7494 VariantCopy(&
v[
j], &pDispParams->rgvarg[pDispParams->cArgs - 1 -
i -
j]);
7498 ERR(
"SafeArrayUnaccessData failed with %x\n",
hres);
7506 V_VT(&rgvarg[
i]) = rgvt[
i];
7511 if (wParamFlags & PARAMFLAG_FIN)
7514 V_VT(&missing_arg[
i]) = rgvt[
i] & ~VT_BYREF;
7516 V_VT(&rgvarg[
i]) = rgvt[
i];
7521 V_VT(&rgvarg[
i]) = rgvt[
i];
7529 V_VT(&rgvarg[
i]) = rgvt[
i];
7534 ERR(
"failed to convert param %d to %s from %s\n",
i,
7538 prgpvarg[
i] = &rgvarg[
i];
7542 prgpvarg[
i] = src_arg;
7552 tdesc = tdesc->u.lptdesc;
7558 hres = IUnknown_QueryInterface(
V_UNKNOWN(prgpvarg[
i]), &
guid, (
void**)&userdefined_iface);
7568 else if (wParamFlags & PARAMFLAG_FOPT)
7571 arg = prgpvarg[
i] = &rgvarg[
i];
7572 if (wParamFlags & PARAMFLAG_FHASDEFAULT)
7574 hres =
VariantCopy(
arg, &func_desc->lprgelemdescParam[
i].u.paramdesc.pparamdescex->varDefaultValue);
7606 if (func_desc->elemdescFunc.tdesc.vt ==
VT_VOID)
7610 V_VT(&varresult) = 0;
7616 V_VT(&varresult), func_desc->cParams, rgvt,
7617 prgpvarg, &varresult);
7619 vargs_converted = 0;
7621 for (
i = 0;
i < func_desc->cParams;
i++)
7623 USHORT wParamFlags = func_desc->lprgelemdescParam[
i].u.paramdesc.wParamFlags;
7626 if (wParamFlags & PARAMFLAG_FLCID)
7628 else if (wParamFlags & PARAMFLAG_FRETVAL)
7641 else if (vargs_converted < pDispParams->cArgs)
7643 VARIANTARG *
arg = &pDispParams->rgvarg[pDispParams->cArgs - 1 - vargs_converted];
7644 if (wParamFlags & PARAMFLAG_FOUT)
7652 ERR(
"failed to convert param %d to vt %d\n",
i,
7653 V_VT(&pDispParams->rgvarg[pDispParams->cArgs - 1 - vargs_converted]));
7659 func_desc->cParamsOpt < 0 &&
7660 i == func_desc->cParams-1)
7668 ERR(
"SafeArrayGetUBound failed with %x\n",
hres);
7674 ERR(
"SafeArrayAccessData failed with %x\n",
hres);
7677 for (
j = 0;
j <= ubound;
j++)
7682 ERR(
"SafeArrayUnaccessData failed with %x\n",
hres);
7689 else if (wParamFlags & PARAMFLAG_FOPT)
7691 if (wParamFlags & PARAMFLAG_FHASDEFAULT)
7700 WARN(
"invoked function failed with error 0x%08x\n",
V_ERROR(&varresult));
7705 pExcepInfo->scode =
V_ERROR(&varresult);
7708 IErrorInfo_GetDescription(pErrorInfo, &pExcepInfo->bstrDescription);
7709 IErrorInfo_GetHelpFile(pErrorInfo, &pExcepInfo->bstrHelpFile);
7710 IErrorInfo_GetSource(pErrorInfo, &pExcepInfo->bstrSource);
7711 IErrorInfo_GetHelpContext(pErrorInfo, &pExcepInfo->dwHelpContext);
7713 IErrorInfo_Release(pErrorInfo);
7724 *pVarResult = varresult;
7730 if (
SUCCEEDED(
hres) && pVarResult && (func_desc->cParams == 1) &&
7731 (func_desc->invkind & INVOKE_PROPERTYGET) &&
7732 (func_desc->lprgelemdescParam[0].u.paramdesc.wParamFlags & PARAMFLAG_FRETVAL) &&
7733 (pDispParams->cArgs != 0))
7741 hres = IDispatch_Invoke(pDispatch, DISPID_VALUE, &
IID_NULL,
7743 pDispParams, pVarResult, pExcepInfo, pArgErr);
7744 IDispatch_Release(pDispatch);
7757 case FUNC_DISPATCH: {
7762 FIXME(
"Calling Invoke in IDispatch iface. untested!\n");
7763 hres = IDispatch_Invoke(
7765 pVarResult,pExcepInfo,pArgErr
7768 FIXME(
"IDispatch::Invoke failed with %08x. (Could be not a real error?)\n",
hres);
7769 IDispatch_Release(disp);
7771 FIXME(
"FUNC_DISPATCH used on object without IDispatch iface?\n");
7775 FIXME(
"Unknown function invocation type %d\n", func_desc->funckind);
7783 }
else if(
SUCCEEDED(
hres = ITypeInfo2_GetVarIndexOfMemId(iface, memid, &var_index))) {
7786 hres = ITypeInfo2_GetVarDesc(iface, var_index, &var_desc);
7789 FIXME(
"varseek: Found memid, but variable-based invoking not supported\n");
7791 ITypeInfo2_ReleaseVarDesc(iface, var_desc);
7796 ITypeInfo2_GetTypeKind(iface, &
type_kind);
7798 if(
This->impltypes) {
7801 hres = ITypeInfo2_GetRefTypeInfo(iface,
This->impltypes[0].hRef, &pTInfo);
7803 hres = ITypeInfo_Invoke(pTInfo,pIUnk,memid,
wFlags,pDispParams,pVarResult,pExcepInfo,pArgErr);
7804 ITypeInfo_Release(pTInfo);
7807 WARN(
"Could not search inherited interface!\n");
7810 WARN(
"did not find member id %d, flags 0x%x!\n", memid,
wFlags);
7822 MEMBERID memid,
BSTR *pBstrName,
BSTR *pBstrDocString,
7823 DWORD *pdwHelpContext,
BSTR *pBstrHelpFile)
7828 TRACE(
"(%p) memid %d Name(%p) DocString(%p)"
7829 " HelpContext(%p) HelpFile(%p)\n",
7830 This, memid, pBstrName, pBstrDocString, pdwHelpContext, pBstrHelpFile);
7837 *pdwHelpContext=
This->dwHelpContext;
7868 if(
This->impltypes &&
7873 result = ITypeInfo2_GetRefTypeInfo(iface,
This->impltypes[0].hRef, &pTInfo);
7875 result = ITypeInfo_GetDocumentation(pTInfo, memid, pBstrName,
7876 pBstrDocString, pdwHelpContext, pBstrHelpFile);
7877 ITypeInfo_Release(pTInfo);
7880 WARN(
"Could not search inherited interface!\n");
7883 WARN(
"member %d not found\n", memid);
7893 INVOKEKIND invKind,
BSTR *pBstrDllName,
BSTR *pBstrName,
7899 TRACE(
"(%p)->(memid %x, %d, %p, %p, %p)\n",
This, memid, invKind, pBstrDllName, pBstrName, pwOrdinal);
7901 if (pBstrDllName) *pBstrDllName =
NULL;
7902 if (pBstrName) *pBstrName =
NULL;
7903 if (pwOrdinal) *pwOrdinal = 0;
7936 HREFTYPE *hRefType,
ITypeInfo **ppTInfo)
7941 TRACE(
"%p, 0x%x\n", iface, *hRefType);
7947 hr = ITypeInfo_GetRefTypeInfo(iface,
This->impltypes[0].hRef, &pSubTypeInfo);
7953 ITypeInfo_Release(pSubTypeInfo);
7960 return ITypeInfo_GetRefTypeInfo(iface, *hRefType, ppTInfo);
7974 static const WCHAR formatW[] = {
'\\',
'%',
'd',0};
7998 ITypeLib_Release(
pTLib);
8020 if ((
INT)hRefType < 0) {
8023 if (!(
This->typeattr.wTypeFlags & TYPEFLAG_FDUAL) ||
8033 *pTypeInfoImpl = *
This;
8034 pTypeInfoImpl->
ref = 0;
8049 ITypeInfo_AddRef(*ppTInfo);
8055 HREFTYPE href_dispatch = hRefType;
8062 if(!(hRefType & 0x1)){
8063 for(
i = 0;
i <
This->pTypeLib->TypeInfoCount; ++
i)
8065 if (
This->pTypeLib->typeinfos[
i]->hreftype == (hRefType&(~0x3)))
8068 *ppTInfo = (
ITypeInfo*)&
This->pTypeLib->typeinfos[
i]->ITypeInfo2_iface;
8069 ITypeInfo_AddRef(*ppTInfo);
8077 if(ref_type->
reference == (hRefType & (~0x3)))
8080 if(&ref_type->
entry == &
This->pTypeLib->ref_list)
8082 FIXME(
"Can't find pRefType for ref %x\n", hRefType);
8088 TRACE(
"internal reference\n");
8092 TRACE(
"typeinfo in imported typelib that is already loaded\n");
8094 ITypeLib_AddRef(
pTLib);
8097 static const WCHAR TYPELIBW[] = {
'T',
'Y',
'P',
'E',
'L',
'I',
'B',0};
8101 TRACE(
"typeinfo in imported typelib that isn't already loaded\n");
8116 This->pTypeLib->syskind,
8127 ITypeLib_AddRef(
pTLib);
8138 ITypeLib_Release(
pTLib);
8142 TRACE(
"(%p) hreftype 0x%04x loaded %s (%p)\n",
This, hRefType,
8153 MEMBERID memid, INVOKEKIND invKind,
PVOID *
ppv)
8161 TRACE(
"(%p)->(0x%x, 0x%x, %p)\n",
This, memid, invKind,
ppv);
8163 hr = ITypeInfo2_GetDllEntry(iface, memid, invKind, &
dll, &
entry, &ordinal);
8194 ERR(
"function not found %d\n", ordinal);
8224 WARN(
"Not able to aggregate\n");
8228 hr = ITypeInfo2_GetTypeAttr(iface, &pTA);
8233 WARN(
"CreateInstance on typeinfo of type %x\n", pTA->typekind);
8239 if(pTA->wTypeFlags & TYPEFLAG_FAPPOBJECT)
8243 TRACE(
"GetActiveObject rets %08x\n",
hr);
8246 hr = IUnknown_QueryInterface(
pUnk,
riid, ppvObj);
8247 IUnknown_Release(
pUnk);
8253 CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER,
8257 ITypeInfo2_ReleaseTypeAttr(iface, pTA);
8291 *ppTLib = (
ITypeLib *)&
This->pTypeLib->ITypeLib2_iface;
8292 ITypeLib_AddRef(*ppTLib);
8293 TRACE(
"returning ppTLib=%p\n", *ppTLib);
8305 TYPEATTR* pTypeAttr)
8318 FUNCDESC *pFuncDesc)
8325 for (
i = 0;
i < pFuncDesc->cParams;
i++)
8351 TYPEKIND *pTypeKind)
8354 *pTypeKind =
This->typeattr.typekind;
8355 TRACE(
"(%p) type 0x%0x\n",
This,*pTypeKind);
8369 *pTypeFlags=
This->typeattr.wTypeFlags;
8370 TRACE(
"(%p) flags 0x%x\n",
This,*pTypeFlags);
8380 MEMBERID memid, INVOKEKIND invKind,
UINT *pFuncIndex)
8386 for (fdc = 0; fdc <
This->typeattr.cFuncs; ++fdc){
8388 if(memid == pFuncInfo->
funcdesc.memid && (invKind & pFuncInfo->
funcdesc.invkind))
8391 if(fdc < This->typeattr.cFuncs) {
8397 TRACE(
"(%p) memid 0x%08x invKind 0x%04x -> %s\n",
This,
8409 MEMBERID memid,
UINT *pVarIndex)
8414 TRACE(
"%p %d %p\n", iface, memid, pVarIndex);
8420 *pVarIndex = (pVarInfo -
This->vardescs);
8439 if(!
guid || !pVarVal)
8496 TRACE(
"%p %u %u %s %p\n",
This, indexFunc, indexParam,
8499 if(indexFunc >=
This->typeattr.cFuncs)
8502 if(indexParam >= pFDesc->
funcdesc.cParams)
8584 BSTR *pbstrHelpString,
8585 DWORD *pdwHelpStringContext,
8586 BSTR *pbstrHelpStringDll)
8591 TRACE(
"(%p) memid %d lcid(0x%x) HelpString(%p) "
8592 "HelpStringContext(%p) HelpStringDll(%p)\n",
8593 This, memid, lcid, pbstrHelpString, pdwHelpStringContext,
8594 pbstrHelpStringDll );
8602 if(pdwHelpStringContext)
8603 *pdwHelpStringContext=
This->dwHelpStringContext;
8604 if(pbstrHelpStringDll)
8605 *pbstrHelpStringDll=
8613 if(pdwHelpStringContext)
8615 if(pbstrHelpStringDll)
8616 *pbstrHelpStringDll=
8624 if(pdwHelpStringContext)
8626 if(pbstrHelpStringDll)
8627 *pbstrHelpStringDll=
8642 CUSTDATA *pCustData)
8659 CUSTDATA *pCustData)
8678 UINT indexFunc,
UINT indexParam, CUSTDATA *pCustData)
8683 TRACE(
"%p %u %u %p\n",
This, indexFunc, indexParam, pCustData);
8685 if(indexFunc >=
This->typeattr.cFuncs)
8688 if(indexParam >= pFDesc->
funcdesc.cParams)
8721 CUSTDATA *pCustData)
8734static const ITypeInfo2Vtbl
tinfvt =
8805 if (!pTypeLibImpl)
return E_FAIL;
8812 pTIIface->
index = 0;
8818 pTIIface->
typeattr.wMajorVerNum = 0;
8819 pTIIface->
typeattr.wMinorVerNum = 0;
8820 pTIIface->
typeattr.cbAlignment = 2;
8821 pTIIface->
typeattr.cbSizeInstance = -1;
8836 pFuncDesc->
funcdesc.funckind = FUNC_VIRTUAL;
8840 pFuncDesc->
funcdesc.cParamsOpt = 0;
8841 pFuncDesc->
funcdesc.oVft =
md->iMeth *
sizeof(
void *);
8843 pFuncDesc->
funcdesc.wFuncFlags = 0;
8844 pFuncDesc->
funcdesc.elemdescFunc.tdesc.vt =
md->vtReturn;
8845 pFuncDesc->
funcdesc.elemdescFunc.u.paramdesc.wParamFlags = PARAMFLAG_NONE;
8846 pFuncDesc->
funcdesc.elemdescFunc.u.paramdesc.pparamdescex =
NULL;
8848 md->cArgs *
sizeof(ELEMDESC));
8867 pTIClass->
index = 1;
8873 pTIClass->
typeattr.wMajorVerNum = 0;
8874 pTIClass->
typeattr.wMinorVerNum = 0;
8875 pTIClass->
typeattr.cbAlignment = 2;
8876 pTIClass->
typeattr.cbSizeInstance = -1;
8886 ref = heap_alloc_zero(
sizeof(*
ref));
8894 ITypeInfo_AddRef(*pptinfo);
8905 return ITypeInfo2_QueryInterface(&
This->ITypeInfo2_iface,
riid,
ppv);
8912 return ITypeInfo2_AddRef(&
This->ITypeInfo2_iface);
8919 return ITypeInfo2_Release(&
This->ITypeInfo2_iface);
8928 DESCKIND * pDescKind,
8937 TRACE(
"(%p)->(%s, %x, 0x%x, %p, %p, %p)\n",
This,
debugstr_w(
szName), lHash,
wFlags, ppTInfo, pDescKind, pBindPtr);
8939 *pDescKind = DESCKIND_NONE;
8940 pBindPtr->lpfuncdesc =
NULL;
8943 for(fdc = 0; fdc <
This->typeattr.cFuncs; ++fdc){
8944 pFDesc = &
This->funcdescs[fdc];
8954 if (fdc < This->typeattr.cFuncs)
8958 &pBindPtr->lpfuncdesc,
8962 *pDescKind = DESCKIND_FUNCDESC;
8964 ITypeInfo_AddRef(*ppTInfo);
8972 *pDescKind = DESCKIND_VARDESC;
8974 ITypeInfo_AddRef(*ppTInfo);
8984 hr=ITypeInfo2_GetRefTypeInfo(&
This->ITypeInfo2_iface,
This->impltypes[0].hRef, &pTInfo);
8987 hr = ITypeInfo_GetTypeComp(pTInfo,&pTComp);
8988 ITypeInfo_Release(pTInfo);
8992 hr = ITypeComp_Bind(pTComp,
szName, lHash,
wFlags, ppTInfo, pDescKind, pBindPtr);
8993 ITypeComp_Release(pTComp);
8994 if (
SUCCEEDED(
hr) && *pDescKind == DESCKIND_FUNCDESC &&
8997 FUNCDESC *tmp = pBindPtr->lpfuncdesc;
9003 WARN(
"Could not search inherited interface!\n");
9023 if (!ppTInfo || !ppTComp)
9032static const ITypeCompVtbl
tcompvt =
9058 This->syskind = syskind;
9063 ITypeLib2_Release(&
This->ITypeLib2_iface);
9068 hres = ITypeLib2_QueryInterface(&
This->ITypeLib2_iface, &IID_ICreateTypeLib2, (
LPVOID*)ppctlib);
9069 ITypeLib2_Release(&
This->ITypeLib2_iface);
9078 return ITypeLib2_QueryInterface(&
This->ITypeLib2_iface,
riid,
object);
9085 return ITypeLib2_AddRef(&
This->ITypeLib2_iface);
9092 return ITypeLib2_Release(&
This->ITypeLib2_iface);
9104 if (!ctinfo || !
name)
9111 if (
This->typeinfos)
9122 info->typeattr.typekind = kind;
9123 info->typeattr.cbAlignment = 4;
9125 switch (
info->typeattr.typekind) {
9130 info->typeattr.cbSizeInstance =
This->ptr_size;
9134 info->typeattr.cbSizeInstance = 0;
9137 info->typeattr.cbSizeInstance = 2;
9140 info->typeattr.cbSizeInstance = -0x75;
9143 FIXME(
"unrecognized typekind %d\n",
info->typeattr.typekind);
9144 info->typeattr.cbSizeInstance = 0xdeadbeef;
9148 hres = ITypeInfo2_QueryInterface(&
info->ITypeInfo2_iface,
9149 &IID_ICreateTypeInfo, (
void **)ctinfo);
9151 ITypeInfo2_Release(&
info->ITypeInfo2_iface);
9157 ++
This->TypeInfoCount;
9178 WORD majorVerNum,
WORD minorVerNum)
9182 TRACE(
"%p %d %d\n",
This, majorVerNum, minorVerNum);
9184 This->ver_major = majorVerNum;
9185 This->ver_minor = minorVerNum;
9239 This->dwHelpContext = helpContext;
9251 This->set_lcid = lcid;
9263 This->libflags = libFlags;
9299 file->string_seg.len = 0;
9339 str->offset = last_offs;
9354 file->header.nametablecount = 0;
9355 file->header.nametablechars = 0;
9357 file->name_seg.len = 0;
9362 file->header.nametablechars +=
size;
9363 file->header.nametablecount++;
9416 str->offset = last_offs;
9430 for (
i = 0;
i < 8;
i ++)
9441 int hash_key, *guidhashtab;
9448 guidhashtab =
file->guidhash_seg.data;
9454 entry->next_hash = guidhashtab[hash_key];
9455 guidhashtab[hash_key] = offs;
9457 guid->offset = offs;
9482 ERR(
"VariantChangeType failed: %08x\n",
hres);
9492 if(
V_UI4(&
v) > 0x3ffffff)
9520 if(
file->custdata_seg.data){
9522 data = (
int *)(((
char *)
file->custdata_seg.data) +
file->custdata_seg.len);
9523 file->custdata_seg.len +=
sizeof(
int) * 2;
9525 file->custdata_seg.len =
sizeof(
int) * 2;
9541 if(
file->custdata_seg.data){
9543 data = ((
char *)
file->custdata_seg.data) +
file->custdata_seg.len;
9544 file->custdata_seg.len +=
len;
9567 FIXME(
"Argument type not yet handled\n");
9584 file->arraydesc_seg.len += (2 +
desc->cDims * 2) *
sizeof(
DWORD);
9585 if(!
file->arraydesc_seg.data)
9589 encoded = (
DWORD*)((
char *)
file->arraydesc_seg.data + offs);
9592 encoded[1] =
desc->cDims | ((
desc->cDims * 2 *
sizeof(
DWORD)) << 16);
9593 for(
i = 0;
i <
desc->cDims; ++
i){
9594 encoded[2 +
i * 2] =
desc->rgbounds[
i].cElements;
9595 encoded[2 +
i * 2 + 1] =
desc->rgbounds[
i].lLbound;
9627 encoded[0] =
desc->vt | (0x7FFE << 16);
9631 encoded[0] =
desc->vt | (0x7FFF << 16);
9632 encoded[1] =
desc->u.hreftype;
9635 TRACE(
"Mixing in-place, VT: 0x%x\n",
desc->vt);
9653 return 0x80000000 | (subtype << 16) |
desc->vt;
9657 while(offs < file->typdesc_seg.len){
9658 if(!
memcmp(&
data[offs], encoded,
sizeof(encoded)))
9660 offs +=
sizeof(encoded);
9663 file->typdesc_seg.len +=
sizeof(encoded);
9664 if(!
file->typdesc_seg.data)
9669 memcpy(&
data[offs], encoded,
sizeof(encoded));
9685 if(!cdguids_seg->
data){
9696 cdguid->
next = offs;
9711 DWORD ret = aux_seg->
len,
i,
j, recorded_size = 0, extra_size = 0;
9717 for(
i = 0;
i <
info->typeattr.cFuncs; ++
i){
9720 recorded_size += 6 *
sizeof(
INT);
9725 recorded_size += 7 *
sizeof(
INT);
9726 else if(
desc->HelpStringContext != 0)
9727 recorded_size += 6 *
sizeof(
INT);
9729 else if(
desc->Entry)
9730 recorded_size += 3 *
sizeof(
INT);
9731 else if(
desc->HelpString)
9732 recorded_size += 2 *
sizeof(
INT);
9733 else if(
desc->helpcontext)
9734 recorded_size +=
sizeof(
INT);
9738 for(
j = 0;
j <
desc->funcdesc.cParams; ++
j){
9739 if(
desc->funcdesc.lprgelemdescParam[
j].u.paramdesc.wParamFlags & PARAMFLAG_FHASDEFAULT){
9740 recorded_size +=
desc->funcdesc.cParams *
sizeof(
INT);
9745 extra_size += 2 *
sizeof(
INT);
9748 for(
i = 0;
i <
info->typeattr.cVars; ++
i){
9751 recorded_size += 5 *
sizeof(
INT);
9754 if(
desc->HelpStringContext != 0)
9755 recorded_size += 5 *
sizeof(
INT);
9757 recorded_size += 4 *
sizeof(
INT);
9759 else if(
desc->HelpString)
9760 recorded_size += 2 *
sizeof(
INT);
9761 else if(
desc->HelpContext != 0)
9762 recorded_size +=
sizeof(
INT);
9764 extra_size += 2 *
sizeof(
INT);
9767 if(!recorded_size && !extra_size)
9770 extra_size +=
sizeof(
INT);
9772 aux_seg->
len += recorded_size + extra_size;
9774 aux_seg->
len +=
sizeof(
INT) * (
info->typeattr.cVars +
info->typeattr.cFuncs);
9781 *((
DWORD*)((
char *)aux_seg->
data +
ret)) = recorded_size;
9787 for(
i = 0;
i <
info->typeattr.cFuncs; ++
i){
9789 DWORD size = 6 *
sizeof(
INT), paramdefault_size = 0, *paramdefault;
9793 funcrecord->
Flags =
desc->funcdesc.wFuncFlags;
9806 desc->funcdesc.funckind |
9807 (
desc->funcdesc.invkind << 3) |
9809 (
desc->funcdesc.callconv << 8);
9812 funcrecord->
FKCCIC |= 0x2000;
9814 for(
j = 0; j < desc->funcdesc.cParams; ++
j){
9815 if(
desc->funcdesc.lprgelemdescParam[
j].u.paramdesc.wParamFlags & PARAMFLAG_FHASDEFAULT){
9816 paramdefault_size =
sizeof(
INT) *
desc->funcdesc.cParams;
9820 if(paramdefault_size > 0)
9821 funcrecord->
FKCCIC |= 0x1000;
9831 if(
desc->HelpString)
9841 funcrecord->
res9 = -1;
9842 funcrecord->
resA = -1;
9845 }
else if(
desc->HelpStringContext != 0){
9848 if(
desc->HelpString)
9858 funcrecord->
res9 = -1;
9859 funcrecord->
resA = -1;
9861 }
else if(
desc->Entry){
9864 if(
desc->HelpString)
9874 }
else if(
desc->HelpString){
9878 }
else if(
desc->helpcontext){
9883 paramdefault = (
DWORD*)((
char *)funcrecord +
size);
9884 size += paramdefault_size;
9886 for(
j = 0;
j <
desc->funcdesc.cParams; ++
j){
9890 if(
desc->pParamDesc[
j].Name)
9891 info->oName =
desc->pParamDesc[
j].Name->offset;
9894 info->Flags =
desc->funcdesc.lprgelemdescParam[
j].u.paramdesc.wParamFlags;
9896 if(paramdefault_size){
9897 if(
desc->funcdesc.lprgelemdescParam[
j].u.paramdesc.wParamFlags & PARAMFLAG_FHASDEFAULT)
9899 else if(paramdefault_size)
9917 for(
i = 0;
i <
info->typeattr.cVars; ++
i){
9923 varrecord->
Flags =
desc->vardesc.wVarFlags;
9926 if(
desc->vardesc.varkind == VAR_CONST){
9933 if(
desc->HelpStringContext != 0){
9936 if(
desc->HelpString)
9940 varrecord->
res9 = -1;
9946 if(
desc->HelpString)
9950 varrecord->
res9 = -1;
9952 }
else if(
desc->HelpString){
9955 if(
desc->HelpString)
9959 }
else if(
desc->HelpContext != 0){
9973 memid = (MEMBERID*)varrecord;
9974 for(
i = 0;
i <
info->typeattr.cFuncs; ++
i){
9976 *memid =
desc->funcdesc.memid;
9979 for(
i = 0;
i <
info->typeattr.cVars; ++
i){
9981 *memid =
desc->vardesc.memid;
9986 for(
i = 0;
i <
info->typeattr.cFuncs; ++
i){
9994 for(
i = 0;
i <
info->typeattr.cVars; ++
i){
10019 if(!
file->ref_seg.data)
10026 for(
i = 0;
i <
info->typeattr.cImplTypes; ++
i){
10028 chunk->res04 =
info->impltypes[
i].implflags;
10030 if(i < info->typeattr.cImplTypes - 1)
10048 if(
info->typeattr.wTypeFlags & TYPEFLAG_FDUAL)
10051 base->typekind =
info->typeattr.typekind;
10053 base->typekind |= (
info->typeattr.cbAlignment << 11) | (
info->typeattr.cbAlignment << 6);
10059 base->cElement = (
info->typeattr.cVars << 16) |
info->typeattr.cFuncs;
10065 base->posguid =
info->guid->offset;
10067 base->posguid = -1;
10068 base->flags =
info->typeattr.wTypeFlags;
10070 base->NameOffset =
info->Name->offset;
10072 ((
unsigned char*)
file->name_seg.data)[
info->Name->offset+9] = 0x38;
10073 *(HREFTYPE*)((
unsigned char*)
file->name_seg.data+
info->Name->offset) =
info->hreftype;
10075 base->NameOffset = -1;
10077 base->version = (
info->typeattr.wMinorVerNum << 16) |
info->typeattr.wMajorVerNum;
10078 if(
info->DocString)
10079 base->docstringoffs =
info->DocString->offset;
10081 base->docstringoffs = -1;
10082 base->helpstringcontext =
info->dwHelpStringContext;
10083 base->helpcontext =
info->dwHelpContext;
10085 base->cImplTypes =
info->typeattr.cImplTypes;
10086 base->cbSizeVft =
info->typeattr.cbSizeVft;
10087 base->size =
info->typeattr.cbSizeInstance;
10094 base->datatype1 =
info->DllName->offset;
10096 base->datatype1 = -1;
10098 if(
info->typeattr.cImplTypes > 0)
10099 base->datatype1 =
info->impltypes[0].hRef;
10101 base->datatype1 = -1;
10115 file->typeinfo_seg.len = 0;
10116 for(
i = 0;
i <
This->TypeInfoCount; ++
i){
10126 file->aux_seg.len = 0;
10129 file->typeinfo_seg.len = 0;
10130 for(
i = 0;
i <
This->TypeInfoCount; ++
i){
10133 ((
char *)
file->typeinfo_seg.data) +
file->typeinfo_seg.len);
10148 DWORD last_offs = 0;
10150 file->impfile_seg.len = 0;
10208 implib->
offset = last_offs;
10225 info->flags =
i | ((ref_type->
tkind & 0xFF) << 24);
10239 file->guidhash_seg.len = 0x80;
10246 file->namehash_seg.len = 0x200;
10254 segdir->
offset = *running_offset;
10256 *running_offset += segdir->
length;
10263 segdir->
res08 = -1;
10264 segdir->
res0c = 0xf;
10280 for(
i = 0; i < This->TypeInfoCount; ++
i){
10281 base->memoffset += file_len;
10310 DWORD written, junk_size, junk_offs, running_offset;
10319 for(
i = 0;
i <
This->TypeInfoCount; ++
i)
10320 if(
This->typeinfos[
i]->needs_layout)
10321 ICreateTypeInfo2_LayOut(&
This->typeinfos[
i]->ICreateTypeInfo2_iface);
10325 file.header.magic1 = 0x5446534D;
10326 file.header.magic2 = 0x00010002;
10328 file.header.lcid2 =
This->set_lcid;
10329 file.header.varflags = 0x40 |
This->syskind;
10330 if (
This->HelpFile)
10331 file.header.varflags |= 0x10;
10332 if (
This->HelpStringDll)
10334 file.header.version = (
This->ver_minor << 16) |
This->ver_major;
10335 file.header.flags =
This->libflags;
10336 file.header.helpstringcontext = 0;
10337 file.header.helpcontext =
This->dwHelpContext;
10338 file.header.res44 = 0x20;
10339 file.header.res48 = 0x80;
10340 file.header.dispatchpos =
This->dispatch_href;
10364 file.header.helpfile =
This->HelpFile->offset;
10366 file.header.helpfile = -1;
10368 if(
This->DocString)
10369 file.header.helpstring =
This->DocString->offset;
10371 file.header.helpstring = -1;
10375 file.header.nrtypeinfos =
This->TypeInfoCount;
10378 file.header.NameOffset =
This->Name->offset;
10380 file.header.NameOffset = -1;
10385 file.header.posguid =
This->guid->offset;
10387 file.header.posguid = -1;
10389 junk_size =
file.header.nrtypeinfos *
sizeof(
DWORD);
10391 junk_size +=
sizeof(
DWORD);
10393 junk = heap_alloc_zero(junk_size);
10395 *
junk =
This->HelpStringDll->offset;
10407 running_offset = 0;
10409 TRACE(
"header at: 0x%x\n", running_offset);
10410 running_offset +=
sizeof(
file.header);
10412 TRACE(
"junk at: 0x%x\n", running_offset);
10413 running_offset += junk_size;
10415 TRACE(
"segdir at: 0x%x\n", running_offset);
10416 running_offset +=
sizeof(
file.segdir);
10418 TRACE(
"typeinfo at: 0x%x\n", running_offset);
10421 TRACE(
"guidhashtab at: 0x%x\n", running_offset);
10424 TRACE(
"guidtab at: 0x%x\n", running_offset);
10427 TRACE(
"reftab at: 0x%x\n", running_offset);
10430 TRACE(
"impinfo at: 0x%x\n", running_offset);
10433 TRACE(
"impfiles at: 0x%x\n", running_offset);
10436 TRACE(
"namehashtab at: 0x%x\n", running_offset);
10439 TRACE(
"nametab at: 0x%x\n", running_offset);
10442 TRACE(
"stringtab at: 0x%x\n", running_offset);
10445 TRACE(
"typdesc at: 0x%x\n", running_offset);
10448 TRACE(
"arraydescriptions at: 0x%x\n", running_offset);
10451 TRACE(
"custdata at: 0x%x\n", running_offset);
10454 TRACE(
"cdguids at: 0x%x\n", running_offset);
10457 TRACE(
"res0e at: 0x%x\n", running_offset);
10460 TRACE(
"res0f at: 0x%x\n", running_offset);
10463 TRACE(
"aux_seg at: 0x%x\n", running_offset);
10536 if (!
guid || !varVal)
10545 ULONG helpStringContext)
10548 FIXME(
"%p %u - stub\n",
This, helpStringContext);
10591 return ITypeInfo2_QueryInterface(&
This->ITypeInfo2_iface,
riid,
object);
10598 return ITypeInfo2_AddRef(&
This->ITypeInfo2_iface);
10605 return ITypeInfo2_Release(&
This->ITypeInfo2_iface);
10629 if (typeFlags & TYPEFLAG_FDUAL) {
10630 static const WCHAR stdole2tlb[] = {
's',
't',
'd',
'o',
'l',
'e',
'2',
'.',
't',
'l',
'b',0 };
10641 ITypeLib_Release(
stdole);
10645 hres = ICreateTypeInfo2_AddRefTypeInfo(iface,
dispatch, &hreftype);
10651 old_flags =
This->typeattr.wTypeFlags;
10652 This->typeattr.wTypeFlags = typeFlags;
10654 hres = ICreateTypeInfo2_LayOut(iface);
10656 This->typeattr.wTypeFlags = old_flags;
10685 This->dwHelpContext = helpContext;
10691 WORD majorVerNum,
WORD minorVerNum)
10695 TRACE(
"%p %d %d\n",
This, majorVerNum, minorVerNum);
10697 This->typeattr.wMajorVerNum = majorVerNum;
10698 This->typeattr.wMinorVerNum = minorVerNum;
10704 ITypeInfo *typeInfo, HREFTYPE *refType)
10711 TYPEATTR *typeattr;
10715 TRACE(
"%p %p %p\n",
This, typeInfo, refType);
10717 if (!typeInfo || !refType)
10729 *refType =
target->hreftype;
10742 implib->
lcid == libattr->lcid &&
10748 if(&implib->
entry == &
This->pTypeLib->implib_list){
10749 implib = heap_alloc_zero(
sizeof(
TLBImpLib));
10756 libattr->wMinorVerNum, libattr->lcid, &implib->
name);
10759 TRACE(
"QueryPathOfRegTypeLib failed, no name stored: %08x\n",
hres);
10764 implib->
lcid = libattr->lcid;
10771 ITypeLib_ReleaseTLibAttr(
container, libattr);
10774 hres = ITypeInfo_GetTypeAttr(typeInfo, &typeattr);
10782 ref_type->
tkind == typeattr->typekind)
10787 if(&ref_type->
entry == &
This->pTypeLib->ref_list){
10788 ref_type = heap_alloc_zero(
sizeof(
TLBRefType));
10790 ref_type->
tkind = typeattr->typekind;
10801 ITypeInfo_ReleaseTypeAttr(typeInfo, typeattr);
10806 This->pTypeLib->dispatch_href = *refType;
10822 if (!funcDesc || funcDesc->oVft & 3)
10825 switch (
This->typeattr.typekind) {
10827 if (funcDesc->funckind != FUNC_STATIC)
10831 if (funcDesc->funckind != FUNC_DISPATCH)
10835 if (funcDesc->funckind != FUNC_PUREVIRTUAL)
10842 if (funcDesc->invkind & (INVOKE_PROPERTYPUT | INVOKE_PROPERTYPUTREF) &&
10843 !funcDesc->cParams)
10848 funcDesc->oVft % 8 != 0)
10852 memset(&tmp_func_desc, 0,
sizeof(tmp_func_desc));
10855 tmp_func_desc.
funcdesc = *funcDesc;
10857 if (tmp_func_desc.
funcdesc.oVft != 0)
10860 if (funcDesc->cScodes && funcDesc->lprgscode) {
10862 memcpy(tmp_func_desc.
funcdesc.lprgscode, funcDesc->lprgscode,
sizeof(
SCODE) * funcDesc->cScodes);
10865 tmp_func_desc.
funcdesc.cScodes = 0;
10869 for (
i = 0;
i < funcDesc->cParams; ++
i) {
10870 buf_size +=
sizeof(ELEMDESC);
10874 buffer = (
char*)(tmp_func_desc.
funcdesc.lprgelemdescParam + funcDesc->cParams);
10883 for (
i = 0;
i < funcDesc->cParams; ++
i) {
10891 if (tmp_func_desc.
funcdesc.lprgelemdescParam[
i].u.paramdesc.wParamFlags & PARAMFLAG_FHASDEFAULT &&
10905 if (
This->funcdescs) {
10909 if (index < This->typeattr.cFuncs) {
10914 func_desc =
This->funcdescs +
This->typeattr.cFuncs;
10917 for(
i = 0;
i <
This->typeattr.cFuncs + 1; ++
i){
10920 if(
fd->custdata_list.prev ==
fd->custdata_list.next)
10923 fd->custdata_list.prev->next = &
fd->custdata_list;
10924 fd->custdata_list.next->prev = &
fd->custdata_list;
10931 memcpy(func_desc, &tmp_func_desc,
sizeof(tmp_func_desc));
10934 ++
This->typeattr.cFuncs;
10950 switch(
This->typeattr.typekind){
10953 FIXME(
"Unhandled index: -1\n");
10964 if (
index != 0 ||
This->typeattr.cImplTypes)
10968 FIXME(
"Unimplemented typekind: %d\n",
This->typeattr.typekind);
10972 if (
This->impltypes){
10978 if (index < This->typeattr.cImplTypes) {
10983 impl_type =
This->impltypes +
This->typeattr.cImplTypes;
10986 for(
i = 0;
i <
This->typeattr.cImplTypes + 1; ++
i){
11002 impl_type->
hRef = refType;
11004 ++
This->typeattr.cImplTypes;
11006 if((refType & (~0x3)) == (
This->pTypeLib->dispatch_href & (~0x3)))
11007 This->typeattr.wTypeFlags |= TYPEFLAG_FDISPATCHABLE;
11009 hres = ICreateTypeInfo2_LayOut(iface);
11027 if (
index >=
This->typeattr.cImplTypes)
11042 This->typeattr.cbAlignment = alignment;
11059 This->typeattr.lpstrSchema =
This->Schema->str;
11072 if (
This->vardescs){
11078 if (index < This->typeattr.cVars) {
11083 var_desc =
This->vardescs +
This->typeattr.cVars;
11086 for(
i = 0;
i <
This->typeattr.cVars + 1; ++
i){
11089 if(
var->custdata_list.prev ==
var->custdata_list.next)
11092 var->custdata_list.prev->next = &
var->custdata_list;
11093 var->custdata_list.next->prev = &
var->custdata_list;
11098 var_desc =
This->vardescs = heap_alloc_zero(
sizeof(
TLBVarDesc));
11104 ++
This->typeattr.cVars;
11123 if (
index >=
This->typeattr.cFuncs || numNames == 0)
11126 if (func_desc->
funcdesc.invkind & (INVOKE_PROPERTYPUT | INVOKE_PROPERTYPUTREF)){
11127 if(numNames > func_desc->
funcdesc.cParams)
11130 if(numNames > func_desc->
funcdesc.cParams + 1)
11133 for(
i = 0;
i <
This->typeattr.cFuncs; ++
i) {
11136 if (iter->
funcdesc.invkind & (INVOKE_PROPERTYPUT | INVOKE_PROPERTYPUTREF | INVOKE_PROPERTYGET) &&
11137 func_desc->
funcdesc.invkind & (INVOKE_PROPERTYPUT | INVOKE_PROPERTYPUTREF | INVOKE_PROPERTYGET) &&
11146 for (
i = 1;
i < numNames; ++
i) {
11172 TYPEDESC *tdescAlias)
11292 This->typeattr.idldescType.dwReserved = idlDesc->dwReserved;
11293 This->typeattr.idldescType.wIDLFlags = idlDesc->wIDLFlags;
11310 hres = ICreateTypeInfo2_QueryInterface(iface, &IID_ITypeInfo, (
LPVOID*)&tinfo);
11319 hres = ITypeInfo_GetRefTypeOfImplType(tinfo, 0, &inh_href);
11322 hres = ITypeInfo_GetRefTypeInfo(tinfo, inh_href, &inh);
11325 hres = ITypeInfo_GetTypeAttr(inh, &
attr);
11327 ITypeInfo_Release(inh);
11328 ITypeInfo_Release(tinfo);
11331 This->typeattr.cbSizeVft =
attr->cbSizeVft;
11332 ITypeInfo_ReleaseTypeAttr(inh,
attr);
11336 hres = ITypeInfo_GetRefTypeOfImplType(inh, 0, &inh_href);
11339 hres = ITypeInfo_GetRefTypeInfo(inh, inh_href, &
next);
11341 ITypeInfo_Release(inh);
11348 ITypeInfo_Release(inh);
11350 This->typeattr.cbSizeVft = 0;
11353 ITypeInfo_Release(tinfo);
11357 This->typeattr.cbSizeVft = 0;
11360 ITypeInfo_Release(tinfo);
11364 This->typeattr.cbSizeVft = 7 *
This->pTypeLib->ptr_size;
11366 This->typeattr.cbSizeVft = 0;
11368 func_desc =
This->funcdescs;
11370 while (i < This->typeattr.cFuncs) {
11371 if (!(func_desc->
funcdesc.oVft & 0x1))
11374 if ((func_desc->
funcdesc.oVft & 0xFFFC) > user_vft)
11375 user_vft = func_desc->
funcdesc.oVft & 0xFFFC;
11377 This->typeattr.cbSizeVft +=
This->pTypeLib->ptr_size;
11386 iter =
This->funcdescs;
11387 while (j < This->typeattr.cFuncs) {
11388 if (iter != func_desc && iter->
funcdesc.memid == func_desc->
funcdesc.memid) {
11390 func_desc->
funcdesc.memid = 0x60000000 + (
depth << 16) +
This->typeattr.cFuncs;
11394 iter =
This->funcdescs;
11407 if (user_vft >
This->typeattr.cbSizeVft)
11408 This->typeattr.cbSizeVft = user_vft +
This->pTypeLib->ptr_size;
11410 for(
i = 0;
i <
This->typeattr.cVars; ++
i){
11419 iter =
This->vardescs;
11420 while (j < This->typeattr.cVars) {
11421 if (iter != var_desc && iter->
vardesc.memid == var_desc->
vardesc.memid) {
11423 var_desc->
vardesc.memid = 0x40000000 + (
depth << 16) +
This->typeattr.cVars;
11427 iter =
This->vardescs;
11437 ITypeInfo_Release(tinfo);
11450 MEMBERID memid, INVOKEKIND invKind)
11453 FIXME(
"%p %x %d - stub\n",
This, memid, invKind);
11490 if (!
guid || !varVal)
11531 ULONG helpStringContext)
11535 TRACE(
"%p %u\n",
This, helpStringContext);
11537 This->dwHelpStringContext = helpStringContext;
11637 if (lpCust && lpCust->cCustData)
11639 if (lpCust->prgCustData)
11643 for (
i = 0;
i < lpCust->cCustData;
i++)
11647 lpCust->prgCustData =
NULL;
11649 lpCust->cCustData = 0;
PRTL_UNICODE_STRING_BUFFER Path
_STLP_INLINE_LOOP _STLP_STD::pair< _InputIter1, _InputIter2 > mismatch(_InputIter1 __first1, _InputIter1 __last1, _InputIter2 __first2)
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
static void * heap_realloc(void *mem, size_t len)
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static const WCHAR nameW[]
static VOID HelpContext(PCONTEXT_ENTRY pContext)
void dispatch(HANDLE hStopEvent)
static void list_remove(struct list_entry *entry)
static int list_empty(struct list_entry *head)
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
static void list_add_head(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
#define RegCloseKey(hKey)
static HINSTANCE instance
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
LONG WINAPI RegDeleteKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ REGSAM samDesired, _In_ DWORD Reserved)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
LSTATUS WINAPI RegQueryValueW(HKEY hkey, LPCWSTR name, LPWSTR data, LPLONG count)
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)
struct tagVARIANT VARIANT
#define GetProcAddress(x, y)
#define INVALID_HANDLE_VALUE
#define CreateFileMappingW(a, b, c, d, e, f)
static __inline const char * debugstr_an(const char *s, int n)
#define GetCurrentProcess()
#define _strnicmp(_String1, _String2, _MaxCount)
#define HeapFree(x, y, z)
#define WINE_DECLARE_DEBUG_CHANNEL(x)
#define FILE_ATTRIBUTE_NORMAL
#define WideCharToMultiByte
#define MultiByteToWideChar
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
DWORD WINAPI SearchPathW(IN LPCWSTR lpPath OPTIONAL, IN LPCWSTR lpFileName, IN LPCWSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart OPTIONAL)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
BOOL WINAPI FindActCtxSectionGuid(DWORD dwFlags, const GUID *lpExtGuid, ULONG ulId, const GUID *lpSearchGuid, PACTCTX_SECTION_KEYED_DATA pInfo)
BOOL WINAPI FreeResource(HGLOBAL handle)
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
LPVOID WINAPI LockResource(HGLOBAL handle)
BOOL WINAPI EnumResourceNamesW(HMODULE hmod, LPCWSTR type, ENUMRESNAMEPROCW lpfun, LONG_PTR lparam)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
LCID WINAPI GetSystemDefaultLCID(void)
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
INT WINAPI StringFromGUID2(REFGUID id, LPOLESTR str, INT cmax)
HRESULT WINAPI GetErrorInfo(ULONG dwReserved, IErrorInfo **pperrinfo)
ULONG WINAPI LHashValOfNameSysA(SYSKIND skind, LCID lcid, LPCSTR lpStr)
HRESULT WINAPI SafeArrayGetUBound(SAFEARRAY *psa, UINT nDim, LONG *plUbound)
HRESULT WINAPI SafeArrayAccessData(SAFEARRAY *psa, void **ppvData)
HRESULT WINAPI SafeArrayUnaccessData(SAFEARRAY *psa)
HRESULT WINAPI SafeArrayDestroy(SAFEARRAY *psa)
SAFEARRAY *WINAPI SafeArrayCreate(VARTYPE vt, UINT cDims, SAFEARRAYBOUND *rgsabound)
static ITypeInfoImpl * info_impl_from_ICreateTypeInfo2(ICreateTypeInfo2 *iface)
static void TLBFuncDesc_Constructor(TLBFuncDesc *func_desc)
struct tagITypeInfoImpl ITypeInfoImpl
static HRESULT WINAPI ITypeLib2_fnGetTypeComp(ITypeLib2 *iface, ITypeComp **ppTComp)
static const WCHAR HELPDIRW[]
static TLBGuid * TLB_append_guid(struct list *guid_list, const GUID *new_guid, HREFTYPE hreftype)
static HRESULT WINAPI ITypeInfo2_fnGetImplTypeCustData(ITypeInfo2 *iface, UINT index, REFGUID guid, VARIANT *pVarVal)
void WINAPI ClearCustData(CUSTDATA *lpCust)
static HRESULT TLB_copy_all_custdata(struct list *custdata_list, CUSTDATA *pCustData)
static SIZE_T TLB_SizeElemDesc(const ELEMDESC *elemdesc)
static HRESULT WINAPI ITypeLib2_fnGetLibAttr(ITypeLib2 *iface, LPTLIBATTR *attr)
static WCHAR * get_interface_key(REFGUID guid, WCHAR *buffer)
static HRESULT WINAPI ITypeInfo_fnGetVarDesc(ITypeInfo2 *iface, UINT index, LPVARDESC *ppVarDesc)
static HRESULT MSFT_ReadAllGuids(TLBContext *pcx)
static HRESULT WINAPI ITypeInfo_fnInvoke(ITypeInfo2 *iface, VOID *pIUnk, MEMBERID memid, UINT16 wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *pArgErr)
static HRESULT WINAPI ITypeLib2_fnGetTypeInfoOfGuid(ITypeLib2 *iface, REFGUID guid, ITypeInfo **ppTInfo)
static TLBGuid * MSFT_ReadGuid(int offset, TLBContext *pcx)
static HRESULT WINAPI ITypeInfo2_fnGetDocumentation2(ITypeInfo2 *iface, MEMBERID memid, LCID lcid, BSTR *pbstrHelpString, DWORD *pdwHelpStringContext, BSTR *pbstrHelpStringDll)
static ULONG WINAPI TLB_Mapping_Release(IUnknown *iface)
static WORD SLTG_ReadString(const char *ptr, const TLBString **pStr, ITypeLibImpl *lib)
static void TLB_unregister_interface(GUID *guid, REGSAM flag)
static int TLB_str_memcmp(void *left, const TLBString *str, DWORD len)
static WORD SLTG_ReadStringA(const char *ptr, char **str)
static void MSFT_ReadValue(VARIANT *pVar, int offset, TLBContext *pcx)
static HRESULT WINAPI ICreateTypeLib2_fnSaveAllChanges(ICreateTypeLib2 *iface)
static HRESULT WINAPI ICreateTypeInfo2_fnDeleteImplType(ICreateTypeInfo2 *iface, UINT index)
static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncCustData(ICreateTypeInfo2 *iface, UINT index, REFGUID guid, VARIANT *varVal)
static const ITypeCompVtbl tlbtcvt
static void TLBVarDesc_Constructor(TLBVarDesc *var_desc)
struct tagTLBString TLBString
static int MSFT_CustData(TLBContext *pcx, int offset, struct list *custdata_list)
static TLBImplType * TLBImplType_Alloc(UINT n)
HRESULT ITypeInfoImpl_GetInternalFuncDesc(ITypeInfo *iface, UINT index, const FUNCDESC **ppFuncDesc)
static ULONG WINAPI ICreateTypeInfo2_fnRelease(ICreateTypeInfo2 *iface)
static void SLTG_ProcessModule(char *pBlk, ITypeInfoImpl *pTI, char *pNameTable, SLTG_TypeInfoHeader *pTIHeader, const SLTG_TypeInfoTail *pTITail, const BYTE *hlp_strings)
static HRESULT WINAPI ITypeComp_fnQueryInterface(ITypeComp *iface, REFIID riid, LPVOID *ppv)
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 HRESULT WINAPI ICreateTypeInfo2_fnSetSchema(ICreateTypeInfo2 *iface, LPOLESTR schema)
static HRESULT WINAPI ITypeComp_fnBindType(ITypeComp *iface, OLECHAR *szName, ULONG lHash, ITypeInfo **ppTInfo, ITypeComp **ppTComp)
static HRESULT WINAPI ICreateTypeLib2_fnSetGuid(ICreateTypeLib2 *iface, REFGUID guid)
static HRESULT WINAPI ITypeInfo2_fnGetAllFuncCustData(ITypeInfo2 *iface, UINT index, CUSTDATA *pCustData)
static void WMSFT_free_file(WMSFT_TLBFile *file)
static HRESULT WMSFT_fixup_typeinfos(ITypeLibImpl *This, WMSFT_TLBFile *file, DWORD file_len)
static HRESULT WINAPI ITypeInfo2_fnGetVarIndexOfMemId(ITypeInfo2 *iface, MEMBERID memid, UINT *pVarIndex)
static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncHelpContext(ICreateTypeInfo2 *iface, UINT index, DWORD helpContext)
static ITypeInfoImpl * MSFT_DoTypeInfo(TLBContext *pcx, int count, ITypeLibImpl *pLibInfo)
#define FromLEDWords(X, Y)
static void tmp_fill_segdir_seg(MSFT_pSeg *segdir, WMSFT_SegContents *contents, DWORD *running_offset)
static HRESULT TLB_ReadTypeLib(LPCWSTR pszFileName, LPWSTR pszPath, UINT cchPath, ITypeLib2 **ppTypeLib)
static HRESULT MSFT_ReadAllStrings(TLBContext *pcx)
static ULONG WINAPI ITypeInfo_fnAddRef(ITypeInfo2 *iface)
static HRESULT WINAPI ICreateTypeInfo2_fnSetVersion(ICreateTypeInfo2 *iface, WORD majorVerNum, WORD minorVerNum)
static HRESULT WINAPI ICreateTypeInfo2_fnSetTypeFlags(ICreateTypeInfo2 *iface, UINT typeFlags)
static HRESULT WMSFT_compile_guids(ITypeLibImpl *This, WMSFT_TLBFile *file)
static HRESULT WINAPI ICreateTypeLib2_fnSetName(ICreateTypeLib2 *iface, LPOLESTR name)
static char * SLTG_DoImpls(char *pBlk, ITypeInfoImpl *pTI, BOOL OneOnly, const sltg_ref_lookup_t *ref_lookup)
static void MSFT_GetTdesc(TLBContext *pcx, INT type, TYPEDESC *pTd)
static HRESULT WINAPI ITypeLibComp_fnBindType(ITypeComp *iface, OLECHAR *szName, ULONG lHash, ITypeInfo **ppTInfo, ITypeComp **ppTComp)
static HRESULT TLB_set_custdata(struct list *custdata_list, TLBGuid *tlbguid, VARIANT *var)
static void TLB_FreeVarDesc(VARDESC *)
static HRESULT WINAPI ITypeInfo2_fnGetTypeFlags(ITypeInfo2 *iface, ULONG *pTypeFlags)
static HRESULT WINAPI TLB_PEFile_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
static TLBVarDesc * TLB_get_vardesc_by_name(TLBVarDesc *vardescs, UINT n, const OLECHAR *name)
static HRESULT WINAPI ICreateTypeLib2_fnSetHelpContext(ICreateTypeLib2 *iface, DWORD helpContext)
static WCHAR * get_typelib_key(REFGUID guid, WORD wMaj, WORD wMin, WCHAR *buffer)
static HRESULT WINAPI ITypeLibComp_fnBind(ITypeComp *iface, OLECHAR *szName, ULONG lHash, WORD wFlags, ITypeInfo **ppTInfo, DESCKIND *pDescKind, BINDPTR *pBindPtr)
static TLBVarDesc * TLB_get_vardesc_by_memberid(TLBVarDesc *vardescs, UINT n, MEMBERID memid)
static DWORD WMSFT_append_typedesc(TYPEDESC *desc, WMSFT_TLBFile *file, DWORD *out_mix, INT16 *out_size)
static HRESULT WINAPI ICreateTypeLib2_fnSetHelpFileName(ICreateTypeLib2 *iface, LPOLESTR helpFileName)
static const IUnknownVtbl TLB_Mapping_Vtable
static void dump_TypeInfo(const ITypeInfoImpl *pty)
static HRESULT WINAPI ITypeInfo_fnGetRefTypeInfo(ITypeInfo2 *iface, HREFTYPE hRefType, ITypeInfo **ppTInfo)
static ITypeLibImpl * impl_from_ITypeLib(ITypeLib *iface)
static ITypeLibImpl * TypeLibImpl_Constructor(void)
static void TLBImplType_Constructor(TLBImplType *impl)
static void dump_ELEMDESC(const ELEMDESC *edesc)
static HRESULT WINAPI ICreateTypeInfo2_fnSetTypeDescAlias(ICreateTypeInfo2 *iface, TYPEDESC *tdescAlias)
static HRESULT WINAPI ITypeInfo2_fnGetFuncCustData(ITypeInfo2 *iface, UINT index, REFGUID guid, VARIANT *pVarVal)
static TLBCustData * TLB_get_custdata_by_guid(struct list *custdata_list, REFGUID guid)
static const GUID * TLB_get_guidref(const TLBGuid *guid)
static void ITypeInfoImpl_FuncDescAddHrefOffset(LPFUNCDESC pFuncDesc, UINT hrefoffset)
static TLBString * TLB_append_str(struct list *string_list, BSTR new_str)
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 DWORD MSFT_Read(void *buffer, DWORD count, TLBContext *pcx, LONG where)
static HRESULT WINAPI ITypeInfo2_fnGetTypeKind(ITypeInfo2 *iface, TYPEKIND *pTypeKind)
HRESULT WINAPI CreateTypeLib(SYSKIND syskind, LPCOLESTR file, ICreateTypeLib **ctlib)
static HRESULT WINAPI ICreateTypeInfo2_fnSetVarName(ICreateTypeInfo2 *iface, UINT index, LPOLESTR name)
static HRESULT WINAPI ICreateTypeLib2_fnSetCustData(ICreateTypeLib2 *iface, REFGUID guid, VARIANT *varVal)
#define DISPATCH_HREF_OFFSET
static void WMSFT_compile_impinfo(ITypeLibImpl *This, WMSFT_TLBFile *file)
static HRESULT WINAPI ITypeLib2_fnGetTypeInfo(ITypeLib2 *iface, UINT index, ITypeInfo **ppTInfo)
static HRESULT WINAPI ICreateTypeInfo2_fnSetImplTypeFlags(ICreateTypeInfo2 *iface, UINT index, INT implTypeFlags)
static void SLTG_ProcessInterface(char *pBlk, ITypeInfoImpl *pTI, char *pNameTable, SLTG_TypeInfoHeader *pTIHeader, const SLTG_TypeInfoTail *pTITail, const BYTE *hlp_strings)
struct tagTLBContext TLBContext
static ULONG WINAPI ICreateTypeLib2_fnRelease(ICreateTypeLib2 *iface)
static void dump_TLBVarDesc(const TLBVarDesc *pvd, UINT n)
static void WINAPI ITypeInfo_fnReleaseFuncDesc(ITypeInfo2 *iface, FUNCDESC *pFuncDesc)
static HRESULT WINAPI ITypeInfo2_fnGetAllParamCustData(ITypeInfo2 *iface, UINT indexFunc, UINT indexParam, CUSTDATA *pCustData)
static HRESULT TLB_Mapping_Open(LPCWSTR path, LPVOID *ppBase, DWORD *pdwTLBLength, IUnknown **ppFile)
static void MSFT_DoFuncs(TLBContext *pcx, ITypeInfoImpl *pTI, int cFuncs, int cVars, int offset, TLBFuncDesc **pptfd)
static HRESULT WINAPI ITypeLib2_fnGetAllCustData(ITypeLib2 *iface, CUSTDATA *pCustData)
static TLBFuncDesc * TLB_get_funcdesc_by_memberid(TLBFuncDesc *funcdescs, UINT n, MEMBERID memid)
static HRESULT sltg_get_typelib_ref(const sltg_ref_lookup_t *table, DWORD typeinfo_ref, HREFTYPE *typelib_ref)
static SIZE_T TLB_SizeTypeDesc(const TYPEDESC *tdesc, BOOL alloc_initial_space)
static int read_xx_header(HFILE lzfd)
static ULONG WINAPI ITypeComp_fnAddRef(ITypeComp *iface)
static UINT WINAPI ITypeLib2_fnGetTypeInfoCount(ITypeLib2 *iface)
static HRESULT WINAPI ICreateTypeInfo2_fnDeleteFuncDesc(ICreateTypeInfo2 *iface, UINT index)
static const IUnknownVtbl TLB_NEFile_Vtable
static HRESULT WINAPI ICreateTypeLib2_fnSetDocString(ICreateTypeLib2 *iface, LPOLESTR doc)
static HRESULT WINAPI ICreateTypeInfo2_fnSetVarHelpStringContext(ICreateTypeInfo2 *iface, UINT index, ULONG helpStringContext)
static HRESULT WINAPI ICreateTypeInfo2_fnSetCustData(ICreateTypeInfo2 *iface, REFGUID guid, VARIANT *varVal)
static void SLTG_ProcessDispatch(char *pBlk, ITypeInfoImpl *pTI, char *pNameTable, SLTG_TypeInfoHeader *pTIHeader, const SLTG_TypeInfoTail *pTITail, const BYTE *hlp_strings)
static void dump_TLBRefType(const ITypeLibImpl *pTL)
static const TLBString * decode_string(const BYTE *table, const char *stream, DWORD stream_length, ITypeLibImpl *lib)
static HRESULT WINAPI ITypeInfo_fnGetMops(ITypeInfo2 *iface, MEMBERID memid, BSTR *pBstrMops)
static const ITypeCompVtbl tcompvt
static HRESULT TLB_size_instance(ITypeInfoImpl *info, SYSKIND sys, TYPEDESC *tdesc, ULONG *size, WORD *align)
HRESULT WINAPI CreateDispTypeInfo(INTERFACEDATA *pidata, LCID lcid, ITypeInfo **pptinfo)
static const IUnknownVtbl TLB_PEFile_Vtable
static HRESULT WINAPI ICreateTypeInfo2_fnSetVarDocString(ICreateTypeInfo2 *iface, UINT index, LPOLESTR docString)
static HRESULT WINAPI ITypeInfo_fnGetImplTypeFlags(ITypeInfo2 *iface, UINT index, INT *pImplTypeFlags)
static HRESULT WINAPI ITypeInfo2_fnGetParamCustData(ITypeInfo2 *iface, UINT indexFunc, UINT indexParam, REFGUID guid, VARIANT *pVarVal)
static HRESULT WINAPI ITypeLib2_fnGetDocumentation(ITypeLib2 *iface, INT index, BSTR *pBstrName, BSTR *pBstrDocString, DWORD *pdwHelpContext, BSTR *pBstrHelpFile)
static HRESULT WINAPI ITypeInfo_fnGetTypeComp(ITypeInfo2 *iface, ITypeComp **ppTComp)
static TYPEDESC std_typedesc[VT_LPWSTR+1]
static const ITypeInfo2Vtbl tinfvt
static WCHAR * get_lcid_subkey(LCID lcid, SYSKIND syskind, WCHAR *buffer)
HRESULT WINAPI LoadRegTypeLib(REFGUID rguid, WORD wVerMajor, WORD wVerMinor, LCID lcid, ITypeLib **ppTLib)
static void MSFT_DoVars(TLBContext *pcx, ITypeInfoImpl *pTI, int cFuncs, int cVars, int offset, TLBVarDesc **pptvd)
HRESULT WINAPI CreateTypeLib2(SYSKIND syskind, LPCOLESTR szFile, ICreateTypeLib2 **ppctlib)
static HRESULT WINAPI ITypeInfo2_fnGetVarCustData(ITypeInfo2 *iface, UINT index, REFGUID guid, VARIANT *pVarVal)
static HRESULT WINAPI ITypeInfo_fnCreateInstance(ITypeInfo2 *iface, IUnknown *pOuterUnk, REFIID riid, VOID **ppvObj)
static BOOL find_typelib_key(REFGUID guid, WORD *wMaj, WORD *wMin)
static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncHelpStringContext(ICreateTypeInfo2 *iface, UINT index, ULONG helpStringContext)
static HRESULT TLB_PEFile_Open(LPCWSTR path, INT index, LPVOID *ppBase, DWORD *pdwTLBLength, IUnknown **ppFile)
static DWORD SLTG_ReadLibBlk(LPVOID pLibBlk, ITypeLibImpl *pTypeLibImpl)
static BSTR TLB_get_bstr(const TLBString *str)
static HRESULT WINAPI ITypeLib2_fnGetDocumentation2(ITypeLib2 *iface, INT index, LCID lcid, BSTR *pbstrHelpString, DWORD *pdwHelpStringContext, BSTR *pbstrHelpStringDll)
static void WMSFT_write_segment(HANDLE outfile, WMSFT_SegContents *segment)
HRESULT WINAPI RegisterTypeLib(ITypeLib *ptlib, const WCHAR *szFullPath, const WCHAR *szHelpDir)
static void dump_TLBImpLib(const TLBImpLib *import)
static ITypeInfoImpl * TLB_get_typeinfo_by_name(ITypeInfoImpl **typeinfos, UINT n, const OLECHAR *name)
static void SLTG_ProcessEnum(char *pBlk, ITypeInfoImpl *pTI, const char *pNameTable, SLTG_TypeInfoHeader *pTIHeader, const SLTG_TypeInfoTail *pTITail, const BYTE *hlp_strings)
#define INVBUF_GET_ARG_PTR_ARRAY(buffer, params)
static HRESULT WINAPI ICreateTypeLib2_fnSetHelpStringDll(ICreateTypeLib2 *iface, LPOLESTR filename)
HRESULT WINAPI DispCallFunc(void *pvInstance, ULONG_PTR oVft, CALLCONV cc, VARTYPE vtReturn, UINT cActuals, VARTYPE *prgvt, VARIANTARG **prgpvarg, VARIANT *pvargResult)
static ULONG WINAPI TLB_NEFile_AddRef(IUnknown *iface)
static void ITypeInfoImpl_ElemDescAddHrefOffset(LPELEMDESC pElemDesc, UINT hrefoffset)
static HRESULT WINAPI ITypeInfo2_fnGetAllVarCustData(ITypeInfo2 *iface, UINT index, CUSTDATA *pCustData)
static void WINAPI ITypeInfo_fnReleaseVarDesc(ITypeInfo2 *iface, VARDESC *pVarDesc)
static ITypeLib2 * ITypeLib2_Constructor_SLTG(LPVOID pLib, DWORD dwTLBLength)
static BOOL CALLBACK search_res_tlb(HMODULE hModule, LPCWSTR lpszType, LPWSTR lpszName, LONG_PTR lParam)
static void * TLB_CopyTypeDesc(TYPEDESC *dest, const TYPEDESC *src, void *buffer)
static HRESULT WINAPI ITypeInfo_fnGetIDsOfNames(ITypeInfo2 *iface, LPOLESTR *rgszNames, UINT cNames, MEMBERID *pMemId)
static void MSFT_Seek(TLBContext *pcx, LONG where)
struct tagWMSFT_TLBFile WMSFT_TLBFile
static void TLB_register_interface(TLIBATTR *libattr, LPOLESTR name, TYPEATTR *tattr, DWORD flag)
static DWORD WMSFT_append_arraydesc(ARRAYDESC *desc, WMSFT_TLBFile *file)
static HRESULT TLB_NEFile_Open(LPCWSTR path, INT index, LPVOID *ppBase, DWORD *pdwTLBLength, IUnknown **ppFile)
static HRESULT WMSFT_compile_names(ITypeLibImpl *This, WMSFT_TLBFile *file)
static TLBString * MSFT_ReadString(TLBContext *pcx, int offset)
static HRESULT WINAPI ICreateTypeInfo2_fnSetHelpStringContext(ICreateTypeInfo2 *iface, ULONG helpStringContext)
static HRESULT WINAPI ICreateTypeInfo2_fnSetMops(ICreateTypeInfo2 *iface, UINT index, BSTR bstrMops)
struct tagTLBGuid TLBGuid
static HRESULT WINAPI ICreateTypeInfo2_fnDeleteFuncDescByMemId(ICreateTypeInfo2 *iface, MEMBERID memid, INVOKEKIND invKind)
static HRESULT WINAPI ITypeInfo_fnGetContainingTypeLib(ITypeInfo2 *iface, ITypeLib **ppTLib, UINT *pIndex)
static ULONG WINAPI ITypeComp_fnRelease(ITypeComp *iface)
static CRITICAL_SECTION_DEBUG cache_section_debug
static HRESULT TLB_AllocAndInitFuncDesc(const FUNCDESC *src, FUNCDESC **dest_ptr, BOOL dispinterface)
#define INVBUF_GET_MISSING_ARG_ARRAY(buffer, params)
static TLB_PEFile * pefile_impl_from_IUnknown(IUnknown *iface)
static void MSFT_DoImplTypes(TLBContext *pcx, ITypeInfoImpl *pTI, int count, int offset)
static HRESULT WINAPI ICreateTypeInfo2_fnAddFuncDesc(ICreateTypeInfo2 *iface, UINT index, FUNCDESC *funcDesc)
static HRESULT MSFT_ReadAllNames(TLBContext *pcx)
static HRESULT WINAPI ICreateTypeInfo2_fnAddVarDesc(ICreateTypeInfo2 *iface, UINT index, VARDESC *varDesc)
static HRESULT WINAPI ITypeLibComp_fnQueryInterface(ITypeComp *iface, REFIID riid, LPVOID *ppv)
static TLB_Mapping * mapping_impl_from_IUnknown(IUnknown *iface)
static HRESULT WINAPI ICreateTypeInfo2_fnSetHelpContext(ICreateTypeInfo2 *iface, DWORD helpContext)
static void dump_TypeDesc(const TYPEDESC *pTD, char *szVarType)
struct tagWMSFT_SegContents WMSFT_SegContents
static HRESULT WINAPI ICreateTypeInfo2_fnSetVarCustData(ICreateTypeInfo2 *iface, UINT index, REFGUID guid, VARIANT *varVal)
HRESULT WINAPI LoadTypeLibEx(LPCOLESTR szFile, REGKIND regkind, ITypeLib **pptLib)
#define INVBUF_ELEMENT_SIZE
HRESULT WINAPI QueryPathOfRegTypeLib(REFGUID guid, WORD wMaj, WORD wMin, LCID lcid, LPBSTR path)
static HRESULT query_typelib_path(REFGUID guid, WORD wMaj, WORD wMin, SYSKIND syskind, LCID lcid, BSTR *path, BOOL redir)
static void dump_VARDESC(const VARDESC *v)
static ITypeLibImpl * impl_from_ICreateTypeLib2(ICreateTypeLib2 *iface)
static TLBVarDesc * TLBVarDesc_Alloc(UINT n)
struct tagWMSFT_ImpFile WMSFT_ImpFile
struct tagITypeLibImpl ITypeLibImpl
static ITypeInfoImpl * ITypeInfoImpl_Constructor(void)
static HRESULT WINAPI ICreateTypeInfo2_fnDeleteVarDesc(ICreateTypeInfo2 *iface, UINT index)
static HRESULT WINAPI ITypeLib2_fnGetTypeInfoType(ITypeLib2 *iface, UINT index, TYPEKIND *pTKind)
static TLBString * SLTG_ReadName(const char *pNameTable, int offset, ITypeLibImpl *lib)
static BOOL find_ne_resource(HFILE lzfd, LPCSTR typeid, LPCSTR resid, DWORD *resLen, DWORD *resOff)
static HRESULT WINAPI ITypeLib2_fnIsName(ITypeLib2 *iface, LPOLESTR szNameBuf, ULONG lHashVal, BOOL *pfName)
static void WMSFT_compile_guidhash(ITypeLibImpl *This, WMSFT_TLBFile *file)
static VOID WINAPI ITypeLib2_fnReleaseTLibAttr(ITypeLib2 *iface, TLIBATTR *pTLibAttr)
static void dump_TLBImplType(const TLBImplType *impl, UINT n)
static HRESULT WINAPI ITypeInfo_fnAddressOfMember(ITypeInfo2 *iface, MEMBERID memid, INVOKEKIND invKind, PVOID *ppv)
static HRESULT userdefined_to_variantvt(ITypeInfo *tinfo, const TYPEDESC *tdesc, VARTYPE *vt)
static HRESULT WINAPI ICreateTypeLib2_fnSetVersion(ICreateTypeLib2 *iface, WORD majorVerNum, WORD minorVerNum)
static void dump_DispParms(const DISPPARAMS *pdp)
static HRESULT TLB_SanitizeBSTR(BSTR str)
static struct list tlb_cache
static ULONG WINAPI ITypeInfo_fnRelease(ITypeInfo2 *iface)
static DWORD WMSFT_compile_typeinfo_aux(ITypeInfoImpl *info, WMSFT_TLBFile *file)
static const char * lookup_code(const BYTE *table, DWORD table_size, struct bitstream *bits)
static void ITypeInfoImpl_Destroy(ITypeInfoImpl *This)
static HRESULT WINAPI ICreateTypeInfo2_fnSetName(ICreateTypeInfo2 *iface, LPOLESTR name)
static ULONG WINAPI TLB_PEFile_AddRef(IUnknown *iface)
static HRESULT WINAPI ICreateTypeLib2_fnDeleteTypeInfo(ICreateTypeLib2 *iface, LPOLESTR name)
static HRESULT get_iface_guid(ITypeInfo *tinfo, HREFTYPE href, GUID *guid)
static CRITICAL_SECTION cache_section
static ITypeLibImpl * impl_from_ITypeLib2(ITypeLib2 *iface)
static HRESULT WINAPI ITypeInfo_fnQueryInterface(ITypeInfo2 *iface, REFIID riid, VOID **ppvObject)
static ULONG WINAPI TLB_PEFile_Release(IUnknown *iface)
static HRESULT WINAPI ITypeInfo2_fnGetAllImplTypeCustData(ITypeInfo2 *iface, UINT index, CUSTDATA *pCustData)
static const ITypeLib2Vtbl tlbvt
static sltg_ref_lookup_t * SLTG_DoRefs(SLTG_RefInfo *pRef, ITypeLibImpl *pTL, char *pNameTable)
static const WCHAR ProxyStubClsidW[]
static HRESULT WINAPI ICreateTypeInfo2_fnSetDocString(ICreateTypeInfo2 *iface, LPOLESTR doc)
static ULONG WINAPI TLB_NEFile_Release(IUnknown *iface)
static HRESULT WINAPI ICreateTypeInfo2_fnAddImplType(ICreateTypeInfo2 *iface, UINT index, HREFTYPE refType)
static BOOL TLB_is_propgetput(INVOKEKIND invkind)
HRESULT WINAPI RegisterTypeLibForUser(ITypeLib *ptlib, OLECHAR *szFullPath, OLECHAR *szHelpDir)
static void WMSFT_compile_impfile(ITypeLibImpl *This, WMSFT_TLBFile *file)
static void WMSFT_compile_namehash(ITypeLibImpl *This, WMSFT_TLBFile *file)
HRESULT WINAPI UnRegisterTypeLib(REFGUID libid, WORD wVerMajor, WORD wVerMinor, LCID lcid, SYSKIND syskind)
static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncAndParamNames(ICreateTypeInfo2 *iface, UINT index, LPOLESTR *names, UINT numNames)
static void SLTG_ProcessRecord(char *pBlk, ITypeInfoImpl *pTI, const char *pNameTable, SLTG_TypeInfoHeader *pTIHeader, const SLTG_TypeInfoTail *pTITail, const BYTE *hlp_strings)
static ULONG WINAPI ITypeLibComp_fnAddRef(ITypeComp *iface)
static int get_ptr_size(SYSKIND syskind)
static HRESULT WINAPI ITypeLib2_fnQueryInterface(ITypeLib2 *iface, REFIID riid, void **ppv)
static BOOL func_restricted(const FUNCDESC *desc)
static HRESULT TLB_CopyElemDesc(const ELEMDESC *src, ELEMDESC *dest, char **buffer)
static ITypeInfoImpl * impl_from_ITypeInfo2(ITypeInfo2 *iface)
static const WCHAR ProxyStubClsid32W[]
static ITypeInfoImpl * info_impl_from_ITypeComp(ITypeComp *iface)
static HRESULT WINAPI ITypeInfo_fnGetFuncDesc(ITypeInfo2 *iface, UINT index, LPFUNCDESC *ppFuncDesc)
static HRESULT WINAPI ITypeInfo_fnGetTypeAttr(ITypeInfo2 *iface, LPTYPEATTR *ppTypeAttr)
static HRESULT WINAPI ITypeLib2_fnFindName(ITypeLib2 *iface, LPOLESTR name, ULONG hash, ITypeInfo **ppTInfo, MEMBERID *memid, UINT16 *found)
static HRESULT WINAPI ITypeInfo_fnGetDocumentation(ITypeInfo2 *iface, MEMBERID memid, BSTR *pBstrName, BSTR *pBstrDocString, DWORD *pdwHelpContext, BSTR *pBstrHelpFile)
static HRESULT WINAPI ICreateTypeLib2_fnSetLibFlags(ICreateTypeLib2 *iface, UINT libFlags)
static WORD * SLTG_DoElem(WORD *pType, char *pBlk, ELEMDESC *pElem, const sltg_ref_lookup_t *ref_lookup)
struct tagTLBImpLib TLBImpLib
static ITypeLibImpl * impl_from_ITypeComp(ITypeComp *iface)
static const char *const typekind_desc[]
static HRESULT TLB_AllocAndInitVarDesc(const VARDESC *src, VARDESC **dest_ptr)
static ULONG WINAPI ITypeLib2_fnAddRef(ITypeLib2 *iface)
struct tagTLBRefType TLBRefType
static HRESULT WINAPI ICreateTypeLib2_fnCreateTypeInfo(ICreateTypeLib2 *iface, LPOLESTR name, TYPEKIND kind, ICreateTypeInfo **ctinfo)
static HRESULT WINAPI ITypeLib2_fnGetLibStatistics(ITypeLib2 *iface, ULONG *pcUniqueNames, ULONG *pcchUniqueNames)
static HRESULT WINAPI ITypeInfo_fnGetDllEntry(ITypeInfo2 *iface, MEMBERID memid, INVOKEKIND invKind, BSTR *pBstrDllName, BSTR *pBstrName, WORD *pwOrdinal)
static const GUID * TLB_get_guid_null(const TLBGuid *guid)
static void WINAPI ITypeInfo_fnReleaseTypeAttr(ITypeInfo2 *iface, TYPEATTR *pTypeAttr)
static HRESULT TLB_SanitizeVariant(VARIANT *var)
static HRESULT ITypeInfoImpl_GetInternalDispatchFuncDesc(ITypeInfo *iface, UINT index, const FUNCDESC **ppFuncDesc, UINT *funcs, UINT *hrefoffset)
static HRESULT WINAPI ITypeLib2_fnGetCustData(ITypeLib2 *iface, REFGUID guid, VARIANT *pVarVal)
struct tagWMSFT_RefChunk WMSFT_RefChunk
static DWORD WMSFT_compile_custdata(struct list *custdata_list, WMSFT_TLBFile *file)
static HRESULT WINAPI ICreateTypeInfo2_fnLayOut(ICreateTypeInfo2 *iface)
static ITypeLib2 * ITypeLib2_Constructor_MSFT(LPVOID pLib, DWORD dwTLBLength)
static DWORD MSFT_ReadLEWords(void *buffer, DWORD count, TLBContext *pcx, LONG where)
static const ICreateTypeInfo2Vtbl CreateTypeInfo2Vtbl
static void dump_FUNCDESC(const FUNCDESC *funcdesc)
static HRESULT ITypeInfoImpl_GetDispatchRefTypeInfo(ITypeInfo *iface, HREFTYPE *hRefType, ITypeInfo **ppTInfo)
struct tagTLBCustData TLBCustData
struct tagTLBImplType TLBImplType
static HRESULT WINAPI ICreateTypeInfo2_fnSetAlignment(ICreateTypeInfo2 *iface, WORD alignment)
static HRESULT WINAPI ITypeInfo2_fnGetAllCustData(ITypeInfo2 *iface, CUSTDATA *pCustData)
static HRESULT WINAPI ICreateTypeInfo2_fnSetParamCustData(ICreateTypeInfo2 *iface, UINT funcIndex, UINT paramIndex, REFGUID guid, VARIANT *varVal)
static DWORD MSFT_ReadLEDWords(void *buffer, DWORD count, TLBContext *pcx, LONG where)
static void dump_TLBFuncDesc(const TLBFuncDesc *pfd, UINT n)
static HRESULT WINAPI ITypeComp_fnBind(ITypeComp *iface, OLECHAR *szName, ULONG lHash, WORD wFlags, ITypeInfo **ppTInfo, DESCKIND *pDescKind, BINDPTR *pBindPtr)
static HRESULT WINAPI ICreateTypeLib2_fnQueryInterface(ICreateTypeLib2 *iface, REFIID riid, void **object)
static DWORD WMSFT_encode_variant(VARIANT *value, WMSFT_TLBFile *file)
static ULONG WINAPI TLB_Mapping_AddRef(IUnknown *iface)
static WORD * SLTG_DoType(WORD *pType, char *pBlk, TYPEDESC *pTD, const sltg_ref_lookup_t *ref_lookup)
static HRESULT WINAPI ICreateTypeInfo2_fnDeleteVarDescByMemId(ICreateTypeInfo2 *iface, MEMBERID memid)
static HRESULT WINAPI ICreateTypeInfo2_fnSetImplTypeCustData(ICreateTypeInfo2 *iface, UINT index, REFGUID guid, VARIANT *varVal)
static const WCHAR TypeLibW[]
static void SLTG_ProcessAlias(char *pBlk, ITypeInfoImpl *pTI, char *pNameTable, SLTG_TypeInfoHeader *pTIHeader, const SLTG_TypeInfoTail *pTITail)
static BOOL TLB_GUIDFromString(const char *str, GUID *guid)
static ITypeInfoImpl * impl_from_ITypeInfo(ITypeInfo *iface)
static HRESULT WINAPI ITypeInfo_fnGetNames(ITypeInfo2 *iface, MEMBERID memid, BSTR *rgBstrNames, UINT cMaxNames, UINT *pcNames)
static HRESULT WINAPI ICreateTypeInfo2_fnSetGuid(ICreateTypeInfo2 *iface, REFGUID guid)
static ULONG WINAPI ICreateTypeInfo2_fnAddRef(ICreateTypeInfo2 *iface)
#define INVBUF_GET_ARG_ARRAY(buffer, params)
static HREFTYPE MSFT_ReadHreftype(TLBContext *pcx, int offset)
static ULONG WINAPI ICreateTypeLib2_fnAddRef(ICreateTypeLib2 *iface)
static TLBString * MSFT_ReadName(TLBContext *pcx, int offset)
#define INVBUF_GET_ARG_TYPE_ARRAY(buffer, params)
static void SLTG_ProcessCoClass(char *pBlk, ITypeInfoImpl *pTI, char *pNameTable, SLTG_TypeInfoHeader *pTIHeader, SLTG_TypeInfoTail *pTITail)
static const WCHAR FLAGSW[]
static HRESULT typedescvt_to_variantvt(ITypeInfo *tinfo, const TYPEDESC *tdesc, VARTYPE *vt)
static HRESULT WINAPI ITypeInfo2_fnGetFuncIndexOfMemId(ITypeInfo2 *iface, MEMBERID memid, INVOKEKIND invKind, UINT *pFuncIndex)
static HRESULT WMSFT_compile_strings(ITypeLibImpl *This, WMSFT_TLBFile *file)
static HRESULT WINAPI ICreateTypeInfo2_fnInvalidate(ICreateTypeInfo2 *iface)
HRESULT WINAPI LoadTypeLib(const OLECHAR *szFile, ITypeLib **pptLib)
struct tagTLBParDesc TLBParDesc
static ULONG WINAPI ITypeLibComp_fnRelease(ITypeComp *iface)
HRESULT WINAPI UnRegisterTypeLibForUser(REFGUID libid, WORD wVerMajor, WORD wVerMinor, LCID lcid, SYSKIND syskind)
static HRESULT TLB_get_size_from_hreftype(ITypeInfoImpl *info, HREFTYPE href, ULONG *size, WORD *align)
static void TLB_FreeElemDesc(ELEMDESC *elemdesc)
static int hash_guid(GUID *guid)
static HRESULT WINAPI ICreateTypeLib2_fnSetHelpStringContext(ICreateTypeLib2 *iface, ULONG helpStringContext)
#define FromLEWords(X, Y)
static HRESULT WINAPI ICreateTypeInfo2_fnSetFuncDocString(ICreateTypeInfo2 *iface, UINT index, LPOLESTR docString)
static TLBFuncDesc * TLBFuncDesc_Alloc(UINT n)
static ULONG WINAPI ITypeLib2_fnRelease(ITypeLib2 *iface)
static HRESULT WINAPI ICreateTypeInfo2_fnAddRefTypeInfo(ICreateTypeInfo2 *iface, ITypeInfo *typeInfo, HREFTYPE *refType)
static HRESULT MSFT_ReadAllRefs(TLBContext *pcx)
static TLB_NEFile * nefile_impl_from_IUnknown(IUnknown *iface)
#define TLB_REF_NOT_FOUND
static void WMSFT_compile_typeinfo_seg(ITypeLibImpl *This, WMSFT_TLBFile *file, DWORD *junk)
static HRESULT WINAPI ICreateTypeInfo2_fnSetVarHelpContext(ICreateTypeInfo2 *iface, UINT index, DWORD helpContext)
static HRESULT WINAPI ICreateTypeLib2_fnSetLcid(ICreateTypeLib2 *iface, LCID lcid)
static const ICreateTypeLib2Vtbl CreateTypeLib2Vtbl
static HRESULT WINAPI TLB_NEFile_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
struct tagTLBFuncDesc TLBFuncDesc
static void TLB_FreeCustData(struct list *custdata_list)
static HRESULT WINAPI ICreateTypeInfo2_fnDefineFuncAsDllEntry(ICreateTypeInfo2 *iface, UINT index, LPOLESTR dllName, LPOLESTR procName)
static HRESULT WINAPI ITypeInfo_fnGetRefTypeOfImplType(ITypeInfo2 *iface, UINT index, HREFTYPE *pRefType)
static BSTR TLB_MultiByteToBSTR(const char *ptr)
#define DISPATCH_HREF_MASK
static DWORD WMSFT_compile_typeinfo(ITypeInfoImpl *info, INT16 index, WMSFT_TLBFile *file, char *data)
static DWORD WMSFT_compile_typeinfo_ref(ITypeInfoImpl *info, WMSFT_TLBFile *file)
static HRESULT WINAPI ICreateTypeInfo2_fnSetTypeIdldesc(ICreateTypeInfo2 *iface, IDLDESC *idlDesc)
static HRESULT WINAPI ICreateTypeInfo2_fnQueryInterface(ICreateTypeInfo2 *iface, REFIID riid, void **object)
static void TLB_abort(void)
static HRESULT WINAPI ITypeInfo2_fnGetCustData(ITypeInfo2 *iface, REFGUID guid, VARIANT *pVarVal)
static HRESULT WINAPI TLB_Mapping_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
struct tagTLBVarDesc TLBVarDesc
static void dump_TLBFuncDescOne(const TLBFuncDesc *pfd)
static TLBParDesc * TLBParDesc_Constructor(UINT n)
struct tagMSFT_ImpInfo MSFT_ImpInfo
#define SLTG_FUNCTION_FLAGS_PRESENT
#define SLTG_COMPOBJ_MAGIC
#define SLTG_TIHEADER_MAGIC
#define SLTG_FUNCTION_MAGIC
#define SLTG_STATIC_FUNCTION_MAGIC
struct tagMSFT_TypeInfoBase MSFT_TypeInfoBase
#define SLTG_LIBBLK_MAGIC
#define SLTG_VAR_WITH_FLAGS_MAGIC
#define SLTG_DISPATCH_FUNCTION_MAGIC
#define MSFT_IMPINFO_OFFSET_IS_GUID
static const WCHAR win32W[]
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
int align(int length, int align)
static const FxOffsetAndName offsets[]
GLint GLint GLsizei GLsizei GLsizei depth
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble r
GLdouble GLdouble GLdouble GLdouble q
GLboolean GLboolean GLboolean b
GLenum const GLfloat * params
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
GLuint GLdouble GLdouble GLint GLint order
GLboolean GLboolean GLboolean GLboolean a
GLubyte GLubyte GLubyte GLubyte w
GLfloat GLfloat GLfloat GLfloat h
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 flag
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
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
FxContextHeader * pHeader
#define MB_ERR_INVALID_CHARS
static ITypeInfo * typeinfos[LAST_tid]
VOID WINAPI CoTaskMemFree(LPVOID ptr)
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_Check_return_ long __cdecl strtol(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
LONG WINAPI LZSeek(HFILE fd, LONG off, INT type)
INT WINAPI LZRead(HFILE fd, LPSTR vbuf, INT toread)
HFILE WINAPI LZOpenFileW(LPWSTR fn, LPOFSTRUCT ofs, WORD mode)
void WINAPI LZClose(HFILE fd)
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
#define ERROR_FILE_NOT_FOUND
#define sprintf(buf, format,...)
static const DWORD ptr_size
static const WCHAR desc[]
static const char * debugstr_variant(const VARIANT *var)
static DWORD LPDWORD reslen
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG PVOID ULONG out_size
static OLECHAR OLECHAR *static SYSKIND
static const char * contents
static VARIANTARG static DISPID
#define __ASM_GLOBAL_FUNC(name, code)
static const WCHAR spaceW[]
_Out_ PULONG _Out_ PULONG pIndex
#define REG_CREATED_NEW_KEY
#define LOCALE_USER_DEFAULT
#define MAKELCID(lgid, srtid)
HRESULT WINAPI DECLSPEC_HOTPATCH GetActiveObject(REFCLSID rcid, LPVOID preserved, LPUNKNOWN *ppunk)
BSTR WINAPI SysAllocString(LPCOLESTR str)
UINT WINAPI SysStringLen(BSTR str)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
BSTR WINAPI DECLSPEC_HOTPATCH SysAllocStringByteLen(LPCSTR str, UINT len)
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
#define IMAGE_NT_SIGNATURE
#define IMAGE_OS2_SIGNATURE
#define IMAGE_DOS_SIGNATURE
static const WCHAR szName[]
#define IsEqualGUID(rguid1, rguid2)
#define IsEqualIID(riid1, riid2)
static unsigned __int64 next
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define SUBLANG_ENGLISH_US
__WINE_SERVER_LIST_INLINE unsigned int list_count(const struct list *list)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
static struct __wine_debug_functions funcs
static const WCHAR typelibW[]
static PIXELFORMATDESCRIPTOR pfd
LIST_ENTRY ProcessLocksList
const TLBString * DocString
BOOL not_attached_to_typelib
struct list * pcustdata_list
const TLBString * DllName
ITypeInfo2 ITypeInfo2_iface
DWORD dwHelpStringContext
ITypeComp ITypeComp_iface
struct list custdata_list
ICreateTypeInfo2 ICreateTypeInfo2_iface
ICreateTypeLib2 ICreateTypeLib2_iface
ITypeLib2 ITypeLib2_iface
const TLBString * HelpFile
struct list custdata_list
const TLBString * DocString
struct tagITypeInfoImpl ** typeinfos
ITypeComp ITypeComp_iface
const TLBString * HelpStringDll
MSFT_pSeg pArrayDescriptions
const TLBString * HelpString
struct list custdata_list
struct tagITypeLibImpl * pImpTypeLib
struct list custdata_list
struct list custdata_list
const TLBString * HelpString
struct list custdata_list
WMSFT_SegContents aux_seg
WMSFT_SegContents typeinfo_seg
WMSFT_SegContents namehash_seg
WMSFT_SegContents ref_seg
WMSFT_SegContents impinfo_seg
WMSFT_SegContents arraydesc_seg
WMSFT_SegContents impfile_seg
WMSFT_SegContents custdata_seg
WMSFT_SegContents guidhash_seg
WMSFT_SegContents guid_seg
WMSFT_SegContents string_seg
WMSFT_SegContents cdguids_seg
WMSFT_SegContents name_seg
WMSFT_SegContents typdesc_seg
#define FIELD_OFFSET(t, f)
#define CONTAINING_RECORD(address, type, field)
HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, USHORT wFlags, VARTYPE vt)
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
void WINAPI VariantInit(VARIANTARG *pVarg)
HRESULT WINAPI VariantCopyInd(VARIANT *pvargDest, VARIANTARG *pvargSrc)
HRESULT WINAPI VariantCopy(VARIANTARG *pvargDest, VARIANTARG *pvargSrc)
HRESULT VARIANT_ClearInd(VARIANTARG *pVarg)
static unsigned stack_offset(compile_ctx_t *ctx)
WORD WORD PSZ PSZ pszFileName
_In_ WDFCOLLECTION _In_ ULONG Index
DWORD WINAPI GetLastError(void)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define LOAD_LIBRARY_AS_DATAFILE
void WINAPI DebugBreak(void)
#define LOAD_WITH_ALTERED_SEARCH_PATH
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define DONT_RESOLVE_DLL_REFERENCES
_In_ DWORD _Out_ _In_ WORD wFlags
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
_In_ PATHOBJ _In_ CLIPOBJ _In_ BRUSHOBJ _In_ POINTL _In_ MIX mix
#define TYPE_E_BADMODULEKIND
#define DISP_E_PARAMNOTFOUND
#define DISP_E_NONAMEDARGS
#define TYPE_E_REGISTRYACCESS
#define TYPE_E_ELEMENTNOTFOUND
#define TYPE_E_DLLFUNCTIONNOTFOUND
#define DISP_E_BADVARTYPE
#define TYPE_E_AMBIGUOUSNAME
#define TYPE_E_INCONSISTENTPROPFUNCS
#define DISP_E_BADPARAMCOUNT
#define TYPE_E_TYPEMISMATCH
#define STG_E_FILENOTFOUND
#define DISP_E_NOTACOLLECTION
#define TYPE_E_CANTLOADLIBRARY
#define DISP_E_MEMBERNOTFOUND
#define TYPE_E_NAMECONFLICT
#define CLASS_E_NOAGGREGATION
#define TYPE_E_INVALIDSTATE
#define TYPE_E_LIBNOTREGISTERED
#define DISP_E_UNKNOWNNAME
#define STG_E_INSUFFICIENTMEMORY
#define HKEY_CLASSES_ROOT
#define IS_INTRESOURCE(i)
#define MAKEINTRESOURCEA(i)
#define MAKEINTRESOURCEW(i)