Closed avi-cenna closed 3 months ago
Interesting. Reproduced on my machines. Thanks for reporting, I'll have to look into this.
Release optimizations must be stripping something out, since everything works as expected with opt-level = 0
.
further edit: When release optimizations are enabled, we hit a stack buffer overflow inside of the hook function, but when they're disabled we don't. fun.
Even more fun, anything above opt-level = 0
seems to be causing incorrect parameters being passed to our callback function that gets registered with Windows.
edit:
Starts appearing in Rust 1.78. The n_code argument seems to not be passed correctly, as it's 0
without optimizations and 512
with, which is what w_param should be (WM_MOUSEHOOK
value).
edit2:
Seems to be a compiler bug. Based on the asm output, either rustc 1.78 or llvm 18 are miscompiling the hook function.
Fixed in the latest commit! Seems like I introduced some UB that wasn't actually an issue until 1.78.
This is a nice tool, but the release build doesn't seem to work for some reason.
I did both
cargo build
andcargo build --release
. When I ran the release executable withstart target/release/hotcorners.exe
nothing happens when I move my mouse to the top left corner. However, when I run the debug build withstart target/debug/hotcorners.exe
it works as expected.