On 10/9/06, Michal Okresa <[EMAIL PROTECTED]> wrote:
On Monday 09 October 2006 19:14, Dan Kegel wrote: ...
> I think it's great you're working on this.  What were the bugs?

Thanks for your comments.

I discovered these two problems in Rob's patch which make test crash.
* Firstly function IKindaEnumWidget_Release(pKEW) was called twice in test
sequence:

IKindaEnumWidget_Release(pKEW);
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL);
hr = CoUnmarshalInterface(pStream, &IID_IKindaEnumWidget, (void **)&pKEW);
ok_ole_success(hr, CoUnmarshalInterface);
IStream_Release(pStream);

hr = IKindaEnumWidget_Next(pKEW, &pWidget);  /* pKEW !!! */
ok_ole_success(hr, IKindaEnumWidget_Next);

IKindaEnumWidget_Release(pKEW);

As you can see, pKEW is used even though memory was released.

* Second problem was in function: static IWidget *Widget_Create(void).

ITypeLib_GetTypeInfoOfGuid failed with wine (but only in last test -
test_DispCallFunc) and hr pointer is NULL. Therefore
ITypeLib_Release(pTypeInfo) after IF {} block might not be called.

hr = ITypeLib_GetTypeInfoOfGuid(pTypeLib, &IID_IWidget, &pTypeInfo);
ok_ole_success(hr, ITypeLib_GetTypeInfoOfGuid);
if (SUCCEEDED(hr))
{
        This->pDispatchUnknown = NULL;
        hr = CreateStdDispatch((IUnknown *)&This->lpVtbl, This, pTypeInfo,
&This->pDispatchUnknown);
        ok_ole_success(hr, CreateStdDispatch);
        ITypeInfo_Release(pTypeInfo);
}
ITypeLib_Release(pTypeInfo); (hr is null)

This problem was difficult to find because test crashed randomly (winedbg
excercise ;-) )

And finally I added few VariantClear() calls (but this isn't important)

Thanks for the info...

Dan H., could you have a quick look at Michal's patch?
- Dan


Reply via email to