打开包在voidptr_t中的UInt64

Unwrap a UInt64 that is wrapped in a voidptr_t

本文关键字:中的 UInt64 voidptr      更新时间:2023-09-26

在js-ctypes中,我收到了一个Windows句柄(voidptr_t)。在某些情况下,句柄是空的,所以它作为

返回给我。
var ret = ctypes.voidptr_t(ctypes.UInt64('0x0'))

我想打开voidptr_t,然后再打开ctypes.UInt64.compare(ret, ctypes.UInt64('0x0'))

现在我正在做这个古怪的事情:

if (local_hwnd.toString().indexOf('UInt64("0x0")') > -1) {
    console.log('has no handle it is 0 local_hwnd.toString() = ', local_hwnd.toString());
}

对于简单的null比较:

ptr.isNull()

实际打开的东西(到UInt64):

ctypes.cast(ptr, ctypes.uintptr_t).value