1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-30 15:13:32 +00:00

[PM-9126] COM Object Registration (#13278)

* PM-9126: Initial scaffolding for com object registration

* PM-9126: Clean Up PACOMObject trait and impl

* PM-9126: Add unsafe tests

* PM-9126: Clean up registration PR with a working CoRegisterClassObject call

* PM-9126: Add AddAuthenticator fn call

* PM-9126: Load AddAuthenticator fn call dynamically

* PM-9126: Add AddAuthenticator experiments

* PR-9126: add brackets around guids

* PM-9126: clean up part 1

* PM-9126: Cleanup changes

* Only call the register function if on Windows

* PM-9126: Block two generated types that create issues for the i686-pc-windows-msvc target

* PM-9126: Refine bindings file

* PM-9126: Address PR comments part 1

* PM-9126: Address PR comments part 2

* PM-9126: Return result in napi layer

* PM-9126: Propogate error from add authenticator call

* PM-9126: Change for version update
This commit is contained in:
Colton Hurst
2025-04-03 17:11:04 -04:00
committed by GitHub
parent 64bbdcd638
commit e23a353543
17 changed files with 329 additions and 32 deletions

View File

@@ -0,0 +1,26 @@
fn main() {
#[cfg(target_os = "windows")]
windows();
}
#[cfg(target_os = "windows")]
fn windows() {
let out_dir = std::env::var("OUT_DIR").expect("OUT_DIR not set");
let bindings = bindgen::Builder::default()
.header("pluginauthenticator.hpp")
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.allowlist_type("DWORD")
.allowlist_type("PBYTE")
.allowlist_type("EXPERIMENTAL.*")
.allowlist_function("WebAuthNGetApiVersionNumber")
.generate()
.expect("Unable to generate bindings.");
bindings
.write_to_file(format!(
"{}\\windows_plugin_authenticator_bindings.rs",
out_dir
))
.expect("Couldn't write bindings.");
}