Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/ddraw/tests/ddraw1.c | 99 +++++++++++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw2.c | 106 ++++++++++++++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw4.c | 106 ++++++++++++++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw7.c | 99 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 410 insertions(+)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 449f0c6ec87..9bba97eb455 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -12890,9 +12890,44 @@ static void test_clipper_refcount(void)
static void test_caps(void) { + DWORD caps_never, caps_always, caps_hal; DDCAPS hal_caps, hel_caps; IDirectDraw *ddraw; HRESULT hr; + BOOL no3d; + + caps_never = DDSCAPS_RESERVED1 + | DDSCAPS_ALPHA + | DDSCAPS_PRIMARYSURFACELEFT + | DDSCAPS_SYSTEMMEMORY + | DDSCAPS_VISIBLE + | DDSCAPS_WRITEONLY + | DDSCAPS_LIVEVIDEO + | DDSCAPS_HWCODEC + | DDSCAPS_MODEX + | DDSCAPS_RESERVED2 + | 0x01000000u + | 0x02000000u + | DDSCAPS_ALLOCONLOAD + | DDSCAPS_VIDEOPORT + | DDSCAPS_STANDARDVGAMODE + | DDSCAPS_OPTIMIZED; + + caps_always = DDSCAPS_FLIP + | DDSCAPS_OFFSCREENPLAIN + | DDSCAPS_PRIMARYSURFACE + | DDSCAPS_TEXTURE + | DDSCAPS_ZBUFFER + | DDSCAPS_MIPMAP; + + caps_hal = DDSCAPS_BACKBUFFER + | DDSCAPS_COMPLEX + | DDSCAPS_FRONTBUFFER + | DDSCAPS_3DDEVICE + | DDSCAPS_VIDEOMEMORY + | DDSCAPS_OWNDC + | DDSCAPS_LOCALVIDMEM + | DDSCAPS_NONLOCALVIDMEM;
ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); @@ -12910,6 +12945,70 @@ static void test_caps(void) "Got unexpected caps %#x, expected %#x.\n", hel_caps.ddsOldCaps.dwCaps, hel_caps.ddsCaps.dwCaps);
+ no3d = !(hal_caps.ddsCaps.dwCaps & DDSCAPS_3DDEVICE); + if (hal_caps.ddsCaps.dwCaps) + { + todo_wine ok(!(hal_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine_if(no3d) ok(!(~hal_caps.ddsCaps.dwCaps & caps_always), + "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine ok(!(~hal_caps.ddsCaps.dwCaps & caps_hal), "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + } + todo_wine ok(!(hel_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + todo_wine_if(no3d) ok(!(~hel_caps.ddsCaps.dwCaps & caps_always), + "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + todo_wine ok(!(hel_caps.ddsCaps.dwCaps & caps_hal), "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + + IDirectDraw_Release(ddraw); + + if (hal_caps.ddsCaps.dwCaps) + { + hr = DirectDrawCreate((GUID *)DDCREATE_HARDWAREONLY, &ddraw, NULL); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + + 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); + + todo_wine ok(!(hal_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine_if(no3d) ok(!(~hal_caps.ddsCaps.dwCaps & caps_always), + "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine ok(!(~hal_caps.ddsCaps.dwCaps & caps_hal), "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine ok(!hel_caps.ddsCaps.dwCaps, "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + + IDirectDraw_Release(ddraw); + } + + hr = DirectDrawCreate((GUID *)DDCREATE_EMULATIONONLY, &ddraw, NULL); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + + 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); + + todo_wine ok(!hal_caps.ddsCaps.dwCaps, "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine ok(!(hel_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + todo_wine_if(no3d) ok(!(~hel_caps.ddsCaps.dwCaps & caps_always), + "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + todo_wine ok(!(hel_caps.ddsCaps.dwCaps & caps_hal), "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + IDirectDraw_Release(ddraw); }
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index df99938e430..6ceec6f92c3 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -13766,9 +13766,45 @@ static void test_clipper_refcount(void)
static void test_caps(void) { + DWORD caps_never, caps_always, caps_hal; DDCAPS hal_caps, hel_caps; IDirectDraw2 *ddraw; + IDirectDraw *ddraw1; HRESULT hr; + BOOL no3d; + + caps_never = DDSCAPS_RESERVED1 + | DDSCAPS_ALPHA + | DDSCAPS_PRIMARYSURFACELEFT + | DDSCAPS_SYSTEMMEMORY + | DDSCAPS_VISIBLE + | DDSCAPS_WRITEONLY + | DDSCAPS_LIVEVIDEO + | DDSCAPS_HWCODEC + | DDSCAPS_MODEX + | DDSCAPS_RESERVED2 + | 0x01000000u + | 0x02000000u + | DDSCAPS_ALLOCONLOAD + | DDSCAPS_VIDEOPORT + | DDSCAPS_STANDARDVGAMODE + | DDSCAPS_OPTIMIZED; + + caps_always = DDSCAPS_FLIP + | DDSCAPS_OFFSCREENPLAIN + | DDSCAPS_PRIMARYSURFACE + | DDSCAPS_TEXTURE + | DDSCAPS_ZBUFFER + | DDSCAPS_MIPMAP; + + caps_hal = DDSCAPS_BACKBUFFER + | DDSCAPS_COMPLEX + | DDSCAPS_FRONTBUFFER + | DDSCAPS_3DDEVICE + | DDSCAPS_VIDEOMEMORY + | DDSCAPS_OWNDC + | DDSCAPS_LOCALVIDMEM + | DDSCAPS_NONLOCALVIDMEM;
ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); @@ -13786,6 +13822,76 @@ static void test_caps(void) "Got unexpected caps %#x, expected %#x.\n", hel_caps.ddsOldCaps.dwCaps, hel_caps.ddsCaps.dwCaps);
+ no3d = !(hal_caps.ddsCaps.dwCaps & DDSCAPS_3DDEVICE); + if (hal_caps.ddsCaps.dwCaps) + { + todo_wine ok(!(hal_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine_if(no3d) ok(!(~hal_caps.ddsCaps.dwCaps & caps_always), + "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine ok(!(~hal_caps.ddsCaps.dwCaps & caps_hal), "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + } + todo_wine ok(!(hel_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + todo_wine_if(no3d) ok(!(~hel_caps.ddsCaps.dwCaps & caps_always), + "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + todo_wine ok(!(hel_caps.ddsCaps.dwCaps & caps_hal), "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + + IDirectDraw2_Release(ddraw); + + if (hal_caps.ddsCaps.dwCaps) + { + hr = DirectDrawCreate((GUID *)DDCREATE_HARDWAREONLY, &ddraw1, NULL); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirectDraw_QueryInterface(ddraw1, &IID_IDirectDraw2, (void **)&ddraw); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + IDirectDraw_Release(ddraw1); + + 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); + + todo_wine ok(!(hal_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine_if(no3d) ok(!(~hal_caps.ddsCaps.dwCaps & caps_always), + "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine ok(!(~hal_caps.ddsCaps.dwCaps & caps_hal), "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine ok(!hel_caps.ddsCaps.dwCaps, "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + + IDirectDraw2_Release(ddraw); + } + + hr = DirectDrawCreate((GUID *)DDCREATE_EMULATIONONLY, &ddraw1, NULL); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirectDraw_QueryInterface(ddraw1, &IID_IDirectDraw2, (void **)&ddraw); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + IDirectDraw_Release(ddraw1); + + 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); + + todo_wine ok(!hal_caps.ddsCaps.dwCaps, "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine ok(!(hel_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + todo_wine_if(no3d) ok(!(~hel_caps.ddsCaps.dwCaps & caps_always), + "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + todo_wine ok(!(hel_caps.ddsCaps.dwCaps & caps_hal), "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + IDirectDraw2_Release(ddraw); }
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 75784443a47..d04d09ac783 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -16327,9 +16327,45 @@ static void test_clipper_refcount(void)
static void test_caps(void) { + DWORD caps_never, caps_always, caps_hal; DDCAPS hal_caps, hel_caps; IDirectDraw4 *ddraw; + IDirectDraw *ddraw1; HRESULT hr; + BOOL no3d; + + caps_never = DDSCAPS_RESERVED1 + | DDSCAPS_ALPHA + | DDSCAPS_PRIMARYSURFACELEFT + | DDSCAPS_SYSTEMMEMORY + | DDSCAPS_VISIBLE + | DDSCAPS_WRITEONLY + | DDSCAPS_LIVEVIDEO + | DDSCAPS_HWCODEC + | DDSCAPS_MODEX + | DDSCAPS_RESERVED2 + | 0x01000000u + | 0x02000000u + | DDSCAPS_ALLOCONLOAD + | DDSCAPS_VIDEOPORT + | DDSCAPS_STANDARDVGAMODE + | DDSCAPS_OPTIMIZED; + + caps_always = DDSCAPS_FLIP + | DDSCAPS_OFFSCREENPLAIN + | DDSCAPS_PRIMARYSURFACE + | DDSCAPS_TEXTURE + | DDSCAPS_ZBUFFER + | DDSCAPS_MIPMAP; + + caps_hal = DDSCAPS_BACKBUFFER + | DDSCAPS_COMPLEX + | DDSCAPS_FRONTBUFFER + | DDSCAPS_3DDEVICE + | DDSCAPS_VIDEOMEMORY + | DDSCAPS_OWNDC + | DDSCAPS_LOCALVIDMEM + | DDSCAPS_NONLOCALVIDMEM;
ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); @@ -16347,6 +16383,76 @@ static void test_caps(void) "Got unexpected caps %#x, expected %#x.\n", hel_caps.ddsOldCaps.dwCaps, hel_caps.ddsCaps.dwCaps);
+ no3d = !(hal_caps.ddsCaps.dwCaps & DDSCAPS_3DDEVICE); + if (hal_caps.ddsCaps.dwCaps) + { + todo_wine ok(!(hal_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine_if(no3d) ok(!(~hal_caps.ddsCaps.dwCaps & caps_always), + "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine ok(!(~hal_caps.ddsCaps.dwCaps & caps_hal), "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + } + todo_wine ok(!(hel_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + todo_wine_if(no3d) ok(!(~hel_caps.ddsCaps.dwCaps & caps_always), + "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + todo_wine ok(!(hel_caps.ddsCaps.dwCaps & caps_hal), "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + + IDirectDraw4_Release(ddraw); + + if (hal_caps.ddsCaps.dwCaps) + { + hr = DirectDrawCreate((GUID *)DDCREATE_HARDWAREONLY, &ddraw1, NULL); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirectDraw_QueryInterface(ddraw1, &IID_IDirectDraw4, (void **)&ddraw); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + IDirectDraw_Release(ddraw1); + + 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); + + todo_wine ok(!(hal_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine_if(no3d) ok(!(~hal_caps.ddsCaps.dwCaps & caps_always), + "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine ok(!(~hal_caps.ddsCaps.dwCaps & caps_hal), "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine ok(!hel_caps.ddsCaps.dwCaps, "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + + IDirectDraw4_Release(ddraw); + } + + hr = DirectDrawCreate((GUID *)DDCREATE_EMULATIONONLY, &ddraw1, NULL); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirectDraw_QueryInterface(ddraw1, &IID_IDirectDraw4, (void **)&ddraw); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + IDirectDraw_Release(ddraw1); + + 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); + + todo_wine ok(!hal_caps.ddsCaps.dwCaps, "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine ok(!(hel_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + todo_wine_if(no3d) ok(!(~hel_caps.ddsCaps.dwCaps & caps_always), + "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + todo_wine ok(!(hel_caps.ddsCaps.dwCaps & caps_hal), "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + IDirectDraw4_Release(ddraw); }
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 99bd9c82f6b..5f7c9d43eb8 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -16300,9 +16300,44 @@ static void test_begin_end_state_block(void)
static void test_caps(void) { + DWORD caps_never, caps_always, caps_hal; DDCAPS hal_caps, hel_caps; IDirectDraw7 *ddraw; HRESULT hr; + BOOL no3d; + + caps_never = DDSCAPS_RESERVED1 + | DDSCAPS_ALPHA + | DDSCAPS_PRIMARYSURFACELEFT + | DDSCAPS_SYSTEMMEMORY + | DDSCAPS_VISIBLE + | DDSCAPS_WRITEONLY + | DDSCAPS_LIVEVIDEO + | DDSCAPS_HWCODEC + | DDSCAPS_MODEX + | DDSCAPS_RESERVED2 + | 0x01000000u + | 0x02000000u + | DDSCAPS_ALLOCONLOAD + | DDSCAPS_VIDEOPORT + | DDSCAPS_STANDARDVGAMODE + | DDSCAPS_OPTIMIZED; + + caps_always = DDSCAPS_FLIP + | DDSCAPS_OFFSCREENPLAIN + | DDSCAPS_PRIMARYSURFACE + | DDSCAPS_TEXTURE + | DDSCAPS_ZBUFFER + | DDSCAPS_MIPMAP; + + caps_hal = DDSCAPS_BACKBUFFER + | DDSCAPS_COMPLEX + | DDSCAPS_FRONTBUFFER + | DDSCAPS_3DDEVICE + | DDSCAPS_VIDEOMEMORY + | DDSCAPS_OWNDC + | DDSCAPS_LOCALVIDMEM + | DDSCAPS_NONLOCALVIDMEM;
ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); @@ -16320,6 +16355,70 @@ static void test_caps(void) "Got unexpected caps %#x, expected %#x.\n", hel_caps.ddsOldCaps.dwCaps, hel_caps.ddsCaps.dwCaps);
+ no3d = !(hal_caps.ddsCaps.dwCaps & DDSCAPS_3DDEVICE); + if (hal_caps.ddsCaps.dwCaps) + { + todo_wine ok(!(hal_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine_if(no3d) ok(!(~hal_caps.ddsCaps.dwCaps & caps_always), + "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine ok(!(~hal_caps.ddsCaps.dwCaps & caps_hal), "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + } + todo_wine ok(!(hel_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + todo_wine_if(no3d) ok(!(~hel_caps.ddsCaps.dwCaps & caps_always), + "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + todo_wine ok(!(hel_caps.ddsCaps.dwCaps & caps_hal), "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + + IDirectDraw7_Release(ddraw); + + if (hal_caps.ddsCaps.dwCaps) + { + hr = pDirectDrawCreateEx((GUID *)DDCREATE_HARDWAREONLY, (void **)&ddraw, &IID_IDirectDraw7, NULL); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + + 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); + + todo_wine ok(!(hal_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine_if(no3d) ok(!(~hal_caps.ddsCaps.dwCaps & caps_always), + "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine ok(!(~hal_caps.ddsCaps.dwCaps & caps_hal), "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine ok(!hel_caps.ddsCaps.dwCaps, "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + + IDirectDraw7_Release(ddraw); + } + + hr = pDirectDrawCreateEx((GUID *)DDCREATE_EMULATIONONLY, (void **)&ddraw, &IID_IDirectDraw7, NULL); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + + 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); + + todo_wine ok(!hal_caps.ddsCaps.dwCaps, "Got unexpected caps %#x.\n", hal_caps.ddsCaps.dwCaps); + todo_wine ok(!(hel_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + todo_wine_if(no3d) ok(!(~hel_caps.ddsCaps.dwCaps & caps_always), + "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + todo_wine ok(!(hel_caps.ddsCaps.dwCaps & caps_hal), "Got unexpected caps %#x.\n", hel_caps.ddsCaps.dwCaps); + IDirectDraw7_Release(ddraw); }