From e68cf6fa9117fac010718d6949aaaa8334c52de4 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Sat, 15 Apr 2023 21:47:37 -0700 Subject: [PATCH] chore(deps): bump windows crates from 0.44 to 0.48 --- Cargo.lock | 14 +++++++------- komorebi-core/Cargo.toml | 2 +- komorebi/Cargo.toml | 6 +++--- komorebi/src/com/mod.rs | 2 +- komorebi/src/windows_api.rs | 18 +++++++++--------- komorebi/src/windows_callbacks.rs | 2 +- komorebic/Cargo.toml | 2 +- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 83f2dc4b..be2087d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1581,20 +1581,20 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.44.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ "windows-implement", "windows-interface", - "windows-targets 0.42.2", + "windows-targets 0.48.0", ] [[package]] name = "windows-implement" -version = "0.44.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce87ca8e3417b02dc2a8a22769306658670ec92d78f1bd420d6310a67c245c6" +checksum = "5e2ee588991b9e7e6c8338edf3333fbe4da35dc72092643958ebb43f0ab2c49c" dependencies = [ "proc-macro2", "quote", @@ -1603,9 +1603,9 @@ dependencies = [ [[package]] name = "windows-interface" -version = "0.44.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "853f69a591ecd4f810d29f17e902d40e349fb05b0b11fff63b08b826bfe39c7f" +checksum = "e6fb8df20c9bcaa8ad6ab513f7b40104840c8867d5751126e4df3b08388d0cc7" dependencies = [ "proc-macro2", "quote", diff --git a/komorebi-core/Cargo.toml b/komorebi-core/Cargo.toml index 5700c5dd..961ed637 100644 --- a/komorebi-core/Cargo.toml +++ b/komorebi-core/Cargo.toml @@ -15,7 +15,7 @@ strum = { version = "0.24", features = ["derive"] } schemars = "0.8" [dependencies.windows] -version = "0.44" +version = "0.48" features = [ "Win32_Foundation", ] diff --git a/komorebi/Cargo.toml b/komorebi/Cargo.toml index 36581a2b..dcf213ef 100644 --- a/komorebi/Cargo.toml +++ b/komorebi/Cargo.toml @@ -41,10 +41,10 @@ uds_windows = "1" which = "4" winput = "0.2" winreg = "0.50" -windows-interface = { version = "0.44" } -windows-implement = { version = "0.44" } +windows-interface = { version = "0.48" } +windows-implement = { version = "0.48" } [dependencies.windows] -version = "0.44" +version = "0.48" features = [ "implement", "Win32_System_Com", diff --git a/komorebi/src/com/mod.rs b/komorebi/src/com/mod.rs index 5ec89c81..4d4f8af3 100644 --- a/komorebi/src/com/mod.rs +++ b/komorebi/src/com/mod.rs @@ -10,8 +10,8 @@ use interfaces::IServiceProvider; use std::ffi::c_void; +use windows::core::ComInterface; use windows::core::Interface; -use windows::core::Vtable; use windows::Win32::Foundation::HWND; use windows::Win32::System::Com::CoCreateInstance; use windows::Win32::System::Com::CoInitializeEx; diff --git a/komorebi/src/windows_api.rs b/komorebi/src/windows_api.rs index 79b586f6..429f2ef5 100644 --- a/komorebi/src/windows_api.rs +++ b/komorebi/src/windows_api.rs @@ -14,7 +14,7 @@ use windows::core::PWSTR; use windows::Win32::Foundation::BOOL; use windows::Win32::Foundation::COLORREF; use windows::Win32::Foundation::HANDLE; -use windows::Win32::Foundation::HINSTANCE; +use windows::Win32::Foundation::HMODULE; use windows::Win32::Foundation::HWND; use windows::Win32::Foundation::LPARAM; use windows::Win32::Foundation::POINT; @@ -671,7 +671,7 @@ impl WindowsApi { pub fn system_parameters_info_w( action: SYSTEM_PARAMETERS_INFO_ACTION, ui_param: u32, - pv_param: *const c_void, + pv_param: *mut c_void, update_flags: SYSTEM_PARAMETERS_INFO_UPDATE_FLAGS, ) -> Result<()> { unsafe { SystemParametersInfoW(action, ui_param, Option::from(pv_param), update_flags) } @@ -681,12 +681,12 @@ impl WindowsApi { #[allow(dead_code)] pub fn focus_follows_mouse() -> Result { - let is_enabled: BOOL = unsafe { std::mem::zeroed() }; + let mut is_enabled: BOOL = unsafe { std::mem::zeroed() }; Self::system_parameters_info_w( SPI_GETACTIVEWINDOWTRACKING, 0, - std::ptr::addr_of!(is_enabled).cast(), + std::ptr::addr_of_mut!(is_enabled).cast(), SPIF_SENDCHANGE, )?; @@ -698,7 +698,7 @@ impl WindowsApi { Self::system_parameters_info_w( SPI_SETACTIVEWINDOWTRACKING, 0, - 1 as *const c_void, + 1 as *mut c_void, SPIF_SENDCHANGE, ) } @@ -708,12 +708,12 @@ impl WindowsApi { Self::system_parameters_info_w( SPI_SETACTIVEWINDOWTRACKING, 0, - std::ptr::null::(), + std::ptr::null_mut::(), SPIF_SENDCHANGE, ) } - pub fn module_handle_w() -> Result { + pub fn module_handle_w() -> Result { unsafe { GetModuleHandleW(None) }.process() } @@ -750,7 +750,7 @@ impl WindowsApi { .process() } - pub fn create_border_window(name: PCSTR, instance: HINSTANCE) -> Result { + pub fn create_border_window(name: PCSTR, instance: HMODULE) -> Result { unsafe { let hwnd = CreateWindowExA( WS_EX_TOOLWINDOW | WS_EX_LAYERED, @@ -782,7 +782,7 @@ impl WindowsApi { } } - pub fn create_hidden_window(name: PCSTR, instance: HINSTANCE) -> Result { + pub fn create_hidden_window(name: PCSTR, instance: HMODULE) -> Result { unsafe { CreateWindowExA( WS_EX_NOACTIVATE, diff --git a/komorebi/src/windows_callbacks.rs b/komorebi/src/windows_callbacks.rs index 82e20026..94b5843b 100644 --- a/komorebi/src/windows_callbacks.rs +++ b/komorebi/src/windows_callbacks.rs @@ -18,10 +18,10 @@ use windows::Win32::Graphics::Gdi::HDC; use windows::Win32::Graphics::Gdi::HMONITOR; use windows::Win32::Graphics::Gdi::PAINTSTRUCT; use windows::Win32::Graphics::Gdi::PS_SOLID; -use windows::Win32::System::SystemServices::DBT_DEVNODES_CHANGED; use windows::Win32::UI::Accessibility::HWINEVENTHOOK; use windows::Win32::UI::WindowsAndMessaging::DefWindowProcW; use windows::Win32::UI::WindowsAndMessaging::PostQuitMessage; +use windows::Win32::UI::WindowsAndMessaging::DBT_DEVNODES_CHANGED; use windows::Win32::UI::WindowsAndMessaging::SPI_ICONVERTICALSPACING; use windows::Win32::UI::WindowsAndMessaging::SPI_SETWORKAREA; use windows::Win32::UI::WindowsAndMessaging::WM_DESTROY; diff --git a/komorebic/Cargo.toml b/komorebic/Cargo.toml index 9b6e1ffc..45763651 100644 --- a/komorebic/Cargo.toml +++ b/komorebic/Cargo.toml @@ -29,7 +29,7 @@ sysinfo = "0.28" uds_windows = "1" [dependencies.windows] -version = "0.44" +version = "0.48" features = [ "Win32_Foundation", "Win32_UI_WindowsAndMessaging"