本文整理汇总了Python中dllretrace.DllRetracer.handleFailure方法的典型用法代码示例。如果您正苦于以下问题:Python DllRetracer.handleFailure方法的具体用法?Python DllRetracer.handleFailure怎么用?Python DllRetracer.handleFailure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dllretrace.DllRetracer
的用法示例。
在下文中一共展示了DllRetracer.handleFailure方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: handleFailure
# 需要导入模块: from dllretrace import DllRetracer [as 别名]
# 或者: from dllretrace.DllRetracer import handleFailure [as 别名]
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)
示例2: handleFailure
# 需要导入模块: from dllretrace import DllRetracer [as 别名]
# 或者: from dllretrace.DllRetracer import handleFailure [as 别名]
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)
示例3: handleFailure
# 需要导入模块: from dllretrace import DllRetracer [as 别名]
# 或者: from dllretrace.DllRetracer import handleFailure [as 别名]
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)