{"_id":"@bun-win32/activeds","_rev":"4-d664e797acfb3d469a8b3bd467b0101c","name":"@bun-win32/activeds","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/activeds","version":"1.0.0","keywords":["bun","ffi","win32","windows","activeds","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/activeds@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":"9aed6be730f48a3eb84552dc7c790c2e8350b089","tarball":"https://registry.npmjs.org/@bun-win32/activeds/-/activeds-1.0.0.tgz","fileCount":6,"integrity":"sha512-QK3VpysYrwkIuofI8HR5gibL+XoC34+DDaN2gKynMoQErkZEdn6ADP2RY7GzGpC6wlzv7VGrZhLfr5C6Cva2KQ==","signatures":[{"sig":"MEYCIQDZg5Rqy0QtpQaeR18so6nI4I68ZBEIOAFm/ZiXRzTCoAIhAIXA7DWJumCVs2lGb9vYzIouSGNLJpYXLDHtV/Pl7Itz","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14074},"main":"./index.ts","type":"module","module":"index.ts","shasum":"9aed6be730f48a3eb84552dc7c790c2e8350b089","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:directory-explorer":"bun ./example/directory-explorer.ts","example:directory-constellation":"bun ./example/directory-constellation.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-QK3VpysYrwkIuofI8HR5gibL+XoC34+DDaN2gKynMoQErkZEdn6ADP2RY7GzGpC6wlzv7VGrZhLfr5C6Cva2KQ==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/activeds"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 ACTIVEDS 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/activeds_1.0.0_1779222174915_0.8113423888974389","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bun-win32/activeds","version":"1.0.1","keywords":["bun","ffi","win32","windows","activeds","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/activeds@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":"d50da46bceb2e05d12ee4ce6cde83d4dbcb658fe","tarball":"https://registry.npmjs.org/@bun-win32/activeds/-/activeds-1.0.1.tgz","fileCount":6,"integrity":"sha512-Eob6p6kDtpaQ9cD0KjpIZXxj6PvFbJi/tesw9mnpAqlLRkxqml0AqUbwoXh3oNgWst3RbQiUL2lQpm9aY22V+w==","signatures":[{"sig":"MEQCIGBMH2DW+C4dBFgpSRulsclF2tfHkTGjtWsfjjGQIhk4AiAyZcgD+4IhM/6OU6fq/AFW90gfC/HndIvD8kiawJCrlw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14079},"main":"./index.ts","type":"module","module":"index.ts","shasum":"d50da46bceb2e05d12ee4ce6cde83d4dbcb658fe","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:directory-explorer":"bun ./example/directory-explorer.ts","example:directory-constellation":"bun ./example/directory-constellation.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-Eob6p6kDtpaQ9cD0KjpIZXxj6PvFbJi/tesw9mnpAqlLRkxqml0AqUbwoXh3oNgWst3RbQiUL2lQpm9aY22V+w==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/activeds"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 ACTIVEDS 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/activeds_1.0.1_1781130776520_0.5762636362774995","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/activeds","version":"2.0.0","keywords":["bun","ffi","win32","windows","activeds","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/activeds@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":"bd40c550618a338235f9b1cbb31624dec036f50c","tarball":"https://registry.npmjs.org/@bun-win32/activeds/-/activeds-2.0.0.tgz","fileCount":6,"integrity":"sha512-9Fm74pycda3vrAK4jo2LGBEUgTmtuo1755bd9PpK308IGaQw4InCNkbpLOTMrrxpgmJ5p5nfhK/N8bc9WHkhhw==","signatures":[{"sig":"MEYCIQC27wwvy1mnnbOx8b7bh14ZEIaFEz49mQyzNl0hG3RWtgIhAIpfLjBHNNXhQbz7tMgtlXgfqTCvprNOTmGZaRG+YfWF","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15482},"main":"./index.ts","type":"module","module":"index.ts","shasum":"bd40c550618a338235f9b1cbb31624dec036f50c","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:directory-explorer":"bun ./example/directory-explorer.ts","example:directory-constellation":"bun ./example/directory-constellation.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-9Fm74pycda3vrAK4jo2LGBEUgTmtuo1755bd9PpK308IGaQw4InCNkbpLOTMrrxpgmJ5p5nfhK/N8bc9WHkhhw==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/activeds"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 ACTIVEDS 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/activeds_2.0.0_1782435262895_0.2170927803696916","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 ACTIVEDS bindings for Bun (FFI) on Windows.","devDependencies":{"@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/activeds","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/activeds"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","activeds","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:directory-constellation":"bun ./example/directory-constellation.ts","example:directory-explorer":"bun ./example/directory-explorer.ts"},"_id":"@bun-win32/activeds@2.0.1","_integrity":"sha512-69ygPAEYyJj44YrtIo+XErhXn0NWjvQr9NPgYB0qiFjBpD3vCveQdrqhig5gHExZgI6W6kd9hzsddskkVSSliQ==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"ce00abcde9a239ce7345db533766b08d662a003e","dist":{"integrity":"sha512-69ygPAEYyJj44YrtIo+XErhXn0NWjvQr9NPgYB0qiFjBpD3vCveQdrqhig5gHExZgI6W6kd9hzsddskkVSSliQ==","shasum":"ce00abcde9a239ce7345db533766b08d662a003e","tarball":"https://registry.npmjs.org/@bun-win32/activeds/-/activeds-2.0.1.tgz","fileCount":6,"unpackedSize":15482,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCweWPSfVdF0q/U0+5/6VBUK1W9iYyTUyDHaY0H62kO+gIhAK+RtC3MWYNcCcMhlJFnEPVi9RwvPmsuD64ImLbQf6em"}]},"_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/activeds_2.0.1_1782437716762_0.20021610924972366"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-19T20:22:54.768Z","modified":"2026-06-26T01:35:17.043Z","1.0.0":"2026-05-19T20:22:55.061Z","1.0.1":"2026-06-10T22:32:56.674Z","2.0.0":"2026-06-26T00:54:23.046Z","2.0.1":"2026-06-26T01:35:16.914Z"},"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","activeds","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/activeds"},"description":"Zero-dependency, zero-overhead Win32 ACTIVEDS bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/activeds\n\nZero-dependency, zero-overhead Win32 Activeds bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/activeds` exposes the `activeds.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Activeds`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.\n\nThese are the ADSI (Active Directory Service Interfaces) C/C++ helper functions: bind to a directory object by ADsPath (`ADsGetObject` / `ADsOpenObject`), enumerate container children (`ADsBuildEnumerator` / `ADsEnumerateNext` / `ADsFreeEnumerator`), build Automation variant arrays, and round-trip binary security descriptors. The object surface itself is COM (`IADs` / `IADsContainer`), driven through the returned interface pointers. The `WinNT:` provider works on a standalone machine; `LDAP:` requires a directory.\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 `activeds.dll` (ADSI directory automation).\n- In-source docs in `structs/Activeds.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Activeds.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/Activeds.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/activeds\n```\n\n## Quick Start\n\n```ts\nimport { CFunction, FFIType, type Pointer, dlopen, read } from 'bun:ffi';\n\nimport Activeds from '@bun-win32/activeds';\n\n// COM must be initialized before any ADSI bind.\nconst ole32 = dlopen('ole32.dll', { CoInitializeEx: { args: [FFIType.ptr, FFIType.u32], returns: FFIType.i32 } });\nole32.symbols.CoInitializeEx(null, 0x2 /* COINIT_APARTMENTTHREADED */);\n\n// IID_IADs = {fd8256d0-fd15-11ce-abc4-02608c9e7553}\nconst iid = Buffer.alloc(16);\niid.writeUInt32LE(0xfd8256d0, 0);\niid.writeUInt16LE(0xfd15, 4);\niid.writeUInt16LE(0x11ce, 6);\nBuffer.from([0xab, 0xc4, 0x02, 0x60, 0x8c, 0x9e, 0x75, 0x53]).copy(iid, 8);\n\nconst path = Buffer.from(`WinNT://${process.env.COMPUTERNAME},computer\\0`, 'utf16le');\nconst ppObject = Buffer.alloc(8);\n\nconst hr = Activeds.ADsGetObject(path.ptr!, iid.ptr!, ppObject.ptr!);\nconst pIADs = ppObject.readBigUInt64LE(0);\nconsole.log('ADsGetObject hr =', (hr >>> 0).toString(16), 'IADs* =', pIADs.toString(16));\n\n// IADs::get_Name is vtable slot 7 (IUnknown 0-2, IDispatch 3-6).\nconst vtable = read.u64(Number(pIADs) as Pointer, 0);\nconst getName = read.u64(Number(vtable) as Pointer, 7 * 8);\nconst pBstr = Buffer.alloc(8);\nCFunction({ ptr: Number(getName) as Pointer, args: [FFIType.u64, FFIType.ptr], returns: FFIType.i32 })(pIADs, pBstr.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:directory-explorer\nbun run example:directory-constellation\n```\n\n## Notes\n\n- Either rely on lazy binding or call `Activeds.Preload()`.\n- Call `CoInitializeEx` before any ADSI bind; ADSI objects are COM.\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"}