
Security News
OpenGrep Restores Fingerprinting in JSON and SARIF Outputs
OpenGrep has restored fingerprint and metavariable support in JSON and SARIF outputs, making static analysis more effective for CI/CD security automation.
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)
26.1.1 (2024-12-26)
Note: Version bump only for package win32-api
FAQs
win32 definitions for node-ffi
The npm package win32-def receives a total of 305 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
OpenGrep has restored fingerprint and metavariable support in JSON and SARIF outputs, making static analysis more effective for CI/CD security automation.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.