Fixes Escape of Monkey Islands crashing on start with two monitors (it enumerates too many devices and accesses something out of bound, while better caps let it filter out unneeded devices).
From: Paul Gofman pgofman@codeweavers.com
--- dlls/ddraw/ddraw.c | 6 +++--- dlls/ddraw/tests/ddraw1.c | 4 ++++ dlls/ddraw/tests/ddraw2.c | 4 ++++ dlls/ddraw/tests/ddraw4.c | 4 ++++ dlls/ddraw/tests/ddraw7.c | 2 ++ 5 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index fd4c5bd4862..7d9d25e62c7 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -73,7 +73,7 @@ static struct enum_device_entry "WINE Direct3D7 RGB Software Emulation using WineD3D", "Wine D3D7 RGB", &IID_IDirect3DRGBDevice, - D3DDEVCAPS_HWTRANSFORMANDLIGHT | D3DDEVCAPS_DRAWPRIMITIVES2EX, + D3DDEVCAPS_HWTRANSFORMANDLIGHT | D3DDEVCAPS_DRAWPRIMITIVES2EX | D3DDEVCAPS_HWRASTERIZATION, }, };
@@ -3883,8 +3883,8 @@ static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBA /* RGB, RAMP and MMX devices cannot report HAL hardware flags */ hal_desc.dwFlags = 0; /* RGB, REF, RAMP and MMX devices don't report hardware transform and lighting capability */ - hal_desc.dwDevCaps &= ~(D3DDEVCAPS_HWTRANSFORMANDLIGHT | D3DDEVCAPS_DRAWPRIMITIVES2EX); - hel_desc.dwDevCaps &= ~(D3DDEVCAPS_HWTRANSFORMANDLIGHT | D3DDEVCAPS_DRAWPRIMITIVES2EX); + hal_desc.dwDevCaps &= ~(D3DDEVCAPS_HWTRANSFORMANDLIGHT | D3DDEVCAPS_DRAWPRIMITIVES2EX | D3DDEVCAPS_HWRASTERIZATION); + hel_desc.dwDevCaps &= ~(D3DDEVCAPS_HWTRANSFORMANDLIGHT | D3DDEVCAPS_DRAWPRIMITIVES2EX | D3DDEVCAPS_HWRASTERIZATION);
hr = callback((GUID *)&IID_IDirect3DRGBDevice, reference_description, device_name, &hal_desc, &hel_desc, context); diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 3d81c590a3a..5e10db15860 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -15215,6 +15215,10 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d "RGB Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, "RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + ok((hal->dwDevCaps & D3DDEVCAPS_HWRASTERIZATION) == 0, + "RGB Device hal device caps has D3DDEVCAPS_HWRASTERIZATION set\n"); + ok((hel->dwDevCaps & D3DDEVCAPS_HWRASTERIZATION) == 0, + "RGB Device hel device caps has D3DDEVCAPS_HWRASTERIZATION set\n"); } else if(IsEqualGUID(&IID_IDirect3DHALDevice, guid)) { diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index f4079b1e5e5..84f0b82bb96 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -16161,6 +16161,10 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d "RGB Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, "RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + ok((hal->dwDevCaps & D3DDEVCAPS_HWRASTERIZATION) == 0, + "RGB Device hal device caps has D3DDEVCAPS_HWRASTERIZATION set\n"); + ok((hel->dwDevCaps & D3DDEVCAPS_HWRASTERIZATION) == 0, + "RGB Device hel device caps has D3DDEVCAPS_HWRASTERIZATION set\n"); } else if(IsEqualGUID(&IID_IDirect3DHALDevice, guid)) { diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index ff38483faf9..02591afc079 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -19230,6 +19230,10 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d "RGB Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, "RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + ok((hal->dwDevCaps & D3DDEVCAPS_HWRASTERIZATION) == 0, + "RGB Device hal device caps has D3DDEVCAPS_HWRASTERIZATION set\n"); + ok((hel->dwDevCaps & D3DDEVCAPS_HWRASTERIZATION) == 0, + "RGB Device hel device caps has D3DDEVCAPS_HWRASTERIZATION set\n"); } else if(IsEqualGUID(&IID_IDirect3DHALDevice, guid)) { diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 8631f824edd..75bc08b0437 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -19446,6 +19446,8 @@ static HRESULT WINAPI test_enum_devices_caps_callback(char *device_desc, char *d "RGB Device device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n"); ok((device_desc7->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0, "RGB Device device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n"); + ok((device_desc7->dwDevCaps & D3DDEVCAPS_HWRASTERIZATION) == 0, + "RGB Device device caps has D3DDEVCAPS_HWRASTERIZATION set\n"); } else {
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=128689
Your paranoid android.
=== w10pro64 (32 bit report) ===
ddraw: ddraw1.c:13629: Test failed: WM_KILLFOCUS was not received. ddraw1.c:13665: Test failed: Got unexpected hr 0x887600e1. ddraw1.c:13668: Test failed: Got unexpected hr 0x887600ff. 1c88:ddraw1: unhandled exception c0000005 at 00418050
=== w7u_el (32 bit report) ===
ddraw: ddraw4.c:5983: Test failed: Expected WM_ACTIVATEAPP, but did not receive it.
=== w1064v1507 (32 bit report) ===
ddraw: ddraw7.c:18971: Test failed: Got unexpected color 0x0000ff00.
=== w10pro64 (32 bit report) ===
ddraw: ddraw7.c:17115: Test failed: WM_KILLFOCUS was not received. ddraw7.c:17277: Test failed: Got unexpected hr 0x887600e1. ddraw7.c:17280: Test failed: Got unexpected hr 0x887600ff. 0ec4:ddraw7: unhandled exception c0000005 at 0050879A
This merge request was approved by Zebediah Figura.