Comments (4)
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;
}
from detour-rs.
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}`
from detour-rs.
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" }
from detour-rs.
Yes, latest master fixed this. Thanks.
from detour-rs.
Related Issues (20)
- error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable HOT 1
- Build Error: 'const_fn' feature removed HOT 1
- `const_fn` fix is not released on crates.io HOT 2
- Compatibility issues with lazy_static HOT 2
- unwrap fails on value: RegionFailure(FreeMemory). HOT 2
- detour function from dll not working? HOT 1
- Improve cross-platform support for platforms with greater r^x restrictions
- Not able to hook COM functions properly? HOT 6
- Support trailing commas in function parameter lists
- Named inline assembly labels are denied by default
- Update mmap-fixed's ``winapi`` dependency HOT 6
- error[E0277]: expected a `Fn<(u32, u32, *mut winapi::ctypes::c_void, u32)>` closure, found `unsafe extern "system" fn(u32, u32, *mut winapi::ctypes::c_void, u32) -> u32 {our_GetSystemFirmwareTable}` HOT 3
- Support starting of process with detours "pre-enabled"
- Is nightly still needed? HOT 5
- Process stopped with exit code 0xC0000409 (STATUS_STACK_BUFFER_OVERRUN) HOT 4
- How to go about using a custom calling convention
- Is this crate still maintained?
- Error Building on nightly-1.67.0 - Tuple trait bounds on Args for Fn-Family of traits
- Client Build problem
- libudis86-sys v0.2.1 does not work on HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from detour-rs.