{"_id":"@bun-win32/mpr","_rev":"3-cb596529be83a72db9c6fce61caab8b3","name":"@bun-win32/mpr","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/mpr","version":"1.0.0","keywords":["bun","ffi","win32","windows","mpr","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/mpr@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":"30834f31bab58547b6b3f0c9d69f61a428d34541","tarball":"https://registry.npmjs.org/@bun-win32/mpr/-/mpr-1.0.0.tgz","fileCount":6,"integrity":"sha512-aqt7/RHeypvuwCDce+bLnuRluYHSqjuE5RiBHCglw+y/z4NOVrBhVg9xZLLAmBuB4F0ynXwsi0/as8t7ktXYug==","signatures":[{"sig":"MEUCIQDjZCIFHyNbVJKbP6NXHvRija9DyAaig1xSb7l6upFB8AIgH3HR2YrmPiZAZrOfsl5pULHLbbzP39AYL8sB2lc+Xtw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21783},"main":"./index.ts","type":"module","module":"index.ts","shasum":"30834f31bab58547b6b3f0c9d69f61a428d34541","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:drive-audit":"bun ./example/drive-audit.ts","example:net-explorer":"bun ./example/net-explorer.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-aqt7/RHeypvuwCDce+bLnuRluYHSqjuE5RiBHCglw+y/z4NOVrBhVg9xZLLAmBuB4F0ynXwsi0/as8t7ktXYug==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/mpr"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 MPR 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","@bun-win32/kernel32":"1.0.21"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/mpr_1.0.0_1775784248071_0.7136792459817936","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/mpr","version":"2.0.0","keywords":["bun","ffi","win32","windows","mpr","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/mpr@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":"53941f3d0330a22c4a5b1303fa09b92d6cef62b5","tarball":"https://registry.npmjs.org/@bun-win32/mpr/-/mpr-2.0.0.tgz","fileCount":6,"integrity":"sha512-pm1JCtmYYhrERo7e/JQyOVAGwtgRAybyVqq5DHwy94oEmOP0FmiccychqnqG/Fdn5oxoffhX5BC853aktC4/PQ==","signatures":[{"sig":"MEUCIFnHuAjGQbLI26Ud9m9Wb7JP59exU8s3ShQ6SrM7Y8UnAiEAth1pFlVG6XZyfoRcOdoJ87igE3ejVZsMkxvZWDCSH4c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23465},"main":"./index.ts","type":"module","module":"index.ts","shasum":"53941f3d0330a22c4a5b1303fa09b92d6cef62b5","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:drive-audit":"bun ./example/drive-audit.ts","example:net-explorer":"bun ./example/net-explorer.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-pm1JCtmYYhrERo7e/JQyOVAGwtgRAybyVqq5DHwy94oEmOP0FmiccychqnqG/Fdn5oxoffhX5BC853aktC4/PQ==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/mpr"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 MPR 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","@bun-win32/kernel32":"2.0.0"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/mpr_2.0.0_1782435473445_0.17276055180117855","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 MPR bindings for Bun (FFI) on Windows.","devDependencies":{"@bun-win32/kernel32":"2.0.1","@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/mpr","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/mpr"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","mpr","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:drive-audit":"bun ./example/drive-audit.ts","example:net-explorer":"bun ./example/net-explorer.ts"},"_id":"@bun-win32/mpr@2.0.1","_integrity":"sha512-eGmFdJUO4GOK1S+TAmShNRNP7T3bVaSr6ToGruMi45rSZX5lP4djr7gCKJkQf8QMLMWS3a1PdhkGqnf0+4Hsqw==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"4a63ff4df8b91837ad8ca42b80abf86d930d0315","dist":{"integrity":"sha512-eGmFdJUO4GOK1S+TAmShNRNP7T3bVaSr6ToGruMi45rSZX5lP4djr7gCKJkQf8QMLMWS3a1PdhkGqnf0+4Hsqw==","shasum":"4a63ff4df8b91837ad8ca42b80abf86d930d0315","tarball":"https://registry.npmjs.org/@bun-win32/mpr/-/mpr-2.0.1.tgz","fileCount":6,"unpackedSize":23465,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDRq+BxXTHSQ9zuDQtUG8W+vd/MTNOmUYPlyh3VYshxhgIhANK85nC8bdm9MJ8Up/590FSw4TYZ2cHm6yNM/CuRfVUw"}]},"_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/mpr_2.0.1_1782438131159_0.9785448165425759"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-10T01:24:07.953Z","modified":"2026-06-26T01:42:11.441Z","1.0.0":"2026-04-10T01:24:08.203Z","2.0.0":"2026-06-26T00:57:53.586Z","2.0.1":"2026-06-26T01:42:11.303Z"},"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","mpr","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/mpr"},"description":"Zero-dependency, zero-overhead Win32 MPR bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/mpr\n\nZero-dependency, zero-overhead Win32 MPR bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/mpr` exposes the `mpr.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Mpr`, 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 `mpr.dll` (network drive mapping, UNC connections, resource enumeration).\n- In-source docs in `structs/Mpr.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Mpr.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/Mpr.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/mpr\n```\n\n## Quick Start\n\n```ts\nimport Mpr, { WN_NO_ERROR } from '@bun-win32/mpr';\n\n// Get the current network user\nconst userBuf = Buffer.alloc(512);\nconst sizeBuf = Buffer.alloc(4);\nsizeBuf.writeUInt32LE(256, 0);\n\nconst result = Mpr.WNetGetUserW(null, userBuf.ptr, sizeBuf.ptr);\n\nif (result === WN_NO_ERROR) {\n  const user = userBuf.toString('utf16le').replace(/\\0.*$/, '');\n  console.log(`Network user: ${user}`);\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:net-explorer\nbun run example:drive-audit\n```\n\n## Notes\n\n- Either rely on lazy binding or call `Mpr.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"}