http://bugs.winehq.org/show_bug.cgi?id=8231
Summary: fish tycoon fails to start
Product: Wine
Version: 0.9.36.
Platform: Other
OS/Version: other
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: wine-directx-ddraw
AssignedTo: wine-bugs(a)winehq.org
ReportedBy: dan.nixon(a)gmail.com
Fish Tycoon installs and the title screen which launches into payment methods,
loading the actual game, etc is displayed correctly. Attempting to run the game
results in this error message:
GapiDraw
"Failed initializing DirectDraw. only 16-bit and 32-bit displays are supported
in windowed mode."
Ubuntu 7.04 (feisty)
Radeon Mobility
fglrx
direct rendering is enabled
tried both 0.9.33 (feisty repository) and 0.9.36 (winehq repository), same
result with each.
Here is my related post on the ubuntu forums:
http://ubuntuforums.org/showthread.php?t=428217
Here is the fish tycoon demo:
http://www.fishtycoon.com/zips/FTsetup1_00.exe
--
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.winehq.org/show_bug.cgi?id=8222
------- Additional Comments From focht(a)gmx.net 2007-30-04 07:13 -------
Hello,
looks like an application bug to me (in custom installer dll).
Here is my own trace with relevant parts:
--- snip trace ---
...
0028:Call msi.MsiGetPropertyA(00000001,00730460
"AUMUSEORIGINALAPPID",00000000,615f1514) ret=1001a525
0028:trace:msi:MSI_GetProperty 1 L"AUMUSEORIGINALAPPID" (nil) 0x615f1514
...
0028:Call kernel32.WideCharToMultiByte(00000000,00000000,0066b2a8
L"True",ffffffff,00000000,00000000,00000000,00000000) ret=601b99f7
0028:Ret kernel32.WideCharToMultiByte() retval=00000005 ret=601b99f7
0028:Call kernel32.WideCharToMultiByte(00000000,00000000,0066b2a8
L"True",ffffffff,00000000,00000000,00000000,00000000) ret=601b9a4f
0028:Ret kernel32.WideCharToMultiByte() retval=00000005 ret=601b9a4f
...
0028:Ret msi.MsiGetPropertyA() retval=00000000 ret=1001a525
0028:Call ntdll.RtlAllocateHeap(00730000,00000000,00000004) ret=10029d46
0028:Ret ntdll.RtlAllocateHeap() retval=00730488 ret=10029d46
0028:Call msi.MsiGetPropertyA(00000001,00730460
"AUMUSEORIGINALAPPID",00730488,615f1514) ret=1001a57f
...
0028:Call kernel32.WideCharToMultiByte(00000000,00000000,0066b2a8
L"True",ffffffff,00000000,00000000,00000000,00000000) ret=601b99f7
0028:Ret kernel32.WideCharToMultiByte() retval=00000005 ret=601b99f7
0028:Call kernel32.WideCharToMultiByte(00000000,00000000,0066b2a8
L"True",ffffffff,00730488,00000004,00000000,00000000) ret=601b9a4f
0028:Ret kernel32.WideCharToMultiByte() retval=00000000 ret=601b9a4f
0028:Ret msi.MsiGetPropertyA() retval=000000ea ret=1001a57f
--- snip trace ---
First, they determine necessary buffer length for MsiGetProperty().
Returned length is 4 -> strlen("True")
MSDN states:
"When the function returns ERROR_SUCCESS, this variable contains the size of the
data copied to szValueBuf, not including the terminating null character."
The caller reserves 4 bytes of memory and passes it to msi.
RtlAllocateHeap(00730000,00000000,00000004)
Now guess.
The second MsiGetProperty() fails because the NULL terminator can't be stuffed
into result buffer (supplied buffer len = 4, string len = 4).
Hence the "msi.MsiGetPropertyA() retval=000000ea" -> 234 -> ERROR_MORE_DATA.
Clearly sloppy devs... they should reserve memory for NULL terminator too. :)
Just curious ... does this installer work on windows?
If yes, windows might be braindamaged once more :)
This is the installer MD5sum with the bug (just in case adobe silently replaces
their buggy stuff):
5f28c010a854dbff6a8b329ec31a5c66 Photoshop_albumSE_en_us_320.exe
Regards
--
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.winehq.org/show_bug.cgi?id=8230
------- Additional Comments From us(a)edmeades.me.uk 2007-30-04 07:07 -------
Wine cannot handle multiline if statements yet... I wasn't planning on adding
it as I've never seen it used, but if its needed somewhere I'll see what I can
do
--
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
http://bugs.winehq.org/show_bug.cgi?id=8230
us(a)edmeades.me.uk changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |wine-bugs(a)winehq.org
AssignedTo|wine-bugs(a)winehq.org |us(a)edmeades.me.uk
--
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.winehq.org/show_bug.cgi?id=8177
------- Additional Comments From dmitry(a)codeweavers.com 2007-30-04 06:09 -------
It would be interesting to do something like this:
AddFontResource("etsans.fon");
lstrcpyA(lf.lfFaceName, "ET Sans Serif");
hfont = CreateFontIndirect(&lf);
hdc = GetDC(0);
SelectObject(hdc, hfont);
cs = GetTextCharsetInfo(hdc, &fs, 0);
and dump the contents of fs.fsCsb[0] and cs value.
--
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.winehq.org/show_bug.cgi?id=8177
------- Additional Comments From software(a)astrojar.org.uk 2007-30-04 04:48 -------
Are there any tests that I could do under Windows to help?
--
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.winehq.org/show_bug.cgi?id=2398
------- Additional Comments From k00_fol(a)k.kth.se 2007-30-04 04:11 -------
>With the Toolset it (mostly) works. The window is in the correct location,
>rotates around, etc,etc, correctly. However, if you attempt to use one of
>the menu's. The main opengl window stops updating, until you cause the
>whole window to refresh. (such as by putting another window on top of it.)
>
>Perhaps its drawing to the wrong "place"?
I can verify that the everything with the drawing seems to be correct. But I
can not reproduce the menu update hiccup. (using wine .9.34)
However I get really ugly crashes if I first open a dialog window (e.g.
proerties on a -d object) and then close it. It varies from a "Bad opcode"
error message from the X server, and a unresponding system.
I can reproduce the X error message if it's intresting, but maybe it's only
issues with my graphics driver?
--
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
http://bugs.winehq.org/show_bug.cgi?id=2398
------- Additional Comments From k00_fol(a)k.kth.se 2007-30-04 04:09 -------
>With the Toolset it (mostly) works. The window is in the correct location,
>rotates around, etc,etc, correctly. However, if you attempt to use one of
>the menu's. The main opengl window stops updating, until you cause the
>whole window to refresh. (such as by putting another window on top of it.)
>
>Perhaps its drawing to the wrong "place"?
I can verify that the everything with the drawing seems to be correct. But I
can not reproduce the menu update hiccup. (using wine .9.34)
However I get really ugly crashes if I first open a dialog window (e.g.
proerties on a -d object) and then close it. It varies from a "Bad opcode"
error message from the X server, and a unresponding system.
I can reproduce the X error message if it's intresting, but maybe it's only
issues with my graphics driver?
--
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
http://bugs.winehq.org/show_bug.cgi?id=7679
------- Additional Comments From focht(a)gmx.net 2007-30-04 03:48 -------
Hello,
seems i have to provide more info to get someone adding a patch ;)
The following is a trace from problematic hooker call:
--- snip ---
..
trace:virtual:NtProtectVirtualMemory 0xffffffff 0x1c7812c 0000000c 0000000c
trace:virtual:VIRTUAL_SetProt 0x1c78000-0x1c78fff c----
trace:virtual:VIRTUAL_DumpView View: 0x1c70000 - 0x1c79fff 0x140
trace:virtual:VIRTUAL_DumpView 0x1c70000 - 0x1c70fff c-r--
trace:virtual:VIRTUAL_DumpView 0x1c71000 - 0x1c73fff c-r-x
trace:virtual:VIRTUAL_DumpView 0x1c74000 - 0x1c76fff c-rW-
trace:virtual:VIRTUAL_DumpView 0x1c77000 - 0x1c77fff c-r--
trace:virtual:VIRTUAL_DumpView 0x1c78000 - 0x1c78fff c----
trace:virtual:VIRTUAL_DumpView 0x1c79000 - 0x1c79fff c-r--
..
--- snip ---
The problem is VIRTUAL_GetProt() in dlls/ntdll/virtual.c:NtProtectVirtualMemory().
It doesnt honour multiple flag combinations (of course some of them are invalid).
As said in my previous comment, it tries to NtProtectVirtualMemory(
PAGE_WRITECOPY | PAGE_READWRITE) due to .idata section attributes.
VIRTUAL_GetProt( PAGE_WRITECOPY | PAGE_READWRITE) is called which can't handle
multiple flags and falls through default case (vprot = 0).
VIRTUAL_SetProt() is then called with (0 | VPROT_COMMITTED).
This results in no access page ("c----") where every pointer access causes
access violation.
To fix this, add the following pre-check in
--- snip dlls/ntdll/virtual.c ---
NTSTATUS WINAPI NtProtectVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T
*size_ptr,
ULONG new_prot, ULONG *old_prot )
{
FILE_VIEW *view;
sigset_t sigset;
NTSTATUS status = STATUS_SUCCESS;
char *base;
UINT i;
BYTE vprot, *p;
ULONG prot;
SIZE_T size = *size_ptr;
LPVOID addr = *addr_ptr;
RTL_OSVERSIONINFOEXW info;
TRACE("%p %p %08lx %08x\n", process, addr, size, new_prot );
/* Check for mutually exclusive protection values (e.g. WRITECOPY | READWRITE)
NOTE: VIRTUAL_GetProt doesnt honour multiple flags, so we do it here.
Make NtProtectVirtualMemory fail to emulate windows NT behaviour.
TODO: check for other invalid combinations */
if( (new_prot & (PAGE_READWRITE | PAGE_WRITECOPY)) ==
(PAGE_READWRITE | PAGE_WRITECOPY))
{
info.dwOSVersionInfoSize = sizeof(info);
if( (RtlGetVersion( &info) == STATUS_SUCCESS) &&
(info.dwPlatformId == VER_PLATFORM_WIN32_NT))
{
TRACE( "invalid page protection combination, emulating NT\n");
return STATUS_INVALID_PARAMETER;
}
}
if (process != NtCurrentProcess())
....
--- snip dlls/ntdll/virtual.c ---
After patch:
--- snip trace ---
..
trace:virtual:NtProtectVirtualMemory 0xffffffff 0x1c7812c 0000000c 0000000c
trace:virtual:NtProtectVirtualMemory invalid page protection combination,
emulating NT
trace:virtual:NtProtectVirtualMemory 0xffffffff 0x1e12000 00000004 00000004
trace:virtual:VIRTUAL_SetProt 0x1e12000-0x1e12fff c-rw-
trace:virtual:VIRTUAL_SetProt forcing exec permission on 0x1e12000-0x1e12fff
trace:virtual:VIRTUAL_DumpView View: 0x1e10000 - 0x1e14fff 0x140
trace:virtual:VIRTUAL_DumpView 0x1e10000 - 0x1e10fff c-r--
trace:virtual:VIRTUAL_DumpView 0x1e11000 - 0x1e11fff c-r-x
trace:virtual:VIRTUAL_DumpView 0x1e12000 - 0x1e12fff c-rw-
trace:virtual:VIRTUAL_DumpView 0x1e13000 - 0x1e13fff c-rW-
trace:virtual:VIRTUAL_DumpView 0x1e14000 - 0x1e14fff c-r--
..
--- snip trace ---
App starts now fine with winecfg = NT+
Though this check might miss some cases, there is no information that *all*
combination are mutually exclusive.
It might be fun to add all VirtualProtect( flag_combinations) test cases for
various windows versions :)
This is left as excercise.
It could be possible that allowing only one flag at a time breaks too much
stuff, so i coded this specific case here.
Shouldnt be a performance killer at all.
Regards
--
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.