msi: Avoid redundant loading of media info.
This commit is contained in:
parent
cfddf2796e
commit
5521646380
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue