Commit dcd9b8ea authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

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

parent 39342535
...@@ -5626,6 +5626,11 @@ static void test_LoadRegTypeLib(void) ...@@ -5626,6 +5626,11 @@ static void test_LoadRegTypeLib(void)
ok(hr == TYPE_E_LIBNOTREGISTERED || broken(hr == S_OK) /* winxp */, "got 0x%08x\n", hr); ok(hr == TYPE_E_LIBNOTREGISTERED || broken(hr == S_OK) /* winxp */, "got 0x%08x\n", hr);
SysFreeString(path); 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 */ /* manifest version is 2.0, actual is 1.0 */
hr = LoadRegTypeLib(&LIBID_register_test, 1, 0, LOCALE_NEUTRAL, &tl); 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); ok(hr == TYPE_E_LIBNOTREGISTERED || broken(hr == S_OK) /* winxp */, "got 0x%08x\n", hr);
......
...@@ -323,7 +323,7 @@ static HRESULT query_typelib_path( REFGUID guid, WORD wMaj, WORD wMin, ...@@ -323,7 +323,7 @@ static HRESULT query_typelib_path( REFGUID guid, WORD wMaj, WORD wMin,
WCHAR *nameW; WCHAR *nameW;
DWORD len; 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; return TYPE_E_LIBNOTREGISTERED;
nameW = (WCHAR*)((BYTE*)data.lpSectionBase + tlib->name_offset); nameW = (WCHAR*)((BYTE*)data.lpSectionBase + tlib->name_offset);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment