{"_id":"@bun-win32/rstrtmgr","_rev":"3-96cb1f01fa68dfbe1dbc1b5419a75148","name":"@bun-win32/rstrtmgr","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/rstrtmgr","version":"1.0.0","keywords":["bun","ffi","win32","windows","rstrtmgr","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/rstrtmgr@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":"1dd531e26930c9583e1c508be9e516da1beb0f52","tarball":"https://registry.npmjs.org/@bun-win32/rstrtmgr/-/rstrtmgr-1.0.0.tgz","fileCount":6,"integrity":"sha512-WlvA4mxgpPaBgargO8zlghGMoB75z7/qqWjYCbDmt8lRN5YkMI4iFVSGuxFYMvaLy6BFTPrKCtLMpao8CXkJFA==","signatures":[{"sig":"MEQCIAMiUaGH1u59dZh6+Pz/M6A82d3snzUTuUel/RHcUJ36AiAnot3EY8hWa1c3LCqi6HaGvN7mpAgCfjB6KnXbJtIxIg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14056},"main":"./index.ts","type":"module","module":"index.ts","shasum":"1dd531e26930c9583e1c508be9e516da1beb0f52","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:lock-atlas":"bun ./example/lock-atlas.ts","example:session-audit":"bun ./example/session-audit.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-WlvA4mxgpPaBgargO8zlghGMoB75z7/qqWjYCbDmt8lRN5YkMI4iFVSGuxFYMvaLy6BFTPrKCtLMpao8CXkJFA==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/rstrtmgr"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 RSTRTMGR 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/rstrtmgr_1.0.0_1775753921036_0.1501372873747755","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/rstrtmgr","version":"2.0.0","keywords":["bun","ffi","win32","windows","rstrtmgr","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/rstrtmgr@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":"e169143912acfd03fc4b624e3a08ca42c21be2c4","tarball":"https://registry.npmjs.org/@bun-win32/rstrtmgr/-/rstrtmgr-2.0.0.tgz","fileCount":6,"integrity":"sha512-XwH1lHWVTkZBFryxNOG1lt7GHnpEnw2cUl3ll7Q0YYkd1MLtQ94TApXjRkHiMMY+0actfuNOQfs72bJZPtaRgg==","signatures":[{"sig":"MEUCIHewdFJlgncvTDvKLnq8Ug39BgrJqRaH/0bDQyz6IyXSAiEA6mtJinqPzC+16UxJfutFR0uMJOAGxzkIaa3SvZfcBy4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15483},"main":"./index.ts","type":"module","module":"index.ts","shasum":"e169143912acfd03fc4b624e3a08ca42c21be2c4","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:lock-atlas":"bun ./example/lock-atlas.ts","example:session-audit":"bun ./example/session-audit.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-XwH1lHWVTkZBFryxNOG1lt7GHnpEnw2cUl3ll7Q0YYkd1MLtQ94TApXjRkHiMMY+0actfuNOQfs72bJZPtaRgg==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/rstrtmgr"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 RSTRTMGR 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/rstrtmgr_2.0.0_1782435500964_0.6962798098232685","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 RSTRTMGR 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/rstrtmgr","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/rstrtmgr"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","rstrtmgr","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:lock-atlas":"bun ./example/lock-atlas.ts","example:session-audit":"bun ./example/session-audit.ts"},"_id":"@bun-win32/rstrtmgr@2.0.1","_integrity":"sha512-csbXxyMFOFuamR7LlIv6uKedYNbf9Gls464ei2qXGM5pb3EyaUUWYopCoSPPEe/eZspSOVXfe+Trf0Cair0BJA==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"4c57bc9222025fddf421276c69ba78286f677b6f","dist":{"integrity":"sha512-csbXxyMFOFuamR7LlIv6uKedYNbf9Gls464ei2qXGM5pb3EyaUUWYopCoSPPEe/eZspSOVXfe+Trf0Cair0BJA==","shasum":"4c57bc9222025fddf421276c69ba78286f677b6f","tarball":"https://registry.npmjs.org/@bun-win32/rstrtmgr/-/rstrtmgr-2.0.1.tgz","fileCount":6,"unpackedSize":15483,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGcYfcvPrqUxlb7CafNUiZ+kSMBhBeTtUbPsuRqiEq//AiA+cwlNT+ihrNZzl6OCWdr2KxP6VIYA8QWjqmf9X6ud5w=="}]},"_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/rstrtmgr_2.0.1_1782438161178_0.9177205146591423"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-09T16:58:40.971Z","modified":"2026-06-26T01:42:41.452Z","1.0.0":"2026-04-09T16:58:41.225Z","2.0.0":"2026-06-26T00:58:21.094Z","2.0.1":"2026-06-26T01:42:41.315Z"},"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","rstrtmgr","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/rstrtmgr"},"description":"Zero-dependency, zero-overhead Win32 RSTRTMGR bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/rstrtmgr\n\nZero-dependency, zero-overhead Win32 Rstrtmgr bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/rstrtmgr` exposes the `rstrtmgr.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Rstrtmgr`, 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 `rstrtmgr.dll` (Restart Manager sessions, resource registration, lock discovery, shutdown, and restart orchestration).\n- In-source docs in `structs/Rstrtmgr.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Rstrtmgr.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Restart Manager aliases, enums, and constants (see `types/Rstrtmgr.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/rstrtmgr\n```\n\n## Quick Start\n\n```ts\nimport Rstrtmgr, { CCH_RM_SESSION_KEY } from '@bun-win32/rstrtmgr';\n\nconst sessionHandleBuffer = Buffer.alloc(4);\nconst sessionKeyBuffer = Buffer.alloc((CCH_RM_SESSION_KEY + 1) * 2);\n\nconst status = Rstrtmgr.RmStartSession(sessionHandleBuffer.ptr, 0, sessionKeyBuffer.ptr);\nif (status !== 0) {\n  throw new Error(`RmStartSession failed: ${status}`);\n}\n\nconst sessionHandle = sessionHandleBuffer.readUInt32LE(0);\nconst sessionKey = sessionKeyBuffer.toString('utf16le').replace(/\\0.*$/, '');\n\nconsole.log({ sessionHandle, sessionKey });\n\nRstrtmgr.RmEndSession(sessionHandle);\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:lock-atlas\nbun run example:session-audit\n```\n\n## Notes\n\n- Either rely on lazy binding or call `Rstrtmgr.Preload()`.\n- `RmReserveHeap` is exported by `rstrtmgr.dll` but omitted here because it is undocumented in `RestartManager.h` and Microsoft Learn.\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"}