This repository was archived by the owner on Oct 21, 2023. It is now read-only.
File tree 3 files changed +10
-5
lines changed
3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ impl AnonymousMember {
210
210
}
211
211
212
212
mod imp {
213
- use crate :: contact:: group:: { Group , WeakGroup } ;
213
+ use crate :: contact:: group:: WeakGroup ;
214
214
use crate :: message:: meta:: Anonymous ;
215
215
use crate :: GroupMemberInfo ;
216
216
Original file line number Diff line number Diff line change @@ -12,8 +12,10 @@ pub extern "C" fn plugin_manager_spawn(
12
12
) -> FFIFuture < FFIResult < Managed > > {
13
13
let manager: & PluginManager = cast_ref ( manager) ;
14
14
let handle = manager. async_runtime ( ) . spawn ( async move {
15
- unsafe {
16
- save_jmp ( ) ;
15
+ if crate :: service:: plugin:: is_rec_enabled ( ) {
16
+ unsafe {
17
+ save_jmp ( ) ;
18
+ }
17
19
}
18
20
19
21
future. await
Original file line number Diff line number Diff line change @@ -137,6 +137,7 @@ const GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS: DWORD = 0x00000004;
137
137
#[ cfg( target_arch = "x86_64" ) ]
138
138
mod x64 {
139
139
use std:: cell:: RefCell ;
140
+ use std:: mem:: MaybeUninit ;
140
141
use std:: sync:: atomic:: { AtomicU32 , Ordering } ;
141
142
use winapi:: um:: winnt:: { RtlCaptureContext , RtlRestoreContext , CONTEXT } ;
142
143
thread_local ! {
@@ -145,12 +146,14 @@ mod x64 {
145
146
}
146
147
147
148
pub unsafe fn save_jmp ( ) {
148
- let mut buf = std :: mem :: zeroed :: < CONTEXT > ( ) ;
149
+ let mut buf = MaybeUninit :: uninit ( ) ;
149
150
150
151
unsafe {
151
- RtlCaptureContext ( & mut buf) ;
152
+ RtlCaptureContext ( buf. as_mut_ptr ( ) ) ;
152
153
}
153
154
155
+ let buf = buf. assume_init ( ) ;
156
+
154
157
let status = STATUS . with ( |r| r. load ( Ordering :: Relaxed ) ) ;
155
158
if status != 0 {
156
159
panic ! ( "exception occurred, status: 0x{status:x}" ) ;
You can’t perform that action at this time.
0 commit comments