volume names of mounted iso images

James Hawkins truiken at gmail.com
Tue May 8 00:18:32 CDT 2007

On 5/7/07, Alexandre Julliard <julliard at winehq.org> wrote:
> "James Hawkins" <truiken at gmail.com> writes:
> > I have a patch ready to go that fixes a problem with the media
> > switching code in msi.  According to tests and msdn, the presence of a
> > required media (usually a CD or DVD) is confirmed using only the
> > volume name listed in the Media table of the msi file.  The patch
> > simplifies the existing media checking code and also fixes a few
> > installers.  The problem is that, on my system at least, the volume
> > name and serial of mounted ISO files (using a loopback device) are not
> > available, and any call to GetVolumeInformation returns an empty
> > string for the volume name.  Because of this, I'm hesitant to get the
> > patch committed for fear of restricting installs to only using
> > physical media.  That would include me, because my CD drive is borked.
> > Setting the volume name in winecfg doesn't work, probably because of
> > permissions and the fact that the mount is read only.  'Autodetect
> > from Device' is apparently not implemented.  Can someone enlighten me
> > on the situation and possible solutions?
> Autodetect from device is the default behavior, and it should work
> fine for ISO images. Probably Wine cannot open the corresponding iso
> file for some reason.

I've looked into the problem a bit more.  It seems the only way to add
a dos device is through explorer, by way of hal.  This works fine for
a CD in the physical drive, as hal notifies explorer that there is a
CD in the drive, and explorer adds the CD to the list of dos devices.
Mounted ISO files, on the other hand, are not reported by hal, as
loopback devices are not supported by hal.  When winecfg, or any other
app for that matter, calls GetVolumeInformation("D:\\"), we attempt to
open the device using CreateFile("\\\\.\\D:").  This fails because the
mounted ISO drive has not been added to the dos device list.  We then
fallback to the "default strategy" which tries to create the file
"D:\\.windows-label", which obviously won't work because D:\ is a
read-only filesystem.  After all this, GetVolumeInformation returns an
empty label and serial.  Back in the days of the config file, we used
to be able to define drives like so:

[Drive D]
"Path" = "/mnt/cdrom"
"Type" = "cdrom"
"Label" = "IMALABEL"
"Device" = "/dev/cdrom"
"Filesystem" = "msdos"

Using hal is obviously the better way to go, but this leaves us in the
dark for mounted ISO files.  Any ideas?  I'm attaching the relevant
portions of a +all log running winecfg after adding the ISO mount
point as drive D:\.

James Hawkins
-------------- next part --------------
A non-text attachment was scrubbed...
Name: all.log
Type: text/x-log
Size: 9078 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20070508/c4109e0c/all-0001.bin

More information about the wine-devel mailing list