1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-29 14:43:31 +00:00

[PM-19471] Update Rust windows crate to 0.61.1 (#13974)

* PM-19471: Update Rust windows crate to 0.61.1

* PM-19471: Add new crate to renovate.json5
This commit is contained in:
Colton Hurst
2025-04-02 16:40:38 -04:00
committed by GitHub
parent 660dd19bd0
commit 31e455ff35
7 changed files with 71 additions and 51 deletions

View File

@@ -70,6 +70,7 @@ windows = { workspace = true, features = [
"Win32_UI_WindowsAndMessaging",
"Win32_System_Pipes",
], optional = true }
windows-future = { workspace = true }
[target.'cfg(windows)'.dev-dependencies]
keytar = { workspace = true }

View File

@@ -10,7 +10,6 @@ use rand::RngCore;
use sha2::{Digest, Sha256};
use windows::{
core::{factory, h, HSTRING},
Foundation::IAsyncOperation,
Security::{
Credentials::{
KeyCredentialCreationOption, KeyCredentialManager, KeyCredentialStatus, UI::*,
@@ -19,6 +18,7 @@ use windows::{
},
Win32::{Foundation::HWND, System::WinRT::IUserConsentVerifierInterop},
};
use windows_future::IAsyncOperation;
use crate::{
biometric::{KeyMaterial, OsDerivedKey},

View File

@@ -23,6 +23,6 @@ pub fn focus_security_prompt() {
pub(crate) fn set_focus(window: HWND) {
unsafe {
let _ = SetForegroundWindow(window);
let _ = SetFocus(window);
let _ = SetFocus(Some(window));
}
}

View File

@@ -23,7 +23,7 @@ pub async fn get_password(service: &str, account: &str) -> Result<String> {
CredReadW(
PCWSTR(target_name.as_ptr()),
CRED_TYPE_GENERIC,
CRED_FLAGS_NONE,
None,
credential_ptr,
)
};
@@ -79,13 +79,7 @@ pub async fn set_password(service: &str, account: &str, password: &str) -> Resul
pub async fn delete_password(service: &str, account: &str) -> Result<()> {
let target_name = U16CString::from_str(target_name(service, account))?;
unsafe {
CredDeleteW(
PCWSTR(target_name.as_ptr()),
CRED_TYPE_GENERIC,
CRED_FLAGS_NONE,
)?
};
unsafe { CredDeleteW(PCWSTR(target_name.as_ptr()), CRED_TYPE_GENERIC, None)? };
Ok(())
}