diff --git a/Cargo.toml b/Cargo.toml index efe8d04..8e64daa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ libc = "0.2" neli = "0.6" [target.'cfg(windows)'.dependencies.windows-sys] -version = "0.48.0" +version = "0.59.0" features = [ "Win32_Foundation", "Win32_Networking_WinSock", diff --git a/src/windows.rs b/src/windows.rs index 59bbc7c..2a3c9ee 100644 --- a/src/windows.rs +++ b/src/windows.rs @@ -10,7 +10,7 @@ use std::{ use windows_sys::Win32::{ Foundation::{ - GetLastError, BOOL, ERROR_ADDRESS_NOT_ASSOCIATED, ERROR_BUFFER_OVERFLOW, + GetLastError, LocalFree, BOOL, ERROR_ADDRESS_NOT_ASSOCIATED, ERROR_BUFFER_OVERFLOW, ERROR_INSUFFICIENT_BUFFER, ERROR_INVALID_PARAMETER, ERROR_NOT_ENOUGH_MEMORY, ERROR_NOT_SUPPORTED, ERROR_NO_DATA, ERROR_SUCCESS, WIN32_ERROR, }, @@ -21,11 +21,8 @@ use windows_sys::Win32::{ Networking::WinSock::{ ADDRESS_FAMILY, AF_INET, AF_INET6, AF_UNSPEC, SOCKADDR_IN, SOCKADDR_IN6, SOCKADDR, }, - System::{ - Diagnostics::Debug::{ - FormatMessageW, FORMAT_MESSAGE_ALLOCATE_BUFFER, FORMAT_MESSAGE_FROM_SYSTEM, - }, - Memory::LocalFree, + System::Diagnostics::Debug::{ + FormatMessageW, FORMAT_MESSAGE_ALLOCATE_BUFFER, FORMAT_MESSAGE_FROM_SYSTEM, }, }; @@ -260,7 +257,7 @@ fn format_error_code(error_code: WIN32_ERROR) -> String { let error_message = String::from_utf16_lossy(slice); unsafe { - LocalFree(wide_ptr as isize); + LocalFree(&mut wide_ptr as *mut _ as *mut _); } error_message