From: Michael Muller michael@fds-team.de
Signed-off-by: David Adam david.adam.cnrs@gmail.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/ddraw/ddraw.c | 2 ++ dlls/ddraw/tests/ddraw1.c | 26 ++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw2.c | 25 +++++++++++++++++++++++++ dlls/ddraw/tests/ddraw4.c | 26 ++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw7.c | 26 ++++++++++++++++++++++++++ 5 files changed, 105 insertions(+)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 04a94b6978f..8dce5ce8f82 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -1510,6 +1510,8 @@ static HRESULT WINAPI ddraw7_GetCaps(IDirectDraw7 *iface, DDCAPS *DriverCaps, DD caps.dwCaps |= DDCAPS_ALIGNSTRIDE; caps.dwAlignStrideAlign = DDRAW_STRIDE_ALIGNMENT;
+ caps.ddsOldCaps.dwCaps = caps.ddsCaps.dwCaps; + if(DriverCaps) { DD_STRUCT_COPY_BYSIZE(DriverCaps, &caps); diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 68428e29650..860e101159f 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -12874,6 +12874,31 @@ static void test_clipper_refcount(void) DestroyWindow(window); }
+static void test_caps(void) +{ + DDCAPS hal_caps, hel_caps; + IDirectDraw *ddraw; + HRESULT hr; + + ddraw = create_ddraw(); + ok(!!ddraw, "Failed to create a ddraw object.\n"); + + memset(&hal_caps, 0, sizeof(hal_caps)); + memset(&hel_caps, 0, sizeof(hel_caps)); + hal_caps.dwSize = sizeof(hal_caps); + hel_caps.dwSize = sizeof(hel_caps); + hr = IDirectDraw_GetCaps(ddraw, &hal_caps, &hel_caps); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hal_caps.ddsOldCaps.dwCaps == hal_caps.ddsCaps.dwCaps, + "Got unexpected caps %#x, expected %#x.\n", + hal_caps.ddsOldCaps.dwCaps, hal_caps.ddsCaps.dwCaps); + ok(hel_caps.ddsOldCaps.dwCaps == hel_caps.ddsCaps.dwCaps, + "Got unexpected caps %#x, expected %#x.\n", + hel_caps.ddsOldCaps.dwCaps, hel_caps.ddsCaps.dwCaps); + + IDirectDraw_Release(ddraw); +} + START_TEST(ddraw1) { DDDEVICEIDENTIFIER identifier; @@ -12984,4 +13009,5 @@ START_TEST(ddraw1) test_gdi_surface(); test_alphatest(); test_clipper_refcount(); + test_caps(); } diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index d0569493268..2c047a5e1ff 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -13750,6 +13750,30 @@ static void test_clipper_refcount(void) DestroyWindow(window); }
+static void test_caps(void) +{ + DDCAPS hal_caps, hel_caps; + IDirectDraw2 *ddraw; + HRESULT hr; + + ddraw = create_ddraw(); + ok(!!ddraw, "Failed to create a ddraw object.\n"); + + memset(&hal_caps, 0, sizeof(hal_caps)); + memset(&hel_caps, 0, sizeof(hel_caps)); + hal_caps.dwSize = sizeof(hal_caps); + hel_caps.dwSize = sizeof(hel_caps); + hr = IDirectDraw2_GetCaps(ddraw, &hal_caps, &hel_caps); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hal_caps.ddsOldCaps.dwCaps == hal_caps.ddsCaps.dwCaps, + "Got unexpected caps %#x, expected %#x.\n", + hal_caps.ddsOldCaps.dwCaps, hal_caps.ddsCaps.dwCaps); + ok(hel_caps.ddsOldCaps.dwCaps == hel_caps.ddsCaps.dwCaps, + "Got unexpected caps %#x, expected %#x.\n", + hel_caps.ddsOldCaps.dwCaps, hel_caps.ddsCaps.dwCaps); + + IDirectDraw2_Release(ddraw); +}
START_TEST(ddraw2) { @@ -13868,4 +13892,5 @@ START_TEST(ddraw2) test_gdi_surface(); test_alphatest(); test_clipper_refcount(); + test_caps(); } diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 823af434dbb..fa6cca60db4 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -16170,6 +16170,31 @@ static void test_clipper_refcount(void) DestroyWindow(window); }
+static void test_caps(void) +{ + DDCAPS hal_caps, hel_caps; + IDirectDraw4 *ddraw; + HRESULT hr; + + ddraw = create_ddraw(); + ok(!!ddraw, "Failed to create a ddraw object.\n"); + + memset(&hal_caps, 0, sizeof(hal_caps)); + memset(&hel_caps, 0, sizeof(hel_caps)); + hal_caps.dwSize = sizeof(hal_caps); + hel_caps.dwSize = sizeof(hel_caps); + hr = IDirectDraw4_GetCaps(ddraw, &hal_caps, &hel_caps); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hal_caps.ddsOldCaps.dwCaps == hal_caps.ddsCaps.dwCaps, + "Got unexpected caps %#x, expected %#x.\n", + hal_caps.ddsOldCaps.dwCaps, hal_caps.ddsCaps.dwCaps); + ok(hel_caps.ddsOldCaps.dwCaps == hel_caps.ddsCaps.dwCaps, + "Got unexpected caps %#x, expected %#x.\n", + hel_caps.ddsOldCaps.dwCaps, hel_caps.ddsCaps.dwCaps); + + IDirectDraw4_Release(ddraw); +} + START_TEST(ddraw4) { DDDEVICEIDENTIFIER identifier; @@ -16302,4 +16327,5 @@ START_TEST(ddraw4) test_gdi_surface(); test_alphatest(); test_clipper_refcount(); + test_caps(); } diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index e8c36dc39af..b0fc634eef7 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -16264,6 +16264,31 @@ static void test_begin_end_state_block(void) DestroyWindow(window); }
+static void test_caps(void) +{ + DDCAPS hal_caps, hel_caps; + IDirectDraw7 *ddraw; + HRESULT hr; + + ddraw = create_ddraw(); + ok(!!ddraw, "Failed to create a ddraw object.\n"); + + memset(&hal_caps, 0, sizeof(hal_caps)); + memset(&hel_caps, 0, sizeof(hel_caps)); + hal_caps.dwSize = sizeof(hal_caps); + hel_caps.dwSize = sizeof(hel_caps); + hr = IDirectDraw7_GetCaps(ddraw, &hal_caps, &hel_caps); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hal_caps.ddsOldCaps.dwCaps == hal_caps.ddsCaps.dwCaps, + "Got unexpected caps %#x, expected %#x.\n", + hal_caps.ddsOldCaps.dwCaps, hal_caps.ddsCaps.dwCaps); + ok(hel_caps.ddsOldCaps.dwCaps == hel_caps.ddsCaps.dwCaps, + "Got unexpected caps %#x, expected %#x.\n", + hel_caps.ddsOldCaps.dwCaps, hel_caps.ddsCaps.dwCaps); + + IDirectDraw7_Release(ddraw); +} + START_TEST(ddraw7) { DDDEVICEIDENTIFIER2 identifier; @@ -16410,4 +16435,5 @@ START_TEST(ddraw7) test_alphatest(); test_clipper_refcount(); test_begin_end_state_block(); + test_caps(); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=53473
Your paranoid android.
=== w1064v1809 (32 bit report) ===
ddraw: 19bc:ddraw7: unhandled exception c0000005 at 733C40F8