m0_57901298 2021-10-04 14:16 采纳率: 58.3%
浏览 75
已结题

[ctypes] access violation reading

>>> import classes as c
>>> a = 'Hello,world!'
>>> c.Pointer(id(a))
Traceback (most recent call last):
  File "<pyshell#56>", line 1, in <module>
    p = c.Pointer(id(a))
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\classes.py", line 158, in __init__
    self.data = self.read(id)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\classes.py", line 172, in read
    return c._string_at(self.id, length)
OSError: exception: access violation reading 0x0000000002A80000
>>> 0x0000000002A80000
44564480
>>> id(a)
44148016

传参44148016,为什么string_at实际接受到44564480?
PS:classes是我写的模块

  • 写回答

3条回答 默认 最新

  • m0_57901298 2021-10-05 15:53
    关注

    参数问题

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 10月13日
  • 已采纳回答 10月5日
  • 创建了问题 10月4日