Home | Info | Community | Development | myReactOS | Contact Us
[static]
Definition at line 3877 of file typelib2.c.
Referenced by ICreateTypeLib2_fnCreateTypeInfo().
{ ICreateTypeInfo2Impl *pCreateTypeInfo2Impl; int nameoffset; int typeinfo_offset; MSFT_TypeInfoBase *typeinfo; TRACE("Constructing ICreateTypeInfo2 for %s with tkind %d\n", debugstr_w(szName), tkind); pCreateTypeInfo2Impl = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(ICreateTypeInfo2Impl)); if (!pCreateTypeInfo2Impl) return NULL; pCreateTypeInfo2Impl->lpVtbl = &ctypeinfo2vt; pCreateTypeInfo2Impl->lpVtblTypeInfo2 = &typeinfo2vt; pCreateTypeInfo2Impl->ref = 1; pCreateTypeInfo2Impl->typelib = typelib; ICreateTypeLib_AddRef((ICreateTypeLib*)typelib); nameoffset = ctl2_alloc_name(typelib, szName); typeinfo_offset = ctl2_alloc_typeinfo(typelib, nameoffset); typeinfo = (MSFT_TypeInfoBase *)&typelib->typelib_segment_data[MSFT_SEG_TYPEINFO][typeinfo_offset]; typelib->typelib_segment_data[MSFT_SEG_NAME][nameoffset + 9] = 0x38; *((int *)&typelib->typelib_segment_data[MSFT_SEG_NAME][nameoffset]) = typeinfo_offset; pCreateTypeInfo2Impl->typeinfo = typeinfo; pCreateTypeInfo2Impl->typekind = tkind; typeinfo->typekind |= tkind | 0x20; ICreateTypeInfo2_SetAlignment((ICreateTypeInfo2 *)pCreateTypeInfo2Impl, 4); switch (tkind) { case TKIND_ENUM: case TKIND_INTERFACE: case TKIND_DISPATCH: case TKIND_COCLASS: typeinfo->size = 4; break; case TKIND_RECORD: case TKIND_UNION: typeinfo->size = 0; break; case TKIND_MODULE: typeinfo->size = 2; break; case TKIND_ALIAS: typeinfo->size = -0x75; break; default: FIXME("(%s,%d), unrecognized typekind %d\n", debugstr_w(szName), tkind, tkind); typeinfo->size = 0xdeadbeef; break; } if (typelib->last_typeinfo) typelib->last_typeinfo->next_typeinfo = pCreateTypeInfo2Impl; typelib->last_typeinfo = pCreateTypeInfo2Impl; if (!typelib->typeinfos) typelib->typeinfos = pCreateTypeInfo2Impl; TRACE(" -- %p\n", pCreateTypeInfo2Impl); return (ICreateTypeInfo2 *)pCreateTypeInfo2Impl; }