[PATCH 3/3] ddraw: Implement DDENUMSURFACES_CANBECREATED.
Zebediah Figura
z.figura12 at gmail.com
Sat May 2 21:45:53 CDT 2020
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=17233
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
dlls/ddraw/ddraw.c | 137 ++++++++++++++++++++++++++++++--------
dlls/ddraw/tests/ddraw1.c | 16 ++---
dlls/ddraw/tests/ddraw2.c | 16 ++---
dlls/ddraw/tests/ddraw4.c | 16 ++---
dlls/ddraw/tests/ddraw7.c | 16 ++---
5 files changed, 142 insertions(+), 59 deletions(-)
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index afd2875ea21..866b7089080 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -3174,6 +3174,9 @@ static HRESULT CALLBACK EnumSurfacesCallback2Thunk(IDirectDrawSurface7 *surface,
struct ddraw_surface *surface_impl = impl_from_IDirectDrawSurface7(surface);
struct surfacescallback2_context *cbcontext = context;
+ if (!surface)
+ return cbcontext->func(NULL, surface_desc, cbcontext->context);
+
IDirectDrawSurface4_AddRef(&surface_impl->IDirectDrawSurface4_iface);
IDirectDrawSurface7_Release(surface);
@@ -3187,6 +3190,9 @@ static HRESULT CALLBACK EnumSurfacesCallbackThunk(IDirectDrawSurface7 *surface,
struct ddraw_surface *surface_impl = impl_from_IDirectDrawSurface7(surface);
struct surfacescallback_context *cbcontext = context;
+ if (!surface)
+ return cbcontext->func(NULL, (DDSURFACEDESC *)surface_desc, cbcontext->context);
+
IDirectDrawSurface_AddRef(&surface_impl->IDirectDrawSurface_iface);
IDirectDrawSurface7_Release(surface);
@@ -3194,6 +3200,34 @@ static HRESULT CALLBACK EnumSurfacesCallbackThunk(IDirectDrawSurface7 *surface,
(DDSURFACEDESC *)surface_desc, cbcontext->context);
}
+struct enum_surface_mode_params
+{
+ IDirectDraw7 *ddraw;
+ const DDSURFACEDESC2 *desc;
+ LPDDENUMSURFACESCALLBACK7 callback;
+ void *context;
+};
+
+static HRESULT CALLBACK enum_surface_mode_callback(DDSURFACEDESC2 *surface_desc, void *context)
+{
+ const struct enum_surface_mode_params *params = context;
+ DDSURFACEDESC2 desc = *params->desc;
+ IDirectDrawSurface7 *surface;
+
+ desc.dwFlags |= DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH | DDSD_PIXELFORMAT;
+ desc.dwWidth = surface_desc->dwWidth;
+ desc.dwHeight = surface_desc->dwHeight;
+ desc.u1.lPitch = surface_desc->u1.lPitch;
+ desc.u4.ddpfPixelFormat = surface_desc->u4.ddpfPixelFormat;
+
+ if (SUCCEEDED(ddraw7_CreateSurface(params->ddraw, &desc, &surface, NULL)))
+ {
+ IDirectDrawSurface7_Release(surface);
+ return params->callback(NULL, &desc, params->context);
+ }
+ return DDENUMRET_OK;
+}
+
/*****************************************************************************
* IDirectDraw7::EnumSurfaces
*
@@ -3214,52 +3248,101 @@ static HRESULT CALLBACK EnumSurfacesCallbackThunk(IDirectDrawSurface7 *surface,
*
*****************************************************************************/
static HRESULT WINAPI ddraw7_EnumSurfaces(IDirectDraw7 *iface, DWORD flags,
- DDSURFACEDESC2 *DDSD, void *Context, LPDDENUMSURFACESCALLBACK7 Callback)
+ DDSURFACEDESC2 *surface_desc, void *context, LPDDENUMSURFACESCALLBACK7 callback)
{
struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
- struct ddraw_surface *surf;
- BOOL all, nomatch;
- DDSURFACEDESC2 desc;
- struct list *entry, *entry2;
+ HRESULT hr = DD_OK;
TRACE("iface %p, flags %#x, surface_desc %p, context %p, callback %p.\n",
- iface, flags, DDSD, Context, Callback);
-
- all = flags & DDENUMSURFACES_ALL;
- nomatch = !!(flags & DDENUMSURFACES_NOMATCH);
+ iface, flags, surface_desc, context, callback);
- if (!Callback)
+ if (!callback)
return DDERR_INVALIDPARAMS;
- wined3d_mutex_lock();
-
- /* Use the _SAFE enumeration, the app may destroy enumerated surfaces */
- LIST_FOR_EACH_SAFE(entry, entry2, &ddraw->surface_list)
+ if (flags & DDENUMSURFACES_CANBECREATED)
{
- surf = LIST_ENTRY(entry, struct ddraw_surface, surface_list_entry);
+ IDirectDrawSurface7 *surface;
+
+ if ((flags & (DDENUMSURFACES_ALL | DDENUMSURFACES_MATCH | DDENUMSURFACES_NOMATCH)) != DDENUMSURFACES_MATCH)
+ return DDERR_INVALIDPARAMS;
- if (!surf->iface_count)
+ wined3d_mutex_lock();
+
+ if (surface_desc->dwFlags & (DDSD_WIDTH | DDSD_HEIGHT))
{
- WARN("Not enumerating surface %p because it doesn't have any references.\n", surf);
- continue;
+ if (SUCCEEDED(ddraw7_CreateSurface(iface, surface_desc, &surface, NULL)))
+ {
+ struct ddraw_surface *surface_impl = impl_from_IDirectDrawSurface7(surface);
+ callback(NULL, &surface_impl->surface_desc, context);
+ IDirectDrawSurface7_Release(surface);
+ }
}
-
- if (all || (nomatch != ddraw_match_surface_desc(DDSD, &surf->surface_desc)))
+ else
{
- TRACE("Enumerating surface %p.\n", surf);
- desc = surf->surface_desc;
- IDirectDrawSurface7_AddRef(&surf->IDirectDrawSurface7_iface);
- if (Callback(&surf->IDirectDrawSurface7_iface, &desc, Context) != DDENUMRET_OK)
+ DDSURFACEDESC2 desc =
{
+ .dwSize = sizeof(desc),
+ .dwFlags = DDSD_PIXELFORMAT,
+ .u4.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT),
+ };
+ struct enum_surface_mode_params params =
+ {
+ .ddraw = iface,
+ .desc = surface_desc,
+ .callback = callback,
+ .context = context,
+ };
+ struct wined3d_display_mode mode;
+
+ if (FAILED(hr = wined3d_output_get_display_mode(ddraw->wined3d_output, &mode, NULL)))
+ {
+ ERR("Failed to get display mode, hr %#x.\n", hr);
wined3d_mutex_unlock();
- return DD_OK;
+ return hr_ddraw_from_wined3d(hr);
}
+
+ ddrawformat_from_wined3dformat(&desc.u4.ddpfPixelFormat, mode.format_id);
+ hr = ddraw7_EnumDisplayModes(iface, 0, &desc, ¶ms, enum_surface_mode_callback);
}
+
+ wined3d_mutex_unlock();
}
+ else if (flags & DDENUMSURFACES_DOESEXIST)
+ {
+ struct ddraw_surface *surface, *cursor;
+ BOOL nomatch = !!(flags & DDENUMSURFACES_NOMATCH);
- wined3d_mutex_unlock();
+ wined3d_mutex_lock();
- return DD_OK;
+ /* Use the safe enumeration, as the callback may destroy surfaces. */
+ LIST_FOR_EACH_ENTRY_SAFE(surface, cursor, &ddraw->surface_list, struct ddraw_surface, surface_list_entry)
+ {
+ if (!surface->iface_count)
+ {
+ WARN("Not enumerating surface %p because it doesn't have any references.\n", surface);
+ continue;
+ }
+
+ if ((flags & DDENUMSURFACES_ALL)
+ || nomatch != ddraw_match_surface_desc(surface_desc, &surface->surface_desc))
+ {
+ DDSURFACEDESC2 desc = surface->surface_desc;
+
+ TRACE("Enumerating surface %p.\n", surface);
+ IDirectDrawSurface7_AddRef(&surface->IDirectDrawSurface7_iface);
+ if (callback(&surface->IDirectDrawSurface7_iface, &desc, context) != DDENUMRET_OK)
+ break;
+ }
+ }
+
+ wined3d_mutex_unlock();
+ }
+ else
+ {
+ return DDERR_INVALIDPARAMS;
+ }
+
+ return hr;
}
static HRESULT WINAPI ddraw4_EnumSurfaces(IDirectDraw4 *iface, DWORD flags,
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index 4e620b4a905..fe0042a5f0c 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -12179,11 +12179,11 @@ static void test_enum_surfaces(void)
ok(hr == DD_OK, "Failed to set cooperative level, hr %#x.\n", hr);
hr = IDirectDraw_EnumSurfaces(ddraw, DDENUMSURFACES_ALL, NULL, NULL, enum_surfaces_cb);
- todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
+ ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
hr = IDirectDraw_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_ALL,
NULL, NULL, enum_surfaces_cb);
- todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
+ ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
memset(&desc, 0, sizeof(desc));
desc.dwSize = sizeof(desc);
@@ -12258,15 +12258,15 @@ static void test_enum_surfaces(void)
hr = IDirectDraw_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_ALL,
&desc, ¶m, enum_surfaces_create_cb);
- todo_wine ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
+ ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
hr = IDirectDraw_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_NOMATCH,
&desc, ¶m, enum_surfaces_create_cb);
- todo_wine ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
+ ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
hr = IDirectDraw_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED,
&desc, ¶m, enum_surfaces_create_cb);
- todo_wine ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
+ ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
/* When not passed width and height, the callback is called with every
* available display resolution. */
@@ -12282,7 +12282,7 @@ static void test_enum_surfaces(void)
hr = IDirectDraw_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_MATCH,
&desc, ¶m, enum_surfaces_create_cb);
ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#x.\n", hr);
- todo_wine ok(param.count == param.modes.count, "Expected %u surfaces, got %u.\n", param.modes.count, param.count);
+ ok(param.count == param.modes.count, "Expected %u surfaces, got %u.\n", param.modes.count, param.count);
desc.dwFlags |= DDSD_WIDTH | DDSD_HEIGHT;
desc.dwWidth = desc.dwHeight = 32;
@@ -12293,7 +12293,7 @@ static void test_enum_surfaces(void)
hr = IDirectDraw_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_MATCH,
&desc, ¶m, enum_surfaces_create_cb);
ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#x.\n", hr);
- todo_wine ok(param.count == 1, "Got unexpected number of enumerated surfaces %u.\n", param.count);
+ ok(param.count == 1, "Got unexpected number of enumerated surfaces %u.\n", param.count);
hr = IDirectDraw_CreateSurface(ddraw, &desc, ¶m.surfaces[0], NULL);
ok(hr == DD_OK, "Failed to create surface, hr %#x.\n", hr);
@@ -12301,7 +12301,7 @@ static void test_enum_surfaces(void)
hr = IDirectDraw_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_MATCH,
&desc, ¶m, enum_surfaces_create_cb);
ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#x.\n", hr);
- todo_wine ok(param.count == 1, "Got unexpected number of enumerated surfaces %u.\n", param.count);
+ ok(param.count == 1, "Got unexpected number of enumerated surfaces %u.\n", param.count);
IDirectDrawSurface_Release(param.surfaces[0]);
desc.dwFlags |= DDSD_PIXELFORMAT;
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index 3172948d335..87ce9203cca 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -13155,11 +13155,11 @@ static void test_enum_surfaces(void)
ok(hr == DD_OK, "Failed to set cooperative level, hr %#x.\n", hr);
hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_ALL, NULL, NULL, enum_surfaces_cb);
- todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
+ ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_ALL,
NULL, NULL, enum_surfaces_cb);
- todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
+ ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
memset(&desc, 0, sizeof(desc));
desc.dwSize = sizeof(desc);
@@ -13234,15 +13234,15 @@ static void test_enum_surfaces(void)
hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_ALL,
&desc, ¶m, enum_surfaces_create_cb);
- todo_wine ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
+ ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_NOMATCH,
&desc, ¶m, enum_surfaces_create_cb);
- todo_wine ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
+ ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED,
&desc, ¶m, enum_surfaces_create_cb);
- todo_wine ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
+ ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
/* When not passed width and height, the callback is called with every
* available display resolution. */
@@ -13258,7 +13258,7 @@ static void test_enum_surfaces(void)
hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_MATCH,
&desc, ¶m, enum_surfaces_create_cb);
ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#x.\n", hr);
- todo_wine ok(param.count == param.modes.count, "Expected %u surfaces, got %u.\n", param.modes.count, param.count);
+ ok(param.count == param.modes.count, "Expected %u surfaces, got %u.\n", param.modes.count, param.count);
desc.dwFlags |= DDSD_WIDTH | DDSD_HEIGHT;
desc.dwWidth = desc.dwHeight = 32;
@@ -13269,7 +13269,7 @@ static void test_enum_surfaces(void)
hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_MATCH,
&desc, ¶m, enum_surfaces_create_cb);
ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#x.\n", hr);
- todo_wine ok(param.count == 1, "Got unexpected number of enumerated surfaces %u.\n", param.count);
+ ok(param.count == 1, "Got unexpected number of enumerated surfaces %u.\n", param.count);
hr = IDirectDraw2_CreateSurface(ddraw, &desc, ¶m.surfaces[0], NULL);
ok(hr == DD_OK, "Failed to create surface, hr %#x.\n", hr);
@@ -13277,7 +13277,7 @@ static void test_enum_surfaces(void)
hr = IDirectDraw2_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_MATCH,
&desc, ¶m, enum_surfaces_create_cb);
ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#x.\n", hr);
- todo_wine ok(param.count == 1, "Got unexpected number of enumerated surfaces %u.\n", param.count);
+ ok(param.count == 1, "Got unexpected number of enumerated surfaces %u.\n", param.count);
IDirectDrawSurface2_Release(param.surfaces[0]);
desc.dwFlags |= DDSD_PIXELFORMAT;
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index fb14f281e20..2a58bf098c8 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -15743,11 +15743,11 @@ static void test_enum_surfaces(void)
ok(hr == DD_OK, "Failed to set cooperative level, hr %#x.\n", hr);
hr = IDirectDraw4_EnumSurfaces(ddraw, DDENUMSURFACES_ALL, NULL, NULL, enum_surfaces_cb);
- todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
+ ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
hr = IDirectDraw4_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_ALL,
NULL, NULL, enum_surfaces_cb);
- todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
+ ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
memset(&desc, 0, sizeof(desc));
desc.dwSize = sizeof(desc);
@@ -15822,15 +15822,15 @@ static void test_enum_surfaces(void)
hr = IDirectDraw4_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_ALL,
&desc, ¶m, enum_surfaces_create_cb);
- todo_wine ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
+ ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
hr = IDirectDraw4_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_NOMATCH,
&desc, ¶m, enum_surfaces_create_cb);
- todo_wine ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
+ ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
hr = IDirectDraw4_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED,
&desc, ¶m, enum_surfaces_create_cb);
- todo_wine ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
+ ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
/* When not passed width and height, the callback is called with every
* available display resolution. */
@@ -15846,7 +15846,7 @@ static void test_enum_surfaces(void)
hr = IDirectDraw4_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_MATCH,
&desc, ¶m, enum_surfaces_create_cb);
ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#x.\n", hr);
- todo_wine ok(param.count == param.modes.count, "Expected %u surfaces, got %u.\n", param.modes.count, param.count);
+ ok(param.count == param.modes.count, "Expected %u surfaces, got %u.\n", param.modes.count, param.count);
desc.dwFlags |= DDSD_WIDTH | DDSD_HEIGHT;
desc.dwWidth = desc.dwHeight = 32;
@@ -15857,7 +15857,7 @@ static void test_enum_surfaces(void)
hr = IDirectDraw4_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_MATCH,
&desc, ¶m, enum_surfaces_create_cb);
ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#x.\n", hr);
- todo_wine ok(param.count == 1, "Got unexpected number of enumerated surfaces %u.\n", param.count);
+ ok(param.count == 1, "Got unexpected number of enumerated surfaces %u.\n", param.count);
hr = IDirectDraw4_CreateSurface(ddraw, &desc, ¶m.surfaces[0], NULL);
ok(hr == DD_OK, "Failed to create surface, hr %#x.\n", hr);
@@ -15865,7 +15865,7 @@ static void test_enum_surfaces(void)
hr = IDirectDraw4_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_MATCH,
&desc, ¶m, enum_surfaces_create_cb);
ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#x.\n", hr);
- todo_wine ok(param.count == 1, "Got unexpected number of enumerated surfaces %u.\n", param.count);
+ ok(param.count == 1, "Got unexpected number of enumerated surfaces %u.\n", param.count);
IDirectDrawSurface4_Release(param.surfaces[0]);
desc.dwFlags |= DDSD_PIXELFORMAT;
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index 459869ad869..511af4c6abd 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -15149,11 +15149,11 @@ static void test_enum_surfaces(void)
ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
hr = IDirectDraw7_EnumSurfaces(ddraw, DDENUMSURFACES_ALL, NULL, NULL, enum_surfaces_cb);
- todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
+ ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
hr = IDirectDraw7_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_ALL,
NULL, NULL, enum_surfaces_cb);
- todo_wine ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
+ ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr);
memset(&desc, 0, sizeof(desc));
desc.dwSize = sizeof(desc);
@@ -15232,15 +15232,15 @@ static void test_enum_surfaces(void)
hr = IDirectDraw7_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_ALL,
&desc, ¶m, enum_surfaces_create_cb);
- todo_wine ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
+ ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
hr = IDirectDraw7_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_NOMATCH,
&desc, ¶m, enum_surfaces_create_cb);
- todo_wine ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
+ ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
hr = IDirectDraw7_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED,
&desc, ¶m, enum_surfaces_create_cb);
- todo_wine ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
+ ok(hr == DDERR_INVALIDPARAMS, "Failed to enumerate surfaces, hr %#x.\n", hr);
/* When not passed width and height, the callback is called with every
* available display resolution. */
@@ -15256,7 +15256,7 @@ static void test_enum_surfaces(void)
hr = IDirectDraw7_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_MATCH,
&desc, ¶m, enum_surfaces_create_cb);
ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#x.\n", hr);
- todo_wine ok(param.count == param.modes.count, "Expected %u surfaces, got %u.\n", param.modes.count, param.count);
+ ok(param.count == param.modes.count, "Expected %u surfaces, got %u.\n", param.modes.count, param.count);
desc.dwFlags |= DDSD_WIDTH | DDSD_HEIGHT;
desc.dwWidth = desc.dwHeight = 32;
@@ -15267,7 +15267,7 @@ static void test_enum_surfaces(void)
hr = IDirectDraw7_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_MATCH,
&desc, ¶m, enum_surfaces_create_cb);
ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#x.\n", hr);
- todo_wine ok(param.count == 1, "Got unexpected number of enumerated surfaces %u.\n", param.count);
+ ok(param.count == 1, "Got unexpected number of enumerated surfaces %u.\n", param.count);
hr = IDirectDraw7_CreateSurface(ddraw, &desc, ¶m.surfaces[0], NULL);
ok(hr == DD_OK, "Failed to create surface, hr %#x.\n", hr);
@@ -15275,7 +15275,7 @@ static void test_enum_surfaces(void)
hr = IDirectDraw7_EnumSurfaces(ddraw, DDENUMSURFACES_CANBECREATED | DDENUMSURFACES_DOESEXIST | DDENUMSURFACES_MATCH,
&desc, ¶m, enum_surfaces_create_cb);
ok(hr == DD_OK, "Failed to enumerate surfaces, hr %#x.\n", hr);
- todo_wine ok(param.count == 1, "Got unexpected number of enumerated surfaces %u.\n", param.count);
+ ok(param.count == 1, "Got unexpected number of enumerated surfaces %u.\n", param.count);
IDirectDrawSurface7_Release(param.surfaces[0]);
desc.dwFlags |= DDSD_PIXELFORMAT;
--
2.26.2
More information about the wine-devel
mailing list