Hello, Octavian. * On Tue, 11 Oct 2011, Octavian Voicu wrote:
try 3: - fix test failure by moving error check from *_DeleteAttachedSurface to ddraw_surface_delete_attached_surface, after another check (thanks Henri).
try 2: - use IUnknown_Release(attached_iface) instead of manual dispatch, as suggested by Henri; - change type of attached_iface from void* to IUnknown* to reflect fact that it's a pointer to an interface; - add test to show that attaching a surface only attaches a specific interface and return error if DeleteAttachedSurface is called with another interface than the attached one (instead of detaching the surface anyway).
Fixes a bug that causes a stencil buffer leak in the game The Longest Journey. Problem can be seen in the console output log attached to bug #11819. This patch doesn't fix the original bug, but now game exits cleanly.
The root of the problem is that when releasing a surface, its attached surfaces are detached using IDirectDraw7_DeleteAttachedSurface, regardless of what interface was originally attached.
I am troubled by seeing (via test.winehq.org) your ddraw:refcount tests to account only results for "VMware SVGA 3D" adapter/driver (and only those with 3D acceleration disabled), I guess. But if this driver is 3D-enabled or just present real physical adapter (with no 3d acceleration) then ddraw:refcount contains 6 static failures such as: refcount.c:214: Test failed: AddAttachedSurface returned 8876000a refcount.c:235: Test failed: AddAttachedSurface returned 8876000a refcount.c:237: Test failed: Got refcount 1, expected 2 refcount.c:262: Test failed: AddAttachedSurface returned 8876000a refcount.c:275: Test failed: AddAttachedSurface returned 8876000a refcount.c:277: Test failed: Got refcount 1, expected 2 refcount: 112 tests executed (0 marked as todo, 6 failures), 0 skipped This relation can be easily tracked by looking at d3d9:visual or (if they aren't present) at opengl32:opgenl tests. Eg. failures occuring here: * Intel(R) 82865G Graphics Controller http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/xp_af-x... http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/xp_af-x... * NVIDIA GeForce FX 5200 http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/win7_s2... http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/win7_s2... http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/xp_s2-s... http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/xp_s2-s... * ATI Radeon HD 4800 Series (telling it has no IDirect3D[7] support for DDraw) http://test.winehq.org/data/a843acef5567bc30901612ce5013da543259b21b/win7_wi... http://test.winehq.org/data/a843acef5567bc30901612ce5013da543259b21b/win7_wi... * VMware SVGA II http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/2000_fg... http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/2000_fg... http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/2000_fg... http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/2000_fg... * VMware SVGA 3D (telling it has not IDirect3D[7] support for DDraw) http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/win7_fg... http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/win7_fg... All other cases succeed. AFAICS all of them represent the only driver (with 3D support turned off): * VMware SVGA 3D http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/win7_wt... visual.c:194: Driver string: "vm3dum.dll" visual.c:195: Description string: "VMware SVGA 3D (Microsoft Corporation - WDDM)" visual.c:197: Device name string: "\\.\DISPLAY1" visual.c:199: Driver version 7.14.1.40 visual.c:12627: Tests skipped: Creating the device failed visual: 5 tests executed (0 marked as todo, 0 failures), 1 skipped. with following results: http://test.winehq.org/data/d0c38ece9db657431559024abb34285cd8b717b6/win7_wt... refcount: 121 tests executed (0 marked as todo, 0 failures), 0 skipped. IMHO, it would be nice to conform to real world configuration. Wish you best luck with fixing your tests:) S.