Author: akhaldi Date: Thu Nov 17 22:58:15 2016 New Revision: 73285
URL: http://svn.reactos.org/svn/reactos?rev=73285&view=rev Log: [OLEAUT32] Sync with Wine Staging 1.9.23. CORE-12409
Modified: trunk/reactos/dll/win32/oleaut32/oleaut.c trunk/reactos/dll/win32/oleaut32/olefont.c trunk/reactos/dll/win32/oleaut32/olepicture.c trunk/reactos/dll/win32/oleaut32/typelib.c trunk/reactos/dll/win32/oleaut32/usrmarshal.c trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/oleaut32/oleaut.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/oleaut.c... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/oleaut.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/oleaut.c [iso-8859-1] Thu Nov 17 22:58:15 2016 @@ -854,7 +854,8 @@ return S_OK; /*FALLTHROUGH*/ } - if (IsEqualCLSID(rclsid, &CLSID_PSTypeInfo) || + if (IsEqualCLSID(rclsid, &CLSID_PSTypeComp) || + IsEqualCLSID(rclsid, &CLSID_PSTypeInfo) || IsEqualCLSID(rclsid, &CLSID_PSTypeLib) || IsEqualCLSID(rclsid, &CLSID_PSDispatch) || IsEqualCLSID(rclsid, &CLSID_PSEnumVariant))
Modified: trunk/reactos/dll/win32/oleaut32/olefont.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/olefont.... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/olefont.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/olefont.c [iso-8859-1] Thu Nov 17 22:58:15 2016 @@ -994,8 +994,10 @@
newObject->pPropertyNotifyCP = NULL; newObject->pFontEventsCP = NULL; - CreateConnectionPoint((IUnknown*)newObject, &IID_IPropertyNotifySink, &newObject->pPropertyNotifyCP); - CreateConnectionPoint((IUnknown*)newObject, &IID_IFontEventsDisp, &newObject->pFontEventsCP); + CreateConnectionPoint((IUnknown*)&newObject->IFont_iface, &IID_IPropertyNotifySink, + &newObject->pPropertyNotifyCP); + CreateConnectionPoint((IUnknown*)&newObject->IFont_iface, &IID_IFontEventsDisp, + &newObject->pFontEventsCP);
if (!newObject->pPropertyNotifyCP || !newObject->pFontEventsCP) { @@ -2209,12 +2211,22 @@ return CONTAINING_RECORD(iface, IClassFactoryImpl, IClassFactory_iface); }
-static HRESULT WINAPI -SFCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) { - IClassFactoryImpl *This = impl_from_IClassFactory(iface); - - FIXME("(%p)->(%s,%p),stub!\n",This,debugstr_guid(riid),ppobj); - return E_NOINTERFACE; +static HRESULT WINAPI SFCF_QueryInterface(IClassFactory *iface, REFIID riid, void **obj) +{ + IClassFactoryImpl *This = impl_from_IClassFactory(iface); + + TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), obj); + + *obj = NULL; + + if (IsEqualIID(&IID_IClassFactory, riid) || IsEqualIID(&IID_IUnknown, riid)) + { + *obj = iface; + IClassFactory_AddRef(iface); + return S_OK; + } + + return E_NOINTERFACE; }
static ULONG WINAPI
Modified: trunk/reactos/dll/win32/oleaut32/olepicture.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/olepictu... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/olepicture.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/olepicture.c [iso-8859-1] Thu Nov 17 22:58:15 2016 @@ -291,7 +291,8 @@ newObject->IConnectionPointContainer_iface.lpVtbl = &OLEPictureImpl_IConnectionPointContainer_VTable;
newObject->pCP = NULL; - CreateConnectionPoint((IUnknown*)newObject,&IID_IPropertyNotifySink,&newObject->pCP); + CreateConnectionPoint((IUnknown*)&newObject->IPicture_iface, &IID_IPropertyNotifySink, + &newObject->pCP); if (!newObject->pCP) { HeapFree(GetProcessHeap(), 0, newObject);
Modified: trunk/reactos/dll/win32/oleaut32/typelib.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/typelib.... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/typelib.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/typelib.c [iso-8859-1] Thu Nov 17 22:58:15 2016 @@ -460,6 +460,9 @@ HRESULT res;
TRACE("(%s,%d,%p)\n",debugstr_w(szFile), regkind, pptLib); + + if (!szFile || !pptLib) + return E_INVALIDARG;
*pptLib = NULL;
@@ -1222,22 +1225,8 @@ BOOL needs_layout;
TLBGuid *guid; - LCID lcid; - MEMBERID memidConstructor; - MEMBERID memidDestructor; - LPOLESTR lpstrSchema; - ULONG cbSizeInstance; - TYPEKIND typekind; - WORD cFuncs; - WORD cVars; - WORD cImplTypes; - WORD cbSizeVft; - WORD cbAlignment; - WORD wTypeFlags; - WORD wMajorVerNum; - WORD wMinorVerNum; + TYPEATTR typeattr; TYPEDESC *tdescAlias; - IDLDESC idldescType;
ITypeLibImpl * pTypeLib; /* back pointer to typelib */ int index; /* index in this typelib; */ @@ -1564,15 +1553,15 @@ TRACE("%p ref=%u\n", pty, pty->ref); TRACE("%s %s\n", debugstr_w(TLB_get_bstr(pty->Name)), debugstr_w(TLB_get_bstr(pty->DocString))); TRACE("attr:%s\n", debugstr_guid(TLB_get_guidref(pty->guid))); - TRACE("kind:%s\n", typekind_desc[pty->typekind]); - TRACE("fct:%u var:%u impl:%u\n", pty->cFuncs, pty->cVars, pty->cImplTypes); - TRACE("wTypeFlags: 0x%04x\n", pty->wTypeFlags); + TRACE("kind:%s\n", typekind_desc[pty->typeattr.typekind]); + TRACE("fct:%u var:%u impl:%u\n", pty->typeattr.cFuncs, pty->typeattr.cVars, pty->typeattr.cImplTypes); + TRACE("wTypeFlags: 0x%04x\n", pty->typeattr.wTypeFlags); TRACE("parent tlb:%p index in TLB:%u\n",pty->pTypeLib, pty->index); - if (pty->typekind == TKIND_MODULE) TRACE("dllname:%s\n", debugstr_w(TLB_get_bstr(pty->DllName))); + if (pty->typeattr.typekind == TKIND_MODULE) TRACE("dllname:%s\n", debugstr_w(TLB_get_bstr(pty->DllName))); if (TRACE_ON(ole)) - dump_TLBFuncDesc(pty->funcdescs, pty->cFuncs); - dump_TLBVarDesc(pty->vardescs, pty->cVars); - dump_TLBImplType(pty->impltypes, pty->cImplTypes); + dump_TLBFuncDesc(pty->funcdescs, pty->typeattr.cFuncs); + dump_TLBVarDesc(pty->vardescs, pty->typeattr.cVars); + dump_TLBImplType(pty->impltypes, pty->typeattr.cImplTypes); }
static void dump_VARDESC(const VARDESC *v) @@ -2630,7 +2619,7 @@ * and some structures, and fix the alignment */ static void TLB_fix_32on64_typeinfo(ITypeInfoImpl *info) { - if(info->typekind == TKIND_ALIAS){ + if(info->typeattr.typekind == TKIND_ALIAS){ switch(info->tdescAlias->vt){ case VT_BSTR: case VT_DISPATCH: @@ -2639,28 +2628,28 @@ case VT_SAFEARRAY: case VT_LPSTR: case VT_LPWSTR: - info->cbSizeInstance = sizeof(void*); - info->cbAlignment = sizeof(void*); + info->typeattr.cbSizeInstance = sizeof(void*); + info->typeattr.cbAlignment = sizeof(void*); break; case VT_CARRAY: case VT_USERDEFINED: - TLB_size_instance(info, SYS_WIN64, info->tdescAlias, &info->cbSizeInstance, &info->cbAlignment); + TLB_size_instance(info, SYS_WIN64, info->tdescAlias, &info->typeattr.cbSizeInstance, &info->typeattr.cbAlignment); break; case VT_VARIANT: - info->cbSizeInstance = sizeof(VARIANT); - info->cbAlignment = 8; + info->typeattr.cbSizeInstance = sizeof(VARIANT); + info->typeattr.cbAlignment = 8; default: - if(info->cbSizeInstance < sizeof(void*)) - info->cbAlignment = info->cbSizeInstance; + if(info->typeattr.cbSizeInstance < sizeof(void*)) + info->typeattr.cbAlignment = info->typeattr.cbSizeInstance; else - info->cbAlignment = sizeof(void*); + info->typeattr.cbAlignment = sizeof(void*); break; } - }else if(info->typekind == TKIND_INTERFACE || - info->typekind == TKIND_DISPATCH || - info->typekind == TKIND_COCLASS){ - info->cbSizeInstance = sizeof(void*); - info->cbAlignment = sizeof(void*); + }else if(info->typeattr.typekind == TKIND_INTERFACE || + info->typeattr.typekind == TKIND_DISPATCH || + info->typeattr.typekind == TKIND_COCLASS){ + info->typeattr.cbSizeInstance = sizeof(void*); + info->typeattr.cbAlignment = sizeof(void*); } } #endif @@ -2687,19 +2676,19 @@ ptiRet->index=count;
ptiRet->guid = MSFT_ReadGuid(tiBase.posguid, pcx); - ptiRet->lcid=pLibInfo->set_lcid; /* FIXME: correct? */ - ptiRet->lpstrSchema=NULL; /* reserved */ - ptiRet->cbSizeInstance=tiBase.size; - ptiRet->typekind=tiBase.typekind & 0xF; - ptiRet->cFuncs=LOWORD(tiBase.cElement); - ptiRet->cVars=HIWORD(tiBase.cElement); - ptiRet->cbAlignment=(tiBase.typekind >> 11 )& 0x1F; /* there are more flags there */ - ptiRet->wTypeFlags=tiBase.flags; - ptiRet->wMajorVerNum=LOWORD(tiBase.version); - ptiRet->wMinorVerNum=HIWORD(tiBase.version); - ptiRet->cImplTypes=tiBase.cImplTypes; - ptiRet->cbSizeVft=tiBase.cbSizeVft; /* FIXME: this is only the non inherited part */ - if(ptiRet->typekind == TKIND_ALIAS){ + ptiRet->typeattr.lcid = pLibInfo->set_lcid; /* FIXME: correct? */ + ptiRet->typeattr.lpstrSchema = NULL; /* reserved */ + ptiRet->typeattr.cbSizeInstance = tiBase.size; + ptiRet->typeattr.typekind = tiBase.typekind & 0xF; + ptiRet->typeattr.cFuncs = LOWORD(tiBase.cElement); + ptiRet->typeattr.cVars = HIWORD(tiBase.cElement); + ptiRet->typeattr.cbAlignment = (tiBase.typekind >> 11 )& 0x1F; /* there are more flags there */ + ptiRet->typeattr.wTypeFlags = tiBase.flags; + ptiRet->typeattr.wMajorVerNum = LOWORD(tiBase.version); + ptiRet->typeattr.wMinorVerNum = HIWORD(tiBase.version); + ptiRet->typeattr.cImplTypes = tiBase.cImplTypes; + ptiRet->typeattr.cbSizeVft = tiBase.cbSizeVft; /* FIXME: this is only the non inherited part */ + if (ptiRet->typeattr.typekind == TKIND_ALIAS) { TYPEDESC tmp; MSFT_GetTdesc(pcx, tiBase.datatype1, &tmp); ptiRet->tdescAlias = heap_alloc(TLB_SizeTypeDesc(&tmp, TRUE)); @@ -2718,27 +2707,27 @@ ptiRet->dwHelpStringContext=tiBase.helpstringcontext; ptiRet->dwHelpContext=tiBase.helpcontext;
- if (ptiRet->typekind == TKIND_MODULE) + if (ptiRet->typeattr.typekind == TKIND_MODULE) ptiRet->DllName = MSFT_ReadString(pcx, tiBase.datatype1);
/* note: InfoType's Help file and HelpStringDll come from the containing * library. Further HelpString and Docstring appear to be the same thing :( */ /* functions */ - if(ptiRet->cFuncs >0 ) - MSFT_DoFuncs(pcx, ptiRet, ptiRet->cFuncs, - ptiRet->cVars, + if(ptiRet->typeattr.cFuncs >0 ) + MSFT_DoFuncs(pcx, ptiRet, ptiRet->typeattr.cFuncs, + ptiRet->typeattr.cVars, tiBase.memoffset, &ptiRet->funcdescs); /* variables */ - if(ptiRet->cVars >0 ) - MSFT_DoVars(pcx, ptiRet, ptiRet->cFuncs, - ptiRet->cVars, + if(ptiRet->typeattr.cVars >0 ) + MSFT_DoVars(pcx, ptiRet, ptiRet->typeattr.cFuncs, + ptiRet->typeattr.cVars, tiBase.memoffset, &ptiRet->vardescs); - if(ptiRet->cImplTypes >0 ) { - switch(ptiRet->typekind) + if(ptiRet->typeattr.cImplTypes >0 ) { + switch(ptiRet->typeattr.typekind) { case TKIND_COCLASS: - MSFT_DoImplTypes(pcx, ptiRet, ptiRet->cImplTypes, + MSFT_DoImplTypes(pcx, ptiRet, ptiRet->typeattr.cImplTypes, tiBase.datatype1); break; case TKIND_DISPATCH: @@ -2765,7 +2754,7 @@ TRACE_(typelib)("%s guid: %s kind:%s\n", debugstr_w(TLB_get_bstr(ptiRet->Name)), debugstr_guid(TLB_get_guidref(ptiRet->guid)), - typekind_desc[ptiRet->typekind]); + typekind_desc[ptiRet->typeattr.typekind]); if (TRACE_ON(typelib)) dump_TypeInfo(ptiRet);
@@ -4097,14 +4086,14 @@
info = (SLTG_ImplInfo*)pBlk; while(1){ - pTI->cImplTypes++; + pTI->typeattr.cImplTypes++; if(info->next == 0xffff) break; info = (SLTG_ImplInfo*)(pBlk + info->next); }
info = (SLTG_ImplInfo*)pBlk; - pTI->impltypes = TLBImplType_Alloc(pTI->cImplTypes); + pTI->impltypes = TLBImplType_Alloc(pTI->typeattr.cImplTypes); pImplType = pTI->impltypes; while(1) { sltg_get_typelib_ref(ref_lookup, info->ref, &pImplType->hRef); @@ -4235,7 +4224,7 @@
prevName = pVarDesc->Name; } - pTI->cVars = cVars; + pTI->typeattr.cVars = cVars; }
static void SLTG_DoFuncs(char *pBlk, char *pFirstItem, ITypeInfoImpl *pTI, @@ -4340,7 +4329,7 @@ } } } - pTI->cFuncs = cFuncs; + pTI->typeattr.cFuncs = cFuncs; }
static void SLTG_ProcessCoClass(char *pBlk, ITypeInfoImpl *pTI, @@ -4388,7 +4377,7 @@ heap_free(ref_lookup);
if (TRACE_ON(typelib)) - dump_TLBFuncDesc(pTI->funcdescs, pTI->cFuncs); + dump_TLBFuncDesc(pTI->funcdescs, pTI->typeattr.cFuncs); }
static void SLTG_ProcessRecord(char *pBlk, ITypeInfoImpl *pTI, @@ -4447,11 +4436,11 @@ /* this is necessary to cope with MSFT typelibs that set cFuncs to the number * of dispinterface functions including the IDispatch ones, so * ITypeInfo::GetFuncDesc takes the real value for cFuncs from cbSizeVft */ - pTI->cbSizeVft = pTI->cFuncs * pTI->pTypeLib->ptr_size; + pTI->typeattr.cbSizeVft = pTI->typeattr.cFuncs * pTI->pTypeLib->ptr_size;
heap_free(ref_lookup); if (TRACE_ON(typelib)) - dump_TLBFuncDesc(pTI->funcdescs, pTI->cFuncs); + dump_TLBFuncDesc(pTI->funcdescs, pTI->typeattr.cFuncs); }
static void SLTG_ProcessEnum(char *pBlk, ITypeInfoImpl *pTI, @@ -4695,14 +4684,14 @@ (*ppTypeInfoImpl)->dwHelpContext = pOtherTypeInfoBlks[i].helpcontext; (*ppTypeInfoImpl)->DocString = decode_string(hlp_strings, pOtherTypeInfoBlks[i].extra, pOtherTypeInfoBlks[i].hlpstr_len, pTypeLibImpl); (*ppTypeInfoImpl)->guid = TLB_append_guid(&pTypeLibImpl->guid_list, &pOtherTypeInfoBlks[i].uuid, 2); - (*ppTypeInfoImpl)->typekind = pTIHeader->typekind; - (*ppTypeInfoImpl)->wMajorVerNum = pTIHeader->major_version; - (*ppTypeInfoImpl)->wMinorVerNum = pTIHeader->minor_version; - (*ppTypeInfoImpl)->wTypeFlags = + (*ppTypeInfoImpl)->typeattr.typekind = pTIHeader->typekind; + (*ppTypeInfoImpl)->typeattr.wMajorVerNum = pTIHeader->major_version; + (*ppTypeInfoImpl)->typeattr.wMinorVerNum = pTIHeader->minor_version; + (*ppTypeInfoImpl)->typeattr.wTypeFlags = (pTIHeader->typeflags1 >> 3) | (pTIHeader->typeflags2 << 5);
- if((*ppTypeInfoImpl)->wTypeFlags & TYPEFLAG_FDUAL) - (*ppTypeInfoImpl)->typekind = TKIND_DISPATCH; + if((*ppTypeInfoImpl)->typeattr.wTypeFlags & TYPEFLAG_FDUAL) + (*ppTypeInfoImpl)->typeattr.typekind = TKIND_DISPATCH;
if((pTIHeader->typeflags1 & 7) != 2) FIXME_(typelib)("typeflags1 = %02x\n", pTIHeader->typeflags1); @@ -4713,15 +4702,15 @@ debugstr_w(TLB_get_bstr((*ppTypeInfoImpl)->Name)), typekind_desc[pTIHeader->typekind], debugstr_guid(TLB_get_guidref((*ppTypeInfoImpl)->guid)), - (*ppTypeInfoImpl)->wTypeFlags); + (*ppTypeInfoImpl)->typeattr.wTypeFlags);
pMemHeader = (SLTG_MemberHeader*)((char *)pBlk + pTIHeader->elem_table);
pTITail = (SLTG_TypeInfoTail*)((char *)(pMemHeader + 1) + pMemHeader->cbExtra);
- (*ppTypeInfoImpl)->cbAlignment = pTITail->cbAlignment; - (*ppTypeInfoImpl)->cbSizeInstance = pTITail->cbSizeInstance; - (*ppTypeInfoImpl)->cbSizeVft = pTITail->cbSizeVft; + (*ppTypeInfoImpl)->typeattr.cbAlignment = pTITail->cbAlignment; + (*ppTypeInfoImpl)->typeattr.cbSizeInstance = pTITail->cbSizeInstance; + (*ppTypeInfoImpl)->typeattr.cbSizeVft = pTITail->cbSizeVft;
switch(pTIHeader->typekind) { case TKIND_ENUM: @@ -4971,7 +4960,7 @@ if(index >= This->TypeInfoCount) return TYPE_E_ELEMENTNOTFOUND;
- *pTKind = This->typeinfos[index]->typekind; + *pTKind = This->typeinfos[index]->typeattr.typekind;
return S_OK; } @@ -5163,7 +5152,7 @@ for(tic = 0; tic < This->TypeInfoCount; ++tic){ ITypeInfoImpl *pTInfo = This->typeinfos[tic]; if(!TLB_str_memcmp(szNameBuf, pTInfo->Name, nNameBufLen)) goto ITypeLib2_fnIsName_exit; - for(fdc = 0; fdc < pTInfo->cFuncs; ++fdc) { + for(fdc = 0; fdc < pTInfo->typeattr.cFuncs; ++fdc) { TLBFuncDesc *pFInfo = &pTInfo->funcdescs[fdc]; int pc; if(!TLB_str_memcmp(szNameBuf, pFInfo->Name, nNameBufLen)) goto ITypeLib2_fnIsName_exit; @@ -5172,7 +5161,7 @@ goto ITypeLib2_fnIsName_exit; } } - for(vrc = 0; vrc < pTInfo->cVars; ++vrc){ + for(vrc = 0; vrc < pTInfo->typeattr.cVars; ++vrc){ TLBVarDesc *pVInfo = &pTInfo->vardescs[vrc]; if(!TLB_str_memcmp(szNameBuf, pVInfo->Name, nNameBufLen)) goto ITypeLib2_fnIsName_exit; } @@ -5222,7 +5211,7 @@ goto ITypeLib2_fnFindName_exit; }
- for(fdc = 0; fdc < pTInfo->cFuncs; ++fdc) { + for(fdc = 0; fdc < pTInfo->typeattr.cFuncs; ++fdc) { TLBFuncDesc *func = &pTInfo->funcdescs[fdc];
if(!TLB_str_memcmp(name, func->Name, len)) { @@ -5231,7 +5220,7 @@ } }
- var = TLB_get_vardesc_by_name(pTInfo->vardescs, pTInfo->cVars, name); + var = TLB_get_vardesc_by_name(pTInfo->vardescs, pTInfo->typeattr.cVars, name); if (var) { memid[count] = var->vardesc.memid; goto ITypeLib2_fnFindName_exit; @@ -5483,8 +5472,8 @@ /* FIXME: check wFlags here? */ /* FIXME: we should use a hash table to look this info up using lHash * instead of an O(n) search */ - if ((pTypeInfo->typekind == TKIND_ENUM) || - (pTypeInfo->typekind == TKIND_MODULE)) + if ((pTypeInfo->typeattr.typekind == TKIND_ENUM) || + (pTypeInfo->typeattr.typekind == TKIND_MODULE)) { if (pTypeInfo->Name && !strcmpW(pTypeInfo->Name->str, szName)) { @@ -5496,8 +5485,8 @@ } }
- if ((pTypeInfo->typekind == TKIND_MODULE) || - (pTypeInfo->typekind == TKIND_ENUM)) + if ((pTypeInfo->typeattr.typekind == TKIND_MODULE) || + (pTypeInfo->typeattr.typekind == TKIND_ENUM)) { ITypeComp *pSubTypeComp = &pTypeInfo->ITypeComp_iface; HRESULT hr; @@ -5512,8 +5501,8 @@ typemismatch = TRUE; }
- if ((pTypeInfo->typekind == TKIND_COCLASS) && - (pTypeInfo->wTypeFlags & TYPEFLAG_FAPPOBJECT)) + if ((pTypeInfo->typeattr.typekind == TKIND_COCLASS) && + (pTypeInfo->typeattr.wTypeFlags & TYPEFLAG_FAPPOBJECT)) { ITypeComp *pSubTypeComp = &pTypeInfo->ITypeComp_iface; HRESULT hr; @@ -5650,8 +5639,8 @@ pTypeInfoImpl->ICreateTypeInfo2_iface.lpVtbl = &CreateTypeInfo2Vtbl; pTypeInfoImpl->ref = 0; pTypeInfoImpl->hreftype = -1; - pTypeInfoImpl->memidConstructor = MEMBERID_NIL; - pTypeInfoImpl->memidDestructor = MEMBERID_NIL; + pTypeInfoImpl->typeattr.memidConstructor = MEMBERID_NIL; + pTypeInfoImpl->typeattr.memidDestructor = MEMBERID_NIL; pTypeInfoImpl->pcustdata_list = &pTypeInfoImpl->custdata_list; list_init(pTypeInfoImpl->pcustdata_list); } @@ -5678,9 +5667,11 @@ else if(IsEqualIID(riid, &IID_ICreateTypeInfo) || IsEqualIID(riid, &IID_ICreateTypeInfo2)) *ppvObject = &This->ICreateTypeInfo2_iface; + else if(IsEqualIID(riid, &IID_ITypeComp)) + *ppvObject = &This->ITypeComp_iface;
if(*ppvObject){ - ITypeInfo2_AddRef(iface); + IUnknown_AddRef((IUnknown*)*ppvObject); TRACE("-- Interface: (%p)->(%p)\n",ppvObject,*ppvObject); return S_OK; } @@ -5709,7 +5700,7 @@
TRACE("destroying ITypeInfo(%p)\n",This);
- for (i = 0; i < This->cFuncs; ++i) + for (i = 0; i < This->typeattr.cFuncs; ++i) { int j; TLBFuncDesc *pFInfo = &This->funcdescs[i]; @@ -5726,7 +5717,7 @@ } heap_free(This->funcdescs);
- for(i = 0; i < This->cVars; ++i) + for(i = 0; i < This->typeattr.cVars; ++i) { TLBVarDesc *pVInfo = &This->vardescs[i]; if (pVInfo->vardesc_create) { @@ -5740,7 +5731,7 @@ heap_free(This->vardescs);
if(This->impltypes){ - for (i = 0; i < This->cImplTypes; ++i){ + for (i = 0; i < This->typeattr.cImplTypes; ++i){ TLBImplType *pImpl = &This->impltypes[i]; TLB_FreeCustData(&pImpl->custdata_list); } @@ -5788,37 +5779,18 @@ TRACE("(%p)\n",This);
size = sizeof(**ppTypeAttr); - if (This->typekind == TKIND_ALIAS && This->tdescAlias) + if (This->typeattr.typekind == TKIND_ALIAS && This->tdescAlias) size += TLB_SizeTypeDesc(This->tdescAlias, FALSE);
*ppTypeAttr = heap_alloc(size); if (!*ppTypeAttr) return E_OUTOFMEMORY;
+ **ppTypeAttr = This->typeattr; (*ppTypeAttr)->guid = *TLB_get_guid_null(This->guid); - (*ppTypeAttr)->lcid = This->lcid; - (*ppTypeAttr)->memidConstructor = This->memidConstructor; - (*ppTypeAttr)->memidDestructor = This->memidDestructor; - (*ppTypeAttr)->lpstrSchema = This->lpstrSchema; - (*ppTypeAttr)->cbSizeInstance = This->cbSizeInstance; - (*ppTypeAttr)->typekind = This->typekind; - (*ppTypeAttr)->cFuncs = This->cFuncs; - (*ppTypeAttr)->cVars = This->cVars; - (*ppTypeAttr)->cImplTypes = This->cImplTypes; - (*ppTypeAttr)->cbSizeVft = This->cbSizeVft; - (*ppTypeAttr)->cbAlignment = This->cbAlignment; - (*ppTypeAttr)->wTypeFlags = This->wTypeFlags; - (*ppTypeAttr)->wMajorVerNum = This->wMajorVerNum; - (*ppTypeAttr)->wMinorVerNum = This->wMinorVerNum; - (*ppTypeAttr)->idldescType = This->idldescType;
if (This->tdescAlias) - TLB_CopyTypeDesc(&(*ppTypeAttr)->tdescAlias, - This->tdescAlias, *ppTypeAttr + 1); - else{ - (*ppTypeAttr)->tdescAlias.vt = VT_EMPTY; - (*ppTypeAttr)->tdescAlias.u.lptdesc = NULL; - } + TLB_CopyTypeDesc(&(*ppTypeAttr)->tdescAlias, This->tdescAlias, *ppTypeAttr + 1);
if((*ppTypeAttr)->typekind == TKIND_DISPATCH) { /* This should include all the inherited funcs */ @@ -6012,7 +5984,7 @@ { ITypeInfoImpl *This = impl_from_ITypeInfo(iface);
- if (index >= This->cFuncs) + if (index >= This->typeattr.cFuncs) return TYPE_E_ELEMENTNOTFOUND;
*ppFuncDesc = &This->funcdescs[index].funcdesc; @@ -6054,7 +6026,7 @@ }
if (funcs) - *funcs = implemented_funcs + This->cFuncs; + *funcs = implemented_funcs + This->typeattr.cFuncs; else *hrefoffset = 0;
@@ -6117,7 +6089,7 @@ if (This->needs_layout) ICreateTypeInfo2_LayOut(&This->ICreateTypeInfo2_iface);
- if (This->typekind == TKIND_DISPATCH) + if (This->typeattr.typekind == TKIND_DISPATCH) hr = ITypeInfoImpl_GetInternalDispatchFuncDesc((ITypeInfo *)iface, index, &internal_funcdesc, NULL, &hrefoffset); @@ -6133,9 +6105,9 @@ hr = TLB_AllocAndInitFuncDesc( internal_funcdesc, ppFuncDesc, - This->typekind == TKIND_DISPATCH); - - if ((This->typekind == TKIND_DISPATCH) && hrefoffset) + This->typeattr.typekind == TKIND_DISPATCH); + + if ((This->typeattr.typekind == TKIND_DISPATCH) && hrefoffset) ITypeInfoImpl_FuncDescAddHrefOffset(*ppFuncDesc, hrefoffset);
TRACE("-- 0x%08x\n", hr); @@ -6208,7 +6180,7 @@
TRACE("(%p) index %d\n", This, index);
- if(index >= This->cVars) + if(index >= This->typeattr.cVars) return TYPE_E_ELEMENTNOTFOUND;
if (This->needs_layout) @@ -6237,7 +6209,7 @@
*pcNames = 0;
- pFDesc = TLB_get_funcdesc_by_memberid(This->funcdescs, This->cFuncs, memid); + pFDesc = TLB_get_funcdesc_by_memberid(This->funcdescs, This->typeattr.cFuncs, memid); if(pFDesc) { if(!cMaxNames || !pFDesc->Name) @@ -6255,7 +6227,7 @@ return S_OK; }
- pVDesc = TLB_get_vardesc_by_memberid(This->vardescs, This->cVars, memid); + pVDesc = TLB_get_vardesc_by_memberid(This->vardescs, This->typeattr.cVars, memid); if(pVDesc) { *rgBstrNames=SysAllocString(TLB_get_bstr(pVDesc->Name)); @@ -6264,7 +6236,7 @@ else { if(This->impltypes && - (This->typekind==TKIND_INTERFACE || This->typekind==TKIND_DISPATCH)) { + (This->typeattr.typekind == TKIND_INTERFACE || This->typeattr.typekind == TKIND_DISPATCH)) { /* recursive search */ ITypeInfo *pTInfo; HRESULT result; @@ -6313,7 +6285,7 @@ retrieve the associated TKIND_INTERFACE handle for the current TKIND_DISPATCH */
- if (This->wTypeFlags & TYPEFLAG_FDUAL) + if (This->typeattr.wTypeFlags & TYPEFLAG_FDUAL) { *pRefType = -2; } @@ -6322,18 +6294,18 @@ hr = TYPE_E_ELEMENTNOTFOUND; } } - else if(index == 0 && This->typekind == TKIND_DISPATCH) + else if(index == 0 && This->typeattr.typekind == TKIND_DISPATCH) { /* All TKIND_DISPATCHs are made to look like they inherit from IDispatch */ *pRefType = This->pTypeLib->dispatch_href; } else { - if(index >= This->cImplTypes) + if(index >= This->typeattr.cImplTypes) hr = TYPE_E_ELEMENTNOTFOUND; else{ *pRefType = This->impltypes[index].hRef; - if(This->typekind == TKIND_INTERFACE) + if (This->typeattr.typekind == TKIND_INTERFACE) *pRefType |= 0x2; } } @@ -6364,12 +6336,12 @@ if(!pImplTypeFlags) return E_INVALIDARG;
- if(This->typekind == TKIND_DISPATCH && index == 0){ + if(This->typeattr.typekind == TKIND_DISPATCH && index == 0){ *pImplTypeFlags = 0; return S_OK; }
- if(index >= This->cImplTypes) + if(index >= This->typeattr.cImplTypes) return TYPE_E_ELEMENTNOTFOUND;
*pImplTypeFlags = This->impltypes[index].implflags; @@ -6396,7 +6368,7 @@ for (i = 0; i < cNames; i++) pMemId[i] = MEMBERID_NIL;
- for (fdc = 0; fdc < This->cFuncs; ++fdc) { + for (fdc = 0; fdc < This->typeattr.cFuncs; ++fdc) { int j; const TLBFuncDesc *pFDesc = &This->funcdescs[fdc]; if(!lstrcmpiW(*rgszNames, TLB_get_bstr(pFDesc->Name))) { @@ -6414,7 +6386,7 @@ return ret; } } - pVDesc = TLB_get_vardesc_by_name(This->vardescs, This->cVars, *rgszNames); + pVDesc = TLB_get_vardesc_by_name(This->vardescs, This->typeattr.cVars, *rgszNames); if(pVDesc){ if(cNames) *pMemId = pVDesc->vardesc.memid; @@ -7035,7 +7007,7 @@ This,pIUnk,memid,wFlags,pDispParams,pVarResult,pExcepInfo,pArgErr );
- if( This->wTypeFlags & TYPEFLAG_FRESTRICTED ) + if( This->typeattr.wTypeFlags & TYPEFLAG_FRESTRICTED ) return DISP_E_MEMBERNOTFOUND;
if (!pDispParams) @@ -7055,7 +7027,7 @@
/* we do this instead of using GetFuncDesc since it will return a fake * FUNCDESC for dispinterfaces and we want the real function description */ - for (fdc = 0; fdc < This->cFuncs; ++fdc){ + for (fdc = 0; fdc < This->typeattr.cFuncs; ++fdc){ pFuncInfo = &This->funcdescs[fdc]; if ((memid == pFuncInfo->funcdesc.memid) && (wFlags & pFuncInfo->funcdesc.invkind) && @@ -7063,7 +7035,7 @@ break; }
- if (fdc < This->cFuncs) { + if (fdc < This->typeattr.cFuncs) { const FUNCDESC *func_desc = &pFuncInfo->funcdesc;
if (TRACE_ON(ole)) @@ -7585,7 +7557,7 @@ *pBstrHelpFile=SysAllocString(TLB_get_bstr(This->pTypeLib->HelpFile)); return S_OK; }else {/* for a member */ - pFDesc = TLB_get_funcdesc_by_memberid(This->funcdescs, This->cFuncs, memid); + pFDesc = TLB_get_funcdesc_by_memberid(This->funcdescs, This->typeattr.cFuncs, memid); if(pFDesc){ if(pBstrName) *pBstrName = SysAllocString(TLB_get_bstr(pFDesc->Name)); @@ -7597,7 +7569,7 @@ *pBstrHelpFile = SysAllocString(TLB_get_bstr(This->pTypeLib->HelpFile)); return S_OK; } - pVDesc = TLB_get_vardesc_by_memberid(This->vardescs, This->cVars, memid); + pVDesc = TLB_get_vardesc_by_memberid(This->vardescs, This->typeattr.cVars, memid); if(pVDesc){ if(pBstrName) *pBstrName = SysAllocString(TLB_get_bstr(pVDesc->Name)); @@ -7612,7 +7584,7 @@ }
if(This->impltypes && - (This->typekind==TKIND_INTERFACE || This->typekind==TKIND_DISPATCH)) { + (This->typeattr.typekind == TKIND_INTERFACE || This->typeattr.typekind == TKIND_DISPATCH)) { /* recursive search */ ITypeInfo *pTInfo; HRESULT result; @@ -7648,10 +7620,10 @@ if (pBstrName) *pBstrName = NULL; if (pwOrdinal) *pwOrdinal = 0;
- if (This->typekind != TKIND_MODULE) + if (This->typeattr.typekind != TKIND_MODULE) return TYPE_E_BADMODULEKIND;
- pFDesc = TLB_get_funcdesc_by_memberid(This->funcdescs, This->cFuncs, memid); + pFDesc = TLB_get_funcdesc_by_memberid(This->funcdescs, This->typeattr.cFuncs, memid); if(pFDesc){ dump_TypeInfo(This); if (TRACE_ON(ole)) @@ -7766,9 +7738,9 @@ if ((INT)hRefType < 0) { ITypeInfoImpl *pTypeInfoImpl;
- if (!(This->wTypeFlags & TYPEFLAG_FDUAL) || - !(This->typekind == TKIND_INTERFACE || - This->typekind == TKIND_DISPATCH)) + if (!(This->typeattr.wTypeFlags & TYPEFLAG_FDUAL) || + !(This->typeattr.typekind == TKIND_INTERFACE || + This->typeattr.typekind == TKIND_DISPATCH)) return TYPE_E_ELEMENTNOTFOUND;
/* when we meet a DUAL typeinfo, we must create the alternate @@ -7780,10 +7752,10 @@ pTypeInfoImpl->ref = 0; list_init(&pTypeInfoImpl->custdata_list);
- if (This->typekind == TKIND_INTERFACE) - pTypeInfoImpl->typekind = TKIND_DISPATCH; + if (This->typeattr.typekind == TKIND_INTERFACE) + pTypeInfoImpl->typeattr.typekind = TKIND_DISPATCH; else - pTypeInfoImpl->typekind = TKIND_INTERFACE; + pTypeInfoImpl->typeattr.typekind = TKIND_INTERFACE;
*ppTInfo = (ITypeInfo *)&pTypeInfoImpl->ITypeInfo2_iface; /* the AddRef implicitly adds a reference to the parent typelib, which @@ -7796,7 +7768,7 @@
result = S_OK; } else if ((hRefType & DISPATCH_HREF_MASK) && - (This->typekind == TKIND_DISPATCH)) + (This->typeattr.typekind == TKIND_DISPATCH)) { HREFTYPE href_dispatch = hRefType; result = ITypeInfoImpl_GetDispatchRefTypeInfo((ITypeInfo *)iface, &href_dispatch, ppTInfo); @@ -8097,7 +8069,7 @@ TYPEKIND *pTypeKind) { ITypeInfoImpl *This = impl_from_ITypeInfo2(iface); - *pTypeKind=This->typekind; + *pTypeKind = This->typeattr.typekind; TRACE("(%p) type 0x%0x\n", This,*pTypeKind); return S_OK; } @@ -8112,7 +8084,7 @@ static HRESULT WINAPI ITypeInfo2_fnGetTypeFlags( ITypeInfo2 *iface, ULONG *pTypeFlags) { ITypeInfoImpl *This = impl_from_ITypeInfo2(iface); - *pTypeFlags=This->wTypeFlags; + *pTypeFlags=This->typeattr.wTypeFlags; TRACE("(%p) flags 0x%x\n", This,*pTypeFlags); return S_OK; } @@ -8129,12 +8101,12 @@ UINT fdc; HRESULT result;
- for (fdc = 0; fdc < This->cFuncs; ++fdc){ + for (fdc = 0; fdc < This->typeattr.cFuncs; ++fdc){ const TLBFuncDesc *pFuncInfo = &This->funcdescs[fdc]; if(memid == pFuncInfo->funcdesc.memid && (invKind & pFuncInfo->funcdesc.invkind)) break; } - if(fdc < This->cFuncs) { + if(fdc < This->typeattr.cFuncs) { *pFuncIndex = fdc; result = S_OK; } else @@ -8159,7 +8131,7 @@
TRACE("%p %d %p\n", iface, memid, pVarIndex);
- pVarInfo = TLB_get_vardesc_by_memberid(This->vardescs, This->cVars, memid); + pVarInfo = TLB_get_vardesc_by_memberid(This->vardescs, This->typeattr.cVars, memid); if(!pVarInfo) return TYPE_E_ELEMENTNOTFOUND;
@@ -8211,7 +8183,7 @@
TRACE("%p %u %s %p\n", This, index, debugstr_guid(guid), pVarVal);
- if(index >= This->cFuncs) + if(index >= This->typeattr.cFuncs) return TYPE_E_ELEMENTNOTFOUND;
pCData = TLB_get_custdata_by_guid(&pFDesc->custdata_list, guid); @@ -8242,7 +8214,7 @@ TRACE("%p %u %u %s %p\n", This, indexFunc, indexParam, debugstr_guid(guid), pVarVal);
- if(indexFunc >= This->cFuncs) + if(indexFunc >= This->typeattr.cFuncs) return TYPE_E_ELEMENTNOTFOUND;
if(indexParam >= pFDesc->funcdesc.cParams) @@ -8274,7 +8246,7 @@
TRACE("%p %s %p\n", This, debugstr_guid(guid), pVarVal);
- if(index >= This->cVars) + if(index >= This->typeattr.cVars) return TYPE_E_ELEMENTNOTFOUND;
pCData = TLB_get_custdata_by_guid(&pVDesc->custdata_list, guid); @@ -8303,7 +8275,7 @@
TRACE("%p %u %s %p\n", This, index, debugstr_guid(guid), pVarVal);
- if(index >= This->cImplTypes) + if(index >= This->typeattr.cImplTypes) return TYPE_E_ELEMENTNOTFOUND;
pCData = TLB_get_custdata_by_guid(&pRDesc->custdata_list, guid); @@ -8352,7 +8324,7 @@ SysAllocString(TLB_get_bstr(This->pTypeLib->HelpStringDll));/* FIXME */ return S_OK; }else {/* for a member */ - pFDesc = TLB_get_funcdesc_by_memberid(This->funcdescs, This->cFuncs, memid); + pFDesc = TLB_get_funcdesc_by_memberid(This->funcdescs, This->typeattr.cFuncs, memid); if(pFDesc){ if(pbstrHelpString) *pbstrHelpString=SysAllocString(TLB_get_bstr(pFDesc->HelpString)); @@ -8363,7 +8335,7 @@ SysAllocString(TLB_get_bstr(This->pTypeLib->HelpStringDll));/* FIXME */ return S_OK; } - pVDesc = TLB_get_vardesc_by_memberid(This->vardescs, This->cVars, memid); + pVDesc = TLB_get_vardesc_by_memberid(This->vardescs, This->typeattr.cVars, memid); if(pVDesc){ if(pbstrHelpString) *pbstrHelpString=SysAllocString(TLB_get_bstr(pVDesc->HelpString)); @@ -8409,7 +8381,7 @@
TRACE("%p %u %p\n", This, index, pCustData);
- if(index >= This->cFuncs) + if(index >= This->typeattr.cFuncs) return TYPE_E_ELEMENTNOTFOUND;
return TLB_copy_all_custdata(&pFDesc->custdata_list, pCustData); @@ -8428,7 +8400,7 @@
TRACE("%p %u %u %p\n", This, indexFunc, indexParam, pCustData);
- if(indexFunc >= This->cFuncs) + if(indexFunc >= This->typeattr.cFuncs) return TYPE_E_ELEMENTNOTFOUND;
if(indexParam >= pFDesc->funcdesc.cParams) @@ -8450,7 +8422,7 @@
TRACE("%p %u %p\n", This, index, pCustData);
- if(index >= This->cVars) + if(index >= This->typeattr.cVars) return TYPE_E_ELEMENTNOTFOUND;
return TLB_copy_all_custdata(&pVDesc->custdata_list, pCustData); @@ -8471,7 +8443,7 @@
TRACE("%p %u %p\n", This, index, pCustData);
- if(index >= This->cImplTypes) + if(index >= This->typeattr.cImplTypes) return TYPE_E_ELEMENTNOTFOUND;
return TLB_copy_all_custdata(&pRDesc->custdata_list, pCustData); @@ -8559,17 +8531,17 @@ pTIIface->Name = NULL; pTIIface->dwHelpContext = -1; pTIIface->guid = NULL; - pTIIface->lcid = lcid; - pTIIface->typekind = TKIND_INTERFACE; - pTIIface->wMajorVerNum = 0; - pTIIface->wMinorVerNum = 0; - pTIIface->cbAlignment = 2; - pTIIface->cbSizeInstance = -1; - pTIIface->cbSizeVft = -1; - pTIIface->cFuncs = 0; - pTIIface->cImplTypes = 0; - pTIIface->cVars = 0; - pTIIface->wTypeFlags = 0; + pTIIface->typeattr.lcid = lcid; + pTIIface->typeattr.typekind = TKIND_INTERFACE; + pTIIface->typeattr.wMajorVerNum = 0; + pTIIface->typeattr.wMinorVerNum = 0; + pTIIface->typeattr.cbAlignment = 2; + pTIIface->typeattr.cbSizeInstance = -1; + pTIIface->typeattr.cbSizeVft = -1; + pTIIface->typeattr.cFuncs = 0; + pTIIface->typeattr.cImplTypes = 0; + pTIIface->typeattr.cVars = 0; + pTIIface->typeattr.wTypeFlags = 0; pTIIface->hreftype = 0;
pTIIface->funcdescs = TLBFuncDesc_Alloc(pidata->cMembers); @@ -8602,7 +8574,7 @@ pFuncDesc->HelpString = NULL; pFuncDesc->Entry = NULL; list_init(&pFuncDesc->custdata_list); - pTIIface->cFuncs++; + pTIIface->typeattr.cFuncs++; ++pFuncDesc; }
@@ -8614,17 +8586,17 @@ pTIClass->Name = NULL; pTIClass->dwHelpContext = -1; pTIClass->guid = NULL; - pTIClass->lcid = lcid; - pTIClass->typekind = TKIND_COCLASS; - pTIClass->wMajorVerNum = 0; - pTIClass->wMinorVerNum = 0; - pTIClass->cbAlignment = 2; - pTIClass->cbSizeInstance = -1; - pTIClass->cbSizeVft = -1; - pTIClass->cFuncs = 0; - pTIClass->cImplTypes = 1; - pTIClass->cVars = 0; - pTIClass->wTypeFlags = 0; + pTIClass->typeattr.lcid = lcid; + pTIClass->typeattr.typekind = TKIND_COCLASS; + pTIClass->typeattr.wMajorVerNum = 0; + pTIClass->typeattr.wMinorVerNum = 0; + pTIClass->typeattr.cbAlignment = 2; + pTIClass->typeattr.cbSizeInstance = -1; + pTIClass->typeattr.cbSizeVft = -1; + pTIClass->typeattr.cFuncs = 0; + pTIClass->typeattr.cImplTypes = 1; + pTIClass->typeattr.cVars = 0; + pTIClass->typeattr.wTypeFlags = 0; pTIClass->hreftype = sizeof(MSFT_TypeInfoBase);
pTIClass->impltypes = TLBImplType_Alloc(1); @@ -8686,7 +8658,7 @@ pBindPtr->lpfuncdesc = NULL; *ppTInfo = NULL;
- for(fdc = 0; fdc < This->cFuncs; ++fdc){ + for(fdc = 0; fdc < This->typeattr.cFuncs; ++fdc){ pFDesc = &This->funcdescs[fdc]; if (!lstrcmpiW(TLB_get_bstr(pFDesc->Name), szName)) { if (!wFlags || (pFDesc->funcdesc.invkind & wFlags)) @@ -8697,12 +8669,12 @@ } }
- if (fdc < This->cFuncs) + if (fdc < This->typeattr.cFuncs) { HRESULT hr = TLB_AllocAndInitFuncDesc( &pFDesc->funcdesc, &pBindPtr->lpfuncdesc, - This->typekind == TKIND_DISPATCH); + This->typeattr.typekind == TKIND_DISPATCH); if (FAILED(hr)) return hr; *pDescKind = DESCKIND_FUNCDESC; @@ -8710,7 +8682,7 @@ ITypeInfo_AddRef(*ppTInfo); return S_OK; } else { - pVDesc = TLB_get_vardesc_by_name(This->vardescs, This->cVars, szName); + pVDesc = TLB_get_vardesc_by_name(This->vardescs, This->typeattr.cVars, szName); if(pVDesc){ HRESULT hr = TLB_AllocAndInitVarDesc(&pVDesc->vardesc, &pBindPtr->lpvardesc); if (FAILED(hr)) @@ -8738,7 +8710,7 @@ hr = ITypeComp_Bind(pTComp, szName, lHash, wFlags, ppTInfo, pDescKind, pBindPtr); ITypeComp_Release(pTComp); if (SUCCEEDED(hr) && *pDescKind == DESCKIND_FUNCDESC && - This->typekind == TKIND_DISPATCH) + This->typeattr.typekind == TKIND_DISPATCH) { FUNCDESC *tmp = pBindPtr->lpfuncdesc; hr = TLB_AllocAndInitFuncDesc(tmp, &pBindPtr->lpfuncdesc, TRUE); @@ -8865,29 +8837,29 @@ info->pTypeLib = This; info->Name = TLB_append_str(&This->name_list, name); info->index = This->TypeInfoCount; - info->typekind = kind; - info->cbAlignment = 4; - - switch(info->typekind) { + info->typeattr.typekind = kind; + info->typeattr.cbAlignment = 4; + + switch (info->typeattr.typekind) { case TKIND_ENUM: case TKIND_INTERFACE: case TKIND_DISPATCH: case TKIND_COCLASS: - info->cbSizeInstance = This->ptr_size; + info->typeattr.cbSizeInstance = This->ptr_size; break; case TKIND_RECORD: case TKIND_UNION: - info->cbSizeInstance = 0; + info->typeattr.cbSizeInstance = 0; break; case TKIND_MODULE: - info->cbSizeInstance = 2; + info->typeattr.cbSizeInstance = 2; break; case TKIND_ALIAS: - info->cbSizeInstance = -0x75; + info->typeattr.cbSizeInstance = -0x75; break; default: - FIXME("unrecognized typekind %d\n", info->typekind); - info->cbSizeInstance = 0xdeadbeef; + FIXME("unrecognized typekind %d\n", info->typeattr.typekind); + info->typeattr.cbSizeInstance = 0xdeadbeef; break; }
@@ -9460,7 +9432,7 @@ MEMBERID *memid; DWORD *name, *offsets, offs;
- for(i = 0; i < info->cFuncs; ++i){ + for(i = 0; i < info->typeattr.cFuncs; ++i){ TLBFuncDesc *desc = &info->funcdescs[i];
recorded_size += 6 * sizeof(INT); /* mandatory fields */ @@ -9491,7 +9463,7 @@ extra_size += 2 * sizeof(INT); /* memberid, name offs */ }
- for(i = 0; i < info->cVars; ++i){ + for(i = 0; i < info->typeattr.cVars; ++i){ TLBVarDesc *desc = &info->vardescs[i];
recorded_size += 5 * sizeof(INT); /* mandatory fields */ @@ -9517,7 +9489,7 @@
aux_seg->len += recorded_size + extra_size;
- aux_seg->len += sizeof(INT) * (info->cVars + info->cFuncs); /* offsets at the end */ + aux_seg->len += sizeof(INT) * (info->typeattr.cVars + info->typeattr.cFuncs); /* offsets at the end */
if(aux_seg->data) aux_seg->data = heap_realloc(aux_seg->data, aux_seg->len); @@ -9530,7 +9502,7 @@ offs = 0;
funcrecord = (MSFT_FuncRecord*)(((char *)aux_seg->data) + ret + sizeof(INT)); - for(i = 0; i < info->cFuncs; ++i){ + for(i = 0; i < info->typeattr.cFuncs; ++i){ TLBFuncDesc *desc = &info->funcdescs[i]; DWORD size = 6 * sizeof(INT), paramdefault_size = 0, *paramdefault;
@@ -9660,7 +9632,7 @@ }
varrecord = (MSFT_VarRecord*)funcrecord; - for(i = 0; i < info->cVars; ++i){ + for(i = 0; i < info->typeattr.cVars; ++i){ TLBVarDesc *desc = &info->vardescs[i]; DWORD size = 5 * sizeof(INT);
@@ -9717,19 +9689,19 @@ }
memid = (MEMBERID*)varrecord; - for(i = 0; i < info->cFuncs; ++i){ + for(i = 0; i < info->typeattr.cFuncs; ++i){ TLBFuncDesc *desc = &info->funcdescs[i]; *memid = desc->funcdesc.memid; ++memid; } - for(i = 0; i < info->cVars; ++i){ + for(i = 0; i < info->typeattr.cVars; ++i){ TLBVarDesc *desc = &info->vardescs[i]; *memid = desc->vardesc.memid; ++memid; }
name = (UINT*)memid; - for(i = 0; i < info->cFuncs; ++i){ + for(i = 0; i < info->typeattr.cFuncs; ++i){ TLBFuncDesc *desc = &info->funcdescs[i]; if(desc->Name) *name = desc->Name->offset; @@ -9737,7 +9709,7 @@ *name = -1; ++name; } - for(i = 0; i < info->cVars; ++i){ + for(i = 0; i < info->typeattr.cVars; ++i){ TLBVarDesc *desc = &info->vardescs[i]; if(desc->Name) *name = desc->Name->offset; @@ -9761,7 +9733,7 @@ DWORD offs = file->ref_seg.len, i; WMSFT_RefChunk *chunk;
- file->ref_seg.len += info->cImplTypes * sizeof(WMSFT_RefChunk); + file->ref_seg.len += info->typeattr.cImplTypes * sizeof(WMSFT_RefChunk); if(!file->ref_seg.data) file->ref_seg.data = heap_alloc(file->ref_seg.len); else @@ -9769,11 +9741,11 @@
chunk = (WMSFT_RefChunk*)((char*)file->ref_seg.data + offs);
- for(i = 0; i < info->cImplTypes; ++i){ + for(i = 0; i < info->typeattr.cImplTypes; ++i){ chunk->href = info->impltypes[i].hRef; chunk->res04 = info->impltypes[i].implflags; chunk->res08 = -1; - if(i < info->cImplTypes - 1) + if(i < info->typeattr.cImplTypes - 1) chunk->next = offs + sizeof(WMSFT_RefChunk) * (i + 1); else chunk->next = -1; @@ -9791,18 +9763,18 @@
if(data){ MSFT_TypeInfoBase *base = (MSFT_TypeInfoBase*)data; - if(info->wTypeFlags & TYPEFLAG_FDUAL) + if(info->typeattr.wTypeFlags & TYPEFLAG_FDUAL) base->typekind = TKIND_DISPATCH; else - base->typekind = info->typekind; + base->typekind = info->typeattr.typekind; base->typekind |= index << 16; /* TODO: There are some other flags here */ - base->typekind |= (info->cbAlignment << 11) | (info->cbAlignment << 6); + base->typekind |= (info->typeattr.cbAlignment << 11) | (info->typeattr.cbAlignment << 6); base->memoffset = WMSFT_compile_typeinfo_aux(info, file); base->res2 = 0; base->res3 = 0; base->res4 = 3; base->res5 = 0; - base->cElement = (info->cVars << 16) | info->cFuncs; + base->cElement = (info->typeattr.cVars << 16) | info->typeattr.cFuncs; base->res7 = 0; base->res8 = 0; base->res9 = 0; @@ -9811,7 +9783,7 @@ base->posguid = info->guid->offset; else base->posguid = -1; - base->flags = info->wTypeFlags; + base->flags = info->typeattr.wTypeFlags; if(info->Name) { base->NameOffset = info->Name->offset;
@@ -9820,7 +9792,7 @@ }else { base->NameOffset = -1; } - base->version = (info->wMinorVerNum << 16) | info->wMajorVerNum; + base->version = (info->typeattr.wMinorVerNum << 16) | info->typeattr.wMajorVerNum; if(info->DocString) base->docstringoffs = info->DocString->offset; else @@ -9828,20 +9800,20 @@ base->helpstringcontext = info->dwHelpStringContext; base->helpcontext = info->dwHelpContext; base->oCustData = WMSFT_compile_custdata(info->pcustdata_list, file); - base->cImplTypes = info->cImplTypes; - base->cbSizeVft = info->cbSizeVft; - base->size = info->cbSizeInstance; - if(info->typekind == TKIND_COCLASS){ + base->cImplTypes = info->typeattr.cImplTypes; + base->cbSizeVft = info->typeattr.cbSizeVft; + base->size = info->typeattr.cbSizeInstance; + if(info->typeattr.typekind == TKIND_COCLASS){ base->datatype1 = WMSFT_compile_typeinfo_ref(info, file); - }else if(info->typekind == TKIND_ALIAS){ + }else if(info->typeattr.typekind == TKIND_ALIAS){ base->datatype1 = WMSFT_append_typedesc(info->tdescAlias, file, NULL, NULL); - }else if(info->typekind == TKIND_MODULE){ + }else if(info->typeattr.typekind == TKIND_MODULE){ if(info->DllName) base->datatype1 = info->DllName->offset; else base->datatype1 = -1; }else{ - if(info->cImplTypes > 0) + if(info->typeattr.cImplTypes > 0) base->datatype1 = info->impltypes[0].hRef; else base->datatype1 = -1; @@ -10394,12 +10366,12 @@ return hres; }
- old_flags = This->wTypeFlags; - This->wTypeFlags = typeFlags; + old_flags = This->typeattr.wTypeFlags; + This->typeattr.wTypeFlags = typeFlags;
hres = ICreateTypeInfo2_LayOut(iface); if (FAILED(hres)) { - This->wTypeFlags = old_flags; + This->typeattr.wTypeFlags = old_flags; return hres; }
@@ -10440,8 +10412,8 @@
TRACE("%p %d %d\n", This, majorVerNum, minorVerNum);
- This->wMajorVerNum = majorVerNum; - This->wMinorVerNum = minorVerNum; + This->typeattr.wMajorVerNum = majorVerNum; + This->typeattr.wMinorVerNum = minorVerNum;
return S_OK; } @@ -10568,7 +10540,7 @@ if (!funcDesc || funcDesc->oVft & 3) return E_INVALIDARG;
- switch (This->typekind) { + switch (This->typeattr.typekind) { case TKIND_MODULE: if (funcDesc->funckind != FUNC_STATIC) return TYPE_E_BADMODULEKIND; @@ -10582,7 +10554,7 @@ return TYPE_E_BADMODULEKIND; }
- if (index > This->cFuncs) + if (index > This->typeattr.cFuncs) return TYPE_E_ELEMENTNOTFOUND;
if (funcDesc->invkind & (INVOKE_PROPERTYPUT | INVOKE_PROPERTYPUTREF) && @@ -10603,11 +10575,13 @@ if (tmp_func_desc.funcdesc.oVft != 0) tmp_func_desc.funcdesc.oVft |= 1;
- if (funcDesc->cScodes) { + if (funcDesc->cScodes && funcDesc->lprgscode) { tmp_func_desc.funcdesc.lprgscode = heap_alloc(sizeof(SCODE) * funcDesc->cScodes); memcpy(tmp_func_desc.funcdesc.lprgscode, funcDesc->lprgscode, sizeof(SCODE) * funcDesc->cScodes); - } else + } else { tmp_func_desc.funcdesc.lprgscode = NULL; + tmp_func_desc.funcdesc.cScodes = 0; + }
buf_size = TLB_SizeElemDesc(&funcDesc->elemdescFunc); for (i = 0; i < funcDesc->cParams; ++i) { @@ -10648,17 +10622,17 @@
if (This->funcdescs) { This->funcdescs = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->funcdescs, - sizeof(TLBFuncDesc) * (This->cFuncs + 1)); - - if (index < This->cFuncs) { + sizeof(TLBFuncDesc) * (This->typeattr.cFuncs + 1)); + + if (index < This->typeattr.cFuncs) { memmove(This->funcdescs + index + 1, This->funcdescs + index, - (This->cFuncs - index) * sizeof(TLBFuncDesc)); + (This->typeattr.cFuncs - index) * sizeof(TLBFuncDesc)); func_desc = This->funcdescs + index; } else - func_desc = This->funcdescs + This->cFuncs; + func_desc = This->funcdescs + This->typeattr.cFuncs;
/* move custdata lists to the new memory location */ - for(i = 0; i < This->cFuncs + 1; ++i){ + for(i = 0; i < This->typeattr.cFuncs + 1; ++i){ if(index != i){ TLBFuncDesc *fd = &This->funcdescs[i]; if(fd->custdata_list.prev == fd->custdata_list.next) @@ -10675,7 +10649,7 @@ memcpy(func_desc, &tmp_func_desc, sizeof(tmp_func_desc)); list_init(&func_desc->custdata_list);
- ++This->cFuncs; + ++This->typeattr.cFuncs;
This->needs_layout = TRUE;
@@ -10691,25 +10665,25 @@
TRACE("%p %u %d\n", This, index, refType);
- switch(This->typekind){ + switch(This->typeattr.typekind){ case TKIND_COCLASS: { if (index == -1) { FIXME("Unhandled index: -1\n"); return E_NOTIMPL; }
- if(index != This->cImplTypes) + if(index != This->typeattr.cImplTypes) return TYPE_E_ELEMENTNOTFOUND;
break; } case TKIND_INTERFACE: case TKIND_DISPATCH: - if (index != 0 || This->cImplTypes) + if (index != 0 || This->typeattr.cImplTypes) return TYPE_E_ELEMENTNOTFOUND; break; default: - FIXME("Unimplemented typekind: %d\n", This->typekind); + FIXME("Unimplemented typekind: %d\n", This->typeattr.typekind); return E_NOTIMPL; }
@@ -10717,17 +10691,17 @@ UINT i;
This->impltypes = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->impltypes, - sizeof(TLBImplType) * (This->cImplTypes + 1)); - - if (index < This->cImplTypes) { + sizeof(TLBImplType) * (This->typeattr.cImplTypes + 1)); + + if (index < This->typeattr.cImplTypes) { memmove(This->impltypes + index + 1, This->impltypes + index, - (This->cImplTypes - index) * sizeof(TLBImplType)); + (This->typeattr.cImplTypes - index) * sizeof(TLBImplType)); impl_type = This->impltypes + index; } else - impl_type = This->impltypes + This->cImplTypes; + impl_type = This->impltypes + This->typeattr.cImplTypes;
/* move custdata lists to the new memory location */ - for(i = 0; i < This->cImplTypes + 1; ++i){ + for(i = 0; i < This->typeattr.cImplTypes + 1; ++i){ if(index != i){ TLBImplType *it = &This->impltypes[i]; if(it->custdata_list.prev == it->custdata_list.next) @@ -10745,10 +10719,10 @@ TLBImplType_Constructor(impl_type); impl_type->hRef = refType;
- ++This->cImplTypes; + ++This->typeattr.cImplTypes;
if((refType & (~0x3)) == (This->pTypeLib->dispatch_href & (~0x3))) - This->wTypeFlags |= TYPEFLAG_FDISPATCHABLE; + This->typeattr.wTypeFlags |= TYPEFLAG_FDISPATCHABLE;
hres = ICreateTypeInfo2_LayOut(iface); if (FAILED(hres)) @@ -10765,10 +10739,10 @@
TRACE("%p %u %x\n", This, index, implTypeFlags);
- if (This->typekind != TKIND_COCLASS) + if (This->typeattr.typekind != TKIND_COCLASS) return TYPE_E_BADMODULEKIND;
- if (index >= This->cImplTypes) + if (index >= This->typeattr.cImplTypes) return TYPE_E_ELEMENTNOTFOUND;
impl_type->implflags = implTypeFlags; @@ -10783,7 +10757,7 @@
TRACE("%p %d\n", This, alignment);
- This->cbAlignment = alignment; + This->typeattr.cbAlignment = alignment;
return S_OK; } @@ -10800,7 +10774,7 @@
This->Schema = TLB_append_str(&This->pTypeLib->string_list, schema);
- This->lpstrSchema = This->Schema->str; + This->typeattr.lpstrSchema = This->Schema->str;
return S_OK; } @@ -10817,17 +10791,17 @@ UINT i;
This->vardescs = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->vardescs, - sizeof(TLBVarDesc) * (This->cVars + 1)); - - if (index < This->cVars) { + sizeof(TLBVarDesc) * (This->typeattr.cVars + 1)); + + if (index < This->typeattr.cVars) { memmove(This->vardescs + index + 1, This->vardescs + index, - (This->cVars - index) * sizeof(TLBVarDesc)); + (This->typeattr.cVars - index) * sizeof(TLBVarDesc)); var_desc = This->vardescs + index; } else - var_desc = This->vardescs + This->cVars; + var_desc = This->vardescs + This->typeattr.cVars;
/* move custdata lists to the new memory location */ - for(i = 0; i < This->cVars + 1; ++i){ + for(i = 0; i < This->typeattr.cVars + 1; ++i){ if(index != i){ TLBVarDesc *var = &This->vardescs[i]; if(var->custdata_list.prev == var->custdata_list.next) @@ -10845,7 +10819,7 @@ TLB_AllocAndInitVarDesc(varDesc, &var_desc->vardesc_create); var_desc->vardesc = *var_desc->vardesc_create;
- ++This->cVars; + ++This->typeattr.cVars;
This->needs_layout = TRUE;
@@ -10864,7 +10838,7 @@ if (!names) return E_INVALIDARG;
- if (index >= This->cFuncs || numNames == 0) + if (index >= This->typeattr.cFuncs || numNames == 0) return TYPE_E_ELEMENTNOTFOUND;
if (func_desc->funcdesc.invkind & (INVOKE_PROPERTYPUT | INVOKE_PROPERTYPUTREF)){ @@ -10874,7 +10848,7 @@ if(numNames > func_desc->funcdesc.cParams + 1) return TYPE_E_ELEMENTNOTFOUND;
- for(i = 0; i < This->cFuncs; ++i) { + for(i = 0; i < This->typeattr.cFuncs; ++i) { TLBFuncDesc *iter = &This->funcdescs[i]; if (iter->Name && !strcmpW(TLB_get_bstr(iter->Name), *names)) { if (iter->funcdesc.invkind & (INVOKE_PROPERTYPUT | INVOKE_PROPERTYPUTREF | INVOKE_PROPERTYGET) && @@ -10905,7 +10879,7 @@ if(!name) return E_INVALIDARG;
- if(index >= This->cVars) + if(index >= This->typeattr.cVars) return TYPE_E_ELEMENTNOTFOUND;
This->vardescs[index].Name = TLB_append_str(&This->pTypeLib->name_list, name); @@ -10923,10 +10897,10 @@ if(!tdescAlias) return E_INVALIDARG;
- if(This->typekind != TKIND_ALIAS) + if(This->typeattr.typekind != TKIND_ALIAS) return TYPE_E_BADMODULEKIND;
- hr = TLB_size_instance(This, This->pTypeLib->syskind, tdescAlias, &This->cbSizeInstance, &This->cbAlignment); + hr = TLB_size_instance(This, This->pTypeLib->syskind, tdescAlias, &This->typeattr.cbSizeInstance, &This->typeattr.cbAlignment); if(FAILED(hr)) return hr;
@@ -10956,7 +10930,7 @@ if(!docString) return E_INVALIDARG;
- if(index >= This->cFuncs) + if(index >= This->typeattr.cFuncs) return TYPE_E_ELEMENTNOTFOUND;
func_desc->HelpString = TLB_append_str(&This->pTypeLib->string_list, docString); @@ -10975,7 +10949,7 @@ if(!docString) return E_INVALIDARG;
- if(index >= This->cVars) + if(index >= This->typeattr.cVars) return TYPE_E_ELEMENTNOTFOUND;
var_desc->HelpString = TLB_append_str(&This->pTypeLib->string_list, docString); @@ -10991,7 +10965,7 @@
TRACE("%p %u %d\n", This, index, helpContext);
- if(index >= This->cFuncs) + if(index >= This->typeattr.cFuncs) return TYPE_E_ELEMENTNOTFOUND;
func_desc->helpcontext = helpContext; @@ -11007,7 +10981,7 @@
TRACE("%p %u %d\n", This, index, helpContext);
- if(index >= This->cVars) + if(index >= This->typeattr.cVars) return TYPE_E_ELEMENTNOTFOUND;
var_desc->HelpContext = helpContext; @@ -11033,8 +11007,8 @@ if (!idlDesc) return E_INVALIDARG;
- This->idldescType.dwReserved = idlDesc->dwReserved; - This->idldescType.wIDLFlags = idlDesc->wIDLFlags; + This->typeattr.idldescType.dwReserved = idlDesc->dwReserved; + This->typeattr.idldescType.wIDLFlags = idlDesc->wIDLFlags;
return S_OK; } @@ -11055,7 +11029,7 @@ if (FAILED(hres)) return hres;
- if (This->typekind == TKIND_INTERFACE) { + if (This->typeattr.typekind == TKIND_INTERFACE) { ITypeInfo *inh; TYPEATTR *attr; HREFTYPE inh_href; @@ -11072,7 +11046,7 @@ ITypeInfo_Release(tinfo); return hres; } - This->cbSizeVft = attr->cbSizeVft; + This->typeattr.cbSizeVft = attr->cbSizeVft; ITypeInfo_ReleaseTypeAttr(inh, attr);
do{ @@ -11091,34 +11065,34 @@
ITypeInfo_Release(inh); } else if (hres == TYPE_E_ELEMENTNOTFOUND) { - This->cbSizeVft = 0; + This->typeattr.cbSizeVft = 0; hres = S_OK; } else { ITypeInfo_Release(tinfo); return hres; } } else if (hres == TYPE_E_ELEMENTNOTFOUND) { - This->cbSizeVft = 0; + This->typeattr.cbSizeVft = 0; hres = S_OK; } else { ITypeInfo_Release(tinfo); return hres; } - } else if (This->typekind == TKIND_DISPATCH) - This->cbSizeVft = 7 * This->pTypeLib->ptr_size; + } else if (This->typeattr.typekind == TKIND_DISPATCH) + This->typeattr.cbSizeVft = 7 * This->pTypeLib->ptr_size; else - This->cbSizeVft = 0; + This->typeattr.cbSizeVft = 0;
func_desc = This->funcdescs; i = 0; - while (i < This->cFuncs) { + while (i < This->typeattr.cFuncs) { if (!(func_desc->funcdesc.oVft & 0x1)) - func_desc->funcdesc.oVft = This->cbSizeVft; + func_desc->funcdesc.oVft = This->typeattr.cbSizeVft;
if ((func_desc->funcdesc.oVft & 0xFFFC) > user_vft) user_vft = func_desc->funcdesc.oVft & 0xFFFC;
- This->cbSizeVft += This->pTypeLib->ptr_size; + This->typeattr.cbSizeVft += This->pTypeLib->ptr_size;
if (func_desc->funcdesc.memid == MEMBERID_NIL) { TLBFuncDesc *iter; @@ -11128,10 +11102,10 @@ func_desc->funcdesc.memid = 0x60000000 + (depth << 16) + i;
iter = This->funcdescs; - while (j < This->cFuncs) { + while (j < This->typeattr.cFuncs) { if (iter != func_desc && iter->funcdesc.memid == func_desc->funcdesc.memid) { if (!reset) { - func_desc->funcdesc.memid = 0x60000000 + (depth << 16) + This->cFuncs; + func_desc->funcdesc.memid = 0x60000000 + (depth << 16) + This->typeattr.cFuncs; reset = TRUE; } else ++func_desc->funcdesc.memid; @@ -11148,10 +11122,10 @@ ++i; }
- if (user_vft > This->cbSizeVft) - This->cbSizeVft = user_vft + This->pTypeLib->ptr_size; - - for(i = 0; i < This->cVars; ++i){ + if (user_vft > This->typeattr.cbSizeVft) + This->typeattr.cbSizeVft = user_vft + This->pTypeLib->ptr_size; + + for(i = 0; i < This->typeattr.cVars; ++i){ TLBVarDesc *var_desc = &This->vardescs[i]; if(var_desc->vardesc.memid == MEMBERID_NIL){ UINT j = 0; @@ -11161,10 +11135,10 @@ var_desc->vardesc.memid = 0x40000000 + (depth << 16) + i;
iter = This->vardescs; - while (j < This->cVars) { + while (j < This->typeattr.cVars) { if (iter != var_desc && iter->vardesc.memid == var_desc->vardesc.memid) { if (!reset) { - var_desc->vardesc.memid = 0x40000000 + (depth << 16) + This->cVars; + var_desc->vardesc.memid = 0x40000000 + (depth << 16) + This->typeattr.cVars; reset = TRUE; } else ++var_desc->vardesc.memid;
Modified: trunk/reactos/dll/win32/oleaut32/usrmarshal.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/oleaut32/usrmarsh... ============================================================================== --- trunk/reactos/dll/win32/oleaut32/usrmarshal.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/oleaut32/usrmarshal.c [iso-8859-1] Thu Nov 17 22:58:15 2016 @@ -66,6 +66,10 @@ { ALIGN_POINTER(Buffer, 3); *(DWORD*)Buffer = pstg->flags; + + if (!pstg->pInterface) + return Buffer + sizeof(DWORD); + switch(pstg->flags) { case CLS_LIBATTR: @@ -1391,52 +1395,145 @@
HRESULT CALLBACK ITypeComp_Bind_Proxy( ITypeComp* This, - LPOLESTR szName, + LPOLESTR name, ULONG lHashVal, - WORD wFlags, - ITypeInfo** ppTInfo, - DESCKIND* pDescKind, - BINDPTR* pBindPtr) -{ - FIXME("not implemented\n"); - return E_FAIL; + WORD flags, + ITypeInfo **ti, + DESCKIND *desckind, + BINDPTR *bindptr) +{ + CLEANLOCALSTORAGE stg = { 0 }; + ITypeComp *typecomp; + FUNCDESC *funcdesc; + VARDESC *vardesc; + HRESULT hr; + + TRACE("(%p, %s, %#x, %#x, %p, %p, %p)\n", This, debugstr_w(name), lHashVal, flags, ti, + desckind, bindptr); + + *desckind = DESCKIND_NONE; + memset(bindptr, 0, sizeof(*bindptr)); + + hr = ITypeComp_RemoteBind_Proxy(This, name, lHashVal, flags, ti, desckind, + &funcdesc, &vardesc, &typecomp, &stg); + + if (hr == S_OK) + { + switch (*desckind) + { + case DESCKIND_FUNCDESC: + bindptr->lpfuncdesc = funcdesc; + break; + case DESCKIND_VARDESC: + case DESCKIND_IMPLICITAPPOBJ: + bindptr->lpvardesc = vardesc; + break; + case DESCKIND_TYPECOMP: + bindptr->lptcomp = typecomp; + break; + default: + ; + } + } + + return hr; }
HRESULT __RPC_STUB ITypeComp_Bind_Stub( ITypeComp* This, - LPOLESTR szName, + LPOLESTR name, ULONG lHashVal, - WORD wFlags, - ITypeInfo** ppTInfo, - DESCKIND* pDescKind, - LPFUNCDESC* ppFuncDesc, - LPVARDESC* ppVarDesc, - ITypeComp** ppTypeComp, - CLEANLOCALSTORAGE* pDummy) -{ - FIXME("not implemented\n"); - return E_FAIL; + WORD flags, + ITypeInfo **ti, + DESCKIND *desckind, + FUNCDESC **funcdesc, + VARDESC **vardesc, + ITypeComp **typecomp, + CLEANLOCALSTORAGE *stg) +{ + BINDPTR bindptr; + HRESULT hr; + + TRACE("(%p, %s, %#x, %#x, %p, %p, %p, %p, %p, %p)\n", This, debugstr_w(name), + lHashVal, flags, ti, desckind, funcdesc, vardesc, typecomp, stg); + + memset(stg, 0, sizeof(*stg)); + memset(&bindptr, 0, sizeof(bindptr)); + + *funcdesc = NULL; + *vardesc = NULL; + *typecomp = NULL; + *ti = NULL; + + hr = ITypeComp_Bind(This, name, lHashVal, flags, ti, desckind, &bindptr); + if(hr != S_OK) + return hr; + + switch (*desckind) + { + case DESCKIND_FUNCDESC: + *funcdesc = bindptr.lpfuncdesc; + stg->pInterface = (IUnknown*)*ti; + stg->pStorage = funcdesc; + stg->flags = CLS_FUNCDESC; + break; + case DESCKIND_VARDESC: + case DESCKIND_IMPLICITAPPOBJ: + *vardesc = bindptr.lpvardesc; + stg->pInterface = (IUnknown*)*ti; + stg->pStorage = vardesc; + stg->flags = CLS_VARDESC; + break; + case DESCKIND_TYPECOMP: + *typecomp = bindptr.lptcomp; + break; + default: + ; + } + + if (stg->pInterface) + IUnknown_AddRef(stg->pInterface); + + return hr; }
HRESULT CALLBACK ITypeComp_BindType_Proxy( ITypeComp* This, - LPOLESTR szName, + LPOLESTR name, ULONG lHashVal, - ITypeInfo** ppTInfo, - ITypeComp** ppTComp) -{ - FIXME("not implemented\n"); - return E_FAIL; + ITypeInfo **ti, + ITypeComp **typecomp) +{ + HRESULT hr; + + TRACE("(%p, %s, %#x, %p, %p)\n", This, debugstr_w(name), lHashVal, ti, typecomp); + + hr = ITypeComp_RemoteBindType_Proxy(This, name, lHashVal, ti); + if (hr == S_OK) + ITypeInfo_GetTypeComp(*ti, typecomp); + else if (typecomp) + *typecomp = NULL; + + return hr; }
HRESULT __RPC_STUB ITypeComp_BindType_Stub( ITypeComp* This, - LPOLESTR szName, + LPOLESTR name, ULONG lHashVal, - ITypeInfo** ppTInfo) -{ - FIXME("not implemented\n"); - return E_FAIL; + ITypeInfo **ti) +{ + ITypeComp *typecomp = NULL; + HRESULT hr; + + TRACE("(%p, %s, %#x, %p)\n", This, debugstr_w(name), lHashVal, ti); + + hr = ITypeComp_BindType(This, name, lHashVal, ti, &typecomp); + + if (typecomp) + ITypeComp_Release(typecomp); + + return hr; }
/* ITypeInfo */
Modified: trunk/reactos/media/doc/README.WINE URL: http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=7... ============================================================================== --- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original) +++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Thu Nov 17 22:58:15 2016 @@ -141,7 +141,7 @@ reactos/dll/win32/odbccp32 # Synced to WineStaging-1.9.11 reactos/dll/win32/ole32 # Synced to WineStaging-1.9.16 reactos/dll/win32/oleacc # Synced to WineStaging-1.9.11 -reactos/dll/win32/oleaut32 # Synced to WineStaging-1.9.16 +reactos/dll/win32/oleaut32 # Synced to WineStaging-1.9.23 reactos/dll/win32/olecli32 # Synced to WineStaging-1.9.11 reactos/dll/win32/oledlg # Synced to WineStaging-1.9.11 reactos/dll/win32/olepro32 # Synced to WineStaging-1.9.11