[Rough draft] [Be gentle] Library to wrap IPC calls #128
Replies: 1 comment 1 reply
-
I honestly like the attempt to standardise the IPC interface in Rust. However, it’s hard for me to understand what the main goal of something like this would be. In particular, what is meant to be “safe” here? The interface is written to be generic, yet in doing so there are no checks for what the IPC calls actually do (memory safety isn’t enough to make the API foolproof) . I’m sure some tinkering would prove the possibility of passing values “safely” into these functions yet cause abnormal behaviour, like by wrongly modifying data that could even crash the program. Since I started re-writing and porting the current version of Again, it’s an interesting project, and it could make some new work easier (e.g. writing currently unimplemented services). I just don’t find it “safe enough” on its own to warrant usage. I would rather have to handle these system-level (and sometimes kernel-level) processes in C or in standard unsafe code. This is only my extremely personal opinion, and I’d like to hear more from @rust3ds/active. The effort you’ve put into writing such an extensive wrapper for IPC is admirable. Experimenting and researching is very important here. Thank you for your work 😄 |
Beta Was this translation helpful? Give feedback.
-
https://github.com/DeltaF1/3ds-ipc-tools
I've been reading the wiki and learning about IPC for a few weeks now, and I decided I wanted to help make it easier to wrap IPC commands that haven't been wrapped by libctru. This is my first time writing unsafe Rust so it might be terrible, but I wanted to get feedback on whether this is something that you would like included in
ctru-rs
/ctru-sys
at some point, and any suggestions for making the API nicer. I wrote up an example of how one might use the library alongside the 3dbrew wiki in https://github.com/DeltaF1/3ds-ipc-tools/blob/main/Readme.md.TranslateParams
do work to keep the references borrowed for the liftetime of the struct, but I am not super confident about it. Can anyone with more experience than me confirm that I've done that right or if I'm missing something?ResultCode(res)?
but sometimes the type checker gets mad at me and I don't know why lol. Should all my functions with errors returnctru::Result<T>
or isResult<T, ctru_sys::Result>
useful?getThreadCommandBuffer
toctru-sys
as per Expose static inline functions to bindings #123. I ended up implementing them myself with assembly for now (and then realized that AzureMarker did the same thing in Add an ir:USER service wrapper and Circle Pad Pro example #86). Hopefully those will end up in the main packages at some point.steal_service_handle
that I just haven't moved to its own thing yet, that can be ignored. That probably merits its own discussion at another time about whetherctru-rs
/ctru-sys
should include wrappers for Luma3DS-exclusive features.Beta Was this translation helpful? Give feedback.
All reactions