http://bugs.winehq.org/show_bug.cgi?id=26459
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |obfuscation CC| |focht@gmx.net Summary|Dragon Age: Origins doesn't |Dragon Age: Origins DVD |recognize dvd? |authenticity checks fail | |(IOCTL_DVD_READ_STRUCTURE | |fails, structures in | |"ntddcdvd.h" need to be | |byte packed with no | |padding)
--- Comment #4 from Anastasius Focht focht@gmx.net 2012-01-21 05:22:10 CST --- Hello,
bought the game for a few bucks to look into it ;-) It seems there is a problem with packing size of structures.
While verifying the authenticity of original DVD, the game loader tries to retrieve the DvdPhysicalDescriptor using IOCTL_DVD_READ_STRUCTURE.
--- snip --- 0009:Call KERNEL32.DeviceIoControl(0000009c,00335140,0032e510,00000011,36518b90,00000804,0032e4f8,00000000) ret=00453065 0009:trace:cdrom:CDROM_DeviceIoControl 0x9c IOCTL_DVD_READ_STRUCTURE 0x32e510 17 0x36518b90 2052 0x32e400 0009:trace:cdrom:CDROM_Open 0, 6 0009:Ret KERNEL32.DeviceIoControl() retval=00000000 ret=00453065 ... 0029:Call user32.MessageBoxW(00000000,00aa8328 L"Failed to authenticate the disk. Please insert the correct disk and try again.",00aa83c8 L"Dragon Age: Origins",00000010) ret=004023dc --- snip ---
Winedbg:
--- snip --- =>0 0x7bc3247a CDROM_DeviceIoControl(hDevice=0x80, hEvent=0x0(nil), UserApcRoutine=(nil), UserApcContext=0x0(nil), piosb=0x33e49c, dwIoControlCode=0x335140, lpInBuffer=0x33e510, nInBufferSize=0x11, lpOutBuffer=0x36518b90, nOutBufferSize=0x804) [/home/focht/projects/wine/wine-git/dlls/ntdll/cdrom.c:2810] in ntdll (0x0033e464) 1 0x7b84011d DeviceIoControl+0x2fe(hDevice=0x80, dwIoControlCode=0x335140, lpvInBuffer=0x33e510, cbInBuffer=0x11, lpvOutBuffer=0x36518b90, cbOutBuffer=0x804, lpcbBytesReturned=0x33e4f8, lpOverlapped=(nil)) [/home/focht/projects/wine/wine-git/dlls/kernel32/file.c:2423] in kernel32 (0x0033e4c4) ... 3093 sz = sizeof(DVD_LAYER_DESCRIPTOR); Wine-dbg>n 3094 if (lpInBuffer == NULL || nInBufferSize != sizeof(DVD_READ_STRUCTURE)) status = STATUS_INVALID_PARAMETER; --- snip ---
The app passes 17 for DVD_LAYER_DESCRIPTOR structure size. Due to default structure padding/member alignment, Wine's "sizeof(DVD_LAYER_DESCRIPTOR)" will be larger hence the ioctl gets rejected.
Source:
http://source.winehq.org/git/wine.git/blob/750e7e072cd8bb36921545cb2beea9a6c...
All structures in "ntddcdvd.h" need to be byte packed with no padding (#include <pshpack1.h> [...] #include <poppack.h>).
Though with that fix and IOCTL_DVD_READ_STRUCTURE actually returning data it still doesn't pass the game authenticity checks due to other bugs.
I'll file them as separate bugs.
Regards