ddraw: Mark surfaces as lost when changing the display mode.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
dfead1bfa8
commit
0885e3f5ae
|
@ -695,6 +695,8 @@ static HRESULT WINAPI ddraw7_RestoreDisplayMode(IDirectDraw7 *iface)
|
||||||
if (SUCCEEDED(hr = wined3d_set_adapter_display_mode(ddraw->wined3d, WINED3DADAPTER_DEFAULT, NULL)))
|
if (SUCCEEDED(hr = wined3d_set_adapter_display_mode(ddraw->wined3d, WINED3DADAPTER_DEFAULT, NULL)))
|
||||||
ddraw->flags &= ~DDRAW_RESTORE_MODE;
|
ddraw->flags &= ~DDRAW_RESTORE_MODE;
|
||||||
|
|
||||||
|
InterlockedCompareExchange(&ddraw->device_state, DDRAW_DEVICE_STATE_NOT_RESTORED, DDRAW_DEVICE_STATE_OK);
|
||||||
|
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
|
@ -1129,6 +1131,8 @@ static HRESULT WINAPI ddraw7_SetDisplayMode(IDirectDraw7 *iface, DWORD width, DW
|
||||||
if (SUCCEEDED(hr = wined3d_set_adapter_display_mode(ddraw->wined3d, WINED3DADAPTER_DEFAULT, &mode)))
|
if (SUCCEEDED(hr = wined3d_set_adapter_display_mode(ddraw->wined3d, WINED3DADAPTER_DEFAULT, &mode)))
|
||||||
ddraw->flags |= DDRAW_RESTORE_MODE;
|
ddraw->flags |= DDRAW_RESTORE_MODE;
|
||||||
|
|
||||||
|
InterlockedCompareExchange(&ddraw->device_state, DDRAW_DEVICE_STATE_NOT_RESTORED, DDRAW_DEVICE_STATE_OK);
|
||||||
|
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
|
|
||||||
switch (hr)
|
switch (hr)
|
||||||
|
|
|
@ -2783,7 +2783,7 @@ static void test_coop_level_mode_set(void)
|
||||||
hr = IDirectDraw_RestoreDisplayMode(ddraw);
|
hr = IDirectDraw_RestoreDisplayMode(ddraw);
|
||||||
ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr);
|
||||||
hr = IDirectDrawSurface_IsLost(primary);
|
hr = IDirectDrawSurface_IsLost(primary);
|
||||||
todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message);
|
ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message);
|
||||||
expect_messages = NULL;
|
expect_messages = NULL;
|
||||||
|
@ -2946,7 +2946,7 @@ static void test_coop_level_mode_set(void)
|
||||||
hr = IDirectDraw_RestoreDisplayMode(ddraw);
|
hr = IDirectDraw_RestoreDisplayMode(ddraw);
|
||||||
ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr);
|
||||||
hr = IDirectDrawSurface_IsLost(primary);
|
hr = IDirectDrawSurface_IsLost(primary);
|
||||||
todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message);
|
ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message);
|
||||||
expect_messages = NULL;
|
expect_messages = NULL;
|
||||||
|
|
|
@ -2950,7 +2950,7 @@ static void test_coop_level_mode_set(void)
|
||||||
hr = IDirectDraw_RestoreDisplayMode(ddraw);
|
hr = IDirectDraw_RestoreDisplayMode(ddraw);
|
||||||
ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr);
|
||||||
hr = IDirectDrawSurface_IsLost(primary);
|
hr = IDirectDrawSurface_IsLost(primary);
|
||||||
todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message);
|
ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message);
|
||||||
expect_messages = NULL;
|
expect_messages = NULL;
|
||||||
|
@ -3113,7 +3113,7 @@ static void test_coop_level_mode_set(void)
|
||||||
hr = IDirectDraw2_RestoreDisplayMode(ddraw);
|
hr = IDirectDraw2_RestoreDisplayMode(ddraw);
|
||||||
ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr);
|
||||||
hr = IDirectDrawSurface_IsLost(primary);
|
hr = IDirectDrawSurface_IsLost(primary);
|
||||||
todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message);
|
ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message);
|
||||||
expect_messages = NULL;
|
expect_messages = NULL;
|
||||||
|
|
|
@ -3086,7 +3086,7 @@ static void test_coop_level_mode_set(void)
|
||||||
hr = IDirectDraw4_RestoreDisplayMode(ddraw);
|
hr = IDirectDraw4_RestoreDisplayMode(ddraw);
|
||||||
ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr);
|
||||||
hr = IDirectDrawSurface4_IsLost(primary);
|
hr = IDirectDrawSurface4_IsLost(primary);
|
||||||
todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message);
|
ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message);
|
||||||
expect_messages = NULL;
|
expect_messages = NULL;
|
||||||
|
@ -3249,7 +3249,7 @@ static void test_coop_level_mode_set(void)
|
||||||
hr = IDirectDraw4_RestoreDisplayMode(ddraw);
|
hr = IDirectDraw4_RestoreDisplayMode(ddraw);
|
||||||
ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr);
|
||||||
hr = IDirectDrawSurface4_IsLost(primary);
|
hr = IDirectDrawSurface4_IsLost(primary);
|
||||||
todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message);
|
ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message);
|
||||||
expect_messages = NULL;
|
expect_messages = NULL;
|
||||||
|
|
|
@ -2812,7 +2812,7 @@ static void test_coop_level_mode_set(void)
|
||||||
hr = IDirectDraw7_RestoreDisplayMode(ddraw);
|
hr = IDirectDraw7_RestoreDisplayMode(ddraw);
|
||||||
ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr);
|
||||||
hr = IDirectDrawSurface7_IsLost(primary);
|
hr = IDirectDrawSurface7_IsLost(primary);
|
||||||
todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message);
|
ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message);
|
||||||
expect_messages = NULL;
|
expect_messages = NULL;
|
||||||
|
@ -2975,7 +2975,7 @@ static void test_coop_level_mode_set(void)
|
||||||
hr = IDirectDraw7_RestoreDisplayMode(ddraw);
|
hr = IDirectDraw7_RestoreDisplayMode(ddraw);
|
||||||
ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "RestoreDisplayMode failed, hr %#x.\n", hr);
|
||||||
hr = IDirectDrawSurface7_IsLost(primary);
|
hr = IDirectDrawSurface7_IsLost(primary);
|
||||||
todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
|
||||||
|
|
||||||
ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message);
|
ok(!expect_messages->message, "Expected message %#x, but didn't receive it.\n", expect_messages->message);
|
||||||
expect_messages = NULL;
|
expect_messages = NULL;
|
||||||
|
|
Loading…
Reference in New Issue