Am 08.03.2019 um 18:49 schrieb Henri Verbeet hverbeet@gmail.com:
Mostly the fact that impl_from_IDirectDrawClipper() can return NULL, yes.
I can easily change that part.
The vtable only matters for Release(), the rest of the methods don't care if you change the vtable, that's why I added the magic value.
Do applications care though? In principle impl_from_IDirectDrawClipper() doesn't currently check the vtable, but in practice passing a clipper with a modified vtable to just about anything is going to trigger the assert in unsafe_impl_from_IDirectDrawClipper().
Deus Ex doesn't, it only cares that we don't crash when attempting to release an already destroyed clipper. I do not know if there are other applications affected by this, but I don't expect there are many, or we would have seen this issue already.
I.e., as long as applications aren't actually modifying the vtable and still expect things to work, I'd probably prefer using the vtable as "magic".
I changed the patches in that regard and adjusted the tests. The tests still document that the vtable shouldn't be used to detect valid clippers, but are marked todo.