{"_id":"@bun-win32/wldap32","_rev":"3-bf5d52db8c66c9d3bab39d0506c850d9","name":"@bun-win32/wldap32","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/wldap32","version":"1.0.0","keywords":["bun","ffi","win32","windows","wldap32","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/wldap32@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":"8a48d19684900042793129b1bda7ff58ed26a38b","tarball":"https://registry.npmjs.org/@bun-win32/wldap32/-/wldap32-1.0.0.tgz","fileCount":6,"integrity":"sha512-pOP6+fa7RP+kUywukUtAyyJd8JeMBKH8pz65Z9Ob9nh9IO9PJ4Rpkn/yVinTZ+Ajhkw42mtPHbIyj+XL5WgS+Q==","signatures":[{"sig":"MEUCIHMsX+iujMpw3fZZ9APEx15AcI7nfnPsA6Zbf1kH6zAbAiEA2mrrBarZDiyD5TgUFyPjmzbEBFcuplgMtAKERyZe8bY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":113029},"main":"./index.ts","type":"module","module":"index.ts","shasum":"8a48d19684900042793129b1bda7ff58ed26a38b","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:dn-tree":"bun ./example/dn-tree.ts","example:directory-diagnostic":"bun ./example/directory-diagnostic.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-pOP6+fa7RP+kUywukUtAyyJd8JeMBKH8pz65Z9Ob9nh9IO9PJ4Rpkn/yVinTZ+Ajhkw42mtPHbIyj+XL5WgS+Q==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/wldap32"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 WLDAP32 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/wldap32_1.0.0_1779073021203_0.36009199986945584","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/wldap32","version":"2.0.0","keywords":["bun","ffi","win32","windows","wldap32","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/wldap32@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":"701763360724dfadf9f53ad24232a8982d802de0","tarball":"https://registry.npmjs.org/@bun-win32/wldap32/-/wldap32-2.0.0.tgz","fileCount":6,"integrity":"sha512-S/x3h3MahOnZhuWy+JgozFaPiAPublyqqOqPCwFodQuTNFRRiKpGmIkDP0loSduAmfPK2T1ZD3Zks3OQVDpHlg==","signatures":[{"sig":"MEQCIAG6mKti/X/8xbBdwHPhZKP75FKtsCjlejIgP8z/x/wnAiAJ/f+rWYsD2yqVV5mx9nT847KASF5tojhriUuQAZ73BA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":116003},"main":"./index.ts","type":"module","module":"index.ts","shasum":"701763360724dfadf9f53ad24232a8982d802de0","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:dn-tree":"bun ./example/dn-tree.ts","example:directory-diagnostic":"bun ./example/directory-diagnostic.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-S/x3h3MahOnZhuWy+JgozFaPiAPublyqqOqPCwFodQuTNFRRiKpGmIkDP0loSduAmfPK2T1ZD3Zks3OQVDpHlg==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/wldap32"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 WLDAP32 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/wldap32_2.0.0_1782436003659_0.19698104229351254","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 WLDAP32 bindings for Bun (FFI) on Windows.","devDependencies":{"@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/wldap32","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/wldap32"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","wldap32","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:directory-diagnostic":"bun ./example/directory-diagnostic.ts","example:dn-tree":"bun ./example/dn-tree.ts"},"_id":"@bun-win32/wldap32@2.0.1","_integrity":"sha512-F0BfoXjkPKGjBUi3SECO7DoyfDd5MC7taLIQvWf/MUX/vVqwhVFxTIANqcpk0nxmWW9kQKThTX34CQRqZKtWVA==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"216b5ca5f4bd32fbc4e86d463825c89e18f58676","dist":{"integrity":"sha512-F0BfoXjkPKGjBUi3SECO7DoyfDd5MC7taLIQvWf/MUX/vVqwhVFxTIANqcpk0nxmWW9kQKThTX34CQRqZKtWVA==","shasum":"216b5ca5f4bd32fbc4e86d463825c89e18f58676","tarball":"https://registry.npmjs.org/@bun-win32/wldap32/-/wldap32-2.0.1.tgz","fileCount":6,"unpackedSize":116003,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDazkPBYlHE3vRjd+++nLEXe0DWQUri9fy6ksvBFAXP8AiEA/IpOApMeL6AkkNIjsEbHTbbsBvtlCv4R4RZGo177m5Q="}]},"_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/wldap32_2.0.1_1782438228884_0.01100018329782082"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-18T02:57:01.107Z","modified":"2026-06-26T01:43:49.147Z","1.0.0":"2026-05-18T02:57:01.341Z","2.0.0":"2026-06-26T01:06:43.800Z","2.0.1":"2026-06-26T01:43:49.015Z"},"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","wldap32","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/wldap32"},"description":"Zero-dependency, zero-overhead Win32 WLDAP32 bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/wldap32\n\nZero-dependency, zero-overhead Win32 Wldap32 bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/wldap32` exposes the `wldap32.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Wldap32`, 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 `wldap32.dll` (the Windows LDAP client: directory bind/auth, search, modify, add/delete, rename, compare, extended operations, server/client controls, paged / sorted / virtual-list-view results, StartTLS, and the BER encode/decode primitives).\n- All 245 documented `winldap.h` / `winber.h` exports bound, both ANSI (`A`) and Unicode (`W`) variants.\n- In-source docs in `structs/Wldap32.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Wldap32.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/Wldap32.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/wldap32\n```\n\n## Quick Start\n\n```ts\nimport { read } from 'bun:ffi';\n\nimport Wldap32, { LdapOption, LdapRetcode, LdapVersion } from '@bun-win32/wldap32';\n\n// Open a session block. ldap_init is lazy — no socket is opened until the\n// first operation that needs the server. Pass null to find the default server.\nconst host = Buffer.from('ldap.example.com\\0', 'utf16le');\nconst ld = Wldap32.ldap_initW(host.ptr, 389);\nif (ld === 0n) throw new Error('ldap_initW failed');\n\n// Request LDAP v3 for this connection.\nconst version = Buffer.alloc(4);\nversion.writeUInt32LE(LdapVersion.Three, 0);\nWldap32.ldap_set_optionW(ld, LdapOption.Version, version.ptr);\n\n// ldap_err2stringW maps any result code to a human-readable string. It returns\n// a pointer to a wide string owned by wldap32 (do not free it).\nconst messagePointer = Wldap32.ldap_err2stringW(LdapRetcode.InvalidCredentials);\nif (messagePointer !== null) {\n  let message = '';\n  for (let offset = 0; ; offset += 2) {\n    const unit = read.u16(messagePointer, offset);\n    if (unit === 0) break;\n    message += String.fromCharCode(unit);\n  }\n  console.log(message); // \"Invalid Credentials\"\n}\n\nWldap32.ldap_unbind(ld);\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-diagnostic   # exhaustive offline LDAP toolkit report\nbun run example:dn-tree                # animated directory tree drawn from ldap_explode_dnW\n```\n\n## Notes\n\n- Either rely on lazy binding or call `Wldap32.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"}