Skip to content

windowscodecs: Cherry-pick upstream commit cdb9a274 #160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
8fb4dff
winevulkan: Implement VK_KHR_external_memory_win32 for buffers.
Guy1524 May 19, 2021
283aad9
winevulkan: Implement VK_KHR_external_memory_win32 for images.
Guy1524 May 19, 2021
b04b628
winevulkan: Implement support for KMT handles and named objects.
Guy1524 Oct 13, 2021
b79c0eb
sharedgpures: Add support for arbitrary metadata.
Guy1524 Oct 13, 2021
b656237
Silence some warnings.
giomasce Apr 28, 2022
3feef4e
winevulkan: Manually fixup struct alignment for VkPipelineCreationFee…
DadSchoorse Mar 9, 2022
69d3b90
Revert "user32: Move touch related functions to input.c." (partial)
rbernon Jun 2, 2022
0320657
Revert "user32: Implement rudimentary EnableMouseInPointer support." …
rbernon Jun 2, 2022
2767a43
include: Add touch and pointer input related winuser.h declarations.
rbernon May 21, 2021
83c445c
winex11.drv: HACK: Add timeout for unmap_notify wait in set_mwm_hints().
Jun 9, 2022
2dbd298
iphlpapi: Return ERROR_NO_DATA from GetIpNetTable() if no entries are…
Jun 11, 2022
6a95d25
wine.inf: Use built-in atiadlxx for Plants vs Zombies Garden Warfare 2.
Jun 29, 2022
75bbd3a
msvcp110: Introduce wrapper around critical_section functions.
PiotrCW Mar 15, 2022
56a366a
msvcp110: Add _Mtx_clear_owner implementation.
PiotrCW Mar 15, 2022
c740fd8
msvcp110: Add _Mtx_reset_owner implementation.
PiotrCW Mar 15, 2022
61bd690
msvcp110: Use _Condition_variable in _Cnd_t implementation.
PiotrCW Mar 15, 2022
fe176f4
msvcp140: Add SRWLock based _Mtx_t and _Cnd_t implementation.
PiotrCW Mar 15, 2022
b22db6d
msvcp140: Add condition variable tests.
PiotrCW Mar 15, 2022
7aa43ad
msvcr110: Make sure we don't hang in _Condition_variable::notify* fun…
PiotrCW Mar 16, 2022
ce249f4
fsync: Return a copy of the object instead of cache pointer from get_…
Jul 4, 2022
a38347c
fsync: Synchronize access to object cache.
Jul 4, 2022
cf8309f
fixup! fsync: Reuse shared mem indices.
Jul 4, 2022
5fdbeb9
fsync: Implement reference counting for sync objects shared memory.
Jul 4, 2022
9e25fed
win32u: Don't load bitmap only TTF fonts without bitmap table.
Jul 9, 2022
52d7ad1
jscript: Return ParseProcedureText when compile fails.
tati-frog Jul 19, 2022
e665857
mshtml: Only default to IE11 mode for Internet URL Zones when the app…
g-insn Jul 14, 2022
94bdc7b
mshtml: Parse X-UA-Compatible correctly.
g-insn Jul 14, 2022
c0bc35d
wineboot: Print more information when TSC calibration fails.
rbernon Jul 28, 2022
90b70bd
fsync: Increase shm page size.
Aug 1, 2022
e66df33
fsync: Use static shm_addrs array and get rid of locking in get_shm().
Aug 1, 2022
fb373c0
fsync: Use atomic cache stores and load instead of locking cache.
Aug 1, 2022
78f1860
winex11.drv: Send WM_X11DRV_CLIP_CURSOR_REQUEST with timeout.
Jul 28, 2022
babc757
getminidump: Add a small tool to create minidumps.
nsivov May 17, 2022
c8944f3
ntdll: HACK: Add an option to report ntdll from RtlPcToFileHeader() f…
Aug 3, 2022
cba9566
winhttp: Keep task in queue until completion.
Jun 7, 2022
08d1057
winhttp: Implement reference counting for tasks.
Jun 7, 2022
1f244e5
winhttp: Fix dwResult field in websocket receive error result.
Jun 7, 2022
9bb2853
winhttp: Replace pending read cancel in WinHttpWebSocketClose() with …
Jun 7, 2022
fd7b12b
winhttp: Abort websocket IO on handle close.
Jun 3, 2022
4d042fe
winhttp: Support abort in task_socket_close().
Jun 7, 2022
e6d6c79
winhttp/tests: Add tests for closing web socket with pending operations.
Jun 7, 2022
d32f654
winhttp: Introduce netconn_wait_overlapped_result() helper.
Jun 8, 2022
6b82286
winhttp: Use completion port for async send.
Jun 8, 2022
4e6213d
ws2_32: Check for valid socket in WSAGetOverlappedResult().
Jun 7, 2022
dc419b4
ntdll: Cancel asyncs when thread is terminated.
May 26, 2022
2a21626
ws2_32/tests: Add tests for terminated thread asyncs completion.
May 26, 2022
8bf7ff5
ntoskrnl, server: Support referencing section objects.
Guy1524 Jul 13, 2022
e3b6380
sharedgpures.sys: Keep index into resource pool in FsContext instead …
Guy1524 Jul 13, 2022
2d1c743
sharedgpures.sys: Add support for associating additional NT objects w…
Guy1524 Jul 13, 2022
aff0599
winevulkan: NULL check optional parameters when accessing host object.
Guy1524 Jul 14, 2022
acbb398
winevulkan: Update to VK spec version 1.3.224.
DadSchoorse Aug 4, 2022
aa015cc
winevulkan: Update vk.xml to 1.3.224.
ivyl Aug 8, 2022
c3c51a3
gdi32/tests: Add more tests for GetTextMetrics().
zzhiyi Aug 9, 2022
c0f11d7
win32u: Choose a smaller ppem to avoid exceeding the requested font h…
zzhiyi Aug 9, 2022
2f8e6a1
mscoree: Update Wine Mono to 7.3.1.
Conmanx360 Aug 10, 2022
d362a0e
ddraw: Force x87 arithmetic.
Aug 12, 2022
b0a9e4d
winevulkan: Implement VK_KHR_external_semaphore_win32 for OPAQUE_WIN3…
Guy1524 Apr 22, 2022
8d67196
winevulkan: Add initial support for D3D12-Fence compatible timeline s…
Guy1524 Jul 14, 2022
8092e74
winevulkan: Implement vkWaitForFences and vkSignalSemaphore for D3D12…
Guy1524 Jul 14, 2022
b1c761d
winevulkan: Copy VkSubmitInfo structs so that they don't contain poin…
Guy1524 Jul 14, 2022
8ae6283
winevulkan: Support waiting for and signalling D3D12-Fence style time…
Guy1524 Jul 15, 2022
d4680ad
winevulkan: Add support for signalling VkFence from virtualized VkQue…
Guy1524 Jul 15, 2022
5795449
winevulkan: Flush virtual queue before providing native handle.
Guy1524 Aug 1, 2022
6087ed0
winevulkan: Allowing importing D3D11 Texture handles as Vulkan memory…
Guy1524 Aug 11, 2022
4e8597e
winevulkan: Expose VK_EXT_memory_priority and VK_KHR_win32_keyed_mute…
Guy1524 Aug 11, 2022
61792fd
esync, fsync: Support waiting on file handles.
Aug 16, 2022
ddf2353
ddraw/tests: Add device capability tests.
zzhiyi Aug 17, 2022
e777687
ddraw: Don't report unsupported device capability in d3d7_EnumDevices().
zzhiyi Aug 17, 2022
f427927
mf: Handle timer time behind clock time in present_clock_schedule_tim…
Aug 1, 2022
576c442
mf/samplegrabber: Process samples in paused state in ignore_clock mode.
Aug 15, 2022
4060fd6
mf/samplegrabber: Handle samples receieved in paused state.
Aug 2, 2022
dce3a6f
winegstreamer: Remove useless check when creating a WMA decoder.
giomasce Jul 14, 2022
2e5dfbd
ddraw/tests: Add more tests for restoring complex surfaces.
Aug 16, 2022
e1d4b4c
ddraw: Restore full complex attachment chain in ddraw_surface7_Restor…
Aug 16, 2022
be21efc
ntdll: Enable WINE_FSYNC_SIMULATE_SCHED_QUANTUM for Planet Zoo.
Aug 17, 2022
994844d
winevulkan: Fix vkWaitSemaphores implementation with 32-bit time_t va…
Guy1524 Aug 22, 2022
77752f3
jscript: Implement Function.prototype.bind's `thisArg` properly.
g-insn Aug 29, 2022
41df121
windowscodecs: BitmapScaler_CopyPixels: Do not demand a larger buffer…
Apr 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3290,6 +3290,7 @@ WINE_CONFIG_MAKEFILE(dlls/setupapi/tests)
WINE_CONFIG_MAKEFILE(dlls/setupx.dll16,enable_win16)
WINE_CONFIG_MAKEFILE(dlls/sfc)
WINE_CONFIG_MAKEFILE(dlls/sfc_os)
WINE_CONFIG_MAKEFILE(dlls/sharedgpures.sys)
WINE_CONFIG_MAKEFILE(dlls/shcore)
WINE_CONFIG_MAKEFILE(dlls/shcore/tests)
WINE_CONFIG_MAKEFILE(dlls/shdoclc)
Expand Down Expand Up @@ -3614,6 +3615,7 @@ WINE_CONFIG_MAKEFILE(programs/find/tests)
WINE_CONFIG_MAKEFILE(programs/findstr)
WINE_CONFIG_MAKEFILE(programs/fsutil)
WINE_CONFIG_MAKEFILE(programs/fsutil/tests)
WINE_CONFIG_MAKEFILE(programs/getminidump)
WINE_CONFIG_MAKEFILE(programs/hh)
WINE_CONFIG_MAKEFILE(programs/hostname)
WINE_CONFIG_MAKEFILE(programs/icacls)
Expand Down
4 changes: 2 additions & 2 deletions dlls/appwiz.cpl/addons.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(appwizcpl);
#define GECKO_SHA "???"
#endif

