X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=wrappers%2Fd2d1trace.py;h=10e14a441b5044c0472da769733e09dfec791908;hb=48c661ea6c0f2bd9b76a3385cd946b7d07bc9b5f;hp=d6d48646d6cdcbdd812247ecc598b639d63d7b1b;hpb=81301939f025407ceb284a9dcd5d5a1f05d27b8f;p=apitrace diff --git a/wrappers/d2d1trace.py b/wrappers/d2d1trace.py index d6d4864..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.traceModule(d2d1) + api = API() + api.addModule(d2d1) + api.addModule(dwrite) + tracer = DllTracer() + tracer.traceApi(api)