nvda
9446ee04 - Fix restype of CancellableSendMessage (#19862)

Commit
1 day ago
Fix restype of CancellableSendMessage (#19862) May fix #19729 ### Summary of the issue: * as defined in `nvdaHelper/local/nvdaHelperLocal.cpp`, the return type of `cancellableSendMessageTimeout` is `LRESULT`. * `LRESULT` is defined as `__int64` on 64-bit Windows, and `long` on 32-bit Windows. That is, `LRESULT` is the signed machine-word-sized integer type. * However, in `source/NVDAHelper/localLib.py`, its return type was set to `c_int`. That is, the signed 32-bit integer type. * This may be a contributing factor to #19729, as `ScintillaTextInfo` uses `cancellableSendMessageTimeout` when getting the text offset from point. Since the the return type is signed, very large (but still positive 64-bit two's compliment) integers may be interpreted as negative due to being truncated. * On the other hand, if my math is correct, this would only start manifesting in files that are 2GiB or larger, though the reporters did say the files were large. ### Description of user facing changes: Unknown, but may fix a crash in Notepad++ (and potentially other cases) ### Description of developer facing changes: `NVDAHelper.localLib.cancellableSendMessageTimeout.restype` is now `c_longlong` ### Description of development approach: Defined `LRESULT` as `c_ssize_t` (`c_long` on 32-bit; `c_longlong` on 64-bit), and set `NVDAHelper.localLib.cancellableSendMessageTimeout`'s `restype` to `LRESULT`. ### Testing strategy: Ran from source and did normal work. I don't think this has the potential to cause issues, unless we introduced code relying on the incorrect restype during the 64-bit migration, as the return type was fine on 32-bit builds (`c_int is c_long`). ### Known issues with pull request: None
Author
Parents
Loading