oleaut32: Fix QueryPathOfRegTypeLib minor version comparison.

A search with wMin != 0xFFFF should match only if the actual version found
matches the major and is is >= the minor version requested (preferring
an exact match if one is available)

Signed-off-by: Kevin Puetz <PuetzKevinA@JohnDeere.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Kevin Puetz 2022-02-19 14:06:21 -06:00 committed by Alexandre Julliard
parent 3b90b7be75
commit 288a1024b9
2 changed files with 3 additions and 3 deletions

View file

@ -1521,7 +1521,7 @@ cleanup:
static BOOL do_typelib_reg_key(GUID *uid, WORD maj, WORD min, DWORD arch, LPCWSTR base, BOOL remove)
{
static const WCHAR typelibW[] = {'T','y','p','e','l','i','b','\\',0};
static const WCHAR formatW[] = {'\\','%','u','.','%','u','\\','0','\\','w','i','n','%','u',0};
static const WCHAR formatW[] = {'\\','%','x','.','%','x','\\','0','\\','w','i','n','%','u',0};
static const WCHAR format2W[] = {'%','s','_','%','u','_','%','u','.','d','l','l',0};
WCHAR buf[128];
HKEY hkey;
@ -1578,7 +1578,7 @@ static void test_QueryPathOfRegTypeLib(DWORD arch)
{ 3, 1, S_OK, {'f','a','k','e','_','3','_','1','.','d','l','l',0 } },
{ 3, 22, S_OK, {'f','a','k','e','_','3','_','3','7','.','d','l','l',0 } },
{ 3, 37, S_OK, {'f','a','k','e','_','3','_','3','7','.','d','l','l',0 } },
{ 3, 40, S_OK, {'f','a','k','e','_','3','_','3','7','.','d','l','l',0 } },
{ 3, 40, TYPE_E_LIBNOTREGISTERED, { 0 } },
{ 0xffff, 0xffff, S_OK, {'f','a','k','e','_','5','_','3','7','.','d','l','l',0 } },
{ 0xffff, 0, TYPE_E_LIBNOTREGISTERED, { 0 } },
{ 3, 0xffff, TYPE_E_LIBNOTREGISTERED, { 0 } },

View file

@ -207,7 +207,7 @@ static BOOL find_typelib_key( REFGUID guid, WORD *wMaj, WORD *wMin )
best_min = v_min;
break; /* exact match */
}
if (*wMin != 0xffff && v_min > best_min) best_min = v_min;
if (*wMin != 0xffff && v_min >= *wMin && v_min > best_min) best_min = v_min;
}
}
len = sizeof(key_name);