Henri Verbeet hverbeet@codeweavers.com writes:
IDirect3DDeviceImpl_CreateHandle() is particular is just awful.
dlls/ddraw/ddraw_private.h | 30 ++++++++++++- dlls/ddraw/device.c | 63 ++++++++++++------------- dlls/ddraw/direct3d.c | 10 ++++ dlls/ddraw/executebuffer.c | 26 ++++------ dlls/ddraw/main.c | 109 ++++++++++++++++++++++++++++++++++++++++++++ dlls/ddraw/material.c | 13 ++--- dlls/ddraw/viewport.c | 34 ++++++-------- 7 files changed, 211 insertions(+), 74 deletions(-)
Not sure it's really less offensive:
../../../tools/runtest -q -P wine -M ddraw.dll -T ../../.. -p ddraw_test.exe.so visual.c && touch visual.ok visual.c:1770: Tests skipped: device has no P8 texture support, skipping test visual.c:1952: Test failed: IDirect3DMaterial_GetHandle failed: 80070057 visual.c:1989: Test failed: Got color 00000000, expected 00ff0000 visual.c:1997: Test failed: Got color 00000000, expected 000000ff wine: Unhandled page fault on write access to 0x00000083 at address 0x686daffd (thread 0024), starting debugger... Unhandled exception: page fault on write access to 0x00000083 in 32-bit code (0x686daffd). Register dump: CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b EIP:686daffd ESP:0032fa60 EBP:0032fae8 EFLAGS:00010206( R- -- I - -P- ) EAX:00000059 EBX:6870b914 ECX:00149058 EDX:0000001b ESI:000004b0 EDI:00000097 Stack dump: 0x0032fa60: 00000000 6870c5e8 686fbe22 686f95a0 0x0032fa70: 00000097 0000001b 00020808 00000000 0x0032fa80: 00000000 3f800000 00000000 00149058 0x0032fa90: 0000001b 686f954c 6870c70c 686f95a0 0x0032faa0: 686f95d0 6870c5e8 686fbe22 00000000 0x0032fab0: 001329e8 00000000 00000000 00000000 Backtrace: =>0 0x686daffd IDirect3DDeviceImpl_7_Release+0x25d(iface=0x149058) [/home/julliard/wine/wine/dlls/ddraw/device.c:422] in ddraw (0x0032fb28) 1 0x686cfd60 Thunk_IDirect3DDeviceImpl_1_Release+0x5f(iface=0x149064) [/home/julliard/wine/wine/dlls/ddraw/device.c:474] in ddraw (0x0032fd38) 2 0x686a29fd func_visual+0x155c() [/home/julliard/wine/wine/dlls/ddraw/tests/visual.c:1099] in ddraw_test (0x0032fd88) 3 0x686a2dee run_test+0x15d(name=<is not available>) [/home/julliard/wine/wine/dlls/ddraw/tests/../../../include/wine/test.h:556] in ddraw_test (0x0032fe48) 4 0x686a2fe7 main+0x156(argc=<couldn't compute location>, argv=<couldn't compute location>) [/home/julliard/wine/wine/dlls/ddraw/tests/../../../include/wine/test.h:624] in ddraw_test (0x0032fe90) 5 0x686a3b6c __wine_spec_exe_entry+0x7b(peb=0x7ffdf000) [/home/julliard/wine/wine/dlls/winecrt0/exe_entry.c:36] in ddraw_test (0x0032fea8) 6 0x7b85521c call_process_entry+0xb() in kernel32 (0x0032fee8) 7 0x7b85766b start_process+0x5a(peb=0x7ffdf000) [/home/julliard/wine/wine/dlls/kernel32/process.c:996] in kernel32 (0x0032fef8) 8 0x7bc72370 call_thread_func+0xb() in ntdll (0x0032ffc8) 9 0x7bc72540 call_thread_entry_point+0x6f(entry=0x7b857610, arg=0x7ffdf000) [/home/julliard/wine/wine/dlls/ntdll/signal_i386.c:2473] in ntdll (0x0032ffe8) 10 0x7bc4d8ca start_process+0x29(kernel_start=0x7b857610) [/home/julliard/wine/wine/dlls/ntdll/loader.c:2612] in ntdll (0x00000000) 0x686daffd IDirect3DDeviceImpl_7_Release+0x25d [/home/julliard/wine/wine/dlls/ddraw/device.c:422] in ddraw: movl $0x0,0x68(%edx) 422 m->Handle = 0;
Oh, I see what happens there. IDirect3DImpl_7_CreateDevice() doesn't zero it's fields during creation. I'll send a patch to have ddraw_handle_table_init() do explicitly itself tomorrow.