{"_id":"@bun-win32/firewallapi","_rev":"4-df10a2ad069f16957cf3aac1af4ef2d6","name":"@bun-win32/firewallapi","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/firewallapi","version":"1.0.0","keywords":["bun","ffi","win32","windows","firewallapi","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/firewallapi@1.0.0","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"753ea81389bb4f4eefbe67089c7292e6c2f86d5f","tarball":"https://registry.npmjs.org/@bun-win32/firewallapi/-/firewallapi-1.0.0.tgz","fileCount":6,"integrity":"sha512-SSL3PFNuzalOeEr51GGVDcUSWSd1jLsC04oukPozIxSkUAES5kVa4w/0o9mZScbREMj7ghUMfLW0ZLP9JEY6wg==","signatures":[{"sig":"MEYCIQDNV+m4GPXvOFNJ0aFKRMZP7sqFFdXsHFBDhi1GgQ0PvwIhANXpJ810BqeK5kApfvKtW7UPAYIQ4gKH3clB8I5fzNb4","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15285},"main":"./index.ts","type":"module","module":"index.ts","shasum":"753ea81389bb4f4eefbe67089c7292e6c2f86d5f","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:firewall-audit":"bun ./example/firewall-audit.ts","example:firewall-x-ray":"bun ./example/firewall-x-ray.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-SSL3PFNuzalOeEr51GGVDcUSWSd1jLsC04oukPozIxSkUAES5kVa4w/0o9mZScbREMj7ghUMfLW0ZLP9JEY6wg==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/firewallapi"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 FirewallAPI (Windows Firewall / network isolation) bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/firewallapi_1.0.0_1779222160734_0.28946318731251175","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bun-win32/firewallapi","version":"1.0.1","keywords":["bun","ffi","win32","windows","firewallapi","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/firewallapi@1.0.1","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"134dcdb8124b5f40442bb9b526a09dcf5560621e","tarball":"https://registry.npmjs.org/@bun-win32/firewallapi/-/firewallapi-1.0.1.tgz","fileCount":6,"integrity":"sha512-BrcuIVWLZkiNB5U1x5uy25cZrXHguz8kxdyQthfwQLxtw85tO84ZSSc24NWfcEI3TzXpxcP05iYWghJhW0C6og==","signatures":[{"sig":"MEQCIB/ZsSHcBinRD2Cg0ZI8GAF7tcRQVYXROGWXe/RSNAsmAiAUa037CIfgc4ZLEET5HynIgkka05mdSjaBQ7CyJbTQ8w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15290},"main":"./index.ts","type":"module","module":"index.ts","shasum":"134dcdb8124b5f40442bb9b526a09dcf5560621e","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:firewall-audit":"bun ./example/firewall-audit.ts","example:firewall-x-ray":"bun ./example/firewall-x-ray.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-BrcuIVWLZkiNB5U1x5uy25cZrXHguz8kxdyQthfwQLxtw85tO84ZSSc24NWfcEI3TzXpxcP05iYWghJhW0C6og==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/firewallapi"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 FirewallAPI (Windows Firewall / network isolation) bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.4"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/firewallapi_1.0.1_1781130830788_0.6702370816352221","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/firewallapi","version":"2.0.0","keywords":["bun","ffi","win32","windows","firewallapi","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/firewallapi@2.0.0","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"64280bd671ff7feecb9061ea723dc5196a7b9a72","tarball":"https://registry.npmjs.org/@bun-win32/firewallapi/-/firewallapi-2.0.0.tgz","fileCount":6,"integrity":"sha512-GE7MBHNwiOCotaix+mrz+NZE2qY84UrcG2YuFAGkYwWYkcupS7ES/IH+vlYJuASTPG5tyZmQYpZ8dE6Nj/rV+w==","signatures":[{"sig":"MEUCIQD2Hr3UIsLOSbHnrCFAprHwmjiSzqZJrP4lDQHVxSHeVQIgXW85+OCCYeuKPcOhBPQmbbQr75HD7URhfgQBGgjIXtU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16603},"main":"./index.ts","type":"module","module":"index.ts","shasum":"64280bd671ff7feecb9061ea723dc5196a7b9a72","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:firewall-audit":"bun ./example/firewall-audit.ts","example:firewall-x-ray":"bun ./example/firewall-x-ray.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-GE7MBHNwiOCotaix+mrz+NZE2qY84UrcG2YuFAGkYwWYkcupS7ES/IH+vlYJuASTPG5tyZmQYpZ8dE6Nj/rV+w==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/firewallapi"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 FirewallAPI (Windows Firewall / network isolation) bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"26.3.0","dependencies":{"@bun-win32/core":"2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/firewallapi_2.0.0_1782435308839_0.874761339614399","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"author":"Stev Peifer <stev.p@outlook.com>","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dependencies":{"@bun-win32/core":"2.0.1"},"description":"Zero-dependency, zero-overhead Win32 FirewallAPI (Windows Firewall / network isolation) bindings for Bun (FFI) on Windows.","devDependencies":{"@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/firewallapi","peerDependencies":{"typescript":"^5"},"private":false,"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/firewallapi"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","firewallapi","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:firewall-audit":"bun ./example/firewall-audit.ts","example:firewall-x-ray":"bun ./example/firewall-x-ray.ts"},"_id":"@bun-win32/firewallapi@2.0.1","_integrity":"sha512-5lojJN2nsaPDgNC+3efZixLJ0x2yes8B6STPnW94nJenNSjkM08aCLT7J7/7ZwLlb6TWnyWRjwzuf+BDtT8keA==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"4571a662a7fb70bf01250fa551d8f03591a02193","dist":{"integrity":"sha512-5lojJN2nsaPDgNC+3efZixLJ0x2yes8B6STPnW94nJenNSjkM08aCLT7J7/7ZwLlb6TWnyWRjwzuf+BDtT8keA==","shasum":"4571a662a7fb70bf01250fa551d8f03591a02193","tarball":"https://registry.npmjs.org/@bun-win32/firewallapi/-/firewallapi-2.0.1.tgz","fileCount":6,"unpackedSize":16603,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEIXf6ihH27aFaJ4ANjxnuIWAblTSYWoXBh4CaMxsDo9AiB2cYAs2Z8dFz/pHkrixqbAJmAeF3bF50dYRDK72z7IDA=="}]},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"directories":{},"maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/firewallapi_2.0.1_1782437770147_0.9521928031163311"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-19T20:22:40.535Z","modified":"2026-06-26T01:36:10.453Z","1.0.0":"2026-05-19T20:22:40.888Z","1.0.1":"2026-06-10T22:33:50.919Z","2.0.0":"2026-06-26T00:55:09.016Z","2.0.1":"2026-06-26T01:36:10.322Z"},"bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","homepage":"https://github.com/ObscuritySRL/bun-win32#readme","keywords":["bun","ffi","win32","windows","firewallapi","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/firewallapi"},"description":"Zero-dependency, zero-overhead Win32 FirewallAPI (Windows Firewall / network isolation) bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/firewallapi\n\nZero-dependency, zero-overhead Win32 FirewallAPI bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/firewallapi` exposes the `FirewallAPI.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `FirewallApi`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.\n\n`FirewallAPI.dll` has a small documented flat-export surface: the 9 `NetworkIsolation*` AppContainer / network-isolation functions plus the four `Dll*` COM-server entry points. The Windows Firewall policy surface (`INetFwPolicy2`, `INetFwRules`, `INetFwRule`) is COM: `FirewallAPI.dll` is the registered in-process server for `CLSID_NetFwPolicy2`, so it is reached through `DllGetClassObject` + the `IClassFactory` / `INetFwPolicy2` vtables (see the example).\n\nThe bindings are strongly typed for a smooth DX in TypeScript.\n\n## Features\n\n- [Bun](https://bun.sh)-first ergonomics on Windows 10/11.\n- Direct FFI to `FirewallAPI.dll` (Windows Firewall policy COM server, network isolation, and AppContainer enumeration).\n- In-source docs in `structs/FirewallApi.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`FirewallApi.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/FirewallApi.ts`).\n\n## Requirements\n\n- [Bun](https://bun.sh) runtime\n- Windows 10 or later\n\n## Installation\n\n```sh\nbun add @bun-win32/firewallapi\n```\n\n## Quick Start\n\n```ts\nimport FirewallApi, { NETISO_FLAG } from '@bun-win32/firewallapi';\n\n// Enumerate every AppContainer registered on the system.\nconst count = Buffer.alloc(4);\nconst ppList = Buffer.alloc(8); // receives a PINET_FIREWALL_APP_CONTAINER\n\nconst status = FirewallApi.NetworkIsolationEnumAppContainers(NETISO_FLAG.NETISO_FLAG_FORCE_COMPUTE_BINARIES, count.ptr!, ppList.ptr!);\n\nif (status === 0) {\n  console.log(`AppContainers registered: ${count.readUInt32LE(0)}`);\n  // ppList now holds the address of the DLL-allocated array; walk it with\n  // Kernel32.ReadProcessMemory, then release it via\n  // FirewallApi.NetworkIsolationFreeAppContainers (see example/firewall-x-ray.ts).\n}\n```\n\n> [!NOTE]\n> AI agents: see `AI.md` for the package binding contract and source-navigation guidance. It explains how to use the package without scanning the entire implementation.\n\n## Examples\n\nRun the included examples:\n\n```sh\nbun run example:firewall-x-ray\nbun run example:firewall-audit\n```\n\n## Notes\n\n- Either rely on lazy binding or call `FirewallApi.Preload()`.\n- The `INetFwPolicy2` policy COM surface is reached via `DllGetClassObject` (this DLL is the registered `CLSID_NetFwPolicy2` in-process server). Call `CoInitialize` first.\n- Reading firewall profile state works unelevated; modifying policy requires elevation.\n- Windows only. Bun runtime required.\n- **SAL types & naming:** nullability is in the **type** — `Optional<T>` (formally optional, SAL `_*opt_`) and `Nullable<T>` (plain `[in]`/`[out]` the docs say can be NULL), the null sentinel derived from `T` (`null` for pointers `LP*`/`P*`, `0n` for handles/by-value addresses); direction is in the **parameter name** — `_out` (`_Out_`), `_in_out` (`_Inout_`), `_In_` bare. See `AI.md` and the repo `AGENTS.md`.\n","readmeFilename":"README.md"}