1
0
mirror of https://github.com/narzoul/DDrawCompat synced 2024-12-30 08:55:36 +01:00

Fixed QueryInterface on same interface

Because multiple DirectDraw interface versions may share the same
method implementations, CompatVtable may dispatch calls to an earlier
interface where that method implementation was already hooked.

Therefore a call to QueryInterface is needed even if the method
thinks the result will be the same interface type; a simple
AddRef may not have the same effect.
This commit is contained in:
narzoul 2018-02-25 17:13:46 +01:00
parent 39d148e3ba
commit 6c34bbb437

View File

@ -91,13 +91,6 @@ namespace Compat
#undef DEFINE_INTF_ID
template <typename Intf>
void queryInterface(Intf& origIntf, Intf*& newIntf)
{
newIntf = &origIntf;
newIntf->lpVtbl->AddRef(newIntf);
}
template <typename NewIntf>
void queryInterface(IUnknown& origIntf, NewIntf*& newIntf)
{