Skip to content

Commit 096369d

Browse files
authored
Rollup merge of #139382 - ChrisDenton:windows-bindgen-0-61, r=Mark-Simulacrum
Update windows-bindgen to 0.61.0 This updates the automatically generate Windows API bindings. Not much changed this time: - There's now `Default` implementations for many types, which is convenient. It does however conflict with one place where we implemented a non-zeroed default (to set the length field). But that's no big problem. - The `--no-core` flag has been renamed to `--no-deps` to more accurately reflect its meaning (i.e. generate all necessary code without requiring additional dependencies). - The `--link` flag allows us to set the location of the `link!` macro. Currently we use our workspace's `windows_targets` crate but we could move it into library/std using `--link`. However, this would need to be co-ordinated with the `backtrace` crate (which is a separate crate but included in std using `#[path]`). So I've left that for another time.
2 parents 0149a43 + 8b12153 commit 096369d

File tree

6 files changed

+290
-31
lines changed

6 files changed

+290
-31
lines changed

Diff for: Cargo.lock

+4-2
Original file line numberDiff line numberDiff line change
@@ -6059,11 +6059,13 @@ dependencies = [
60596059

60606060
[[package]]
60616061
name = "windows-bindgen"
6062-
version = "0.59.0"
6062+
version = "0.61.0"
60636063
source = "registry+https://github.com/rust-lang/crates.io-index"
6064-
checksum = "9b7fb600834d7e868f6e5bb748a86101427330fafbf9485c331b9d5f562d54a5"
6064+
checksum = "ac1c59c20569610dd9ed784d5f003fb493ec57b4cf39d974eb03a84bb7156c90"
60656065
dependencies = [
60666066
"rayon",
6067+
"serde",
6068+
"serde_json",
60676069
]
60686070

60696071
[[package]]

Diff for: library/std/src/sys/fs/windows/remove_dir_all.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ fn open_link_no_reparse(
9595
ObjectName: &mut path_str,
9696
RootDirectory: parent.as_raw_handle(),
9797
Attributes: ATTRIBUTES.load(Ordering::Relaxed),
98-
..c::OBJECT_ATTRIBUTES::default()
98+
..c::OBJECT_ATTRIBUTES::with_length()
9999
};
100100
let share = c::FILE_SHARE_DELETE | c::FILE_SHARE_READ | c::FILE_SHARE_WRITE;
101101
let options = c::FILE_OPEN_REPARSE_POINT | options;

Diff for: library/std/src/sys/pal/windows/c.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ impl UNICODE_STRING {
4444
}
4545
}
4646

47-
impl Default for OBJECT_ATTRIBUTES {
48-
fn default() -> Self {
47+
impl OBJECT_ATTRIBUTES {
48+
pub fn with_length() -> Self {
4949
Self {
5050
Length: size_of::<Self>() as _,
5151
RootDirectory: ptr::null_mut(),

Diff for: library/std/src/sys/pal/windows/c/bindings.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
--out windows_sys.rs
22
--flat
33
--sys
4-
--no-core
4+
--no-deps
5+
--link windows_targets
56
--filter
67
!INVALID_HANDLE_VALUE
78
ABOVE_NORMAL_PRIORITY_CLASS
@@ -19,7 +20,6 @@ ALL_PROCESSOR_GROUPS
1920
ARM64_NT_NEON128
2021
BELOW_NORMAL_PRIORITY_CLASS
2122
bind
22-
BOOL
2323
BY_HANDLE_FILE_INFORMATION
2424
CALLBACK_CHUNK_FINISHED
2525
CALLBACK_STREAM_SWITCH

0 commit comments

Comments
 (0)