X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=wrappers%2Fd2d1trace.py;h=10e14a441b5044c0472da769733e09dfec791908;hb=3bb79b3cf7860ddc57bd15f9f8bda407600c8b22;hp=a6142852d094881a9a37ee51f3276a7fb3cdc599;hpb=cbe34810938b91291bc46a5de5535057b869f750;p=apitrace diff --git a/wrappers/d2d1trace.py b/wrappers/d2d1trace.py index a614285..10e14a4 100644 --- a/wrappers/d2d1trace.py +++ b/wrappers/d2d1trace.py @@ -25,31 +25,24 @@ from dlltrace import DllTracer +from specs.stdapi import API +from specs.dwrite import dwrite from specs.d2d1 import d2d1 -class D2D1Tracer(DllTracer): - - def wrapArg(self, function, arg): - if function.name == 'D2D1CreateFactory' and arg.output: - print ' if (*%s) {' % arg.name - for iface in d2d1.interfaces: - print ' if (riid == IID_%s) {' % iface.name - print ' *%s = (LPVOID) new Wrap%s((%s *)*%s);' % (arg.name, iface.name, iface.name, arg.name) - print ' }' - print ' }' - else: - DllTracer.wrapArg(self, function, arg) - - if __name__ == '__main__': print '#define INITGUID' print print '#include "trace_writer_local.hpp"' print '#include "os.hpp"' print + print '#define DWRITE_EXPORT WINAPI' + print print '#include "d2dimports.hpp"' print - tracer = D2D1Tracer('d2d1.dll') - tracer.traceApi(d2d1) + api = API() + api.addModule(d2d1) + api.addModule(dwrite) + tracer = DllTracer() + tracer.traceApi(api)