Query MediaType of SD-Cards using IOCTL_GET_DISK_DRIVE_GEOMETRY

Eduard Hasenleithner eduard at hasenleithner.at
Sat Jul 14 14:14:57 CDT 2012


Hi

I'm trying to use the TANITA Bodyvision software 
(http://www.tanita.co.uk/index.php?id=158) under wine. The software is 
supposed to read its data from an SD-Card. But under wine it cannot find 
the SD card.

I managed to find out what it takes so that the software finds the SD 
card. Please see the attached small sample to see how the software 
iterates the drive letters, and how it determines a eligibile media 
using (data.MediaType == RemovableMedia).

The reasons why this does not work are manyfold. Here are some events 
which happen when inserting the card.
* The drive is reported using udisks. This creates a symlink in 
dosdevices to the raw block device /dev/sdf
* The partition /dev/sdf1 is mounted automatically in /media/XXXX-YYYY
* /dev/sdf and /dev/sdf1 are not user read/writable.
* wine creates a drive letter symlink for /dev/sdf
* no symlink is created for /media/XXXX-YYYY
* When you open wine explorer, the drive does not show up in the drive list

This means that the drive letter assigned for the sd card will not be 
returned in GetLogicalDrives(). When the symlink to the mountpoint is 
added manually, following output is produced:

DbgPrint says: Drive f
fixme:ntdll:server_ioctl_file Unsupported ioctl 70000 (device=7 access=0 
func=0 method=0)
DbgPrint says: DeviceIoControl failed

When get_dos_device is made to unconditionally return 
STATUS_BAD_DEVICE_TYPE, the ioctl is properly delivered to 
harddisk_ioctl DeviceIoControl succeeds:

DbgPrint says: Drive f
DbgPrint says: Removable: 0

But still, the device is reported as non-removable. The reason for this 
is probably that udisks reports /dev/sdf as removable, but not its 
partition /dev/sdf1.

Is it worth for working on patches for these issues, or is this 
completely impossible with the current architecture?

Eduard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: find-media.c
Type: text/x-csrc
Size: 857 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20120714/cba5248b/attachment.c>


More information about the wine-devel mailing list