{"_id":"@bun-win32/rpcrt4","_rev":"4-e68dffc3096add5bdbeaa30ec31e9a1e","name":"@bun-win32/rpcrt4","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/rpcrt4","version":"1.0.0","keywords":["bun","ffi","win32","windows","rpcrt4","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/rpcrt4@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":"4e2eb2b464dcda83f1c480d2670460c2f7355be0","tarball":"https://registry.npmjs.org/@bun-win32/rpcrt4/-/rpcrt4-1.0.0.tgz","fileCount":6,"integrity":"sha512-1EUcuf4QO5atXHQ2rWPaQF+mYTsmIwHtDJ2RRPTymODC8Iegg6B2Uqk08SMiastp6+F7oe3c0CQ3aItvSrCqMw==","signatures":[{"sig":"MEUCIEr+Du6Y0by8XiUD1Nuxw6Bd4nWWHs7Cd3pe/eZZPFcKAiEA/QYdP50FFmbijYi0LHEV19HeYBTwvnLn5mmHoAvHXmQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":94770},"main":"./index.ts","type":"module","module":"index.ts","shasum":"4e2eb2b464dcda83f1c480d2670460c2f7355be0","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:uuid-cascade":"bun ./example/uuid-cascade.ts","example:rpc-diagnostic":"bun ./example/rpc-diagnostic.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-1EUcuf4QO5atXHQ2rWPaQF+mYTsmIwHtDJ2RRPTymODC8Iegg6B2Uqk08SMiastp6+F7oe3c0CQ3aItvSrCqMw==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/rpcrt4"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 RPCRT4 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/rpcrt4_1.0.0_1778847654163_0.33153152813602893","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bun-win32/rpcrt4","version":"1.0.1","keywords":["bun","ffi","win32","windows","rpcrt4","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/rpcrt4@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":"7d18fc16df8660295001a6049db956ae176c7c08","tarball":"https://registry.npmjs.org/@bun-win32/rpcrt4/-/rpcrt4-1.0.1.tgz","fileCount":6,"integrity":"sha512-3EEz/unA9JcQMjUWScdwK8dD3kMUoWEiU+kNxvkIaBArTtHP/asnYCHB/TeIzxZ4a0jlSzYRi2Z6UzZ7gESdcQ==","signatures":[{"sig":"MEUCIQCCcCu4F5qPvo5jjUinDQ8u4Al69frHEX9m003qqk0B0wIgbUdyXm3sblC6mTFKBAUZ4H0wI/8MSF9kYNmUaJieCxE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":94797},"main":"./index.ts","type":"module","module":"index.ts","shasum":"7d18fc16df8660295001a6049db956ae176c7c08","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:uuid-cascade":"bun ./example/uuid-cascade.ts","example:rpc-diagnostic":"bun ./example/rpc-diagnostic.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-3EEz/unA9JcQMjUWScdwK8dD3kMUoWEiU+kNxvkIaBArTtHP/asnYCHB/TeIzxZ4a0jlSzYRi2Z6UzZ7gESdcQ==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/rpcrt4"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 RPCRT4 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/rpcrt4_1.0.1_1780581919447_0.013522974988226188","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/rpcrt4","version":"2.0.0","keywords":["bun","ffi","win32","windows","rpcrt4","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/rpcrt4@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":"d0c26cc84ba6de17d686c2eeafeb5e1f33298bd6","tarball":"https://registry.npmjs.org/@bun-win32/rpcrt4/-/rpcrt4-2.0.0.tgz","fileCount":6,"integrity":"sha512-s6oo+RgBkJIEFGqcfShnMPe9sE56ArZ1Xb7S8HzcNhIxLE12dYHSfeNQKCS01VUQt7Z1ikoLfsBMGfXyOPEP5A==","signatures":[{"sig":"MEQCIFInq56ItFHKguFk4KQ4Cmp6xGUNLAq4+fucKFYy1kL0AiBoPPhKtbLdKDnz+y+AAjEMcs6iLkWTBpd9Sx42cFZMag==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":98378},"main":"./index.ts","type":"module","module":"index.ts","shasum":"d0c26cc84ba6de17d686c2eeafeb5e1f33298bd6","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:uuid-cascade":"bun ./example/uuid-cascade.ts","example:rpc-diagnostic":"bun ./example/rpc-diagnostic.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-s6oo+RgBkJIEFGqcfShnMPe9sE56ArZ1Xb7S8HzcNhIxLE12dYHSfeNQKCS01VUQt7Z1ikoLfsBMGfXyOPEP5A==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/rpcrt4"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 RPCRT4 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/rpcrt4_2.0.0_1782435499610_0.976267765632862","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 RPCRT4 bindings for Bun (FFI) on Windows.","devDependencies":{"@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/rpcrt4","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/rpcrt4"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","rpcrt4","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:uuid-cascade":"bun ./example/uuid-cascade.ts","example:rpc-diagnostic":"bun ./example/rpc-diagnostic.ts"},"_id":"@bun-win32/rpcrt4@2.0.1","_integrity":"sha512-isPTULZny2NQ2kfhgGw/gsP3oz/PkRll2JcKWDKslMmGvfxeL3fEY3kLA2yyoA8mSJNnRHJnep/xURr6UP+W/A==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"103b27e2ec0640ea91e220615fe09108e8f6e334","dist":{"integrity":"sha512-isPTULZny2NQ2kfhgGw/gsP3oz/PkRll2JcKWDKslMmGvfxeL3fEY3kLA2yyoA8mSJNnRHJnep/xURr6UP+W/A==","shasum":"103b27e2ec0640ea91e220615fe09108e8f6e334","tarball":"https://registry.npmjs.org/@bun-win32/rpcrt4/-/rpcrt4-2.0.1.tgz","fileCount":6,"unpackedSize":98378,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDJbFyLLnC1ILb34iG1YXUPofVEjk3+s2yrM3WA7L110AIgMJB3AO8Z/KRy6SleY5SY0ze1LFQSB3KoEt0c/hendNk="}]},"_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/rpcrt4_2.0.1_1782438159798_0.7160940734618075"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-15T12:20:54.055Z","modified":"2026-06-26T01:42:40.082Z","1.0.0":"2026-05-15T12:20:54.340Z","1.0.1":"2026-06-04T14:05:19.614Z","2.0.0":"2026-06-26T00:58:19.762Z","2.0.1":"2026-06-26T01:42:39.952Z"},"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","rpcrt4","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/rpcrt4"},"description":"Zero-dependency, zero-overhead Win32 RPCRT4 bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/rpcrt4\n\nZero-dependency, zero-overhead Win32 RPCRT4 bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/rpcrt4` exposes the `rpcrt4.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Rpcrt4`, 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 `rpcrt4.dll` (UUID generation, RPC client/server, string bindings, endpoint mapping, authentication, error enumeration, and MES pickling).\n- In-source docs in `structs/Rpcrt4.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Rpcrt4.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/Rpcrt4.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/rpcrt4\n```\n\n## Quick Start\n\n```ts\nimport Rpcrt4 from '@bun-win32/rpcrt4';\nimport { read, toArrayBuffer, type Pointer } from 'bun:ffi';\n\n// Generate a fresh UUID\nconst uuid = Buffer.alloc(16);\nRpcrt4.UuidCreate(uuid.ptr!);\n\n// Convert to canonical string form\nconst stringOut = Buffer.alloc(8);\nRpcrt4.UuidToStringW(uuid.ptr!, stringOut.ptr!);\nconst strPtr = read.ptr(stringOut.ptr!) as Pointer;\nconst text = new TextDecoder('utf-16').decode(toArrayBuffer(strPtr, 0, 80)).replace(/\\0.*$/, '');\nconsole.log(text); // e.g. 7e8f0c30-1d8a-4b7e-9f12-2c3d4e5f6789\n\n// Free the wide string when done\nRpcrt4.RpcStringFreeW(stringOut.ptr!);\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:uuid-cascade\nbun run example:rpc-diagnostic\n```\n\n## Notes\n\n- Either rely on lazy binding or call `Rpcrt4.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"}