]> git.cworth.org Git - apitrace/blobdiff - retrace/retrace.py
d3dretrace: More robust against DXGI missing calls.
[apitrace] / retrace / retrace.py
index 5b5812faa101feb04c651608c24561bf22d9f0af..c4ad2d2bb494aceb861dcf163818bb702af58622 100644 (file)
@@ -434,6 +434,7 @@ class Retracer:
         if function.type is not stdapi.Void:
             print '    _result = %s(%s);' % (function.name, arg_names)
             print '    (void)_result;'
+            self.checkResult(function.type)
         else:
             print '    %s(%s);' % (function.name, arg_names)
 
@@ -450,9 +451,16 @@ class Retracer:
         if method.type is not stdapi.Void:
             print '    _result = _this->%s(%s);' % (method.name, arg_names)
             print '    (void)_result;'
+            self.checkResult(method.type)
         else:
             print '    _this->%s(%s);' % (method.name, arg_names)
 
+    def checkResult(self, resultType):
+        if str(resultType) == 'HRESULT':
+            print r'    if (FAILED(_result)) {'
+            print r'        retrace::warning(call) << "failed\n";'
+            print r'    }'
+
     def filterFunction(self, function):
         return True