ddraw.add_interfaces(interfaces)
-
-class DDrawTracer(DllTracer):
-
- def trace_function_impl_body(self, function):
- if function.name in ('AcquireDDThreadLock', 'ReleaseDDThreadLock'):
- self.dispatch_function(function)
- return
-
- DllTracer.trace_function_impl_body(self, function)
-
- def wrap_arg(self, function, arg):
- if function.name == 'DirectDrawCreateEx' and arg.name == 'lplpDD':
- print ' if (*lplpDD) {'
- for iface in interfaces:
- print ' if (iid == IID_%s) {' % iface.name
- print ' *lplpDD = (LPVOID) new Wrap%s((%s *)*lplpDD);' % (iface.name, iface.name)
- print ' }'
- print ' }'
-
- DllTracer.wrap_arg(self, function, arg)
-
-
-if __name__ == '__main__':
- print '#define INITGUID'
- print '#include <windows.h>'
- print '#include <ddraw.h>'
- print '#include <d3d.h>'
- print
- print '''
-
-#ifndef D3DLIGHT_PARALLELPOINT
-#define D3DLIGHT_PARALLELPOINT (D3DLIGHTTYPE)4
-#endif
-
-#ifndef D3DLIGHT_GLSPOT
-#define D3DLIGHT_GLSPOT (D3DLIGHTTYPE)5
-#endif
-
-'''
- print '#include "trace_writer.hpp"'
- print '#include "os.hpp"'
- print
- tracer = DDrawTracer('ddraw.dll')
- tracer.trace_api(ddraw)