mirror of
https://github.com/bitwarden/browser
synced 2026-02-10 05:30:01 +00:00
Use windows::core re-export everywhere
This commit is contained in:
@@ -5,7 +5,7 @@ use std::{
|
||||
sync::Arc,
|
||||
time::Duration,
|
||||
};
|
||||
use windows_core::{s, HRESULT};
|
||||
use windows::core::{s, HRESULT};
|
||||
|
||||
use crate::ipc2::{
|
||||
PasskeyAssertionRequest, PasskeyAssertionResponse, Position, TimedCallback, UserVerification,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
|
||||
use windows::core::{implement, interface, IInspectable, IUnknown, Interface, HRESULT};
|
||||
use windows::Win32::Foundation::{RECT, S_OK};
|
||||
use windows::Win32::System::Com::*;
|
||||
use windows::Win32::UI::WindowsAndMessaging::GetWindowRect;
|
||||
use windows_core::{implement, interface, IInspectable, IUnknown, Interface, HRESULT};
|
||||
|
||||
use crate::assert::plugin_get_assertion;
|
||||
use crate::ipc2::{TimedCallback, WindowsProviderClient};
|
||||
@@ -34,7 +34,7 @@ pub enum PluginLockStatus {
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct WebAuthnPluginOperationRequest {
|
||||
pub window_handle: windows::Win32::Foundation::HWND,
|
||||
pub transaction_id: windows_core::GUID,
|
||||
pub transaction_id: windows::core::GUID,
|
||||
pub request_signature_byte_count: u32,
|
||||
pub request_signature_pointer: *mut u8,
|
||||
pub request_type: WebAuthnPluginRequestType,
|
||||
@@ -71,14 +71,14 @@ pub struct WebAuthnPluginOperationResponse {
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct WebAuthnPluginCancelOperationRequest {
|
||||
pub transaction_id: windows_core::GUID,
|
||||
pub transaction_id: windows::core::GUID,
|
||||
pub request_signature_byte_count: u32,
|
||||
pub request_signature_pointer: *mut u8,
|
||||
}
|
||||
|
||||
// Stable IPluginAuthenticator interface
|
||||
#[interface("d26bcf6f-b54c-43ff-9f06-d5bf148625f7")]
|
||||
pub unsafe trait IPluginAuthenticator: windows_core::IUnknown {
|
||||
pub unsafe trait IPluginAuthenticator: windows::core::IUnknown {
|
||||
fn MakeCredential(
|
||||
&self,
|
||||
request: *const WebAuthnPluginOperationRequest,
|
||||
@@ -237,10 +237,10 @@ impl IPluginAuthenticator_Impl for PluginAuthenticatorComObject_Impl {
|
||||
impl IClassFactory_Impl for Factory_Impl {
|
||||
fn CreateInstance(
|
||||
&self,
|
||||
_outer: windows_core::Ref<IUnknown>,
|
||||
iid: *const windows_core::GUID,
|
||||
_outer: windows::core::Ref<IUnknown>,
|
||||
iid: *const windows::core::GUID,
|
||||
object: *mut *mut core::ffi::c_void,
|
||||
) -> windows_core::Result<()> {
|
||||
) -> windows::core::Result<()> {
|
||||
tracing::debug!("Creating COM server instance.");
|
||||
tracing::debug!("Trying to connect to Bitwarden IPC");
|
||||
let client = WindowsProviderClient::connect();
|
||||
@@ -249,7 +249,7 @@ impl IClassFactory_Impl for Factory_Impl {
|
||||
unsafe { unknown.query(iid, object).ok() }
|
||||
}
|
||||
|
||||
fn LockServer(&self, _lock: windows_core::BOOL) -> windows_core::Result<()> {
|
||||
fn LockServer(&self, _lock: windows::core::BOOL) -> windows::core::Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use std::ptr;
|
||||
|
||||
use base64::{engine::general_purpose::STANDARD, Engine as _};
|
||||
use windows::core::{s, ComObjectInterface, GUID, HRESULT, HSTRING, PCWSTR};
|
||||
use windows::Win32::System::Com::*;
|
||||
use windows_core::{s, ComObjectInterface, GUID, HRESULT, HSTRING, PCWSTR};
|
||||
|
||||
use crate::com_provider;
|
||||
use crate::util::delay_load;
|
||||
@@ -152,7 +152,7 @@ pub fn initialize_com_library() -> std::result::Result<(), String> {
|
||||
|
||||
/// Registers the Bitwarden Plugin Authenticator COM library with Windows.
|
||||
pub fn register_com_library() -> std::result::Result<(), String> {
|
||||
static FACTORY: windows_core::StaticComObject<com_provider::Factory> =
|
||||
static FACTORY: windows::core::StaticComObject<com_provider::Factory> =
|
||||
com_provider::Factory.into_static();
|
||||
let clsid_guid = parse_clsid_to_guid().map_err(|e| format!("Failed to parse CLSID: {}", e))?;
|
||||
let clsid: *const GUID = &clsid_guid;
|
||||
|
||||
@@ -4,7 +4,7 @@ use std::mem::ManuallyDrop;
|
||||
use std::ptr;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use windows_core::{s, HRESULT};
|
||||
use windows::core::{s, HRESULT};
|
||||
|
||||
use crate::com_provider::{
|
||||
parse_credential_list, WebAuthnPluginOperationRequest, WebAuthnPluginOperationResponse,
|
||||
@@ -627,7 +627,7 @@ pub unsafe fn plugin_make_credential(
|
||||
mod tests {
|
||||
use std::ptr;
|
||||
|
||||
use windows_core::s;
|
||||
use windows::core::s;
|
||||
|
||||
use crate::{
|
||||
make_credential::{
|
||||
|
||||
@@ -5,7 +5,7 @@ use std::time::{SystemTime, UNIX_EPOCH};
|
||||
|
||||
use windows::Win32::Foundation::*;
|
||||
use windows::Win32::System::LibraryLoader::*;
|
||||
use windows_core::*;
|
||||
use windows::core::*;
|
||||
|
||||
use crate::com_buffer::ComBuffer;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
https://github.com/microsoft/webauthn/blob/master/webauthnplugin.h
|
||||
*/
|
||||
|
||||
use windows_core::*;
|
||||
use windows::core::*;
|
||||
|
||||
use crate::com_buffer::ComBuffer;
|
||||
use crate::util::{delay_load, WindowsString};
|
||||
|
||||
Reference in New Issue
Block a user