msi: Avoid redundant loading of media info.

This commit is contained in:
Hans Leidekker 2011-04-14 14:40:45 +02:00 committed by Alexandre Julliard
parent cfddf2796e
commit 5521646380
1 changed files with 8 additions and 7 deletions

View File

@ -658,16 +658,16 @@ static UINT get_drive_type(const WCHAR *path)
UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi)
{
static const WCHAR query[] = {
'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','`','M','e','d','i','a','`',' ',
'W','H','E','R','E',' ','`','L','a','s','t','S','e','q','u','e','n','c','e','`',' ',
'>','=',' ','%','i',' ','O','R','D','E','R',' ','B','Y',' ','`','D','i','s','k','I','d','`',0};
MSIRECORD *row;
LPWSTR source_dir;
LPWSTR source;
LPWSTR source_dir, source;
DWORD options;
static const WCHAR query[] = {
'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ',
'`','M','e','d','i','a','`',' ','W','H','E','R','E',' ',
'`','L','a','s','t','S','e','q','u','e','n','c','e','`',' ','>','=',' ','%','i',
' ','O','R','D','E','R',' ','B','Y',' ','`','D','i','s','k','I','d','`',0};
if (Sequence <= mi->last_sequence) /* already loaded */
return ERROR_SUCCESS;
row = MSI_QueryGetRecord(package->db, query, Sequence);
if (!row)
@ -720,6 +720,7 @@ UINT msi_load_media_info(MSIPACKAGE *package, UINT Sequence, MSIMEDIAINFO *mi)
options, INSTALLPROPERTY_LASTUSEDSOURCEW, source);
msi_free(source_dir);
TRACE("sequence %u -> cabinet %s disk id %u\n", Sequence, debugstr_w(mi->cabinet), mi->disk_id);
return ERROR_SUCCESS;
}