Piotr Caban : oleaut32: Fix best version handling in QueryPathOfRegTypeLib when type library redirection is used.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jan 26 10:32:50 CST 2016


Module: wine
Branch: master
Commit: dcd9b8ea0e3915e72c7f279dbdae8c4973c5f8b5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=dcd9b8ea0e3915e72c7f279dbdae8c4973c5f8b5

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Mon Jan 25 16:24:51 2016 +0100

oleaut32: Fix best version handling in QueryPathOfRegTypeLib when type library redirection is used.

Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/oleaut32/tests/typelib.c | 5 +++++
 dlls/oleaut32/typelib.c       | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c
index fe80b70..a354f00 100644
--- a/dlls/oleaut32/tests/typelib.c
+++ b/dlls/oleaut32/tests/typelib.c
@@ -5626,6 +5626,11 @@ static void test_LoadRegTypeLib(void)
     ok(hr == TYPE_E_LIBNOTREGISTERED || broken(hr == S_OK) /* winxp */, "got 0x%08x\n", hr);
     SysFreeString(path);
 
+    path = NULL;
+    hr = QueryPathOfRegTypeLib(&LIBID_TestTypelib, 0xffff, 0xffff, LOCALE_NEUTRAL, &path);
+    ok(hr == S_OK, "got 0x%08x\n", hr);
+    SysFreeString(path);
+
     /* manifest version is 2.0, actual is 1.0 */
     hr = LoadRegTypeLib(&LIBID_register_test, 1, 0, LOCALE_NEUTRAL, &tl);
     ok(hr == TYPE_E_LIBNOTREGISTERED || broken(hr == S_OK) /* winxp */, "got 0x%08x\n", hr);
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 0a83b79..6fd52b0 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -323,7 +323,7 @@ static HRESULT query_typelib_path( REFGUID guid, WORD wMaj, WORD wMin,
             WCHAR *nameW;
             DWORD len;
 
-            if (tlib->major_version != wMaj || tlib->minor_version < wMin)
+            if ((wMaj != 0xffff || wMin != 0xffff) && (tlib->major_version != wMaj || tlib->minor_version < wMin))
                 return TYPE_E_LIBNOTREGISTERED;
 
             nameW = (WCHAR*)((BYTE*)data.lpSectionBase + tlib->name_offset);




More information about the wine-cvs mailing list