This patch looks mostly good, but see below for a couple fixes. Also, it should be split. You could split it into one patch for the CustData functions and one for HelpStringContext.
You should also write some tests for them. They'd be best in test_CreateTypeLib(), which is a really big function. Basically, it sets and retrieves a bunch of typelib stuff, then saves and re-loads the typelib from disk, and then retrieves everything again to verify it saved correctly. The HelpStringContext test should be very easy to write, but the CustData functions are a little bit more complicated.
Be sure to run the tests on the testbot before submitting. There are often differences between Windows versions that you'll need to allow for.
Just out of curiosity, do you have an application that actually uses these functions, or are you implementing them simply for completeness?
On Fri, Jul 04, 2014 at 01:03:44AM +0200, Guillaume Charifi wrote:
static HRESULT WINAPI ICreateTypeInfo2_fnSetVarCustData(ICreateTypeInfo2 *iface, UINT index, REFGUID guid, VARIANT *varVal) {
- TLBGuid *tlbguid;
- ITypeInfoImpl *This = info_impl_from_ICreateTypeInfo2(iface);
- FIXME("%p %u %s %p - stub\n", This, index, debugstr_guid(guid), varVal);
- return E_NOTIMPL;
- TLBVarDesc *pVDesc = &This->vardescs[index];
- TRACE("%p %u %s %p\n", This, index, debugstr_guid(guid), varVal);
- if (!guid || !varVal)
return E_INVALIDARG;
- if(index >= This->cFuncs)
return E_INVALIDARG;
This should be cVars.
static HRESULT WINAPI ICreateTypeInfo2_fnSetImplTypeCustData(ICreateTypeInfo2 *iface, UINT index, REFGUID guid, VARIANT *varVal) {
- TLBGuid *tlbguid;
- ITypeInfoImpl *This = info_impl_from_ICreateTypeInfo2(iface);
- FIXME("%p %u %s %p - stub\n", This, index, debugstr_guid(guid), varVal);
- return E_NOTIMPL;
- TLBImplType *pRDesc = &This->impltypes[index];
- TRACE("%p %u %s %p\n", This, index, debugstr_guid(guid), varVal);
- if (!guid || !varVal)
return E_INVALIDARG;
- if(index >= This->cFuncs)
return E_INVALIDARG;
And this should be cImplTypes.
Andrew