diff --git a/Cargo.toml b/Cargo.toml index bd3dbb3..d0894f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ keywords = ["admin", "linux", "network", "sys", "windows"] license = "MIT OR Apache-2.0" name = "quork" repository = "https://github.com/jewlexx/quork.git" -rust-version = "1.69.0" +rust-version = "1.70.0" version = "0.8.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -48,8 +48,5 @@ sized_string = [] std = [] traits = [] -[build-dependencies] -cc = "1.2" - [dev-dependencies] is-root = "0.1" diff --git a/build.rs b/build.rs deleted file mode 100644 index 3f5fecc..0000000 --- a/build.rs +++ /dev/null @@ -1,11 +0,0 @@ -use cc::Build; - -fn main() { - if cfg!(windows) { - println!("cargo:rustc-link-lib=ole32"); - - Build::new() - .file("include/win/network.c") - .compile("networkcomid"); - } -} diff --git a/include/win/network.c b/include/win/network.c deleted file mode 100644 index 6202664..0000000 --- a/include/win/network.c +++ /dev/null @@ -1,3 +0,0 @@ -#include - -CLSID get_networklist_manager_clsid() { return CLSID_NetworkListManager; } \ No newline at end of file diff --git a/src/win/network.rs b/src/win/network.rs index 7d359b6..29749a6 100644 --- a/src/win/network.rs +++ b/src/win/network.rs @@ -1,11 +1,11 @@ //! Network helpers -use windows::{ - core::GUID, - Win32::{ - Networking::NetworkListManager::{INetworkListManager, NLM_CONNECTIVITY}, - System::Com::{CoCreateInstance, CLSCTX_ALL}, +use windows::Win32::{ + Networking::{ + self, + NetworkListManager::{INetworkListManager, NLM_CONNECTIVITY}, }, + System::Com::{CoCreateInstance, CLSCTX_ALL}, }; use windows::Win32::Networking::NetworkListManager::{ @@ -119,10 +119,6 @@ impl From for NLM_CONNECTIVITY { } } -extern "C" { - fn get_networklist_manager_clsid() -> GUID; -} - /// Gets the [`INetworkListManager`] COM interface class GUID. /// /// Not reccomended for use directly, but rather though the [`Connectivity`] enum @@ -135,7 +131,11 @@ extern "C" { pub unsafe fn get_networklist_manager() -> windows::core::Result { ComInit::init(); - CoCreateInstance(&get_networklist_manager_clsid(), None, CLSCTX_ALL) + CoCreateInstance( + &Networking::NetworkListManager::NetworkListManager, + None, + CLSCTX_ALL, + ) } /// Gets the current connectivity to a network.