]> git.cworth.org Git - apitrace/commitdiff
d3d9trace: Fix wrapping of IDirect3DSwapChain9Ex pointers.
authorJosé Fonseca <jfonseca@vmware.com>
Thu, 25 Apr 2013 15:01:48 +0000 (16:01 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Fri, 26 Apr 2013 10:43:45 +0000 (11:43 +0100)
PIX will complain without this.

wrappers/d3d9trace.py

index f3236e729b64d34c5e400aeb7855a894f49ffdbe..df401da5d090e7cd67b75018d8ba13f35cf20335 100644 (file)
@@ -25,8 +25,8 @@
 
 
 from dlltrace import DllTracer
-from specs.stdapi import API
-from specs.d3d9 import d3d9, D3DSHADER9
+from specs.stdapi import API, Pointer, ObjPointer
+from specs.d3d9 import d3d9, D3DSHADER9, IDirect3DSwapChain9Ex
 
 import specs.d3d9dxva2
 
@@ -41,6 +41,16 @@ class D3D9Tracer(DllTracer):
 
         DllTracer.serializeArgValue(self, function, arg)
 
+    def wrapArg(self, function, arg):
+        # Correctly handle the wrapping of IDirect3DSwapChain9Ex objects
+        if function.name in ('GetSwapChain', 'CreateAdditionalSwapChain') \
+           and self.interface.name == 'IDirect3DDevice9Ex' \
+           and arg.name == 'pSwapChain':
+            self.wrapValue(Pointer(ObjPointer(IDirect3DSwapChain9Ex)), '((IDirect3DSwapChain9Ex**)pSwapChain)')
+            return
+
+        DllTracer.wrapArg(self, function, arg)
+
     def enumWrapperInterfaceVariables(self, interface):
         variables = DllTracer.enumWrapperInterfaceVariables(self, interface)