#define MONO_VERSION "7.3.0"
#define MONO_VERSION "7.3.1"
#if defined(__i386__) || defined(__x86_64__)
#define MONO_ARCH "x86"
#define MONO_SHA "939e2f5669720d0d0fc7e305426622a11a33b7ae385c4d7e581e29ea264e22ff"
#define MONO_SHA "fe30a28e8d5816de8216f6358c93f400445e9c94c811c2d1c67dbe59c17ff055"
#else
#define MONO_ARCH ""
#define MONO_SHA "???"
Expand Down
7 changes: 7 additions & 0 deletions dlls/ddraw/ddraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,27 +49,31 @@ static struct enum_device_entry
char interface_name[100];
char device_name[100];
const GUID *device_guid;
DWORD unsupported_caps;
} device_list7[] =
{
/* T&L HAL device */
{
"WINE Direct3D7 Hardware Transform and Lighting acceleration using WineD3D",
"Wine D3D7 T&L HAL",
&IID_IDirect3DTnLHalDevice,
0,
},

/* HAL device */
{
"WINE Direct3D7 Hardware acceleration using WineD3D",
"Direct3D HAL",
&IID_IDirect3DHALDevice,
D3DDEVCAPS_HWTRANSFORMANDLIGHT,
},

/* RGB device */
{
"WINE Direct3D7 RGB Software Emulation using WineD3D",
"Wine D3D7 RGB",
&IID_IDirect3DRGBDevice,
D3DDEVCAPS_HWTRANSFORMANDLIGHT | D3DDEVCAPS_DRAWPRIMITIVES2EX,
},
};

