Skip to content
Open
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
23 changes: 18 additions & 5 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6557,13 +6557,14 @@ dependencies = [

[[package]]
name = "windows-bindgen"
version = "0.66.0"
version = "0.100.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81b7ec123a4eadd44d1f44f76804316b477b2537abed9a2ab950b3c54afa1fcf"
checksum = "c6bb7c22ca81c6dc1554fd328c12697b4b0ad5c45081df2c3c9a3f89cc467da2"
dependencies = [
"serde",
"serde_json",
"windows-threading 0.2.1",
"proc-macro2",
"quote",
"windows-default",
"windows-metadata",
]

[[package]]
Expand Down Expand Up @@ -6610,6 +6611,12 @@ dependencies = [
"windows-strings 0.5.1",
]

[[package]]
name = "windows-default"
version = "0.100.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4882bb065b03115aa8891d44d076bbe843d286d8bfd0b55caaa4b049141a712"

[[package]]
name = "windows-future"
version = "0.2.1"
Expand Down Expand Up @@ -6666,6 +6673,12 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"

[[package]]
name = "windows-metadata"
version = "0.100.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d3a758dc1da4ae61aa7f93afbb505d564c72dd6431e513ed581377857896a72"

[[package]]
name = "windows-numerics"
version = "0.2.0"
Expand Down
7 changes: 4 additions & 3 deletions library/std/src/os/windows/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,8 @@ impl<'a> Drop for ProcThreadAttributeList<'a> {
///
/// [1]: <https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-deleteprocthreadattributelist>
fn drop(&mut self) {
let lp_attribute_list = self.attribute_list.as_mut_ptr().cast::<c_void>();
let lp_attribute_list =
self.attribute_list.as_mut_ptr().cast::<sys::c::_PROC_THREAD_ATTRIBUTE_LIST>();
unsafe { sys::c::DeleteProcThreadAttributeList(lp_attribute_list) }
}
}
Expand Down Expand Up @@ -689,7 +690,7 @@ impl<'a> ProcThreadAttributeListBuilder<'a> {
// `InitializeProcThreadAttributeList` to properly initialize the list.
sys::cvt(unsafe {
sys::c::InitializeProcThreadAttributeList(
attribute_list.as_mut_ptr().cast::<c_void>(),
attribute_list.as_mut_ptr().cast::<sys::c::_PROC_THREAD_ATTRIBUTE_LIST>(),
attribute_count,
0,
&mut required_size,
Expand All @@ -703,7 +704,7 @@ impl<'a> ProcThreadAttributeListBuilder<'a> {
for (&attribute, value) in self.attributes.iter().take(attribute_count as usize) {
sys::cvt(unsafe {
sys::c::UpdateProcThreadAttribute(
attribute_list.as_mut_ptr().cast::<c_void>(),
attribute_list.as_mut_ptr().cast::<sys::c::_PROC_THREAD_ATTRIBUTE_LIST>(),
0,
attribute,
value.ptr,
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/sys/fs/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ impl File {
self.fsync()
}

fn acquire_lock(&self, flags: c::LOCK_FILE_FLAGS) -> io::Result<()> {
fn acquire_lock(&self, flags: u32) -> io::Result<()> {
unsafe {
let mut overlapped: c::OVERLAPPED = mem::zeroed();
let event = c::CreateEventW(ptr::null_mut(), c::FALSE, c::FALSE, ptr::null());
Expand Down Expand Up @@ -1173,7 +1173,7 @@ impl FilePermissions {
}

pub fn file_attributes(&self) -> u32 {
self.attrs as u32
self.attrs
}
}

Expand Down
4 changes: 2 additions & 2 deletions library/std/src/sys/fs/windows/dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn to_u16s_without_nul(path: &Path) -> io::Result<Vec<u16>> {
unsafe fn nt_create_file(
opts: &OpenOptions,
object_attributes: &c::OBJECT_ATTRIBUTES,
create_options: c::NTCREATEFILE_CREATE_OPTIONS,
create_options: u32,
) -> io::Result<Handle> {
let mut handle = ptr::null_mut();
let mut io_status = c::IO_STATUS_BLOCK::PENDING;
Expand Down Expand Up @@ -140,7 +140,7 @@ impl Dir {
let name = UnicodeStrRef::from_slice(path);
let object_attributes = c::OBJECT_ATTRIBUTES {
RootDirectory: self.handle.as_raw_handle(),
ObjectName: name.as_ptr(),
ObjectName: name.as_ptr().cast_mut(),
..c::OBJECT_ATTRIBUTES::with_length()
};
let create_opt = if dir { c::FILE_DIRECTORY_FILE } else { c::FILE_NON_DIRECTORY_FILE };
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sys/fs/windows/remove_dir_all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ fn open_link_no_reparse(

let result = unsafe {
let mut object = c::OBJECT_ATTRIBUTES {
ObjectName: path.as_ptr(),
ObjectName: path.as_ptr().cast_mut(),
Comment thread
ChrisDenton marked this conversation as resolved.
RootDirectory: parent.as_raw_handle(),
Attributes: ATTRIBUTES.load(Ordering::Relaxed),
..c::OBJECT_ATTRIBUTES::with_length()
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sys/io/error/windows/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::sys::pal::c;
// tests `format_error`
#[test]
fn ntstatus_error() {
const STATUS_UNSUCCESSFUL: u32 = 0xc000_0001;
const STATUS_UNSUCCESSFUL: i32 = 0xc000_0001_u32 as i32;
Comment thread
ChrisDenton marked this conversation as resolved.
assert!(
!Error::from_raw_os_error((STATUS_UNSUCCESSFUL | c::FACILITY_NT_BIT) as _)
.to_string()
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/sys/net/connection/socket/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub(super) mod netc {
}

pub unsafe fn send(socket: SOCKET, buf: *const c_void, len: c_int, flags: c_int) -> c_int {
unsafe { c::send(socket, buf.cast::<u8>(), len, flags) }
unsafe { c::send(socket, buf.cast::<i8>(), len, flags) }
}
pub unsafe fn sendto(
socket: SOCKET,
Expand All @@ -98,7 +98,7 @@ pub(super) mod netc {
addr: *const SOCKADDR,
addrlen: c_int,
) -> c_int {
unsafe { c::sendto(socket, buf.cast::<u8>(), len, flags, addr, addrlen) }
unsafe { c::sendto(socket, buf.cast::<i8>(), len, flags, addr, addrlen) }
}
pub unsafe fn getaddrinfo(
node: *const c_char,
Expand Down
Loading
Loading