{"_id":"@bun-win32/cfgmgr32","_rev":"4-760b43a8382701d901cc3abeab0f3762","name":"@bun-win32/cfgmgr32","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/cfgmgr32","version":"1.0.0","keywords":["bun","ffi","win32","windows","cfgmgr32","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/cfgmgr32@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":"b49811105cdabbf4fb8da2b594c89a374f0af82b","tarball":"https://registry.npmjs.org/@bun-win32/cfgmgr32/-/cfgmgr32-1.0.0.tgz","fileCount":6,"integrity":"sha512-WIKufNdokyXlMINHvxhp5jMgT1K7dau3Q+TF1KZzC2gPIyrt59yskjQDbDOTnn8JmcFEnrER8/RcDF392xSxpQ==","signatures":[{"sig":"MEYCIQDl0XrRR88pjMvkcJ4KnjrQYSuIJSys0XpmhSsCsz2R+wIhANk5HUz1Ro6IQohEPeF15+RAMIBBEu7aWeOXSHyjPgRx","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":141561},"main":"./index.ts","type":"module","module":"index.ts","shasum":"b49811105cdabbf4fb8da2b594c89a374f0af82b","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:device-tree":"bun ./example/device-tree.ts","example:usb-inventory":"bun ./example/usb-inventory.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-WIKufNdokyXlMINHvxhp5jMgT1K7dau3Q+TF1KZzC2gPIyrt59yskjQDbDOTnn8JmcFEnrER8/RcDF392xSxpQ==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/cfgmgr32"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 CFGMGR32 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/cfgmgr32_1.0.0_1775845997659_0.5286515392633504","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bun-win32/cfgmgr32","version":"1.0.1","keywords":["bun","ffi","win32","windows","cfgmgr32","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/cfgmgr32@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":"46fdd910a452771072c3c376349662e25d753b47","tarball":"https://registry.npmjs.org/@bun-win32/cfgmgr32/-/cfgmgr32-1.0.1.tgz","fileCount":6,"integrity":"sha512-jurU4t0Vn7lsBgpETo+yulyneXJJQXUjz7+O4q9o9Xfpo8WtFx776oTETtYUg+8OKj9l2bbvDedBlkQwl5nqYw==","signatures":[{"sig":"MEUCIC46MLHMpdA5smFWyojz8yIZZ0V/MjRLvIglj9usrqxZAiEAxJzjNBR5YZPAS4lXC2+hkSE/tAnPCi1wfsu+wm0euD0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":143567},"main":"./index.ts","type":"module","module":"index.ts","shasum":"46fdd910a452771072c3c376349662e25d753b47","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:device-tree":"bun ./example/device-tree.ts","example:usb-inventory":"bun ./example/usb-inventory.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-jurU4t0Vn7lsBgpETo+yulyneXJJQXUjz7+O4q9o9Xfpo8WtFx776oTETtYUg+8OKj9l2bbvDedBlkQwl5nqYw==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/cfgmgr32"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 CFGMGR32 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/cfgmgr32_1.0.1_1781130793507_0.6200810993702759","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/cfgmgr32","version":"2.0.0","keywords":["bun","ffi","win32","windows","cfgmgr32","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/cfgmgr32@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":"aae0ffd7ccff3d8bfae550119030d758ff18c2b4","tarball":"https://registry.npmjs.org/@bun-win32/cfgmgr32/-/cfgmgr32-2.0.0.tgz","fileCount":6,"integrity":"sha512-tH5D0fcKG/agPJmHSgmPScmqvtZXBG8nuDLmCrGkO9FX4EHUeHupAVyHM7O0HVFNY+8ShqTTPbn8nLhVlK4RcQ==","signatures":[{"sig":"MEQCICbNVLIPeToEVffhhb9Y5adsjivaGib9EZKdxvr5sEqVAiAAtcmTVND7csruJotncRJsyOvuCvMt5jhe1vp9qeQlyw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":146691},"main":"./index.ts","type":"module","module":"index.ts","shasum":"aae0ffd7ccff3d8bfae550119030d758ff18c2b4","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:device-tree":"bun ./example/device-tree.ts","example:usb-inventory":"bun ./example/usb-inventory.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-tH5D0fcKG/agPJmHSgmPScmqvtZXBG8nuDLmCrGkO9FX4EHUeHupAVyHM7O0HVFNY+8ShqTTPbn8nLhVlK4RcQ==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/cfgmgr32"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 CFGMGR32 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/cfgmgr32_2.0.0_1782435274294_0.44820694962265906","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 CFGMGR32 bindings for Bun (FFI) on Windows.","devDependencies":{"@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/cfgmgr32","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/cfgmgr32"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","cfgmgr32","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:device-tree":"bun ./example/device-tree.ts","example:usb-inventory":"bun ./example/usb-inventory.ts"},"_id":"@bun-win32/cfgmgr32@2.0.1","_integrity":"sha512-g4otIS2En16bebeg8PyvrTldj/5HDB3TrJ/5nycwXiN3OkRBsBLrmKRa8yHQ+oJ0sOxtonJ8C3vAnT1+UycNjA==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"79304cd4c0c68b87c6e97fc313e6bbce995031bb","dist":{"integrity":"sha512-g4otIS2En16bebeg8PyvrTldj/5HDB3TrJ/5nycwXiN3OkRBsBLrmKRa8yHQ+oJ0sOxtonJ8C3vAnT1+UycNjA==","shasum":"79304cd4c0c68b87c6e97fc313e6bbce995031bb","tarball":"https://registry.npmjs.org/@bun-win32/cfgmgr32/-/cfgmgr32-2.0.1.tgz","fileCount":6,"unpackedSize":146691,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFOrludE9Pcd/spt+Pe/RQfxU7+VZs2r2lsfrbAFYQEsAiBYbfIzWctYeth8F4UcmsuIPhzyfsXyrM7Dc6oNYRcCTA=="}]},"_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/cfgmgr32_2.0.1_1782437730389_0.020107168101967332"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-10T18:33:17.573Z","modified":"2026-06-26T01:35:30.651Z","1.0.0":"2026-04-10T18:33:17.791Z","1.0.1":"2026-06-10T22:33:13.658Z","2.0.0":"2026-06-26T00:54:34.446Z","2.0.1":"2026-06-26T01:35:30.524Z"},"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","cfgmgr32","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/cfgmgr32"},"description":"Zero-dependency, zero-overhead Win32 CFGMGR32 bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/cfgmgr32\n\nZero-dependency, zero-overhead Win32 Cfgmgr32 bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/cfgmgr32` exposes the `cfgmgr32.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Cfgmgr32`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.\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 `cfgmgr32.dll` (device tree traversal, configuration management, device properties, interfaces, and resources).\n- In-source docs in `structs/Cfgmgr32.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Cfgmgr32.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/Cfgmgr32.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/cfgmgr32\n```\n\n## Quick Start\n\n```ts\nimport Cfgmgr32, { CR, CM_LOCATE_DEVNODE } from '@bun-win32/cfgmgr32';\n\nCfgmgr32.Preload(['CM_Locate_DevNodeW', 'CM_Get_Device_IDW', 'CM_Get_Device_ID_Size']);\n\nconst dnDevInst = Buffer.alloc(4);\nlet cr = Cfgmgr32.CM_Locate_DevNodeW(dnDevInst.ptr, null, CM_LOCATE_DEVNODE.NORMAL);\n\nif (cr !== CR.SUCCESS) {\n  throw new Error(`CM_Locate_DevNodeW failed: CR=${cr}`);\n}\n\nconst devInst = dnDevInst.readUInt32LE(0);\nconst idLenBuf = Buffer.alloc(4);\ncr = Cfgmgr32.CM_Get_Device_ID_Size(idLenBuf.ptr, devInst, 0);\n\nif (cr !== CR.SUCCESS) {\n  throw new Error(`CM_Get_Device_ID_Size failed: CR=${cr}`);\n}\n\nconst idLen = idLenBuf.readUInt32LE(0);\nconst idBuf = Buffer.alloc((idLen + 1) * 2);\ncr = Cfgmgr32.CM_Get_Device_IDW(devInst, idBuf.ptr, idLen + 1, 0);\n\nif (cr !== CR.SUCCESS) {\n  throw new Error(`CM_Get_Device_IDW failed: CR=${cr}`);\n}\n\nconst rootDeviceID = new TextDecoder('utf-16le').decode(idBuf).replace(/\\0.*$/, '');\nconsole.log(`Root device: ${rootDeviceID}`);\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:device-tree\nbun run example:usb-inventory\n```\n\n## Notes\n\n- Either rely on lazy binding or call `Cfgmgr32.Preload()`.\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"}