Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/ddraw/device.c | 12 ++++++------ dlls/ddraw/tests/ddraw1.c | 1 - dlls/ddraw/tests/ddraw2.c | 1 - dlls/ddraw/tests/ddraw4.c | 1 - dlls/ddraw/tests/ddraw7.c | 1 - 5 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index e4822e5d29e..1ea28709e9d 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -7007,6 +7007,12 @@ static HRESULT d3d_device_init(struct d3d_device *device, struct ddraw *ddraw, c device->hardware_device = IsEqualGUID(&IID_IDirect3DTnLHalDevice, guid) || IsEqualGUID(&IID_IDirect3DHALDevice, guid);
+ if (device->hardware_device && !(target->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)) + { + WARN("Surface %p is not in video memory.\n", target); + return D3DERR_SURFACENOTINVIDMEM; + } + if (outer_unknown) device->outer_unknown = outer_unknown; else @@ -7094,12 +7100,6 @@ HRESULT d3d_device_create(struct ddraw *ddraw, const GUID *guid, struct ddraw_su return DDERR_OUTOFMEMORY; }
- if (!(target->surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY)) - { - WARN("Surface %p is not in video memory.\n", target); - return D3DERR_SURFACENOTINVIDMEM; - } - if (ddraw->d3ddevice) { FIXME("Only one Direct3D device per DirectDraw object supported.\n"); diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 36507749eca..5f450c60708 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -4578,7 +4578,6 @@ static void test_rt_caps(const GUID *device_guid) }
hr = IDirectDrawSurface_QueryInterface(surface, device_guid, (void **)&device); - todo_wine_if(software_device && test_data[i].create_device_hr == D3DERR_SURFACENOTINVIDMEM) ok((!software_device && hr == test_data[i].create_device_hr) || (software_device && (hr == (test_data[i].create_device_hr == D3DERR_SURFACENOTINVIDMEM ? DD_OK : test_data[i].create_device_hr))), diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 4a7a9cbfe1d..449f6977acf 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -5052,7 +5052,6 @@ static void test_rt_caps(const GUID *device_guid)
hr = IDirect3D2_CreateDevice(d3d, device_guid, surface, &device);
- todo_wine_if(software_device && test_data[i].create_device_hr == D3DERR_SURFACENOTINVIDMEM) ok((!software_device && hr == test_data[i].create_device_hr) || (software_device && (hr == (test_data[i].create_device_hr == D3DERR_SURFACENOTINVIDMEM ? DD_OK : test_data[i].create_device_hr))), diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 745b479e487..1df25e47782 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -6704,7 +6704,6 @@ static void test_rt_caps(const GUID *device_guid)
hr = IDirect3D3_CreateDevice(d3d, device_guid, surface, &device, NULL);
- todo_wine_if(software_device && test_data[i].create_device_hr == D3DERR_SURFACENOTINVIDMEM) ok((!software_device && hr == test_data[i].create_device_hr) || (software_device && (hr == (test_data[i].create_device_hr == D3DERR_SURFACENOTINVIDMEM ? DD_OK : test_data[i].create_device_hr))), diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index da19545b422..0e7724c34f4 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -6433,7 +6433,6 @@ static void test_rt_caps(const GUID *device_guid) surface_desc.ddsCaps.dwCaps2, test_data[i].caps2_out, i, software_device);
hr = IDirect3D7_CreateDevice(d3d, device_guid, surface, &device); - todo_wine_if(software_device && test_data[i].create_device_hr == D3DERR_SURFACENOTINVIDMEM) ok((!software_device && hr == test_data[i].create_device_hr) || (software_device && (hr == (test_data[i].create_device_hr == D3DERR_SURFACENOTINVIDMEM ? DD_OK : test_data[i].create_device_hr))),