[Bug 24182] Need for Russia crashes on startup (failure to create ddraw offscreen surface with no dimensions)

wine-bugs at winehq.org wine-bugs at winehq.org
Sat May 10 07:42:21 CDT 2014


http://bugs.winehq.org/show_bug.cgi?id=24182

Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|http://www.gamershell.com/d |http://static.lhp.hu/letolt
                   |ownload_38878.shtml         |okozpont.hu/programok/n/nee
                   |                            |d_for_russia_greatest_cars_
                   |                            |from_cccp_demo_eng.zip
                 CC|                            |focht at gmx.net
          Component|-unknown                    |directx-d3d
            Summary|Need for Russia crashes     |Need for Russia crashes on
                   |                            |startup (failure to create
                   |                            |ddraw offscreen surface
                   |                            |with no dimensions)

--- Comment #10 from Anastasius Focht <focht at gmx.net> ---
Hello folks,

this download works better:
http://static.lhp.hu/letoltokozpont.hu/programok/n/need_for_russia_greatest_cars_from_cccp_demo_eng.zip

Relevant part of trace log:

--- snip ---
$ pwd
/home/focht/.wine/drive_c/Program Files/nfs

$ WINEDEBUG=+tid,+seh,+relay,+d3d,+ddraw wine ./NFR.exe >>log.txt 2>&1
...
0029:trace:ddraw:ddraw7_CreateSurface iface 0x14b010, surface_desc 0x33faf4,
surface 0x33faf0, outer_unknown (nil).
...
0029:trace:ddraw:ddraw_surface_create ddraw 0x14b010, surface_desc 0x33faf4,
surface 0x33fa6c, outer_unknown (nil), version 7.
0029:trace:ddraw:ddraw_surface_create Requesting surface desc:
0029:trace:ddraw:DDRAW_dump_members  - DDSD_CAPS : DDSCAPS_OFFSCREENPLAIN
DDSCAPS_SYSTEMMEMORY 
...
0029:Call
wined3d.wined3d_get_adapter_display_mode(0014b780,00000000,0033f88c,00000000)
ret=7e68267b
0029:trace:d3d:wined3d_get_adapter_display_mode wined3d 0x14b780, adapter_idx
0, display_mode 0x33f88c, rotation (nil).
0029:Call user32.EnumDisplaySettingsExW(0014e63c
L"\\\\.\\DISPLAY1",ffffffff,0033f6b0,00000000) ret=7e5327a0
0029:Call
winex11.drv.EnumDisplaySettingsEx(0014e63c,ffffffff,0033f6b0,00000000)
ret=7ed0877e
0029:Ret  winex11.drv.EnumDisplaySettingsEx() retval=00000001 ret=7ed0877e
0029:Ret  user32.EnumDisplaySettingsExW() retval=00000001 ret=7e5327a0
0029:trace:d3d:wined3d_get_adapter_display_mode Returning 1024x768 at 60
WINED3DFMT_B8G8R8X8_UNORM 0x1.
0029:Ret  wined3d.wined3d_get_adapter_display_mode() retval=00000000
ret=7e68267b
0029:trace:ddraw:ddrawformat_from_wined3dformat Returning: ( DDPF_RGB , RGB
bits: 32, R 0x00ff0000 G 0x0000ff00 B 0x000000ff)
0029:trace:ddraw:wined3dformat_from_ddrawformat Convert a DirectDraw
Pixelformat to a WineD3D Pixelformat
0029:trace:ddraw:DDRAW_dump_pixelformat ( DDPF_RGB , RGB bits: 32, R 0x00ff0000
G 0x0000ff00 B 0x000000ff)
0029:warn:ddraw:ddraw_surface_create No width / height specified.
0029:Call ntdll.RtlFreeHeap(00110000,00000000,00b35500) ret=7e6828c7
0029:Ret  ntdll.RtlFreeHeap() retval=00000001 ret=7e6828c7
0029:Call wined3d.wined3d_mutex_unlock() ret=7e6547bc
0029:Ret  wined3d.wined3d_mutex_unlock() retval=00000000 ret=7e6547bc
0029:trace:seh:raise_exception code=c0000005 flags=0 addr=0x10052410
ip=10052410 tid=0029
0029:trace:seh:raise_exception  info[0]=00000000
0029:trace:seh:raise_exception  info[1]=00000010
0029:trace:seh:raise_exception  eax=00000000 ebx=004b452c ecx=00000000
edx=7e636b44 esi=004b4508 edi=0033fc28
0029:trace:seh:raise_exception  ebp=0033fc78 esp=0033fbac cs=0023 ds=002b
es=002b fs=0063 gs=006b flags=00210206 
...
0029:Call user32.MessageBoxA(00000000,1010d528 "Memory access
violation",1010d4e0 "Error!",00050000) ret=100012e6 
--- snip ---

The game engine tries to create an offscreen surface with no dimensions and
Wine's DirectDraw doesn't allow this:

--- snip ---
Wine-dbg>bt

Backtrace:

=>0 0x7e6828ca ddraw_surface_create+0xa57(ddraw=0x133108,
surface_desc=0x33faf4, surface=0x33fa6c, outer_unknown=(nil), version=0x7)
[/home/focht/projects/wine/wine.repo/src/dlls/ddraw/surface.c:5689] in ddraw
(0x0033fa38)

  1 0x7e6547b4 ddraw7_CreateSurface+0x273(iface=<couldn't compute location>,
surface_desc=<couldn't compute location>, surface=<couldn't compute location>,
outer_unknown=<couldn't compute location>)
[/home/focht/projects/wine/wine.repo/src/dlls/ddraw/ddraw.c:2800] in ddraw
(0x0033fab8)

5682        /* No width or no height? Use the screen size. */
5683        if (!(desc->dwFlags & DDSD_WIDTH) || !(desc->dwFlags &
DDSD_HEIGHT))
5684        {
5685            if (!(desc->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE))
5686            {
5687                WARN("No width / height specified.\n");
5688                HeapFree(GetProcessHeap(), 0, texture);
5689                return DDERR_INVALIDPARAMS;
5690            }
--- snip ---

Source:
http://source.winehq.org/git/wine.git/blob/a227188573dc727dd6d2c53059c1c093a595be05:/dlls/ddraw/surface.c#l5682

If I remove the check for being a primary surface the game starts and runs fine
(main menu shown, played a single race)

Maybe Henri or Stefan can comment on this behaviour.

$ sha1sum need_for_russia_greatest_cars_from_cccp_demo_eng.zip 
3d61347191f506673c8caeb42cd669c1fef0dd44 
need_for_russia_greatest_cars_from_cccp_demo_eng.zip

$ du -sh need_for_russia_greatest_cars_from_cccp_demo_eng.zip 
48M    need_for_russia_greatest_cars_from_cccp_demo_eng.zip

$ wine --version
wine-1.7.18-92-gb01fc1a

Regards

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list