Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,24 @@ jobs:
throw "Classic COM coverage fell below 70%: $($result.coverage_percent)"
}
Write-Host "Classic COM coverage: $($result.complete_interfaces)/$($result.eligible_interfaces) ($($result.coverage_percent)%)"
- name: Enforce flat Win32 coverage baseline
shell: pwsh
run: |
$json = cargo run -p dynwinrt-codegen --quiet -- win32-census `
--winmd $env:DYNWINRT_WIN32_WINMD `
--json
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
$result = $json | ConvertFrom-Json
if ($result.eligible_functions -ne 18321) {
throw "Flat Win32 census denominator changed: $($result.eligible_functions)"
}
if ($result.complete_functions -lt 8936) {
throw "Flat Win32 complete coverage regressed: $($result.complete_functions)"
}
if ($result.coverage_percent -lt 48.7) {
throw "Flat Win32 coverage fell below 48.7%: $($result.coverage_percent)"
}
Write-Host "Flat Win32 coverage: $($result.complete_functions)/$($result.eligible_functions) ($($result.coverage_percent)%)"
- name: Test Classic COM failure cleanup contracts
run: |
cargo test -p dynwinrt failing_hresult_releases_written_interface_output
Expand Down Expand Up @@ -193,3 +211,7 @@ jobs:
bindings/js/dist/com.d.ts
bindings/js/dist/com-unsafe.js
bindings/js/dist/com-unsafe.d.ts
bindings/js/dist/win32.js
bindings/js/dist/win32.d.ts
bindings/js/dist/win32-unsafe.js
bindings/js/dist/win32-unsafe.d.ts
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ mono_crash.*
x64/
x86/
[Ww][Ii][Nn]32/
!tools/dynwinrt-codegen/src/codegen/win32/
!tools/dynwinrt-codegen/src/codegen/win32/**
!tests/e2e/runners/win32/
!tests/e2e/runners/win32/**
!samples/js/win32/
!samples/js/win32/**
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
[Aa][Rr][Mm]64[Ee][Cc]/
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ common-interface test matrix, unsupported native types, and ownership rules.
See [Classic COM JavaScript usage](docs/guides/windows/classic-com-usage.md) for codegen,
GUID/IID/CLSID, lifecycle, Automation, and explicit unsafe ABI examples.

Flat Win32 `[DllImport]` bindings use the separate
`@microsoft/dynwinrt/win32` runtime and generated namespace subpaths. Numeric
data addresses require `@microsoft/dynwinrt/win32/unsafe`; safe wrappers retain
Buffer storage and manage owned handles. See
[Flat Win32 architecture](docs/architecture/flat-win32-support.md) and
[Flat Win32 usage](docs/guides/windows/flat-win32-usage.md).

Generated bindings project unambiguous public WinRT activation metadata as JavaScript
constructors, including overloads such as `new Uri(base, relative)`. Existing
static factory methods remain available. Classes that can only be returned by
Expand Down
7 changes: 7 additions & 0 deletions bindings/js/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,20 @@ windows-future = "0.3.2"
windows-string = "0.0.0"
pollster = "0.4.0"
serde_json = "1"
libffi = "5.1.0"

[dependencies.windows]
version = ">=0.59, <=0.62"
features = [
"Data_Xml_Dom",
"Win32_Security",
"Win32_System_Threading",
"Win32_System_IO",
"Win32_Storage_FileSystem",
"Win32_Networking_WinSock",
"Win32_Graphics_GdiPlus",
"Win32_Media_MediaFoundation",
"Win32_System_AddressBook",
"Win32_Storage_Packaging_Appx",
"Web_Http",
"Win32_System_SystemInformation",
Expand Down
8 changes: 8 additions & 0 deletions bindings/js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ See the repository's
[Classic COM JavaScript usage guide](../../docs/guides/windows/classic-com-usage.md) for
codegen, GUID/IID/CLSID, lifetime, Automation, and `/com/unsafe` examples.

Flat Win32 exports use `@microsoft/dynwinrt/win32`. Generated wrappers bind an
immutable native call plan, accept retained Buffer storage for dereferenced
pointers, and return `DynWin32Resource` for owned handles. Arbitrary numeric
addresses and manual raw ABI plans require
`@microsoft/dynwinrt/win32/unsafe`. Winsock, GDI+, and Media Foundation
namespaces expose explicit initialization contexts. See the
[flat Win32 usage guide](../../docs/guides/windows/flat-win32-usage.md).

Unambiguous public WinRT activation metadata is projected as JavaScript constructors.
Parameterized and composable activations support idiomatic forms such as
`new Uri(base, relative)` and `new StackPanel()`. The generated static factory
Expand Down
Loading
Loading