X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=wrappers%2Fd3d9trace.py;h=df401da5d090e7cd67b75018d8ba13f35cf20335;hb=d6b7eb6b7c8280762fb635a6e63aa3a426694ed7;hp=2a4c1a93d824503164d15e36b0796a7c105cec59;hpb=b35ae0df401ff22e3b2dc9b6bfacf1e23baebde0;p=apitrace diff --git a/wrappers/d3d9trace.py b/wrappers/d3d9trace.py index 2a4c1a9..df401da 100644 --- a/wrappers/d3d9trace.py +++ b/wrappers/d3d9trace.py @@ -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) @@ -84,17 +94,6 @@ if __name__ == '__main__': print '#include "d3d9shader.hpp"' print '#include "dxvaint.h"' print - print ''' -static inline size_t -_declCount(const D3DVERTEXELEMENT9 *pVertexElements) { - size_t count = 0; - if (pVertexElements) { - while (pVertexElements[count++].Stream != 0xff) - ; - } - return count; -} -''' api = API() api.addModule(d3d9)