rust-windowing / rust-windowing/winit

Potentially invalid message dispatched on Windows

Open
#2,298 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

DS - win32
Dominant language
Rust
Stars
6.2k
Forks
1.3k
Avg merge
2d 19h
Merged PRs (30d)
9

Description

The documentation of GetMessage on windows states that the return value is -1 in case of an error. This error is not handled by the library:

https://github.com/rust-windowing/winit/blob/f04fa5d54f4ec10cdb6d084deeb79d3e6d27ae67/src/platform_impl/windows/event_loop.rs#L259

Possible solutions are using <= 0 (to include -1) or handling it seperately. It seems that platform_imp::windows::event_loop::run_return provides no feedback on possible errors.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/platform_impl/windows/event_loop.rs around line 259 and inspect how GetMessage is handled in the Windows event loop, including platform_imp::windows::event_loop::run_return. Compare that behavior with the documented -1 error return and determine how the library should report it; done means the error case is handled without changing normal event dispatch.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.