+ def implementIidWrapper(self, api):
+ print r'static void'
+ print r'warnIID(const char *functionName, REFIID riid, const char *reason) {'
+ print r' os::log("apitrace: warning: %s: %s IID {0x%08lX,0x%04X,0x%04X,{0x%02X,0x%02X,0x%02X,0x%02X,0x%02X,0x%02X,0x%02X,0x%02X}}\n",'
+ print r' functionName, reason,'
+ print r' riid.Data1, riid.Data2, riid.Data3,'
+ print r' riid.Data4[0], riid.Data4[1], riid.Data4[2], riid.Data4[3], riid.Data4[4], riid.Data4[5], riid.Data4[6], riid.Data4[7]);'
+ print r'}'
+ print
+ print r'static void'
+ print r'wrapIID(const char *functionName, REFIID riid, void * * ppvObj) {'
+ print r' if (!ppvObj || !*ppvObj) {'
+ print r' return;'
+ print r' }'
+ else_ = ''
+ for iface in api.getAllInterfaces():
+ print r' %sif (riid == IID_%s) {' % (else_, iface.name)
+ print r' *ppvObj = new Wrap%s((%s *) *ppvObj);' % (iface.name, iface.name)
+ print r' }'
+ else_ = 'else '
+ print r' %s{' % else_
+ print r' warnIID(functionName, riid, "unknown");'
+ print r' }'
+ print r'}'
+ print
+