initial commit
This commit is contained in:
12
ext/Cargo.toml
Normal file
12
ext/Cargo.toml
Normal file
@@ -0,0 +1,12 @@
|
||||
[package]
|
||||
name = "ext"
|
||||
edition = "2024"
|
||||
version.workspace = true
|
||||
|
||||
[lib]
|
||||
name = "hkrpg"
|
||||
crate-type = ["cdylib"]
|
||||
|
||||
[dependencies]
|
||||
windows.workspace = true
|
||||
hkrpg.workspace = true
|
||||
9
ext/src/lib.rs
Normal file
9
ext/src/lib.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
use windows::Win32::{Foundation::HINSTANCE, System::SystemServices::DLL_PROCESS_ATTACH};
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[unsafe(no_mangle)]
|
||||
unsafe extern "system" fn DllMain(_: HINSTANCE, call_reason: u32, _: *mut ()) {
|
||||
if call_reason == DLL_PROCESS_ATTACH {
|
||||
std::thread::spawn(hkrpg::main);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user