mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2006
Posts: 393
T
The_JD Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
T
Joined: Mar 2006
Posts: 393
Mirust is a lightweight SDK designed to simplify the process of exporting Rust functions to mIRC via DLLs. It provides a safe, idiomatic interface for Rust developers while ensuring full compatibility with mIRC’s environment.

Key features:
  • Automatic DLL Lifecycle Management
    - Handles LoadDll and UnloadDll automatically, eliminating boilerplate and setup hassle.
  • Comprehensive LOADINFO Support
    - Adds LOADINFO compatibility for mIRC versions 5.6 through 5.71. All current LOADINFO items are supported across all versions — even those that didn’t originally include them.
  • Robust String Encoding
    - Transparently encodes and decodes both ANSI and Unicode strings into UTF-8 Rust strings, ensuring smooth interoperability.
  • Selective Function Exposure
    - Functions can be annotated with dllcall = false to restrict access exclusively to $dllcall, preventing accidental use via $dll which could lock up mIRC.
  • Memory Safety by Design
    - Mirust enforces safe Rust practices, preventing out-of-bounds memory access and avoiding unsafe pointer manipulation.


https://crates.io/crates/mirust/

Example function
Code
#[mirust_fn]
fn my_command(
    m_wnd: HWND,
    a_wnd: HWND,
    data: String,
    parms: String,
    show: BOOL,
    nopause: BOOL,
) -> mirust::MircResult {

    let command = "echo -st * Message from 🦀 Rust: $1-".to_string();
    let my_string = format!("You sent me: {}", data);

    mirust::MircResult {
        code: 2, // Command
        data: Some(command),
        parms: Some(my_string),
    }
}

Mirust works with mIRC on x86 (32 bit), and is expected to function correctly on x86_64 (64 bit) and ARM64 versions of mIRC - assuming mIRC will use the "C" ABI in the upcoming variants.

@Khaled, is there a full list of lengths for data/parms (I could only find 900 bytes for 5.6, and the rest is unknown until 7.64 when mBytes was introduced)


[02:16] * Titanic has quit IRC (Excess Flood)
Joined: Jan 2012
Posts: 375
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 375
This is cool.
Thank / Спасибо.


🌐 https://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples

Link Copied to Clipboard