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

    Class WinDLL

    Load a shared library using the stdcall calling convention.

    Used for Windows API functions (kernel32, user32, etc.).

    Python equivalent: ctypes.WinDLL

    import { WinDLL, c_void, c_void_p } from 'node-ctypes';

    const kernel32 = new WinDLL('kernel32.dll');
    const GetLocalTime = kernel32.func('GetLocalTime', c_void, [c_void_p]);

    Hierarchy (View Summary)

    Indexable

    • [funcName: string]: any

      Python-like function access. Accessing any property returns a FunctionWrapper that supports argtypes/restype assignment.

    Index
    path: string

    Library file path.

    loaded: boolean

    Whether the logical handle is open, independently of physical module residency.

    • Get the address of a symbol.

      Parameters

      • name: string

        Symbol name

      Returns bigint

      Address as BigInt

    • Close the library and clear the function cache. Functions obtained from it throw when called afterwards. Throws while a call to one of its functions is in progress (from a callback, or a pending callAsync()). Existing in_dll() views defer native handle release until their dependent memory is collected, but new calls and symbol lookups are rejected. Physical unloading depends on the OS loader; musl keeps modules resident.

      Returns void

    • Close the library at the end of a using block.

      Returns void

    • Read the snapshotted GetLastError() (Windows) or errno from the most recent call on this library. Requires use_last_error: true at construction.

      Python ctypes parity: ctypes.get_last_error() (library-scoped variant).

      Returns number

    • Read the snapshotted errno from the most recent call on this library. Requires use_errno: true at construction.

      Python ctypes parity: ctypes.get_errno() (library-scoped variant).

      Returns number