ddraw: Properly set DDCAPS.ddsOldCaps in ddraw7_GetCaps().

Signed-off-by: David Adam <david.adam.cnrs@gmail.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Muller 2019-06-10 23:36:22 +04:30 committed by Alexandre Julliard
parent 5afcbaa30f
commit 50dfd232a4
5 changed files with 105 additions and 0 deletions

View File

@ -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);

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}