Closed chtotut closed 6 years ago
Not quite sure why, try dropping the unsafe
modifier in the macro:
static_detours! {
struct Send: unsafe extern "system" fn(winapi::SOCKET, *const winapi::c_char, winapi::c_int, winapi::c_int) -> winapi::c_int;
}
→
static_detours! {
struct Send: extern "system" fn(winapi::SOCKET, *const winapi::c_char, winapi::c_int, winapi::c_int) -> winapi::c_int;
}
ws2_32::send
define as unsafe
(https://retep998.github.io/doc/ws2_32/fn.send.html).
If delete unsafe
modifier in the macro - It throw this error:
Send.initialize(
ws2_32::send,
| ^^^^^^^^^^^^ expected normal fn, found unsafe fn
|
= note: expected type `extern "system" fn(u64, *const i8, i32, i32) -> i32`
found type `unsafe extern "system" fn(u64, *const i8, i32, i32) -> i32 {ws2_32::send}`
Okay, this should be fixed in latest master. You can try it now and see if your issue is resolved:
[dependencies]
detour = { git = "https://github.com/darfink/detour-rs", branch = "master" }
Yes, latest master fixed this. Thanks.
Hi. I try use detour for
ws2_32::send
. But then i try to execute original function from detour closure:Code does not compiles. Error:
Where there can be an error?