Skip to content

Fix waitable timer#18952

Merged
SaschaCowley merged 5 commits into
nvaccess:masterfrom
LeonarddeR:fixWaitableTimer
Sep 22, 2025
Merged

Fix waitable timer#18952
SaschaCowley merged 5 commits into
nvaccess:masterfrom
LeonarddeR:fixWaitableTimer

Conversation

@LeonarddeR
Copy link
Copy Markdown
Collaborator

@LeonarddeR LeonarddeR commented Sep 19, 2025

Link to issue number:

Fixes #18949 

Summary of the issue:

Braille display drivers that use a waitable timer to reset the waiting for acknowledgement packets timer currently raise errors.

Description of user facing changes:

NO longer errors.

Description of developer facing changes:

None

Description of development approach:

When calling setWaitableTimer, cast the APC to type PTIMERAPCROUTINE. While PTIMERAPCROUTINE requires more parameters than PAPCFUNC, we always used a PAPCFUNC instance in the past without problems.

Testing strategy:

Known issues with pull request:

None

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@LeonarddeR LeonarddeR marked this pull request as ready for review September 19, 2025 19:08
@LeonarddeR LeonarddeR requested a review from a team as a code owner September 19, 2025 19:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes errors in braille display drivers that use waitable timers by properly casting APC functions to the required PTIMERAPCROUTINE type. The issue occurred when calling setWaitableTimer with completion routines.

  • Updated setWaitableTimer function to accept PTIMERAPCROUTINE type parameters
  • Added proper type casting for APC function parameters in the ioThread module
  • Modernized function signature with type hints and documentation format

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
source/winKernel.py Updated setWaitableTimer function signature with type hints and PTIMERAPCROUTINE handling
source/hwIo/ioThread.py Added explicit cast to PTIMERAPCROUTINE when calling setWaitableTimer

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread source/winKernel.py
Comment thread source/winKernel.py Outdated
Comment thread source/winKernel.py Outdated
Comment thread source/winKernel.py Outdated
Comment thread source/winKernel.py Outdated
Comment thread source/winKernel.py Outdated
Comment thread source/winKernel.py Outdated
Copy link
Copy Markdown
Member

@SaschaCowley SaschaCowley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @LeonarddeR

@SaschaCowley SaschaCowley enabled auto-merge (squash) September 21, 2025 23:38
@SaschaCowley SaschaCowley merged commit dc22697 into nvaccess:master Sep 22, 2025
110 of 114 checks passed
@github-actions github-actions Bot added this to the 2026.1 milestone Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Continuous errors with Braille on latest Alpha with Handy Tech driver

4 participants