forked from BynBang/OpenPrestige
fixes
This commit is contained in:
1 parent
83aea53e57
commit
aa4f6b6ddc
842 files changed
+47284
-91563
No files matched your search
@@ -0,0 +1,32 @@
|
||||
//! prestige_native.dll: loaded into a running Minecraft 1.21.11 (Fabric) JVM by PrestigeInjector.exe.
|
||||
//!
|
||||
//! The DLL worker waits for the JVM, appends the embedded Prestige payload jar to Fabric's Knot class loader, registers the
|
||||
//! JVMTI-backed natives of `dev.zprestige.prestige.inject.NativeBridge` and starts `Bootstrap`, which transforms the already
|
||||
//! loaded game classes and initialises the client.
|
||||
mod bridge;
|
||||
mod jni;
|
||||
mod log;
|
||||
mod worker;
|
||||
|
||||
use std::ffi::c_void;
|
||||
|
||||
const DLL_PROCESS_ATTACH: u32 = 1;
|
||||
|
||||
extern "system" {
|
||||
fn DisableThreadLibraryCalls(module: *mut c_void) -> i32;
|
||||
}
|
||||
|
||||
pub(crate) static mut MODULE: *mut c_void = std::ptr::null_mut();
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "system" fn DllMain(module: *mut c_void, reason: u32, _reserved: *mut c_void) -> i32 {
|
||||
if reason == DLL_PROCESS_ATTACH {
|
||||
unsafe {
|
||||
MODULE = module;
|
||||
DisableThreadLibraryCalls(module);
|
||||
}
|
||||
// Nothing but thread creation may happen under the loader lock.
|
||||
let _ = std::thread::Builder::new().name("prestige-loader".into()).spawn(worker::run);
|
||||
}
|
||||
1
|
||||
}
|
||||
Reference in new issue
Block a user