MCPcopy Create free account
hub / github.com/Recordscript/recordscript / wrap_hresult

Function wrap_hresult

libs/scrap/src/dxgi/mod.rs:640–658  ·  view source on GitHub ↗
(x: HRESULT)

Source from the content-addressed store, hash-verified

638}
639
640fn wrap_hresult(x: HRESULT) -> io::Result<()> {
641 use std::io::ErrorKind::*;
642 Err((match x {
643 S_OK => return Ok(()),
644 DXGI_ERROR_ACCESS_LOST => ConnectionReset,
645 DXGI_ERROR_WAIT_TIMEOUT => TimedOut,
646 DXGI_ERROR_INVALID_CALL => InvalidData,
647 E_ACCESSDENIED => PermissionDenied,
648 DXGI_ERROR_UNSUPPORTED => ConnectionRefused,
649 DXGI_ERROR_NOT_CURRENTLY_AVAILABLE => Interrupted,
650 DXGI_ERROR_SESSION_DISCONNECTED => ConnectionAborted,
651 E_INVALIDARG => InvalidInput,
652 _ => {
653 // 0x8000ffff https://www.auslogics.com/en/articles/windows-10-update-error-0x8000ffff-fixed/
654 return Err(io::Error::new(Other, format!("Error code: {:#X}", x)));
655 }
656 })
657 .into())
658}

Callers 5

newMethod · 0.85
load_frameMethod · 0.85
ohgodwhatMethod · 0.85
get_textureMethod · 0.85
adapter_luidMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected