[Wine-devel] Eter's patch is applied to winehq repo 05/29/13

builder-robot на etersoft.ru builder-robot на etersoft.ru
Ср Май 29 07:00:47 MSK 2013


New Etersoft's patches since last build time:
commit 97f501bec3d97f25f24e2b099bbc83f4a813a35c
Author: Tatyana Fokina <tatyana на etersoft.ru>

    oleaut32: Ignore NULL ppTLib/pIndex in ITypeInfo2_fnGetContainingTypeLib.

---

commit 97f501bec3d97f25f24e2b099bbc83f4a813a35c
Author: Tatyana Fokina <tatyana на etersoft.ru>
Date:   Mon May 27 14:43:38 2013 +0400

    oleaut32: Ignore NULL ppTLib/pIndex in ITypeInfo2_fnGetContainingTypeLib.

diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c
index a20b3bf..32d8a04 100644
--- a/dlls/oleaut32/tests/typelib.c
+++ b/dlls/oleaut32/tests/typelib.c
@@ -3385,6 +3385,54 @@ todo_wine {
     ITypeLib_Release(tl);
 }
 
+static void test_TypeInfo2_GetContainingTypeLib(void)
+{
+    static const WCHAR test[] = {'t','e','s','t','.','t','l','b',0};
+    static OLECHAR testTI[] = {'t','e','s','t','T','y','p','e','I','n','f','o',0};
+
+    ICreateTypeLib2 *ctl2;
+    ICreateTypeInfo *cti;
+    ITypeInfo2 *ti2;
+    ITypeLib *tl;
+    UINT Index;
+    HRESULT hr;
+
+    hr = CreateTypeLib2(SYS_WIN32, test, &ctl2);
+    ok_ole_success(hr, CreateTypeLib2);
+
+    hr = ICreateTypeLib2_CreateTypeInfo(ctl2, testTI, TKIND_DISPATCH, &cti);
+    ok_ole_success(hr, ICreateTypeLib2_CreateTypeInfo);
+
+    hr = ICreateTypeInfo_QueryInterface(cti, &IID_ITypeInfo2, (void**)&ti2);
+    ok_ole_success(hr, ICreateTypeInfo2_QueryInterface);
+
+    tl = NULL;
+    Index = 888;
+    hr = ITypeInfo2_GetContainingTypeLib(ti2, &tl, &Index);
+    ok_ole_success(hr, ITypeInfo2_GetContainingTypeLib);
+    ok(tl != NULL, "ITypeInfo2_GetContainingTypeLib returned empty TypeLib");
+    ok(Index == 0, "ITypeInfo2_GetContainingTypeLib returned Index = %u, expected 0\n", Index);
+    if(tl) ITypeLib_Release(tl);
+
+    tl = NULL;
+    hr = ITypeInfo2_GetContainingTypeLib(ti2, &tl, NULL);
+    ok_ole_success(hr, ITypeInfo2_GetContainingTypeLib);
+    ok(tl != NULL, "ITypeInfo2_GetContainingTypeLib returned empty TypeLib");
+    if(tl) ITypeLib_Release(tl);
+
+    Index = 888;
+    hr = ITypeInfo2_GetContainingTypeLib(ti2, NULL, &Index);
+    ok_ole_success(hr, ITypeInfo2_GetContainingTypeLib);
+    ok(Index == 0, "ITypeInfo2_GetContainingTypeLib returned Index = %u, expected 0\n", Index);
+
+    hr = ITypeInfo2_GetContainingTypeLib(ti2, NULL, NULL);
+    ok_ole_success(hr, ITypeInfo2_GetContainingTypeLib);
+
+    ITypeInfo2_Release(ti2);
+    ICreateTypeInfo_Release(cti);
+    ICreateTypeLib2_Release(ctl2);
+}
+
 START_TEST(typelib)
 {
     const char *filename;
@@ -3416,4 +3464,5 @@ START_TEST(typelib)
     test_register_typelib(FALSE);
     test_create_typelibs();
     test_LoadTypeLib();
+    test_TypeInfo2_GetContainingTypeLib();
 }
diff --git a/dlls/oleaut32/typelib2.c b/dlls/oleaut32/typelib2.c
index 1aeb27a..98f9d62 100644
--- a/dlls/oleaut32/typelib2.c
+++ b/dlls/oleaut32/typelib2.c
@@ -3707,9 +3707,12 @@ static HRESULT WINAPI ITypeInfo2_fnGetContainingTypeLib(
 
     TRACE("(%p,%p,%p)\n", iface, ppTLib, pIndex);
 
-    *ppTLib = (ITypeLib *)&This->typelib->ITypeLib2_iface;
-    ICreateTypeLib_AddRef((ICreateTypeLib*)This->typelib);
-    *pIndex = This->typeinfo->typekind >> 16;
+    if (ppTLib)
+    {
+        *ppTLib = (ITypeLib *)&This->typelib->ITypeLib2_iface;
+        ICreateTypeLib2_AddRef(&This->typelib->ICreateTypeLib2_iface);
+    }
+    if (pIndex) *pIndex = This->typeinfo->typekind >> 16;
 
     return S_OK;
 }


Подробная информация о списке рассылки Wine-devel