oleaut32: Use the new typelib creation implementation.

oldstable
Andrew Eikum 2013-06-05 14:25:07 -05:00 committed by Alexandre Julliard
parent 1319515173
commit 40966b3615
3 changed files with 59 additions and 5343 deletions

View File

@ -17,7 +17,6 @@ C_SRCS = \
safearray.c \
tmarshal.c \
typelib.c \
typelib2.c \
usrmarshal.c \
varformat.c \
variant.c \

View File

@ -8339,6 +8339,35 @@ static const ITypeCompVtbl tcompvt =
ITypeComp_fnBindType
};
HRESULT WINAPI CreateTypeLib2(SYSKIND syskind, LPCOLESTR szFile,
ICreateTypeLib2** ppctlib)
{
ITypeLibImpl *This;
HRESULT hres;
TRACE("(%d,%s,%p)\n", syskind, debugstr_w(szFile), ppctlib);
if (!szFile) return E_INVALIDARG;
This = TypeLibImpl_Constructor();
if (!This)
return E_OUTOFMEMORY;
This->lcid = GetSystemDefaultLCID();
This->syskind = syskind;
This->path = heap_alloc((lstrlenW(szFile) + 1) * sizeof(WCHAR));
if (!This->path) {
ITypeLib2_Release((ITypeLib2*)This);
return E_OUTOFMEMORY;
}
lstrcpyW(This->path, szFile);
hres = ITypeLib2_QueryInterface((ITypeLib2*)This, &IID_ICreateTypeLib2, (LPVOID*)ppctlib);
ITypeLib2_Release((ITypeLib2*)This);
return hres;
}
static HRESULT WINAPI ICreateTypeLib2_fnQueryInterface(ICreateTypeLib2 *iface,
REFIID riid, void **object)
{
@ -10811,3 +10840,33 @@ static const ICreateTypeInfo2Vtbl CreateTypeInfo2Vtbl = {
ICreateTypeInfo2_fnInvalidate,
ICreateTypeInfo2_fnSetName
};
/******************************************************************************
* ClearCustData (OLEAUT32.171)
*
* Clear a custom data type's data.
*
* PARAMS
* lpCust [I] The custom data type instance
*
* RETURNS
* Nothing.
*/
void WINAPI ClearCustData(CUSTDATA *lpCust)
{
if (lpCust && lpCust->cCustData)
{
if (lpCust->prgCustData)
{
DWORD i;
for (i = 0; i < lpCust->cCustData; i++)
VariantClear(&lpCust->prgCustData[i].varValue);
/* FIXME - Should be using a per-thread IMalloc */
heap_free(lpCust->prgCustData);
lpCust->prgCustData = NULL;
}
lpCust->cCustData = 0;
}
}

File diff suppressed because it is too large Load Diff