You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Typically it is shown as a const value (e.g. 0x800401F0), but when assigned to a Dart int, that is of course a positive value. To minimize confusion and retain consistency with COM:
An HRESULT is treated as a signed int in Dart, rather than a positive 0x80000000 value.
COM error constants will be converted to signed 32-bit values
The primary change to the code is that a line like:
constCO_E_NOTINITIALIZED=0x800401F0;
will become
finalCO_E_NOTINITIALIZED=0x800401F0.toSigned(32);
While this adds some pain to the constants.dart file, this will remove some .toUnsigned(32) calls in the code and therefore avoid the risk of a returned HRESULT failing an equality test with a constant.
We'll need to make some updates to the code to test this consistently; I suspect there's a bug farm lurking here already that this work will root out. Good opportunity for more tests.
The text was updated successfully, but these errors were encountered:
We handle errors inconsistently here.
Win32 defines an
HRESULT
as a signed value:Typically it is shown as a const value (e.g.
0x800401F0
), but when assigned to a Dartint
, that is of course a positive value. To minimize confusion and retain consistency with COM:HRESULT
is treated as a signedint
in Dart, rather than a positive 0x80000000 value.The primary change to the code is that a line like:
will become
While this adds some pain to the
constants.dart
file, this will remove some.toUnsigned(32)
calls in the code and therefore avoid the risk of a returnedHRESULT
failing an equality test with a constant.We'll need to make some updates to the code to test this consistently; I suspect there's a bug farm lurking here already that this work will root out. Good opportunity for more tests.
The text was updated successfully, but these errors were encountered: