Rollup merge of #128131 - ChrisDenton:stuff, r=workingjubilee · model-checking/verify-rust-std@1e118ae (original) (raw)
`@@ -4,12 +4,10 @@
`
4
4
`#![cfg_attr(test, allow(dead_code))]
`
5
5
`#![unstable(issue = "none", feature = "windows_c")]
`
6
6
`#![allow(clippy::style)]
`
7
``
`-
#![allow(unsafe_op_in_unsafe_fn)]
`
8
7
``
9
``
`-
use crate::ffi::CStr;
`
10
``
`-
use crate::mem;
`
11
``
`-
use crate::os::raw::{c_uint, c_ulong, c_ushort, c_void};
`
12
``
`-
use crate::ptr;
`
``
8
`+
use core::ffi::{c_uint, c_ulong, c_ushort, c_void, CStr};
`
``
9
`+
use core::mem;
`
``
10
`+
use core::ptr;
`
13
11
``
14
12
`pub(super) mod windows_targets;
`
15
13
``
`@@ -136,26 +134,26 @@ compat_fn_with_fallback! {
`
136
134
`// >= Win10 1607
`
137
135
`
138
136
`pub fn SetThreadDescription(hthread: HANDLE, lpthreaddescription: PCWSTR) -> HRESULT {
`
139
``
`-
SetLastError(ERROR_CALL_NOT_IMPLEMENTED as u32); E_NOTIMPL
`
``
137
`+
unsafe { SetLastError(ERROR_CALL_NOT_IMPLEMENTED as u32); E_NOTIMPL }
`
140
138
`}
`
141
139
``
142
140
`// >= Win10 1607
`
143
141
`
144
142
`pub fn GetThreadDescription(hthread: HANDLE, lpthreaddescription: *mut PWSTR) -> HRESULT {
`
145
``
`-
SetLastError(ERROR_CALL_NOT_IMPLEMENTED as u32); E_NOTIMPL
`
``
143
`+
unsafe { SetLastError(ERROR_CALL_NOT_IMPLEMENTED as u32); E_NOTIMPL }
`
146
144
`}
`
147
145
``
148
146
`// >= Win8 / Server 2012
`
149
147
`
150
148
` #[cfg(target_vendor = "win7")]
`
151
149
`pub fn GetSystemTimePreciseAsFileTime(lpsystemtimeasfiletime: *mut FILETIME) -> () {
`
152
``
`-
GetSystemTimeAsFileTime(lpsystemtimeasfiletime)
`
``
150
`+
unsafe { GetSystemTimeAsFileTime(lpsystemtimeasfiletime) }
`
153
151
`}
`
154
152
``
155
153
`// >= Win11 / Server 2022
`
156
154
`// https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-gettemppath2a
`
157
155
`pub fn GetTempPath2W(bufferlength: u32, buffer: PWSTR) -> u32 {
`
158
``
`-
GetTempPathW(bufferlength, buffer)
`
``
156
`+
unsafe { GetTempPathW(bufferlength, buffer) }
`
159
157
`}
`
160
158
`}
`
161
159
``
`@@ -188,12 +186,12 @@ extern "system" {
`
188
186
`compat_fn_optional! {
`
189
187
`crate::sys::compat::load_synch_functions();
`
190
188
`pub fn WaitOnAddress(
`
191
``
`-
address: *const ::core::ffi::c_void,
`
192
``
`-
compareaddress: *const ::core::ffi::c_void,
`
``
189
`+
address: *const c_void,
`
``
190
`+
compareaddress: *const c_void,
`
193
191
` addresssize: usize,
`
194
192
` dwmilliseconds: u32
`
195
193
`) -> BOOL;
`
196
``
`-
pub fn WakeByAddressSingle(address: *const ::core::ffi::c_void);
`
``
194
`+
pub fn WakeByAddressSingle(address: *const c_void);
`
197
195
`}
`
198
196
``
199
197
`#[cfg(any(target_vendor = "win7", target_vendor = "uwp"))]
`
`@@ -240,7 +238,7 @@ compat_fn_with_fallback! {
`
240
238
` shareaccess: FILE_SHARE_MODE,
`
241
239
` createdisposition: NTCREATEFILE_CREATE_DISPOSITION,
`
242
240
` createoptions: NTCREATEFILE_CREATE_OPTIONS,
`
243
``
`-
eabuffer: *const ::core::ffi::c_void,
`
``
241
`+
eabuffer: *const c_void,
`
244
242
` ealength: u32
`
245
243
`) -> NTSTATUS {
`
246
244
`STATUS_NOT_IMPLEMENTED
`
`@@ -250,9 +248,9 @@ compat_fn_with_fallback! {
`
250
248
` filehandle: HANDLE,
`
251
249
` event: HANDLE,
`
252
250
` apcroutine: PIO_APC_ROUTINE,
`
253
``
`-
apccontext: *const core::ffi::c_void,
`
``
251
`+
apccontext: *const c_void,
`
254
252
` iostatusblock: *mut IO_STATUS_BLOCK,
`
255
``
`-
buffer: *mut core::ffi::c_void,
`
``
253
`+
buffer: *mut c_void,
`
256
254
` length: u32,
`
257
255
` byteoffset: *const i64,
`
258
256
` key: *const u32
`
`@@ -264,9 +262,9 @@ compat_fn_with_fallback! {
`
264
262
` filehandle: HANDLE,
`
265
263
` event: HANDLE,
`
266
264
` apcroutine: PIO_APC_ROUTINE,
`
267
``
`-
apccontext: *const core::ffi::c_void,
`
``
265
`+
apccontext: *const c_void,
`
268
266
` iostatusblock: *mut IO_STATUS_BLOCK,
`
269
``
`-
buffer: *const core::ffi::c_void,
`
``
267
`+
buffer: *const c_void,
`
270
268
` length: u32,
`
271
269
` byteoffset: *const i64,
`
272
270
` key: *const u32
`