Skip to content

Commit 054174b

Browse files
committed
try pass IOCP CI
1 parent ffe34cb commit 054174b

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

core/src/net/operator/windows.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,6 @@ impl Default for Overlapped {
5151
}
5252
}
5353

54-
impl From<&Overlapped> for Overlapped {
55-
fn from(val: &Overlapped) -> Self {
56-
Self {
57-
base: val.base.clone(),
58-
from_fd: val.from_fd,
59-
socket: val.socket,
60-
token: val.token,
61-
syscall: val.syscall,
62-
bytes_transferred: val.bytes_transferred,
63-
}
64-
}
65-
}
66-
6754
impl_display_by_debug!(Overlapped);
6855

6956
#[repr(C)]
@@ -171,7 +158,7 @@ impl<'o> Operator<'o> {
171158
unsafe { entries.set_len(recv_count as _) };
172159
for entry in entries {
173160
let mut overlapped =
174-
Overlapped::from(unsafe { &*entry.lpOverlapped.cast::<Overlapped>() });
161+
unsafe { *Box::from_raw(entry.lpOverlapped.cast::<Overlapped>()) };
175162
overlapped.bytes_transferred = entry.dwNumberOfBytesTransferred;
176163
eprintln!("IOCP got Overlapped:{overlapped}");
177164
cq.push(overlapped);

hook/src/syscall/windows.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ unsafe fn attach() -> std::io::Result<()> {
143143
nfds: c_uint,
144144
timeout: c_int
145145
) -> c_int);
146+
#[cfg(not(feature = "iocp"))]
146147
impl_hook!("kernel32.dll", SLEEP, Sleep(dw_milliseconds: u32) -> ());
147148
impl_hook!("kernel32.dll", CREATEFILEW, CreateFileW(
148149
lpfilename: PCWSTR,

0 commit comments

Comments
 (0)