<PackageReference Include="System.Drawing.Common" Version="9.0.10" />

HRESULT

using System; using System.CodeDom.Compiler; using System.Diagnostics; using System.Globalization; using System.Runtime.InteropServices; namespace Windows.Win32.Foundation { [DebuggerDisplay("{Value}")] [GeneratedCode("Microsoft.Windows.CsWin32", "0.3.106+a37a0b4b70")] internal readonly struct HRESULT : IEquatable<HRESULT> { public static readonly HRESULT COR_E_ARGUMENT = (HRESULT)(-2147024809); public static readonly HRESULT TLBX_E_LIBNOTREGISTERED = (HRESULT)(-2146234011); public static readonly HRESULT COR_E_MISSINGFIELD = (HRESULT)(-2146233071); public static readonly HRESULT COR_E_MISSINGMEMBER = (HRESULT)(-2146233070); public static readonly HRESULT COR_E_MISSINGMETHOD = (HRESULT)(-2146233069); public static readonly HRESULT COR_E_NOTSUPPORTED = (HRESULT)(-2146233067); public static readonly HRESULT COR_E_OVERFLOW = (HRESULT)(-2146233066); public static readonly HRESULT COR_E_INVALIDOLEVARIANTTYPE = (HRESULT)(-2146233039); public static readonly HRESULT COR_E_SAFEARRAYTYPEMISMATCH = (HRESULT)(-2146233037); public static readonly HRESULT COR_E_TARGETINVOCATION = (HRESULT)(-2146232828); public static readonly HRESULT COR_E_OBJECTDISPOSED = (HRESULT)(-2146232798); internal readonly int Value; internal static readonly HRESULT CLIPBRD_E_BAD_DATA = (HRESULT)(-2147221037); internal static readonly HRESULT DISP_E_ARRAYISLOCKED = (HRESULT)(-2147352563); internal static readonly HRESULT DISP_E_BADCALLEE = (HRESULT)(-2147352560); internal static readonly HRESULT DISP_E_BADINDEX = (HRESULT)(-2147352565); internal static readonly HRESULT DISP_E_BADPARAMCOUNT = (HRESULT)(-2147352562); internal static readonly HRESULT DISP_E_BADVARTYPE = (HRESULT)(-2147352568); internal static readonly HRESULT DISP_E_BUFFERTOOSMALL = (HRESULT)(-2147352557); internal static readonly HRESULT DISP_E_DIVBYZERO = (HRESULT)(-2147352558); internal static readonly HRESULT DISP_E_EXCEPTION = (HRESULT)(-2147352567); internal static readonly HRESULT DISP_E_MEMBERNOTFOUND = (HRESULT)(-2147352573); internal static readonly HRESULT DISP_E_NONAMEDARGS = (HRESULT)(-2147352569); internal static readonly HRESULT DISP_E_NOTACOLLECTION = (HRESULT)(-2147352559); internal static readonly HRESULT DISP_E_OVERFLOW = (HRESULT)(-2147352566); internal static readonly HRESULT DISP_E_PARAMNOTFOUND = (HRESULT)(-2147352572); internal static readonly HRESULT DISP_E_PARAMNOTOPTIONAL = (HRESULT)(-2147352561); internal static readonly HRESULT DISP_E_TYPEMISMATCH = (HRESULT)(-2147352571); internal static readonly HRESULT DISP_E_UNKNOWNINTERFACE = (HRESULT)(-2147352575); internal static readonly HRESULT DISP_E_UNKNOWNLCID = (HRESULT)(-2147352564); internal static readonly HRESULT DISP_E_UNKNOWNNAME = (HRESULT)(-2147352570); internal static readonly HRESULT DRAGDROP_E_ALREADYREGISTERED = (HRESULT)(-2147221247); internal static readonly HRESULT DRAGDROP_E_NOTREGISTERED = (HRESULT)(-2147221248); internal static readonly HRESULT DRAGDROP_S_CANCEL = (HRESULT)262401; internal static readonly HRESULT DRAGDROP_S_DROP = (HRESULT)262400; internal static readonly HRESULT DRAGDROP_S_USEDEFAULTCURSORS = (HRESULT)262402; internal static readonly HRESULT DV_E_DVASPECT = (HRESULT)(-2147221397); internal static readonly HRESULT DV_E_FORMATETC = (HRESULT)(-2147221404); internal static readonly HRESULT DV_E_TYMED = (HRESULT)(-2147221399); internal static readonly HRESULT E_ABORT = (HRESULT)(-2147467260); internal static readonly HRESULT E_ACCESSDENIED = (HRESULT)(-2147024891); internal static readonly HRESULT E_FAIL = (HRESULT)(-2147467259); internal static readonly HRESULT E_HANDLE = (HRESULT)(-2147024890); internal static readonly HRESULT E_INVALIDARG = (HRESULT)(-2147024809); internal static readonly HRESULT E_NOINTERFACE = (HRESULT)(-2147467262); internal static readonly HRESULT E_NOTIMPL = (HRESULT)(-2147467263); internal static readonly HRESULT E_OUTOFMEMORY = (HRESULT)(-2147024882); internal static readonly HRESULT E_POINTER = (HRESULT)(-2147467261); internal static readonly HRESULT E_UNEXPECTED = (HRESULT)(-2147418113); internal static readonly HRESULT INPLACE_E_NOTOOLSPACE = (HRESULT)(-2147221087); internal static readonly HRESULT OLE_E_ADVISENOTSUPPORTED = (HRESULT)(-2147221501); internal static readonly HRESULT OLE_E_INVALIDRECT = (HRESULT)(-2147221491); internal static readonly HRESULT OLE_E_NOCONNECTION = (HRESULT)(-2147221500); internal static readonly HRESULT OLE_E_PROMPTSAVECANCELLED = (HRESULT)(-2147221492); internal static readonly HRESULT REGDB_E_CLASSNOTREG = (HRESULT)(-2147221164); internal static readonly HRESULT RPC_E_CHANGED_MODE = (HRESULT)(-2147417850); internal static readonly HRESULT S_FALSE = (HRESULT)1; internal static readonly HRESULT S_OK = (HRESULT)0; internal static readonly HRESULT STG_E_FILENOTFOUND = (HRESULT)(-2147287038); internal static readonly HRESULT STG_E_INVALIDFLAG = (HRESULT)(-2147286785); internal static readonly HRESULT STG_E_INVALIDFUNCTION = (HRESULT)(-2147287039); internal static readonly HRESULT STG_E_INVALIDPOINTER = (HRESULT)(-2147287031); internal static readonly HRESULT TYPE_E_BADMODULEKIND = (HRESULT)(-2147317571); internal static readonly HRESULT VIEW_E_DRAW = (HRESULT)(-2147221184); [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool Succeeded { get { return Value >= 0; } } [DebuggerBrowsable(DebuggerBrowsableState.Never)] internal bool Failed { get { return Value < 0; } } public static HRESULT HRESULT_FROM_WIN32(WIN32_ERROR error) { return new HRESULT((int)(error & (WIN32_ERROR)65535) | -2147024896); } public static implicit operator HRESULT(Exception ex) { return (HRESULT)ex.HResult; } public void AssertSuccess() { } internal HRESULT(int value) { Value = value; } public static implicit operator int(HRESULT value) { return value.Value; } public static explicit operator HRESULT(int value) { return new HRESULT(value); } public static bool operator ==(HRESULT left, HRESULT right) { return left.Value == right.Value; } public static bool operator !=(HRESULT left, HRESULT right) { return !(left == right); } public bool Equals(HRESULT other) { return Value == other.Value; } public override bool Equals(object obj) { if (obj is HRESULT) { HRESULT other = (HRESULT)obj; return Equals(other); } return false; } public override int GetHashCode() { return Value.GetHashCode(); } public override string ToString() { return string.Format(CultureInfo.InvariantCulture, "0x{0:X8}", Value); } public static implicit operator uint(HRESULT value) { return (uint)value.Value; } public static explicit operator HRESULT(uint value) { return new HRESULT((int)value); } internal HRESULT ThrowOnFailure(IntPtr errorInfo = 0) { Marshal.ThrowExceptionForHR(Value, errorInfo); return this; } internal string ToString(string format, IFormatProvider formatProvider) { return ((uint)Value).ToString(format, formatProvider); } } }