From 2229ece9998394e47e311bb1065546007ad76e89 Mon Sep 17 00:00:00 2001 From: iceweasel-oai Date: Tue, 28 Apr 2026 10:29:12 -0700 Subject: [PATCH 1/2] fix Windows pseudoconsole attribute handle --- codex-rs/windows-sandbox-rs/src/proc_thread_attr.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/codex-rs/windows-sandbox-rs/src/proc_thread_attr.rs b/codex-rs/windows-sandbox-rs/src/proc_thread_attr.rs index 7641bb5edd4a..d05628a975a4 100644 --- a/codex-rs/windows-sandbox-rs/src/proc_thread_attr.rs +++ b/codex-rs/windows-sandbox-rs/src/proc_thread_attr.rs @@ -1,4 +1,5 @@ use std::io; +use std::ffi::c_void; use windows_sys::Win32::Foundation::GetLastError; use windows_sys::Win32::Foundation::HANDLE; use windows_sys::Win32::System::Threading::DeleteProcThreadAttributeList; @@ -45,14 +46,13 @@ impl ProcThreadAttributeList { pub fn set_pseudoconsole(&mut self, hpc: isize) -> io::Result<()> { let list = self.as_mut_ptr(); - let mut hpc_value = hpc; let ok = unsafe { UpdateProcThreadAttribute( list, 0, PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE, - (&mut hpc_value as *mut isize).cast(), - std::mem::size_of::(), + hpc as *mut c_void, + std::mem::size_of::(), std::ptr::null_mut(), std::ptr::null_mut(), ) From 00e6a07bae778d08175f4e9905a36ac1ecb8ea83 Mon Sep 17 00:00:00 2001 From: iceweasel-oai Date: Tue, 28 Apr 2026 10:41:31 -0700 Subject: [PATCH 2/2] cargo fmt --- codex-rs/windows-sandbox-rs/src/proc_thread_attr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codex-rs/windows-sandbox-rs/src/proc_thread_attr.rs b/codex-rs/windows-sandbox-rs/src/proc_thread_attr.rs index d05628a975a4..b81469983935 100644 --- a/codex-rs/windows-sandbox-rs/src/proc_thread_attr.rs +++ b/codex-rs/windows-sandbox-rs/src/proc_thread_attr.rs @@ -1,5 +1,5 @@ -use std::io; use std::ffi::c_void; +use std::io; use windows_sys::Win32::Foundation::GetLastError; use windows_sys::Win32::Foundation::HANDLE; use windows_sys::Win32::System::Threading::DeleteProcThreadAttributeList;