
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Definitions of Windows Date Types for koffi
Compile successfully with
Package | Version |
---|---|
win32-api | |
win32-def |
Write koffi calling win32 native functions code by Typescript with Types support.
npm install win32-def
import * as D from 'win32-def/def'
import * as S from 'win32-def/struct'
import * as T from 'win32-def/types'
export class DefWin32 extends Def_B implements T.LibDefBase {
[x: string]: T.FnDefFullParams
static ClientToScreen = [D.BOOL, [D.HWND, `_Inout_ ${S.LPPOINT}`]]
static EnumDisplayDevicesW = [D.BOOL, [D.LPCWSTR, D.DWORD, `_Inout_ ${S.LPDISPLAY_DEVICEW}`, D.DWORD]]
static FindWindowExW = [D.HWND, [D.HWND, D.HWND, D.LPCTSTR, D.LPCTSTR]]
static GetCursorPos = [D.BOOL, [`_Out_ ${S.LPPOINT}`]]
}
export class Win32 implements T.LibDef2Type<typeof DefWin32> {
ClientToScreen: (hWnd: T.HWND, lpPoint: S.POINT_Type) => T.BOOL
EnumDisplayDevicesW: (
lpDevice: T.LPCWSTR | null,
iDevNum: T.DWORD,
lpDisplayDevice: S.DISPLAY_DEVICEW_Type,
dwFlags: T.DWORD,
) => T.BOOL
FindWindowExW: (
hwndParent: T.HWND,
hwndChildAfter: T.HWND,
lpszClass: T.LPCTSTR | null,
lpszWindow: T.LPCTSTR | null,
) => T.HWND
GetCursorPos: (lpPoint: S.POINT_Type) => T.BOOL
}
import { load } from 'win32-def'
import { POINT_Factory } from 'win32-def/struct'
const lib = load<Win32>(options)
const { payload: pos } = POINT_Factory()
const res = await lib.GetCursorPos_Async(pos)
assert(res > 0)
console.info({ res, pos })
assert(pos.x >= 0 && pos.y >= 0)
FAQs
win32 definitions for node-ffi
The npm package win32-def receives a total of 219 weekly downloads. As such, win32-def popularity was classified as not popular.
We found that win32-def demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.