@@ -69,7 +69,7 @@ impl Kernel32 for RemoteKernel32 {
6969 lp_buffer : & mut MEMORY_BASIC_INFORMATION ,
7070 ) -> usize {
7171 unsafe {
72- VirtualQueryEx (
72+ windows_sys :: Win32 :: System :: Memory :: VirtualQueryEx (
7373 self . handle ,
7474 lp_address,
7575 lp_buffer,
@@ -80,7 +80,7 @@ impl Kernel32 for RemoteKernel32 {
8080
8181 fn virtual_alloc ( & self , lp_address : * const c_void , dw_size : usize ) -> * mut c_void {
8282 unsafe {
83- VirtualAllocEx (
83+ windows_sys :: Win32 :: System :: Memory :: VirtualAllocEx (
8484 self . handle ,
8585 lp_address,
8686 dw_size,
@@ -91,7 +91,14 @@ impl Kernel32 for RemoteKernel32 {
9191 }
9292
9393 fn virtual_free ( & self , lp_address : * mut c_void , dw_size : usize ) -> bool {
94- unsafe { VirtualFreeEx ( self . handle , lp_address, dw_size, MEM_RELEASE ) != 0 }
94+ unsafe {
95+ windows_sys:: Win32 :: System :: Memory :: VirtualFreeEx (
96+ self . handle ,
97+ lp_address,
98+ dw_size,
99+ MEM_RELEASE ,
100+ ) != 0
101+ }
95102 }
96103}
97104
@@ -111,6 +118,11 @@ impl ProcessHandle {
111118 pub fn is_valid ( & self ) -> bool {
112119 self . handle != 0
113120 }
121+
122+ #[ cfg( feature = "external_processes" ) ]
123+ pub fn get_raw_handle ( & self ) -> HANDLE {
124+ self . handle
125+ }
114126}
115127
116128impl Drop for ProcessHandle {
@@ -172,11 +184,11 @@ pub fn allocate_windows(
172184
173185 #[ cfg( feature = "external_processes" ) ]
174186 {
175- return if get_sys_info ( ) . this_process_id == settings. target_process_id {
176- allocate_fast ( & LocalKernel32 { } , max_address, & settings)
187+ if get_sys_info ( ) . this_process_id == settings. target_process_id {
188+ allocate_fast ( & LocalKernel32 { } , max_address, settings)
177189 } else {
178- allocate_fast ( & RemoteKernel32 { handle } , max_address, & settings)
179- } ;
190+ allocate_fast ( & RemoteKernel32 { handle } , max_address, settings)
191+ }
180192 }
181193
182194 #[ cfg( not( feature = "external_processes" ) ) ]
0 commit comments