diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 2b696026..83baa5ab 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -20,13 +20,13 @@ model; see [the Win32 architecture](../docs/architecture/flat-win32-contracts.md # Build everything cargo build -# Core library tests (52 tests, 1 ignored — requires WinAppSDK) +# Core library tests (WinAppSDK-specific tests require their SDK inputs) cargo test -p dynwinrt -# dynwinrt-codegen tests (49 unit tests + 1 snapshot test) +# dynwinrt-codegen unit, integration, and snapshot tests cargo test -p dynwinrt-codegen -# Python binding (requires Python 3.8+ and maturin) +# Python binding (requires CPython 3.11-3.14 and maturin) cd bindings/py python -m venv .venv && .venv/Scripts/Activate.ps1 pip install pytest maturin @@ -111,12 +111,12 @@ semantics. Classic COM changes must preserve existing WinRT models, generated output, runtime behavior, and the `@microsoft/dynwinrt` root API. ### Code Generator (dynwinrt-codegen) -- `src/codegen/project.rs` + `src/codegen/projected.rs` — Build the language-neutral `ProjectedFile` IR from parsed metadata -- `src/codegen/render_js.rs` + `src/codegen/render_dts.rs` — Render IR to `.js` and `.d.ts` -- `src/codegen/python.rs` + `src/codegen/py_method.rs` + `src/codegen/python_stub.rs` — Python `.py` and `.pyi` generation -- `src/codegen/common.rs` — Shared helpers (type mapping, argument wrapping, return conversion) -- `src/codegen/typescript.rs` + `src/codegen/method.rs` — Index-file generation and ESM/CJS shim helpers (name is historical; no longer emits stand-alone `.ts` output) -- `--lang js` (default) generates `.js` + ambient `.d.ts` with the `DynWinRtType`/`DynWinRtValue` API (camelCase) +- `src/codegen/winrt/javascript/project/` + `ir.rs` — Build the JavaScript/TypeScript projection IR from parsed metadata +- `src/codegen/winrt/javascript/render/` — Render CommonJS `.js` and `.d.ts` declarations +- `src/codegen/winrt/javascript/generator.rs` — Index-file generation and ESM/CommonJS facades +- `src/codegen/winrt/python/generator/` + `stubs.rs` — Python `.py` and `.pyi` generation +- `src/codegen/winrt/shared/` — Shared WinRT dependency, import, and documentation helpers +- `--lang js` (default) generates CommonJS `.js`, ESM index facades, and `.d.ts` with the `DynWinRtType`/`DynWinRtValue` API (camelCase) - `--lang py` generates `.py`, `.pyi`, and a `py.typed` marker by default using the `DynWinRTType`/`DynWinRTValue` API (snake_case); `--no-pyi` opts out ### Python Binding API Names diff --git a/CLAUDE.md b/CLAUDE.md index 285c6738..8765fdfa 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -109,22 +109,22 @@ napi-rs binding exposing: `DynWinRtType`, `DynWinRtMethodSig`, `DynWinRtMethodHa ### Python Binding (`bindings/py/`) -PyO3 binding exposing: `DynWinRTType`, `DynWinRTMethodSig`, `DynWinRTMethodHandle`, `DynWinRTValue`, `DynWinRTArray`, `DynWinRTStruct`, `DynWinRtDelegate`, `WinGUID`. Async operations block via `wait()` (releases GIL). Events use `DynWinRtDelegate.create()` with `Python::attach()` for GIL-safe callback invocation. +PyO3 binding exposing: `DynWinRTType`, `DynWinRTMethodSig`, `DynWinRTMethodHandle`, `DynWinRTValue`, `DynWinRTArray`, `DynWinRTStruct`, `DynWinRtDelegate`, `WinGUID`. Generated async operations support `asyncio`; the low-level `wait()` fallback blocks with the GIL released. Events use `DynWinRtDelegate.create()` with `Python::attach()` for GIL-safe callback invocation. ### Code Generation Tool (`dynwinrt-codegen`, source in `tools/dynwinrt-codegen/`) Reads .winmd metadata and generates typed wrapper code: -- `--lang js` (default): emits ESM `.js` + ambient `.d.ts` (no tsc step required) using the `DynWinRtType`/`DynWinRtValue` API +- `--lang js` (default): emits CommonJS `.js`, ESM index facades, and `.d.ts` declarations using the `DynWinRtType`/`DynWinRtValue` API; no tsc step is required - `--lang py`: Python classes using the `DynWinRTType`/`DynWinRTValue` API, with `.pyi` stubs and a `py.typed` marker by default; `--no-pyi` opts out - Handles: classes, interfaces, enums, structs (pack/unpack), delegates (IID + param types), async operations (with `AbortSignal`/cancellation), generic collections, events - Auto-detects Windows SDK winmd, auto-discovers sibling `.winmd` files in the same directory, resolves transitive dependencies Key codegen modules: -- **codegen/common.rs**: Shared helpers — type mapping, method sig building, struct field accessors, argument wrapping, return conversion (both JS and Python variants) -- **codegen/project.rs** + **codegen/projected.rs**: Build `ProjectedFile` IR from metadata -- **codegen/render_js.rs** + **codegen/render_dts.rs**: Render IR to `.js` and `.d.ts` -- **codegen/python.rs** + **codegen/py_method.rs** + **codegen/python_stub.rs**: Python `.py` and `.pyi` generation -- **codegen/typescript.rs** + **codegen/method.rs**: Legacy TS generators (still used by some code paths) +- **codegen/winrt/shared/**: Shared WinRT dependency, import, and documentation helpers +- **codegen/winrt/javascript/project/** + **ir.rs**: Build the JavaScript/TypeScript projection IR from metadata +- **codegen/winrt/javascript/render/**: Render CommonJS `.js` and `.d.ts` declarations +- **codegen/winrt/javascript/generator.rs**: Index-file generation and ESM/CommonJS facades +- **codegen/winrt/python/generator/** + **stubs.rs**: Python `.py` and `.pyi` generation - **meta.rs**: WinMD parsing — classes, interfaces, enums, methods, parameters, vtable indices - **types.rs**: `TypeMeta` enum describing WinRT types extracted from metadata - **xml_doc.rs**: Loads sibling `.xml` files (C# /doc format) to inject JSDoc/docstrings @@ -136,9 +136,9 @@ Tests use real Windows APIs without mocking: - **Core Rust tests** (`cargo test -p dynwinrt`): Uri, HttpClient (async), XmlDocument, metadata reading, vector/map collections - **dynwinrt-codegen tests** (`cargo test -p dynwinrt-codegen`): Snapshot tests for Uri TypeScript output, unit tests for type mapping/codegen - **Python binding tests** (`bindings/py/tests/`): - - `test_basic.py` (27 tests): All binding features — primitives, GUID, arrays, structs, enum, URI E2E - - `test_e2e_winrt.py` (19 tests): Real WinRT APIs — XmlDocument, Geopoint, PropertyValue, Buffer, Uri - - `test_runtime.py` (5 tests): Value conversion utilities + - `test_basic.py`: Binding features — primitives, GUID, arrays, structs, enum, URI E2E + - `test_e2e_winrt.py`: Real WinRT APIs — XmlDocument, Geopoint, PropertyValue, Buffer, Uri + - `test_runtime.py`: Value conversion utilities ## Common Patterns @@ -173,23 +173,27 @@ let delegate = dynwinrt::delegate::create_delegate_value( ```rust // Core: WinRTValue::Async implements Future let result = async_value.await?; +``` +```js // JS: returns Promise -let result = value.toPromise().await?; +const result = await value.toPromise(); +``` -// Python: blocks with GIL released -let result = value.wait()?; +```python +result = await generated_async_operation +result = value.wait() # Low-level blocking fallback; releases the GIL. ``` ## Known Limitations - Delegate callbacks support up to 2 ABI parameters (covers ~95% of WinRT delegates) -- No DispatcherQueue / XAML hosting support (data APIs only, no UI framework) — WinUI-style controls need composition/aggregation of runtime classes, which the codegen skips (see composable `.ctor` note in `docs/status/TODO.md`) -- Python binding does not yet support async/await integration with `asyncio` +- WinUI/XAML hosting and DispatcherQueue support remain experimental and require matching Windows App SDK metadata and runtime inputs. +- Python generated async operations integrate with `asyncio`; synchronous interface-implementation callbacks must not return coroutines. ## Environment Setup — updated invariant -`initialize_winappsdk()` currently `.expect(...)`s the `WINAPPSDK_BOOTSTRAP_DLL_PATH` environment variable at `crates/dynwinrt/src/winapp.rs:43`. Auto-detection from `~/.winapp/packages/`, `~/.nuget/packages/microsoft.windowsappsdk.*/`, and Program Files install paths is tracked in `docs/status/TODO.md` P0. +Windows App SDK bootstrap requires an explicit `bootstrap_dll_path` or `WINAPPSDK_BOOTSTRAP_DLL_PATH`. Missing paths, invalid versions, and DLL/export failures return errors; they do not panic. Samples restore or select matching SDK inputs explicitly. Bootstrap-path auto-discovery is not implemented. ## Implementation Notes diff --git a/eng/release/RELEASE_NOTES.md b/eng/release/RELEASE_NOTES.md index fa119f79..7375c374 100644 --- a/eng/release/RELEASE_NOTES.md +++ b/eng/release/RELEASE_NOTES.md @@ -1,151 +1,89 @@ -## Prerelease v0.1.0-preview.22 +## Prerelease v0.1.0-preview.23 -This preview adds standalone WinRT interface implementations, improves Python -asyncio and Classic COM support, and introduces experimental flat Win32 bindings. -It also includes projection, collection, ownership, and native-boundary fixes -since preview.21. +This preview improves Python apartment lifetime safety, collection comparisons and write contracts, Object value conversion, and generated-package installation on Windows. It also strengthens Python callback, overload, and typing contracts, and fixes generated JavaScript/TypeScript interface inputs and async-with-progress Promises. These changes are relative to preview.22. -## Packages and requirements +## Packages and installation - `@microsoft/dynwinrt` - JavaScript/TypeScript runtime. - `@microsoft/dynwinrt-codegen` - JavaScript/TypeScript code generator. - `dynwinrt` - Native Python runtime. - `dynwinrt-codegen` - Standalone Python code generator. -Runtime packages target Windows x64 and ARM64. JavaScript requires Node.js 18 -or later; the Python runtime and generated bindings require CPython 3.11-3.14. -Available APIs also depend on the installed Windows version, SDK components, -package identity, and hardware. +- **Runtime platforms:** Windows x64 and ARM64. +- **JavaScript version:** Node.js 18 or later. +- **Python version:** CPython 3.11-3.14 for the runtime and generated bindings. +- **API availability:** Depends on the Windows version, installed SDK components, package identity, and hardware. +- **Package versions:** Use the same runtime and codegen version for each language. +- **Upgrade cleanup:** Clean old generated bindings before using the new version. ```powershell -npm install @microsoft/dynwinrt -npm install -D @microsoft/dynwinrt-codegen -python -m pip install --pre dynwinrt dynwinrt-codegen +npm install @microsoft/dynwinrt@0.1.0-preview.23 +npm install -D @microsoft/dynwinrt-codegen@0.1.0-preview.23 +python -m pip install --pre "dynwinrt==0.1.0rc23" "dynwinrt-codegen==0.1.0rc23" ``` ## Highlights -### WinRT interface implementations - -Implement supported WinRT interfaces in JavaScript or Python with -`.implement(...)` and `.implementation(...)`. Synchronous, owner-thread handlers -support methods, properties, events, supported structs/arrays, and named multiple -outputs, with typed interface views, multi-interface composition, and explicit -release/disposal. This does not register an OS class or create a COM server. -See the supported contracts and lifetime rules in the -[interface implementation guide](https://github.com/microsoft/dynwinrt/blob/main/docs/guides/windows/winrt-interface-implementations.md). - -### Python asyncio and value conversion - -- Use generated operations with `asyncio.create_task()` and `TaskGroup`, retaining - cancellation and progress. Task scheduling is one-shot; direct awaits remain repeatable. -- Copy between `IBuffer` and JavaScript `Buffer`/`Uint8Array` or Python `bytes`/`bytearray`. -- Explicitly unbox supported `IPropertyValue` scalars and arrays with - `unboxObject()` / `unbox_object()`; generated `Object` results remain unchanged. - -### Expanded Classic COM projections - -- Expand contract-validated JS/TS projections, including HGLOBAL transfer and - variable-length audio formats. -- Add non-consuming `projectAs(...)` interface views, bounded typed activation, - and native completion-to-Promise support for `ActivateAudioInterfaceAsync`. -- Add bounded copy helpers for supported audio, WIC, and linear Media Foundation operations. -- Generate canonical namespace output under `generated/com/`, with separate - unsafe companions and `@microsoft/dynwinrt/com/unsafe/raw`. -- Give previously ambiguous ordinary overloads explicit slot-qualified names - and centralize metadata, ownership, and cleanup contract evidence. - -Safe support remains contract-specific; unsafe entrypoints retain caller-owned -ABI, ownership, and lifetime obligations. - -### Experimental flat Win32 bindings - -Generate JS/TS bindings for a validated subset of DLL exports through -`@microsoft/dynwinrt/win32`, with CJS/ESM namespace modules, status and `LastError` -handling, managed resource cleanup, and explicit Winsock, GDI+, and Media -Foundation contexts. File I/O includes cancellable IOCP-backed -`ReadFile`/`WriteFile` Promises with bounded buffers. Support is partial and does -not yet provide a backward-compatibility guarantee. See the -[Win32 support guide](https://github.com/microsoft/dynwinrt/blob/main/docs/architecture/flat-win32-contracts.md). - -## Correctness and reliability - -- Preserve signed and unsigned WinRT enum backing types in signatures, generic - IIDs, and value conversion, including high-bit constants, arrays, struct - fields, boxed references, and callbacks. -- Normalize signed 32-bit patterns from JavaScript bitwise operations for - generated WinRT and Classic COM UInt32 flags inputs, without relaxing - ordinary UInt32 validation. -- Reject mismatched native-wrapper types in JavaScript calls, including nested - collection inputs and callback results. -- Fix WinRT collection bulk-operation element strides and reject unsupported - collection layouts or ownership shapes before native use. -- Accept explicit `null` for generated JavaScript WinRT collection inputs; - omitted or `undefined` arguments do not silently become null. -- Fix JavaScript collection factories and automatic `IReference` element - boxing, including native array parameters. Convert JavaScript `Map` inputs - to independently owned `IMapView` snapshots through the native `GetView` operation. -- Make duplicate map-constructor keys follow `Insert`: the last value wins, - while the first key and its iteration position are retained. Compare admitted - struct elements and keys by their fields rather than padding, using numerical - floating-point equality. -- Register WinRT interfaces by IID rather than short name, avoiding collisions - between independently generated packages. -- Fix ownership cycles in runtime metadata registration. -- Preserve Win32 resource ownership when explicit cleanup fails, allowing cleanup - to be retried. -- Fix TypeScript union-element array declarations and align nullable collection - output types with runtime values. -- Fix generated COM identifier escaping and architecture-specific aggregate keys. -- Fix Python annotation and helper-name collisions, including standalone nested - struct defaults, and distinguish closed generic interfaces by complete - semantic identity. Improve instance/interface input typing and preserve - subclass types in projected factories. -- Return Python `Char16[]` values as characters, matching their `list[str]` - declarations. Code that relied on integer elements can use `ord()` explicitly. -- Enforce Python projection-scope thread affinity and improve WinUI teardown - through explicit process-level module ownership. Activated WinUI implementation - modules remain loaded until process exit; in-process hot replacement is not supported. -- Resolve CoreMessaging for DispatcherQueue creation and GDI/USER32 helpers - lazily, avoiding their unconditional direct production DLL dependencies. +### Python apartment and native-owner safety + +- Release library-owned COM references before the final managed apartment close. `projected_lifetime_scope()` is optional. +- Block final apartment teardown inside synchronous native callbacks. Preserve guards for recovery. +- Keep nested initialization counts balanced, including initialization during cleanup. Preserve failed closes for retry. +- Reject wrong-thread apartment closes without changing state. Preserve dropped guards for owner-thread recovery. +- Refuse cleanup of unsafe pending async owners. Cleanup does not silently cancel work. + +Recover deferred guards with `RoApartment.recover_pending()` on the owner thread. Use `retry_pending_apartment_close()` for failed unnamed closes. + +### Python collections and Object values + +- Match class, interface, and raw references by COM identity in collection comparisons. Equality and hashing outside collections stay unchanged. +- Preserve mapping entry counts and ordinary Python value equality. Raw `Object` collections do not implicitly box or unbox. +- Align bulk-write input types with item assignment. Preserve native member names and dispatch. +- Return the stored read projection from `setdefault()`. Do not consume the caller's input. +- Add explicit Object boxing with `to_winrt_object()`. Generated Object positions remain native by default. +- Extend `unbox_object()` to DateTime, TimeSpan, geometry, and arrays. Retain exact WinRT types when requested. +- Add opt-in Object map views with `object_value_view()`. Reads unbox and writes box. `.raw` stays native. + +### Python projection contracts + +- Project typed delegate arguments from native signatures. Include typed `MapChanged` callbacks. +- Keep `.py` and `.pyi` overloads and aliases consistent. Accept compatible interface inputs through QueryInterface. +- Default `.pyi` outputs to non-null. Preserve supported nullable results, including XML DOM results. +- Reject native null in stock JSON writes before mutation. Keep valid nulls in custom generic collections. +- Validate interface construction and arrays before retaining native references. Reject Async receivers in `call_0()` and `call_1()`. +- Add named apartment constants and clearer runtime errors. +- Fix strict click-handler typing in both Python Tic-Tac-Toe samples. + +### Python package generation and Windows paths + +- Improve Windows installs with shorter module and staging paths. Keep public type names and namespace exports unchanged. +- Record the producer version in `.dynwinrt-generator.json`. Reject incompatible output before changing files. Keep same-version incremental generation. +- Warn when final generated paths reach the legacy Windows limit. + +### JavaScript/TypeScript and shared code generation + +- Reuse the projected Promise for repeated async-with-progress `.toPromise()` calls. Avoid duplicate native completion registration. +- Generate real interface-method aliases with matching TypeScript declarations. Keep existing overload dispatch unchanged. +- Handle explicitly selected non-generic WinRT delegates in JavaScript and Python. Reject malformed or open-generic delegate roots. ## Upgrade notes -Upgrade runtime and codegen together, then regenerate affected bindings. -Regenerate all packages sharing unsigned WinRT enum declarations together; -do not mix old signed declarations with corrected unsigned declarations. - -- **Python:** fully regenerate and rebuild/reinstall all packages exchanging - closed generic interfaces together. Do not mix old and new stubs. Prefer public - namespace exports over hard-coded internal or long generated module paths. - Worker threads need their own `RoApartment` and `projected_lifetime_scope()`. -- **JavaScript/TypeScript collections:** guard nullable collection outputs. - A present `null` differs from the `undefined` returned for a missing map key - or out-of-range `at()` index. Map `get()` now propagates conversion and native - errors; its `HasKey`/`Lookup` sequence is not atomic against native mutation. -- **Low-level JavaScript UInt32 inputs:** factories, array constructors, and fast - setters reject negative, fractional, non-finite, and out-of-range values - instead of silently wrapping them. Generated UInt32 flags projections handle - ordinary JavaScript bitwise combinations. -- **Classic COM (JS/TS):** regenerate all selected roots into a fresh output directory - and update imports for the namespace layout. -- **Node.js / Electron:** use runtime entrypoints from the same installed package; - do not mix native objects from different builds. - -## Samples and notes - -New and updated samples cover standalone interface implementations, XAML and -code-only WinUI apps, OCR, asynchronous file I/O, Aion Electron chat, and flat -Win32 system/registry/file operations. Setup guidance adopts WinApp CLI and -clarifies metadata, packaging, Windows component, and hardware prerequisites. -See each sample's README before running it. - -Build and release workflows gain parallel validation, expanded projection and -native-boundary regression coverage, and file-based release notes. Native -dependency inspection no longer requires Visual Studio. Guides, JavaScript -binding internals, and benchmark dependencies are also updated. - -Classic COM, flat Win32, and WinUI hosting remain experimental. - -For installation and usage, see the -[README](https://github.com/microsoft/dynwinrt#readme). +Upgrade runtime and codegen together. Regenerate bindings and rebuild/reinstall generated packages. Do not mix old bindings or stubs with the new runtime. + +- **Python lifecycle:** Balance each worker thread's apartment explicitly. `projected_lifetime_scope()` is optional. External COM references remain caller-owned. +- **Python regeneration:** Regenerate fully in a fresh or cleaned generated-output directory. Do not delete or edit only the producer stamp. Use namespace imports for shortened modules. +- **Python typing:** Regenerate `.py` and `.pyi` together. Guard nullable results before member access. SDK nullability facts are not universal. +- **Python collection defaults:** `setdefault()` returns the map's read projection. Raw `Object` maps return `DynWinRTValue | None`. Project or unbox results explicitly. +- **Python JSON:** Use `JsonValue.create_null_value()` for JSON null. Do not pass `None` to stock JSON collections. +- **Python Object conversion:** Plain `int` values box as Int32. Use tags or `PropertyType` for other types. Re-boxing does not preserve box identity. +- **JavaScript/TypeScript:** Regenerate wrappers for interface aliases and the progress Promise fix. A runtime-only upgrade does not update generated code. +- **Rust source compatibility:** Update exhaustive matches on `PropertyValueData` and `PropertyValueUnboxResult`. Handle new variants and `Unsupported(PropertyType)`. Keep `Null` and `NotPropertyValue` distinct. + +## Known boundaries + +- **Experimental APIs:** Classic COM, flat Win32, and WinUI hosting remain experimental. +- **Collection producers:** Architecture-specific support limits remain unchanged. +- **ARM64 WinUI:** Native live coverage remains incomplete. +- **Embedded hosts:** Stop new calls and settle in-flight callbacks. Call `shutdown_python_callbacks()` before `Py_FinalizeEx`. Skipping this protocol leaves only best-effort protection. + +For details, see the [Python runtime guide](https://github.com/microsoft/dynwinrt/blob/main/bindings/py/README.md), [Python codegen path guidance](https://github.com/microsoft/dynwinrt/blob/main/tools/dynwinrt-codegen/python/README.md#windows-path-length), and the [project README](https://github.com/microsoft/dynwinrt#readme). diff --git a/eng/release/UNRELEASED.md b/eng/release/UNRELEASED.md index 42b5f89e..4932c889 100644 --- a/eng/release/UNRELEASED.md +++ b/eng/release/UNRELEASED.md @@ -1,18 +1,9 @@ ## Unreleased (next preview) -Draft notes for a future release, not part of v0.1.0-preview.22. Before tagging -the next release, promote the applicable entries to `RELEASE_NOTES.md` under -the correct version heading. The release pipeline does not stage this file. +Potential improvements for the next preview: -### Python Object values - -- Explicitly box Python values with `to_winrt_object()` and convert values in - supported Object-valued maps with `dynwinrt.values.object_value_view()`. - Generated `Object` positions remain native by default. - -### Rust source compatibility - -- Exhaustive matches on the public `PropertyValueData` and - `PropertyValueUnboxResult` enums must add arms for the new payload variants - and `PropertyValueUnboxResult::Unsupported(PropertyType)`. Handle unsupported - boxes explicitly; keep `Null` and `NotPropertyValue` distinct. +- Broader ABI-safe POD vector support for JavaScript and Python ([#161](https://github.com/microsoft/dynwinrt/issues/161), [#179](https://github.com/microsoft/dynwinrt/pull/179)). +- Explicit Object-value conversion helpers for JavaScript/TypeScript, including boxing, typed unboxing, and opt-in map views. +- Python Classic COM: generated wrappers, object activation, QueryInterface, and managed reference cleanup. +- JavaScript/TypeScript: managed COM interface replacement and broader flat Win32 buffer and resource contracts. +- Smaller generated JavaScript by sharing implementation helpers ([#182](https://github.com/microsoft/dynwinrt/issues/182)). diff --git a/samples/js/README.md b/samples/js/README.md index 84cf03da..88d3f598 100644 --- a/samples/js/README.md +++ b/samples/js/README.md @@ -10,6 +10,7 @@ The application samples below use generated bindings and the | [`windows-hello`](windows-hello/) | Electron, Windows Hello, and HWND-bound Classic COM interop | | [`electron-share-ui`](electron-share-ui/) | Electron Share UI with WinRT and Classic COM | | [`electron-smtc`](electron-smtc/) | Electron system media controls and GSMTC loopback | +| [`electron-aion-chat`](electron-aion-chat/) | Local Aion streaming chat in Electron; requires Snapdragon ARM64, QNN, and the Aion preview framework | | [`interface-implementation`](interface-implementation/) | Standalone JavaScript-backed WinRT interfaces, native IBackgroundTask calls, and multi-interface lifetime | | [`win32`](win32/) | Generated Win32 DLL exports, Registry buffers and handle cleanup, and IOCP-backed asynchronous file I/O | | [`ocr`](ocr/) | Windows AI TextRecognizer OCR, generated bindings, interactive picker or `--image`, and private WinApp CLI identity | diff --git a/samples/js/windows-hello/README.md b/samples/js/windows-hello/README.md index b5864ca6..c579e9bd 100644 --- a/samples/js/windows-hello/README.md +++ b/samples/js/windows-hello/README.md @@ -14,8 +14,10 @@ native addon, without requiring sample-specific C++ or `node-gyp`. - Windows 10 or 11; - Windows Hello configured for the current user; -- Node.js and Rust/Cargo; and -- a Windows SDK containing `Windows.winmd`. +- Node.js and Rust/Cargo; +- a Windows SDK containing `Windows.winmd`; and +- `Microsoft.Windows.SDK.Win32Metadata` containing `Windows.Win32.winmd` + for the Classic COM interop projection. ## Run @@ -36,6 +38,9 @@ npm run generate npm start ``` +Set `DYNWINRT_WIN32_WINMD` to the metadata file when it is outside the default +`$HOME\.nuget\packages` cache. + Click **Verify identity**. Windows displays its native verification dialog owned by the Electron window. Complete or cancel the prompt; the result is shown in the application. diff --git a/samples/python/text-to-speech/README.md b/samples/python/text-to-speech/README.md index 3d43694b..63054b02 100644 --- a/samples/python/text-to-speech/README.md +++ b/samples/python/text-to-speech/README.md @@ -13,6 +13,7 @@ to generated dynwinrt bindings. It demonstrates: ## Prerequisites - Windows 10 or 11 with a Windows SDK installed; +- an active audio output device for playback; - `dynwinrt` installed in the selected Python interpreter; and - `dynwinrt-codegen` on `PATH`, or passed to `generate.ps1` with `-Codegen`. @@ -33,3 +34,6 @@ For non-interactive validation, synthesize the stream without playing it: ```powershell .\run.ps1 -Python C:\path\to\python.exe -Smoke ``` + +`-Smoke` validates synthesis, not playback. In headless or remote sessions without +an audio output, playback may time out because Windows cannot create a media sink.