1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 10:43:35 +00:00

[deps] Platform: Update Rust crate windows to v0.58.0 (#10580)

* [deps] Platform: Update Rust crate windows to v0.58.0

* Fix windows build

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel García <dani-garcia@users.noreply.github.com>
This commit is contained in:
renovate[bot]
2024-11-25 14:59:51 +01:00
committed by GitHub
parent 0723feac9e
commit e07ddcea59
3 changed files with 66 additions and 9 deletions

View File

@@ -63,7 +63,7 @@ ed25519 = { version = "=2.2.3", features = ["pkcs8"] }
[target.'cfg(windows)'.dependencies]
widestring = { version = "=1.1.0", optional = true }
windows = { version = "=0.57.0", features = [
windows = { version = "=0.58.0", features = [
"Foundation",
"Security_Credentials_UI",
"Security_Cryptography",

View File

@@ -1,4 +1,4 @@
use std::str::FromStr;
use std::{ffi::c_void, str::FromStr};
use anyhow::{anyhow, Result};
use base64::{engine::general_purpose::STANDARD as base64_engine, Engine};
@@ -40,6 +40,8 @@ pub struct Biometric {}
impl super::BiometricTrait for Biometric {
async fn prompt(hwnd: Vec<u8>, message: String) -> Result<bool> {
let h = isize::from_le_bytes(hwnd.clone().try_into().unwrap());
let h = h as *mut c_void;
let window = HWND(h);
// The Windows Hello prompt is displayed inside the application window. For best result we
@@ -174,7 +176,7 @@ fn focus_security_prompt() -> Result<()> {
class_name: windows::core::PCSTR,
) -> retry::OperationResult<(), ()> {
let hwnd = unsafe { FindWindowA(class_name, None) };
if hwnd.0 != 0 {
if let Ok(hwnd) = hwnd {
set_focus(hwnd);
return retry::OperationResult::Ok(());
}