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

does a bad job with ctypes.wintypes.ULARGE_INTEGER #15

Open
divinity76 opened this issue May 11, 2022 · 3 comments · May be fixed by #17
Open

does a bad job with ctypes.wintypes.ULARGE_INTEGER #15

divinity76 opened this issue May 11, 2022 · 3 comments · May be fixed by #17

Comments

@divinity76
Copy link

divinity76 commented May 11, 2022

no matter what the ULARGE_INTEGER actually contains, it will just var_dump as

object(c_ulonglong) (0)

for example

import ctypes
import ctypes.wintypes
from var_dump import var_dump

foo = ctypes.wintypes.ULARGE_INTEGER(123)
var_dump(foo, foo.value)

prints

#0 object(c_ulonglong) (0)
#1 int(123)

interestingly print() gets it right,

print(ctypes.wintypes.ULARGE_INTEGER(123))

gives

c_ulonglong(123)
@divinity76
Copy link
Author

proposed fix in #16

@divinity76
Copy link
Author

same problem with ctypes.wintypes.HANDLE not sure if its worthwhile to create a separate issue for ctypes.wintypes.HANDLE ? in any case, #16 also fixes ctypes.wintypes.HANDLE

divinity76 added a commit to divinity76/python-var-dump that referenced this issue May 12, 2022
lots of things possibly wrong with this
- i don't know if this works on python2.7
- i don't know if this is a good fix
- i don't know what this might break
- i did not run it through any testsuite (does a testsuite exist? if it does, i am unaware)

however, previously this
```
import ctypes
import ctypes.wintypes
from var_dump import var_dump

foo = ctypes.wintypes.ULARGE_INTEGER(123)
print(foo)
var_dump(foo)
```
would produce
```
c_ulonglong(123)
#0 object(c_ulonglong) (0)
```
and print() actually did a better job than var_dump() here,
but now it produce:
```
c_ulonglong(123)
#0 object(c_ulonglong(123)) (0)
```
doing at least as good a job as print :)
this also fixes `ctypes.wintypes.HANDLE` which has the same problem as `ctypes.wintypes.ULARGE_INTEGER`
this is an alternative to sha256#16  and fixes sha256#15
@divinity76 divinity76 linked a pull request May 12, 2022 that will close this issue
@divinity76
Copy link
Author

2 different proposed fixes: #16 and #17
i don't know which of those is better, hopefully someone else does

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 a pull request may close this issue.

1 participant