Actual behavior
The current uint operator for HRESULT is: public static implicit operator uint(HRESULT value) => (uint)value.Value;. In my checked build, this throws an overflow exception.
Expected behavior
That this operation be wrapped in an unchecked block, just like public static explicit operator HRESULT(uint value) => new HRESULT(unchecked((int)value)); is.
Repro steps
NativeMethods.txt content:
-
NativeMethods.json content (if present): N/A
-
Any of your own code that should be shared? N/A
Context
- CsWin32 version: 0.3.269
- Win32Metadata version: N/A
- Target Framework: net472
LangVersion: N/A
Actual behavior
The current uint operator for HRESULT is:
public static implicit operator uint(HRESULT value) => (uint)value.Value;. In my checked build, this throws an overflow exception.Expected behavior
That this operation be wrapped in an unchecked block, just like
public static explicit operator HRESULT(uint value) => new HRESULT(unchecked((int)value));is.Repro steps
NativeMethods.txtcontent:NativeMethods.jsoncontent (if present): N/AAny of your own code that should be shared? N/A
Context
LangVersion: N/A