def handleFailure(self, interface, methodOrFunction): # Catch when device is removed, and report the reason. if interface is not None: print(r' if (_result == DXGI_ERROR_DEVICE_REMOVED) {') print(r' d3dretrace::deviceRemoved(call, _this);') print(r' }') Retracer.handleFailure(self, interface, methodOrFunction)
def handleFailure(self, interface, methodOrFunction): if methodOrFunction.name in self.createDeviceMethodNames: print r' exit(EXIT_FAILURE);' return # https://msdn.microsoft.com/en-us/library/windows/desktop/bb324479.aspx if methodOrFunction.name in ('Present', 'PresentEx'): print r' if (_result == D3DERR_DEVICELOST) {' print r' exit(EXIT_FAILURE);' print r' }' Retracer.handleFailure(self, interface, methodOrFunction)
def handleFailure(self, interface, methodOrFunction): # Catch when device is removed, and report the reason. if interface is not None: getDeviceRemovedReasonMethod = interface.getMethodByName("GetDeviceRemovedReason") if getDeviceRemovedReasonMethod is not None: print r' if (_result == DXGI_ERROR_DEVICE_REMOVED) {' print r' HRESULT _reason = _this->GetDeviceRemovedReason();' print r' retrace::failed(call, _reason);' print r' exit(EXIT_FAILURE);' print r' }' Retracer.handleFailure(self, interface, methodOrFunction)
def handleFailure(self, interface, methodOrFunction): # Catch when device is removed, and report the reason. if interface is not None: print r' if (_result == DXGI_ERROR_DEVICE_REMOVED) {' getDeviceRemovedReasonMethod = interface.getMethodByName("GetDeviceRemovedReason") if getDeviceRemovedReasonMethod is not None: print r' HRESULT _reason = _this->GetDeviceRemovedReason();' print r' retrace::failed(call, _reason);' getDeviceMethod = interface.getMethodByName("GetDevice") if getDeviceMethod is not None and len(getDeviceMethod.args) == 1: print r' com_ptr<%s> _pDevice;' % getDeviceMethod.args[0].type.type.type print r' _this->GetDevice(&_pDevice);' print r' HRESULT _reason = _pDevice->GetDeviceRemovedReason();' print r' retrace::failed(call, _reason);' print r' exit(EXIT_FAILURE);' print r' }' Retracer.handleFailure(self, interface, methodOrFunction)