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:
parent
39d148e3ba
commit
6c34bbb437
@ -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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user