node-ctypes - v2.10.0
    Preparing search index...

    Type Alias CastSource

    CastSource:
        | MemorySource
        | ArrayBuffer
        | ByRefAddress
        | FFIFunction
        | CallbackWrapper
        | null

    Interpret a pointer as a different type.

    Python equivalent: ctypes.cast

    When the target is a PointerTypeDef, returns a PointerInstance with .contents and [index] access — equivalent to Python's cast(c_void_p(addr), POINTER(MyStruct)). A FuncPtrFactory target returns a caller with that prototype.

    Memory, a pointer/address, or a native function/callback

    The target type (primitive, struct, POINTER or CFUNCTYPE)

    // Python: cast(c_void_p(addr), POINTER(MyStruct))
    const pValues = cast(col.pADsValues, POINTER(ADSVALUE));
    for (let i = 0; i < col.dwNumValues; i++) {
    console.log(pValues[i].dwType);
    }
    const floatVal = cast(intBuf, c_float);