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

64-bit: Properly prototype *all* the used functions #1805

Open
Athanasius opened this issue Jan 12, 2023 · 1 comment
Open

64-bit: Properly prototype *all* the used functions #1805

Athanasius opened this issue Jan 12, 2023 · 1 comment
Labels
bug python Pull requests that update Python code unconfirmed An unconfirmed bug

Comments

@Athanasius
Copy link
Contributor

LCU No Fool Like One reported seeing:

exception ignored on calling ctypes callback function: <function EDLogs.game_running.<locals>.callback at 0x0000020E9C9D0EA0>
Traceback (most recent call last):
  File "monitor.pyc", line 2041, in callback
  File "monitor.pyc", line 2034, in WindowTitle
ctypes.ArgumentError: argument 1: OverflowError: int too long to convert

presumably on the 5.7.1-alpha1 64-bit pre-release. That makes File "monitor.pyc", line 2034, in WindowTitle to be the line:

length = GetWindowTextLength(h) + 1

That function hasn't been properly prototyped, so will be returning int, instead of the proper type. I note that this is also actually GetWindowTextLengthW.

So, we should really just properly prototype all of the ctypes functions we use to be sure of no issues going forwards.

@Athanasius Athanasius added bug unconfirmed An unconfirmed bug python Pull requests that update Python code labels Jan 12, 2023
@Athanasius
Copy link
Contributor Author

Note that I couldn't reproduce this specific issue, not with 64-bit 3.11.1 under PyCharm nor with the 5.7.1-alpha1 64-bit pre-release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug python Pull requests that update Python code unconfirmed An unconfirmed bug
Projects
General Code Cleanups
Awaiting triage
Development

No branches or pull requests

2 participants