From 376c2fd02b5709a7c3cff88b2bbf08ebcd34cb12 Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Wed, 12 May 2010 14:18:15 +0200 Subject: [PATCH] msi: Store the disk id in the MSIFILE structure. --- dlls/msi/action.c | 21 +++++++++++++++++++++ dlls/msi/msipriv.h | 1 + 2 files changed, 22 insertions(+) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index fb4616723b9..c5354de13e7 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -1374,6 +1374,26 @@ done: return r; } +static UINT load_file_disk_id( MSIPACKAGE *package, MSIFILE *file ) +{ + MSIRECORD *row; + static const WCHAR query[] = { + 'S','E','L','E','C','T',' ','`','D','i','s','k','I','d','`',' ', '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',0}; + + row = MSI_QueryGetRecord( package->db, query, file->Sequence ); + if (!row) + { + WARN("query failed\n"); + return ERROR_FUNCTION_FAILED; + } + + file->disk_id = MSI_RecordGetInteger( row, 1 ); + msiobj_release( &row->hdr ); + return ERROR_SUCCESS; +} + static UINT load_file(MSIRECORD *row, LPVOID param) { MSIPACKAGE* package = param; @@ -1435,6 +1455,7 @@ static UINT load_file(MSIRECORD *row, LPVOID param) } load_file_hash(package, file); + load_file_disk_id(package, file); TRACE("File Loaded (%s)\n",debugstr_w(file->File)); diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index 38487459007..cf9e6909f5d 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -468,6 +468,7 @@ typedef struct tagMSIFILE LPWSTR TargetPath; BOOL IsCompressed; MSIFILEHASHINFO hash; + UINT disk_id; } MSIFILE; typedef struct tagMSITEMPFILE