Try all interfaces when wrapping REFIIDs.
authorJosé Fonseca <jose.r.fonseca@gmail.com>
Fri, 3 Feb 2012 19:06:31 +0000 (19:06 +0000)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Fri, 3 Feb 2012 19:07:35 +0000 (19:07 +0000)
d3d8trace.py
d3d9trace.py
trace.py

index 1da3feb..af87c2d 100644 (file)
@@ -40,6 +40,8 @@ class D3D8Tracer(DllTracer):
 
 
 if __name__ == '__main__':
+    print '#define INITGUID'
+    print
     print '#include <windows.h>'
     print '#include <d3d8.h>'
     print '#include "d3dshader.hpp"'
index ae4acd0..4f40194 100644 (file)
@@ -70,6 +70,8 @@ class D3D9Tracer(DllTracer):
 
 
 if __name__ == '__main__':
+    print '#define INITGUID'
+    print
     print '#include "trace_writer_local.hpp"'
     print '#include "os.hpp"'
     print
index 831af98..bd97772 100644 (file)
--- a/trace.py
+++ b/trace.py
@@ -542,9 +542,11 @@ class Tracer:
     def wrapIid(self, riid, out):
             print '    if (%s && *%s) {' % (out.name, out.name)
             print '        if (*%s == m_pInstance) {' % (out.name,)
+            print '            AddRef();'
+            print '            m_pInstance->Release();'
             print '            *%s = this;' % (out.name,)
             print '        }'
-            for iface in self.api.interfaces:
+            for iface in self.api.getAllInterfaces():
                 print r'        else if (%s == IID_%s) {' % (riid.name, iface.name)
                 print r'            *%s = new Wrap%s((%s *) *%s);' % (out.name, iface.name, iface.name, out.name)
                 print r'        }'