File tree Expand file tree Collapse file tree 2 files changed +2
-14
lines changed Expand file tree Collapse file tree 2 files changed +2
-14
lines changed Original file line number Diff line number Diff 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-
6754impl_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) ;
Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments