ddraw: Don't release ddraw if a surface is still using it.
wine at mkarcher.dialup.fu-berlin.de
Sat May 31 10:03:13 CDT 2008
Am Samstag, den 31.05.2008, 15:43 +0200 schrieb Jens Albretsen:
> > On wine, there is obviously no problem, as wine keeps the DirectDraw
> > object itself alive for longer. On Windows, it is not clear to me that
> > the DirectDraw object is not destroyed at the IDirectDraw_Release, the
> > only thing we know is, that Direct Draw still is working (perhaps
> > implemented by a subobject of the DirectDraw object which keeps living).
> Someone please run the test on windows, I have no windows installation.
I will do that, no problem.
> > I suggest to alternatively write the second part as
> > + ref = IDirectDraw_Release(lpDD);
> > + ok(ref == 0, "Got refcount %ld, expected 0\n", ref);
> > +
> > + IUnknown_Release(surface);
> It would pretty much kill the idea of the test.
OK, I jumped too quickly to my conclusion. In the ddraw log posted to
the bug, the reference count really drops down to zero and exactly that
object is used afterwards. Counting the QueryInterface and Release
calls, I can't understand why the reference count drops to zero.
I will investigate further and respond back then.
> Anyway it makes wine stop crashing when programs tries to do something crazy
> like this. Stefan Dösinger asked me to put a HeapAlloc all memory between the
> two Release's to check if the memory of ddraw object would be corrupt in
> Windows. It really doesn't matter if programs live by chance in windows, if
> we can implement it so it's not by chance anymore.
I agree on that point.
> Jens Albretsen
Regards, Michael Karcher
More information about the wine-devel