Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win-capture: Update hooked state before unhooked signal #10460

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

EZ64cool
Copy link

@EZ64cool EZ64cool commented Mar 30, 2024

Description

Move the game-capture's gc->capturing = false update to before the unhooked signal is sent. This replicates the behaviour of window-capture.

Motivation and Context

If the get_hooked procedure is called during the unhooked signal the source would still report that it's hooked because gc->capturing hasn't been updated yet.

How Has This Been Tested?

Tested on windows 10 x64 and it now works as expected. It's a very isolated change so easy to test.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@WizardCM WizardCM added the Bug Fix Non-breaking change which fixes an issue label Mar 30, 2024
@EZ64cool EZ64cool force-pushed the game-capture-get-hooked-after-unhooked-fix branch from f88307a to a504a8b Compare March 30, 2024 12:38
Copy link
Member

@RytoEX RytoEX left a comment

Choose a reason for hiding this comment

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

The correct commit/PR prefix is "win-capture", the name of the plugin and folder. Please use that.

@RytoEX RytoEX requested review from derrod and Lain-B March 30, 2024 15:44
@EZ64cool EZ64cool force-pushed the game-capture-get-hooked-after-unhooked-fix branch from a504a8b to 6cde4b1 Compare March 30, 2024 15:49
@EZ64cool EZ64cool changed the title game-capture: Update hooked state before unhooked signal win-capture: Update hooked state before unhooked signal Mar 30, 2024
@EZ64cool EZ64cool requested a review from RytoEX March 30, 2024 15:51
@Lain-B Lain-B self-assigned this Mar 30, 2024
@norihiro
Copy link
Contributor

In the commit message of 6cde4b1, the 2nd line is not empty.

@EZ64cool EZ64cool force-pushed the game-capture-get-hooked-after-unhooked-fix branch 2 times, most recently from 36ce5c5 to e17697f Compare April 4, 2024 20:26
@EZ64cool
Copy link
Author

Hey, any chance this could make it in?

It's stopped me from using signals and I'm instead spinning up my own update thread to query the state, which feels a bit overkill for what I need.

@EZ64cool EZ64cool force-pushed the game-capture-get-hooked-after-unhooked-fix branch from 1390258 to dfaa7f0 Compare February 15, 2025 23:34
@EZ64cool
Copy link
Author

Hey @RytoEX sorry to necro this but I just spent some time updating this to latest.

I think your review is the last thing blocking this, if you wouldn't mind taking a look again.

Thanks.

If the get_hooked procedure is called during the unhooked signal
the source would still report that it's hooked because gc->capturing
hasn't been updated yet.
@EZ64cool EZ64cool force-pushed the game-capture-get-hooked-after-unhooked-fix branch from dfaa7f0 to fd9f8a9 Compare February 24, 2025 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fix Non-breaking change which fixes an issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants