Skip to content

Commit

Permalink
windows 0.51
Browse files Browse the repository at this point in the history
  • Loading branch information
kayabaNerve committed Sep 24, 2023
1 parent fe2a2cd commit b5226d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ smol = { version = "1.2.5", optional = true }

[target.'cfg(target_os = "windows")'.dependencies]
if-addrs = "0.7.0"
windows = { version = "0.34.0", features = ["Win32_NetworkManagement_IpHelper", "Win32_Foundation", "Win32_Networking_WinSock"] }
windows = { version = "0.51.0", features = ["Win32_NetworkManagement_IpHelper", "Win32_Foundation", "Win32_NetworkManagement_Ndis", "Win32_Networking_WinSock"] }

[target.'cfg(not(any(target_os = "ios", target_os = "linux", target_os = "macos", target_os = "windows")))'.dependencies]
async-io = "1.6.0"
Expand All @@ -47,4 +47,3 @@ tokio = { version = "1.21.2", features = ["rt", "macros"] }
[[example]]
name = "if_watch"
required-features = ["smol"]

8 changes: 4 additions & 4 deletions src/win.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ use std::sync::Arc;
use std::task::{Context, Poll};
use windows::Win32::Foundation::{BOOLEAN, HANDLE};
use windows::Win32::NetworkManagement::IpHelper::{
CancelMibChangeNotify2, NotifyIpInterfaceChange, AF_UNSPEC, MIB_IPINTERFACE_ROW,
MIB_NOTIFICATION_TYPE,
CancelMibChangeNotify2, NotifyIpInterfaceChange, MIB_IPINTERFACE_ROW, MIB_NOTIFICATION_TYPE,
};
use windows::Win32::Networking::WinSock::AF_UNSPEC;

#[cfg(feature = "tokio")]
pub mod tokio {
Expand Down Expand Up @@ -165,9 +165,9 @@ impl IpChangeNotification {
let callback = Box::into_raw(Box::new(cb));
unsafe {
NotifyIpInterfaceChange(
AF_UNSPEC.0 as _,
AF_UNSPEC,
Some(global_callback),
callback as _,
Some(callback as _),
BOOLEAN(0),
&mut handle as _,
)
Expand Down

0 comments on commit b5226d5

Please sign in to comment.