if ((ret & TwainReturnCode.TWRC_FAILURE) == TwainReturnCode.TWRC_FAILURE)
😯 Why would somebody write that?
Since TWRC_FAILURE=1, this appears to be treating any odd-numbered return code as an error, and even-numbered code as success! Never seen anything like it, don’t see how it fits the spec.
But I’m looking at a big bunch of TWAIN code and this construction occurs literally 101 times.
I’m very confused…
The only reason I can see anyone writing that is if they thought that an error was defined as a bit, but that’s not the case so I agree with you that it looks pretty suspicious.