1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-20 09:23:23 +00:00

[BEEEP] [PM-565] Implement clipboard logic in rust (#4516)

Implement the Desktop clipboard logic natively using rust. This uses the arboard crate for clipboard functionality.

This change consists of 3 portions:
* Rust component.
* Updating renderer to call main using electron ipc.
* Update main to listen to renderer ipc and forward calls to the native clipboard module.
This commit is contained in:
Oscar Hinton
2023-10-02 18:50:57 +02:00
committed by GitHub
parent 6aed74d241
commit 30feb60645
14 changed files with 485 additions and 240 deletions

View File

@@ -95,7 +95,7 @@ pub fn set_password(service: &str, account: &str, password: &str) -> Result<()>
let credential = CREDENTIALW {
Flags: CRED_FLAGS(CRED_FLAGS_NONE),
Type: CRED_TYPE_GENERIC,
TargetName: PWSTR(unsafe { target_name.as_mut_ptr() }),
TargetName: PWSTR(target_name.as_mut_ptr()),
Comment: PWSTR::null(),
LastWritten: last_written,
CredentialBlobSize: credential_len,
@@ -104,7 +104,7 @@ pub fn set_password(service: &str, account: &str, password: &str) -> Result<()>
AttributeCount: 0,
Attributes: std::ptr::null_mut(),
TargetAlias: PWSTR::null(),
UserName: PWSTR(unsafe { user_name.as_mut_ptr() }),
UserName: PWSTR(user_name.as_mut_ptr()),
};
let result = unsafe { CredWriteW(&credential, 0) };