From 6c34bbb437be4515531e65bdb096b91d496312cb Mon Sep 17 00:00:00 2001 From: narzoul Date: Sun, 25 Feb 2018 17:13:46 +0100 Subject: [PATCH] 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. --- DDrawCompat/Common/CompatQueryInterface.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/DDrawCompat/Common/CompatQueryInterface.h b/DDrawCompat/Common/CompatQueryInterface.h index 9398082..a761d19 100644 --- a/DDrawCompat/Common/CompatQueryInterface.h +++ b/DDrawCompat/Common/CompatQueryInterface.h @@ -91,13 +91,6 @@ namespace Compat #undef DEFINE_INTF_ID - template - void queryInterface(Intf& origIntf, Intf*& newIntf) - { - newIntf = &origIntf; - newIntf->lpVtbl->AddRef(newIntf); - } - template void queryInterface(IUnknown& origIntf, NewIntf*& newIntf) {