Verified Commit cfd47114 authored by jD91mZM2's avatar jD91mZM2

Bump miow (and therefor winapi) version

parent 98b8fd65
......@@ -29,7 +29,7 @@ default = ["with-deprecated"]
iovec = "0.1.2"
lazycell = "0.6.0"
log = "0.4"
net2 = { git = "https://github.com/redox-os/net2-rs", rev = "0eae919" }
net2 = { git = "https://github.com/redox-os/net2-rs" }
slab = "0.4.0"
[target.'cfg(target_os = "fuchsia")'.dependencies]
......@@ -43,9 +43,8 @@ redox_syscall = "0.1"
libc = "0.2.19"
[target.'cfg(windows)'.dependencies]
winapi = "0.2.6"
miow = { git = "https://github.com/redox-os/miow" }
kernel32-sys = "0.2"
winapi = "0.3.4"
miow = { git = "https://github.com/redox-os/miow", branch = "latest" }
[dev-dependencies]
env_logger = { version = "0.4.0", default-features = false }
......
......@@ -117,9 +117,6 @@ extern crate miow;
#[cfg(windows)]
extern crate winapi;
#[cfg(windows)]
extern crate kernel32;
#[macro_use]
extern crate log;
......
......@@ -138,9 +138,9 @@
use std::io;
use std::os::windows::prelude::*;
use kernel32;
use winapi;
use winapi::shared::ntdef::*;
use winapi::um::winbase::*;
use winapi::um::ioapiset::*;
mod awakener;
#[macro_use]
......@@ -162,8 +162,8 @@ enum Family {
unsafe fn cancel(socket: &AsRawSocket,
overlapped: &Overlapped) -> io::Result<()> {
let handle = socket.as_raw_socket() as winapi::HANDLE;
let ret = kernel32::CancelIoEx(handle, overlapped.as_mut_ptr());
let handle = socket.as_raw_socket() as HANDLE;
let ret = CancelIoEx(handle, overlapped.as_mut_ptr());
if ret == 0 {
Err(io::Error::last_os_error())
} else {
......@@ -171,15 +171,15 @@ unsafe fn cancel(socket: &AsRawSocket,
}
}
unsafe fn no_notify_on_instant_completion(handle: winapi::HANDLE) -> io::Result<()> {
unsafe fn no_notify_on_instant_completion(handle: HANDLE) -> io::Result<()> {
// TODO: move those to winapi
const FILE_SKIP_COMPLETION_PORT_ON_SUCCESS: winapi::UCHAR = 1;
const FILE_SKIP_SET_EVENT_ON_HANDLE: winapi::UCHAR = 2;
const FILE_SKIP_COMPLETION_PORT_ON_SUCCESS: UCHAR = 1;
const FILE_SKIP_SET_EVENT_ON_HANDLE: UCHAR = 2;
let flags = FILE_SKIP_COMPLETION_PORT_ON_SUCCESS | FILE_SKIP_SET_EVENT_ON_HANDLE;
let r = kernel32::SetFileCompletionNotificationModes(handle, flags);
if r == winapi::TRUE {
let r = SetFileCompletionNotificationModes(handle, flags);
if r == TRUE as i32 {
Ok(())
} else {
Err(io::Error::last_os_error())
......
......@@ -9,7 +9,8 @@ use std::time::Duration;
use lazycell::AtomicLazyCell;
use winapi::*;
use winapi::shared::winerror::*;
use winapi::um::minwinbase::*;
use miow;
use miow::iocp::{CompletionPort, CompletionStatus};
......
......@@ -9,7 +9,8 @@ use std::time::Duration;
use miow::iocp::CompletionStatus;
use miow::net::*;
use net2::{TcpBuilder, TcpStreamExt as Net2TcpExt};
use winapi::*;
use winapi::shared::ntdef::*;
use winapi::um::minwinbase::*;
use iovec::IoVec;
use {poll, Ready, Poll, PollOpt, Token};
......@@ -744,13 +745,16 @@ impl ListenerImp {
let res = match self.inner.family {
Family::V4 => TcpBuilder::new_v4(),
Family::V6 => TcpBuilder::new_v6(),
}.and_then(|builder| unsafe {
}
.and_then(|builder| builder.to_tcp_stream())
.and_then(|stream| unsafe {
trace!("scheduling an accept");
self.inner.socket.accept_overlapped(&builder, &mut me.accept_buf,
self.inner.socket.accept_overlapped(&stream, &mut me.accept_buf,
self.inner.accept.as_mut_ptr())
.map(move |_| stream)
});
match res {
Ok((socket, _)) => {
Ok(socket) => {
// see docs above on StreamImp.inner for rationale on forget
me.accept = State::Pending(socket);
mem::forget(self.clone());
......
......@@ -12,7 +12,8 @@ use std::sync::{Mutex, MutexGuard};
#[allow(unused_imports)]
use net2::{UdpBuilder, UdpSocketExt};
use winapi::*;
use winapi::shared::winerror::*;
use winapi::um::minwinbase::*;
use miow::iocp::CompletionStatus;
use miow::net::SocketAddrBuf;
use miow::net::UdpSocketExt as MiowUdpSocketExt;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment