Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ bitflags = "2.3"
which = "7.0.0"

[dependencies.windows]
version = "0.58.0"
version = "0.59.0"
features = [
"Win32_Foundation",
"Win32_Storage_FileSystem",
Expand Down
10 changes: 5 additions & 5 deletions src/pty/conpty/pty_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl PTYImpl for ConPTY {
let h_console_res = CreateFileW(
conout_pwstr, (FILE_GENERIC_READ | FILE_GENERIC_WRITE).0,
FILE_SHARE_READ | FILE_SHARE_WRITE,
None, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, HANDLE(std::ptr::null_mut()));
None, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, Some(HANDLE(std::ptr::null_mut())));

if let Err(err) = h_console_res {
let result_msg = err.message();
Expand All @@ -89,7 +89,7 @@ impl PTYImpl for ConPTY {
(FILE_GENERIC_READ | FILE_GENERIC_WRITE).0,
FILE_SHARE_READ, None,
OPEN_EXISTING, FILE_FLAGS_AND_ATTRIBUTES(0),
HANDLE(std::ptr::null_mut()));
Some(HANDLE(std::ptr::null_mut())));

if let Err(err) = h_in_res {
let result_msg = err.message();
Expand Down Expand Up @@ -244,7 +244,7 @@ impl PTYImpl for ConPTY {
let mut required_bytes_u = MaybeUninit::<usize>::uninit();
let required_bytes_ptr = required_bytes_u.as_mut_ptr();
let _ = InitializeProcThreadAttributeList(
LPPROC_THREAD_ATTRIBUTE_LIST(ptr::null_mut()), 1, 0,
Some(LPPROC_THREAD_ATTRIBUTE_LIST(ptr::null_mut())), 1, Some(0),
required_bytes_ptr.as_mut().unwrap());

// Allocate memory to represent the list
Expand All @@ -263,7 +263,7 @@ impl PTYImpl for ConPTY {
};

// Initialize the list memory location
if !InitializeProcThreadAttributeList(start_info.lpAttributeList, 1, 0, &mut required_bytes).is_ok() {
if !InitializeProcThreadAttributeList(Some(start_info.lpAttributeList), 1, Some(0), &mut required_bytes).is_ok() {
result = Error::from_win32().into();
let result_msg = result.message();
let string = OsString::from(result_msg);
Expand All @@ -288,7 +288,7 @@ impl PTYImpl for ConPTY {

let succ = CreateProcessW(
PCWSTR(ptr::null_mut()),
PWSTR(cmd),
Some(PWSTR(cmd)),
None,
None,
false,
Expand Down
4 changes: 2 additions & 2 deletions src/pty/winpty/pty_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ impl PTYImpl for WinPTY {
let empty_handle = HANDLE(ptr::null_mut());
let conin_res = CreateFileW(
PCWSTR(conin_name as *const u16), FILE_GENERIC_WRITE.0, FILE_SHARE_NONE, None,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, empty_handle
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, Some(empty_handle)
);

if let Err(err) = conin_res {
Expand All @@ -209,7 +209,7 @@ impl PTYImpl for WinPTY {

let conout_res = CreateFileW(
PCWSTR(conout_name as *mut u16), FILE_GENERIC_READ.0, FILE_SHARE_NONE, None,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, empty_handle
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, Some(empty_handle)
);

if let Err(err) = conout_res {
Expand Down
Loading