]> git.cworth.org Git - apitrace/commitdiff
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 1da3febebfe61c078ae56e534e7eeec01822c3ef..af87c2d2aa58bbae5ce8a00cc13be5bf66927e72 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 ae4acd039fe39f2b274afdfa46f9f624f003611f..4f40194ec5af3a4841f4e21148fa5f494a3388ea 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 831af98640fb6970f143060fd430adf0939eee6d..bd977724484de670baffa9f5b2305531f4edc0f4 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'        }'