Hi Detlef,

On 03/03/2013 10:23 PM, Detlef Riekenberg wrote:
Hi Alexandre.

I have a test failure on my win7 Machine, while a valid cd was in the dvd drive.
volume.c:785: Test failed: IOCTL_DVD_READ_STRUCTURE (DvdPhysicalDescriptor) failed, last error = 1785

Example result:
http://test.winehq.org/data/209b58c64e6181c9bf448cb4f3130d3ba705c5d2/win7_dr-w7sp1-wow-p6100/kernel32:volume.html
(The same failure is present, when running the 64bit test)

Other machines are also affected.
Example:
http://test.winehq.org/data/4a685ebea343efdcb433f8d710b0c9f902e471fa/win7_matt/kernel32:volume.html
Error 1785 is ERROR_UNRECOGNIZED_MEDIA wich means "The disk media is not recognized. It may not be formatted."
All I can do is to add a skip() or maybe a broken() call to continue the test.

You wrote the tests, which where comitted on 12. July 2012:
http://source.winehq.org/git/wine.git/commitdiff/a3b5dd2dff0d04fe317f00282ccb0488e4803015

What media did you use, to test your code?
Data-DVD, Video-DVD, Empty DVD, Data-CD, Video-CD, Audio-CD, Empty CD, No Disc in Drive
What results did you get on Windows and Unix?
As many developpers, I tried with things I had at home.
I tested on a XP or 7 (I don't recall, maybe both) VM with a (Video) DVD, a computer game (The Sims 3) DVD, a Ubuntu DVD version and I also toyed with mkisofs to generate some ISO for me.
And yes, I tested my patch on linux before sending it upstream.

On Linux, mounting the example CD works perfect, but your test fails:
volume.c:785: Test failed: IOCTL_DVD_READ_STRUCTURE (DvdPhysicalDescriptor) failed, last error = 87
Error 87 is ERROR_INVALID_PARAMETER wich is probably returned from http://source.winehq.org/source/dlls/ntdll/cdrom.c#L2546 meaning the ioctl() call failed for some reason.

You know, this function is essentially a wrapper of ioctl() so if you see a failure, you should have a look at /var/log/messages.
You may also add a TRACE with strerror() to know exactly what happens but I fear you would only get something like "Device not supported" or "not ready" or something like that.

Your test only read the DVD descriptor.

To fix your test, I suggest, that you add a trace to dump the
*_READ_STRUCTURE IoControl result and add similar tests
for the other media formats.

I also tested with a different Data-CD and got the same failure on linux (last error = 87).

You can check the image yourself:
http://www.memtest86.com/downloads/memtest86-4.1.0-iso.zip
(Burned on a CD)

That all winetest vm are missing optical media is a different issue:
http://bugs.winehq.org/show_bug.cgi?id=31780


--
By by ... Detlef

Dumping may help you but as we only take the result of ioctl() to feed the different fields of a structure, I don't really see what we can do .. except modifying the code in the kernel to return what we expect.