http://bugs.winehq.org/show_bug.cgi?id=15452
Summary: Freewire aborts due to incorrect handling of COLORRES nIndex in winex11's GetDeviceCaps() Product: Wine Version: CVS/GIT Platform: PC URL: http://www.freewiretv.com/downloadTVWin.html OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winex11.drv AssignedTo: wine-bugs@winehq.org ReportedBy: nodisgod@yahoo.com
Created an attachment (id=16345) --> (http://bugs.winehq.org/attachment.cgi?id=16345) Freewire relay log (rzipped)
With current Git (wine-1.1.5-207-gc425c8a), when attempting to launch Freewire after installation, Freewire aborts with a message box complaining about the currently set bit depth. From relay trace:
0009:Call user32.GetDC(00000000) ret=005808ac 0009:Ret user32.GetDC() retval=0000030c ret=005808ac 0009:Call gdi32.GetDeviceCaps(0000030c,0000006c) ret=005808b5 0009:Ret gdi32.GetDeviceCaps() retval=00000000 ret=005808b5 0009:Call user32.LoadStringA(00000000,00000095,0032f8d4,00000180) ret=005808f3 0009:Ret user32.LoadStringA() retval=0000015d ret=005808f3 0009:Call user32.LoadStringA(00000000,00000097,0032f754,00000180) ret=00580910 0009:Ret user32.LoadStringA() retval=0000001c ret=00580910 0009:Call user32.MessageBoxA(00000000,0032f8d4 "Unfortunately, it has not been possible to start Freewire Television due to your graphics mode.\nPlease set the color depth to 32 bit in the display control panel and restart the application\nIf the problem continues please contact Freewire customer services on 0333 123 0190.\nOr visit the Freewire s"...,0032f754 "We've encountered a problem!",00000030) ret=00580927
The problem seems to lie in: 0009:Call gdi32.GetDeviceCaps(0000030c,0000006c) ret=005808b5 0009:Ret gdi32.GetDeviceCaps() retval=00000000 ret=005808b5
GetDeviceCaps() is being called with the DC handle returned from GetDC(NULL) and the COLORRES value for nIndex. In dlls/winex11.drv/init.c lines 259 and 268:
case COLORRES: /* ... */ return 0;
Freewire apparently does not like the returned value, and thus aborts with the message box. Modifying the COLORRES case to return screen_bpp allows the application to get past this point, though I am not sure if this is the right thing to do.