Skip to content

Commit

Permalink
Windows: Fix External Processes Flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Sewer56 committed Jun 23, 2024
1 parent d049123 commit f04fd9e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src-rust/src/internal/buffer_allocator_windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ impl Kernel32 for LocalKernel32 {
}
}

#[cfg(feature = "external_process")]
#[cfg(feature = "external_processes")]
pub struct RemoteKernel32 {
handle: HANDLE,
}

#[cfg(feature = "external_process")]
#[cfg(feature = "external_processes")]
impl Kernel32 for RemoteKernel32 {
fn virtual_query(
&self,
Expand Down Expand Up @@ -170,7 +170,7 @@ pub fn allocate_windows(
let handle = process_handle.handle;
let max_address = get_max_windows_address(settings.target_process_id, handle);

#[cfg(feature = "external_process")]
#[cfg(feature = "external_processes")]
{
return if get_sys_info().this_process_id == settings.target_process_id {
allocate_fast(&LocalKernel32 {}, max_address, &settings)
Expand All @@ -179,7 +179,7 @@ pub fn allocate_windows(
};
}

#[cfg(not(feature = "external_process"))]
#[cfg(not(feature = "external_processes"))]
allocate_fast(&LocalKernel32 {}, max_address, settings)
}
}
Expand Down
4 changes: 2 additions & 2 deletions src-rust/src/structs/private_allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl PrivateAllocation {
use core::ffi::c_void;

unsafe {
#[cfg(feature = "external_process")]
#[cfg(feature = "external_processes")]
{
if self._this_process_id == get_sys_info().this_process_id {
let result =
Expand All @@ -118,7 +118,7 @@ impl PrivateAllocation {
};
}

#[cfg(not(feature = "external_process"))]
#[cfg(not(feature = "external_processes"))]
{
let result = VirtualFree(self.base_address.as_ptr() as *mut c_void, 0, MEM_RELEASE);
if result == 0 {
Expand Down

0 comments on commit f04fd9e

Please sign in to comment.