msi: Perform a suffix match on the volume name.

This commit is contained in:
Hans Leidekker 2015-04-16 17:01:55 +02:00 committed by Alexandre Julliard
parent 20c3c09fac
commit 8969377647
1 changed files with 10 additions and 3 deletions

View File

@ -54,8 +54,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
static BOOL source_matches_volume(MSIMEDIAINFO *mi, LPCWSTR source_root)
{
WCHAR volume_name[MAX_PATH + 1];
WCHAR root[MAX_PATH + 1];
WCHAR volume_name[MAX_PATH + 1], root[MAX_PATH + 1];
const WCHAR *p;
int len, len2;
strcpyW(root, source_root);
PathStripToRootW(root);
@ -66,7 +67,13 @@ static BOOL source_matches_volume(MSIMEDIAINFO *mi, LPCWSTR source_root)
WARN("failed to get volume information for %s (%u)\n", debugstr_w(root), GetLastError());
return FALSE;
}
return !strcmpiW( mi->volume_label, volume_name );
len = strlenW( volume_name );
len2 = strlenW( mi->volume_label );
if (len2 > len) return FALSE;
p = volume_name + len - len2;
return !strcmpiW( mi->volume_label, p );
}
static UINT msi_change_media(MSIPACKAGE *package, MSIMEDIAINFO *mi)