我从被调用函数分配的内存块中获取信息时遇到问题。具体来说,XGetWindowProperties
JNA 附带的 X11 库中有函数。它通过最后一个参数 - 返回结果PointerByReference prop_return
。
我知道实际的内存区域包含一个Window
. 但是如何创建这些对象?我看不到任何从指针本身获取它的方法,也无法从中获取 a Buffer
,因为我不知道Window
.
真正的功能是:int XGetWindowProperty(...., unsigned char **prop_return)
使用我调用它的参数,它实际上是int XGetWindowProperty(...., Window *prop_return[])
.