[2/2] msi: VolumeLabel and DiskPrompt are optional fields in the Media table.
Hans Leidekker
hans at codeweavers.com
Tue Jan 3 06:53:50 CST 2012
Fixes http://bugs.winehq.org/show_bug.cgi?id=29484
---
dlls/msi/media.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/dlls/msi/media.c b/dlls/msi/media.c
index f8ed27e..d5ace5a 100644
--- a/dlls/msi/media.c
+++ b/dlls/msi/media.c
@@ -820,10 +820,13 @@ static UINT find_published_source(MSIPACKAGE *package, MSIMEDIAINFO *mi)
volume, &volumesz, prompt, &promptsz) == ERROR_SUCCESS)
{
mi->disk_id = id;
- mi->volume_label = msi_realloc(mi->volume_label, ++volumesz * sizeof(WCHAR));
- lstrcpyW(mi->volume_label, volume);
- mi->disk_prompt = msi_realloc(mi->disk_prompt, ++promptsz * sizeof(WCHAR));
- lstrcpyW(mi->disk_prompt, prompt);
+ msi_free( mi->volume_label );
+ if (!(mi->volume_label = msi_alloc( ++volumesz * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
+ strcpyW( mi->volume_label, volume );
+
+ msi_free( mi->disk_prompt );
+ if (!(mi->disk_prompt = msi_alloc( ++promptsz * sizeof(WCHAR) ))) return ERROR_OUTOFMEMORY;
+ strcpyW( mi->disk_prompt, prompt );
if (source_matches_volume(mi, source))
{
--
1.7.7.3
More information about the wine-patches
mailing list