Skip to content

Commit 8512e3a

Browse files
committed
chore: improve naming
1 parent 29d947e commit 8512e3a

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

crates/fspy/src/windows/mod.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,27 +52,27 @@ impl PathAccessIterable {
5252

5353
#[derive(Debug, Clone)]
5454
pub struct SpyImpl {
55-
asni_dll_path_with_nul: Arc<CStr>,
55+
ansi_dll_path_with_nul: Arc<CStr>,
5656
}
5757

5858
impl SpyImpl {
5959
pub fn init_in(path: &Path) -> io::Result<Self> {
6060
let dll_path = INTERPOSE_CDYLIB.write_to(&path, ".dll").unwrap();
6161

6262
let wide_dll_path = dll_path.as_os_str().encode_wide().collect::<Vec<u16>>();
63-
let mut asni_dll_path =
63+
let mut ansi_dll_path =
6464
winsafe::WideCharToMultiByte(CP::ACP, WC::NoValue, &wide_dll_path, None, None)
6565
.map_err(|err| io::Error::from_raw_os_error(err.raw() as i32))?;
6666

67-
asni_dll_path.push(0);
67+
ansi_dll_path.push(0);
6868

69-
let asni_dll_path_with_nul =
70-
unsafe { CStr::from_bytes_with_nul_unchecked(asni_dll_path.as_slice()) };
71-
Ok(Self { asni_dll_path_with_nul: asni_dll_path_with_nul.into() })
69+
let ansi_dll_path_with_nul =
70+
unsafe { CStr::from_bytes_with_nul_unchecked(ansi_dll_path.as_slice()) };
71+
Ok(Self { ansi_dll_path_with_nul: ansi_dll_path_with_nul.into() })
7272
}
7373

7474
pub(crate) async fn spawn(&self, command: Command) -> Result<TrackedChild, SpawnError> {
75-
let asni_dll_path_with_nul = Arc::clone(&self.asni_dll_path_with_nul);
75+
let ansi_dll_path_with_nul = Arc::clone(&self.ansi_dll_path_with_nul);
7676
let mut command = command.into_tokio_command();
7777

7878
command.creation_flags(CREATE_SUSPENDED);
@@ -87,7 +87,7 @@ impl SpyImpl {
8787
let std_child = std_command.spawn()?;
8888
*spawn_success = true;
8989

90-
let mut dll_paths = asni_dll_path_with_nul.as_ptr().cast::<c_char>();
90+
let mut dll_paths = ansi_dll_path_with_nul.as_ptr().cast::<c_char>();
9191
let process_handle = std_child.as_raw_handle().cast::<winapi::ctypes::c_void>();
9292
let success =
9393
unsafe { DetourUpdateProcessWithDll(process_handle, &mut dll_paths, 1) };
@@ -97,7 +97,7 @@ impl SpyImpl {
9797

9898
let payload = Payload {
9999
channel_conf: channel_conf.clone(),
100-
asni_dll_path_with_nul: asni_dll_path_with_nul.to_bytes(),
100+
ansi_dll_path_with_nul: ansi_dll_path_with_nul.to_bytes(),
101101
};
102102
let payload_bytes = bincode::encode_to_vec(payload, BINCODE_CONFIG).unwrap();
103103
let success = unsafe {

crates/fspy_preload_windows/src/windows/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ impl<'a> Client<'a> {
5252
}
5353
}
5454

55-
pub fn asni_dll_path(&self) -> &'a CStr {
56-
unsafe { CStr::from_bytes_with_nul_unchecked(self.payload.asni_dll_path_with_nul) }
55+
pub fn ansi_dll_path(&self) -> &'a CStr {
56+
unsafe { CStr::from_bytes_with_nul_unchecked(self.payload.ansi_dll_path_with_nul) }
5757
}
5858
}
5959

crates/fspy_preload_windows/src/windows/detours/create_process.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ static DETOUR_CREATE_PROCESS_W: Detour<
148148
lp_current_directory,
149149
lp_startup_info,
150150
lp_process_information,
151-
client.asni_dll_path().as_ptr().cast(),
151+
client.ansi_dll_path().as_ptr().cast(),
152152
Some(create_process_with_payload_w),
153153
)
154154
}
@@ -261,7 +261,7 @@ static DETOUR_CREATE_PROCESS_A: Detour<
261261
lp_current_directory,
262262
lp_startup_info,
263263
lp_process_information,
264-
client.asni_dll_path().as_ptr().cast(),
264+
client.ansi_dll_path().as_ptr().cast(),
265265
Some(create_process_with_payload_a),
266266
)
267267
}

crates/fspy_shared/src/windows/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ DEFINE_GUID!(PAYLOAD_ID, 0xfc4845f1, 0x3a8b, 0x4f05, 0xa3, 0xd3, 0xa5, 0xe9, 0xe
1010
#[derive(Encode, BorrowDecode, Debug, Clone)]
1111
pub struct Payload<'a> {
1212
pub channel_conf: ChannelConf,
13-
pub asni_dll_path_with_nul: &'a [u8],
13+
pub ansi_dll_path_with_nul: &'a [u8],
1414
}

0 commit comments

Comments
 (0)