Expand Down Expand Up @@ -3749,6 +3753,7 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
{
struct ddraw *ddraw = impl_from_IDirect3D7(iface);
D3DDEVICEDESC7 device_desc7;
DWORD dev_caps;
HRESULT hr;
size_t i;

Expand All @@ -3764,12 +3769,14 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
wined3d_mutex_unlock();
return hr;
}
dev_caps = device_desc7.dwDevCaps;

for (i = 0; i < ARRAY_SIZE(device_list7); i++)
{
HRESULT ret;

device_desc7.deviceGUID = *device_list7[i].device_guid;
device_desc7.dwDevCaps = dev_caps & ~device_list7[i].unsupported_caps;
ret = callback(device_list7[i].interface_name, device_list7[i].device_name, &device_desc7, context);
if (ret != DDENUMRET_OK)
{
Expand Down
4 changes: 4 additions & 0 deletions dlls/ddraw/ddraw_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#ifndef __WINE_DLLS_DDRAW_DDRAW_PRIVATE_H
#define __WINE_DLLS_DDRAW_DDRAW_PRIVATE_H

#ifdef __i386__
#pragma GCC target ("fpmath=387")
#endif

#include <assert.h>
#include <limits.h>
#include <math.h>
Expand Down
12 changes: 10 additions & 2 deletions dlls/ddraw/surface.c
Original file line number Diff line number Diff line change
Expand Up @@ -3788,6 +3788,7 @@ static HRESULT WINAPI ddraw_surface1_IsLost(IDirectDrawSurface *iface)
static HRESULT WINAPI ddraw_surface7_Restore(IDirectDrawSurface7 *iface)
{
struct ddraw_surface *surface = impl_from_IDirectDrawSurface7(iface);
struct ddraw_surface *attachment;
unsigned int i;

TRACE("iface %p.\n", iface);
Expand Down Expand Up @@ -3833,10 +3834,17 @@ static HRESULT WINAPI ddraw_surface7_Restore(IDirectDrawSurface7 *iface)
return DDERR_WRONGMODE;

surface->is_lost = FALSE;

for(i = 0; i < MAX_COMPLEX_ATTACHED; i++)
{
if (surface->complex_array[i])
surface->complex_array[i]->is_lost = FALSE;
attachment = surface->complex_array[i];
while (attachment)
{
attachment->is_lost = FALSE;
attachment = attachment->complex_array[0];
if (attachment == surface->complex_array[i])
break;
}
}

return DD_OK;
Expand Down
86 changes: 86 additions & 0 deletions dlls/ddraw/tests/d3d.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,19 @@ static HRESULT WINAPI enumDevicesCallback(GUID *Guid, char *DeviceDescription,

ok(hal->dwFlags == 0, "RGB Device %u hal caps has hardware flags %x\n", ver, hal->dwFlags);
ok(hel->dwFlags != 0, "RGB Device %u hel caps has hardware flags %x\n", ver, hel->dwFlags);

todo_wine
ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"RGB Device %d hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n", ver);
todo_wine
ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"RGB Device %d hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n", ver);
todo_wine
ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"RGB Device %d hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n", ver);
todo_wine
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"RGB Device %d hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n", ver);
}
else if(IsEqualGUID(&IID_IDirect3DHALDevice, Guid))
{
Expand All @@ -527,6 +540,17 @@ static HRESULT WINAPI enumDevicesCallback(GUID *Guid, char *DeviceDescription,

ok(hal->dwFlags != 0, "HAL Device %u hal caps has hardware flags %x\n", ver, hal->dwFlags);
ok(hel->dwFlags != 0, "HAL Device %u hel caps has hardware flags %x\n", ver, hel->dwFlags);

ok(hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT,
"HAL Device %d hal device caps does not have D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n", ver);
todo_wine
ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"RGB Device %d hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n", ver);
ok(hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX,
"HAL Device %d hal device caps does not have D3DDEVCAPS_DRAWPRIMITIVES2EX set\n", ver);
todo_wine
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"RGB Device %d hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n", ver);
}
else if(IsEqualGUID(&IID_IDirect3DRefDevice, Guid))
{
Expand All @@ -547,6 +571,15 @@ static HRESULT WINAPI enumDevicesCallback(GUID *Guid, char *DeviceDescription,
"REF Device %d hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n", ver);
ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE,
"REF Device %d hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n", ver);

ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"REF Device %d hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n", ver);
ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"REF Device %d hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n", ver);
ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"REF Device %d hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n", ver);
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"REF Device %d hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n", ver);
}
else if(IsEqualGUID(&IID_IDirect3DRampDevice, Guid))
{
Expand Down Expand Up @@ -574,6 +607,15 @@ static HRESULT WINAPI enumDevicesCallback(GUID *Guid, char *DeviceDescription,

ok(hal->dwFlags == 0, "Ramp Device %u hal caps has hardware flags %x\n", ver, hal->dwFlags);
ok(hel->dwFlags != 0, "Ramp Device %u hel caps has hardware flags %x\n", ver, hel->dwFlags);

ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"Ramp Device %d hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n", ver);
ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"Ramp Device %d hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n", ver);
ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"Ramp Device %d hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n", ver);
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"Ramp Device %d hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n", ver);
}
else if(IsEqualGUID(&IID_IDirect3DMMXDevice, Guid))
{
Expand All @@ -600,6 +642,15 @@ static HRESULT WINAPI enumDevicesCallback(GUID *Guid, char *DeviceDescription,

ok(hal->dwFlags == 0, "MMX Device %u hal caps has hardware flags %x\n", ver, hal->dwFlags);
ok(hel->dwFlags != 0, "MMX Device %u hel caps has hardware flags %x\n", ver, hel->dwFlags);

ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"MMX Device %d hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n", ver);
ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"MMX Device %d hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n", ver);
ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"MMX Device %d hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n", ver);
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"MMX Device %d hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n", ver);
}
else
{
Expand Down Expand Up @@ -664,6 +715,38 @@ static HRESULT WINAPI enumDevicesLifetimeTest7(char *DeviceDescription, char *De
return DDENUMRET_OK;
}

static HRESULT WINAPI enumDevicesCapsTest7(char *DeviceDescription, char *DeviceName,
D3DDEVICEDESC7 *lpdd7, void *Context)
{
if (IsEqualGUID(&lpdd7->deviceGUID, &IID_IDirect3DTnLHalDevice))
{
ok(lpdd7->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT,
"TnLHal Device device caps does not have D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok(lpdd7->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX,
"TnLHal Device device caps does not have D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
}
else if (IsEqualGUID(&lpdd7->deviceGUID, &IID_IDirect3DHALDevice))
{
ok((lpdd7->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"HAL Device device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok(lpdd7->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX,
"HAL Device device caps does not have D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
}
else if (IsEqualGUID(&lpdd7->deviceGUID, &IID_IDirect3DRGBDevice))
{
ok((lpdd7->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"RGB Device device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok((lpdd7->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"RGB Device device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
}
else
{
ok(FALSE, "Unexpected device enumerated: \"%s\" \"%s\"\n", DeviceDescription, DeviceName);
}

return DDENUMRET_OK;
}

/* Check the deviceGUID of devices enumerated by
IDirect3D7_EnumDevices. */
static void D3D7EnumTest(void)
Expand Down Expand Up @@ -783,6 +866,9 @@ static void CapsTest(void)
HRESULT hr;
UINT ver;

hr = IDirect3D7_EnumDevices(lpD3D, enumDevicesCapsTest7, NULL);
ok(hr == D3D_OK, "Got hr %#lx.\n", hr);

hr = DirectDrawCreate(NULL, &dd1, NULL);
ok(hr == DD_OK, "Cannot create a DirectDraw 1 interface, hr = %08x\n", hr);
hr = IDirectDraw_QueryInterface(dd1, &IID_IDirect3D3, (void **) &d3d3);
Expand Down
44 changes: 42 additions & 2 deletions dlls/ddraw/tests/ddraw1.c
Original file line number Diff line number Diff line change
Expand Up @@ -7745,8 +7745,8 @@ static void test_palette_alpha(void)

static void test_lost_device(void)
{
IDirectDrawSurface *surface, *back_buffer, *back_buffer2, *ds;
IDirectDrawSurface *sysmem_surface, *vidmem_surface;
IDirectDrawSurface *surface, *back_buffer;
DDSURFACEDESC surface_desc;
HWND window1, window2;
IDirectDraw *ddraw;
Expand Down Expand Up @@ -7948,10 +7948,30 @@ static void test_lost_device(void)
surface_desc.dwSize = sizeof(surface_desc);
surface_desc.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP;
surface_desc.dwBackBufferCount = 1;
surface_desc.dwBackBufferCount = 2;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL);
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);

ds = NULL;
memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc);
hr = IDirectDrawSurface_GetSurfaceDesc(surface, &surface_desc);
ok(hr == D3D_OK, "Got unexpected hr %#lx.\n", hr);

surface_desc.dwFlags = DDSD_CAPS | DDSD_ZBUFFERBITDEPTH | DDSD_WIDTH | DDSD_HEIGHT;
surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER;
U2(surface_desc).dwZBufferBitDepth = 16;
hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &ds, NULL);
if (FAILED(hr))
{
skip("Could not create Z buffer, skipping Z buffer restore test.\n");
}
else
{
hr = IDirectDrawSurface_AddAttachedSurface(surface, ds);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
}

hr = IDirectDraw_SetCooperativeLevel(ddraw, window1, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN);
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface_IsLost(surface);
Expand Down Expand Up @@ -8041,6 +8061,7 @@ static void test_lost_device(void)

hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &back_buffer);
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr);
ok(back_buffer != surface, "Got the same surface.\n");
hr = IDirectDrawSurface_Restore(surface);
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &back_buffer);
Expand All @@ -8049,6 +8070,25 @@ static void test_lost_device(void)
ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr);
IDirectDrawSurface_Release(back_buffer);

hr = IDirectDrawSurface_GetAttachedSurface(back_buffer, &caps, &back_buffer2);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
ok(back_buffer2 != back_buffer, "Got the same surface.\n");
ok(back_buffer2 != surface, "Got the same surface.\n");
hr = IDirectDrawSurface_IsLost(back_buffer2);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
IDirectDrawSurface_Release(back_buffer2);

if (ds)
{
hr = IDirectDrawSurface_IsLost(ds);
ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDrawSurface_Restore(ds);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
hr = IDirectDrawSurface_IsLost(ds);
ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
IDirectDrawSurface_Release(ds);
}

if (vidmem_surface)
IDirectDrawSurface_Release(vidmem_surface);
IDirectDrawSurface_Release(sysmem_surface);
Expand Down
Loading