diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index 50d476fd63..72bfcd89b8 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -109,6 +109,7 @@ jobs: cargo clippy -p test_readme && cargo clippy -p test_reserved && cargo clippy -p test_resources && + cargo clippy -p test_return_handle && cargo clippy -p test_return_struct && cargo clippy -p test_riddle && cargo clippy -p test_simple_component && diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 77cfef0ed0..7266284345 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -96,8 +96,8 @@ jobs: cargo test -p test_does_not_return && cargo test -p test_enums && cargo test -p test_error && - cargo clean && cargo test -p test_event && + cargo clean && cargo test -p test_extensions && cargo test -p test_handles && cargo test -p test_helpers && @@ -116,6 +116,7 @@ jobs: cargo test -p test_readme && cargo test -p test_reserved && cargo test -p test_resources && + cargo test -p test_return_handle && cargo test -p test_return_struct && cargo test -p test_riddle && cargo test -p test_simple_component && diff --git a/.github/workflows/windows-sys.yml b/.github/workflows/windows-sys.yml index 89cff2685c..961be3f558 100644 --- a/.github/workflows/windows-sys.yml +++ b/.github/workflows/windows-sys.yml @@ -14,7 +14,7 @@ jobs: name: Check strategy: matrix: - rust: [1.48.0, stable, nightly] + rust: [1.56.0, stable, nightly] runs-on: - windows-latest - ubuntu-latest diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 229631b654..a909371dd7 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -14,7 +14,7 @@ jobs: name: Check strategy: matrix: - rust: [1.48.0, stable, nightly] + rust: [1.56.0, stable, nightly] runs-on: - windows-2019 - ubuntu-latest diff --git a/Cargo.toml b/Cargo.toml index cf11c94d66..5fdebc4a95 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ "crates/libs/*", "crates/samples/windows-sys/*", diff --git a/crates/libs/core/Cargo.toml b/crates/libs/core/Cargo.toml index 01532ef5dd..1b5ac2aa0f 100644 --- a/crates/libs/core/Cargo.toml +++ b/crates/libs/core/Cargo.toml @@ -3,12 +3,12 @@ name = "windows-core" version = "0.50.0" authors = ["Microsoft"] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" description = "Rust for Windows" repository = "https://github.com/microsoft/windows-rs" readme = "../../../docs/readme.md" -rust-version = "1.48" +rust-version = "1.56" categories = ["os::windows-apis"] [package.metadata.docs.rs] diff --git a/crates/libs/core/src/imp/mod.rs b/crates/libs/core/src/imp/mod.rs index a91879e531..d5093fd2f3 100644 --- a/crates/libs/core/src/imp/mod.rs +++ b/crates/libs/core/src/imp/mod.rs @@ -20,7 +20,7 @@ pub use sha1::*; pub use waiter::*; pub use weak_ref_count::*; -// This is a workaround since 1.48 does not include `bool::then_some`. +// This is a workaround since 1.56 does not include `bool::then_some`. pub fn then_some(value: bool, t: T) -> Option { if value { Some(t) @@ -29,15 +29,6 @@ pub fn then_some(value: bool, t: T) -> Option { } } -// This is a workaround since 1.48 does not include `bool::then`. -pub fn then T>(value: bool, f: F) -> Option { - if value { - Some(f()) - } else { - None - } -} - pub fn wide_trim_end(mut wide: &[u16]) -> &[u16] { while let Some(last) = wide.last() { match last { diff --git a/crates/libs/core/src/strings/hstring.rs b/crates/libs/core/src/strings/hstring.rs index 93c989bc72..014da49d92 100644 --- a/crates/libs/core/src/strings/hstring.rs +++ b/crates/libs/core/src/strings/hstring.rs @@ -84,8 +84,7 @@ impl HSTRING { fn get_header(&self) -> Option<&Header> { if let Some(header) = &self.0 { - // TODO: this can be replaced with `as_ref` in future: https://github.com/rust-lang/rust/issues/91822 - unsafe { Some(&*(header.as_ptr() as *const Header)) } + unsafe { Some(header.as_ref()) } } else { None } diff --git a/crates/libs/implement/Cargo.toml b/crates/libs/implement/Cargo.toml index fb3cc54ab1..6ca48c6d5a 100644 --- a/crates/libs/implement/Cargo.toml +++ b/crates/libs/implement/Cargo.toml @@ -2,7 +2,7 @@ name = "windows-implement" version = "0.48.0" authors = ["Microsoft"] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" description = "The implement macro for the windows crate" repository = "https://github.com/microsoft/windows-rs" diff --git a/crates/libs/implement/src/lib.rs b/crates/libs/implement/src/lib.rs index 04989a9c59..e54e573663 100644 --- a/crates/libs/implement/src/lib.rs +++ b/crates/libs/implement/src/lib.rs @@ -81,7 +81,7 @@ pub fn implement(attributes: proc_macro::TokenStream, original_type: proc_macro: let tokens = quote! { #[repr(C)] - struct #impl_ident#generics where #constraints { + struct #impl_ident #generics where #constraints { identity: *const ::windows::core::IInspectable_Vtbl, vtables: (#(*const #vtbl_idents,)*), this: #original_ident::#generics, diff --git a/crates/libs/interface/Cargo.toml b/crates/libs/interface/Cargo.toml index 6059ccd183..ee6cafd677 100644 --- a/crates/libs/interface/Cargo.toml +++ b/crates/libs/interface/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "windows-interface" version = "0.48.0" -edition = "2018" +edition = "2021" authors = ["Microsoft"] license = "MIT OR Apache-2.0" description = "The interface macro for the windows crate" diff --git a/crates/libs/metadata/Cargo.toml b/crates/libs/metadata/Cargo.toml index acaa5e3a74..1314183c38 100644 --- a/crates/libs/metadata/Cargo.toml +++ b/crates/libs/metadata/Cargo.toml @@ -2,7 +2,7 @@ name = "windows-metadata" version = "0.49.0" authors = ["Microsoft"] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" description = "Windows metadata reader and writer" repository = "https://github.com/microsoft/windows-rs" diff --git a/crates/libs/sys/Cargo.toml b/crates/libs/sys/Cargo.toml index d911123a11..b3d7e9007d 100644 --- a/crates/libs/sys/Cargo.toml +++ b/crates/libs/sys/Cargo.toml @@ -3,12 +3,12 @@ name = "windows-sys" version = "0.48.0" authors = ["Microsoft"] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" description = "Rust for Windows" repository = "https://github.com/microsoft/windows-rs" readme = "../../../docs/readme.md" -rust-version = "1.48" +rust-version = "1.56" categories = ["os::windows-apis"] [package.metadata.docs.rs] diff --git a/crates/libs/targets/Cargo.toml b/crates/libs/targets/Cargo.toml index 63cb4de88c..eea6544b95 100644 --- a/crates/libs/targets/Cargo.toml +++ b/crates/libs/targets/Cargo.toml @@ -3,7 +3,7 @@ name = "windows-targets" version = "0.48.1" authors = ["Microsoft"] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" description = "Import libs for Windows" repository = "https://github.com/microsoft/windows-rs" diff --git a/crates/libs/windows/Cargo.toml b/crates/libs/windows/Cargo.toml index 26526eb853..4e5ad52954 100644 --- a/crates/libs/windows/Cargo.toml +++ b/crates/libs/windows/Cargo.toml @@ -3,13 +3,13 @@ name = "windows" version = "0.48.0" authors = ["Microsoft"] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" description = "Rust for Windows" repository = "https://github.com/microsoft/windows-rs" documentation = "https://microsoft.github.io/windows-docs-rs/" readme = "../../../docs/readme.md" -rust-version = "1.48" +rust-version = "1.56" categories = ["os::windows-apis"] [package.metadata.docs.rs] diff --git a/crates/libs/windows/src/Windows/Win32/Devices/AllJoyn/mod.rs b/crates/libs/windows/src/Windows/Win32/Devices/AllJoyn/mod.rs index b7333b87a3..35062409f2 100644 --- a/crates/libs/windows/src/Windows/Win32/Devices/AllJoyn/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Devices/AllJoyn/mod.rs @@ -30,7 +30,7 @@ where { ::windows_targets::link!("msajapi.dll" "system" fn AllJoynConnectToBus(connectionspec : ::windows_core::PCWSTR) -> super::super::Foundation:: HANDLE); let result__ = AllJoynConnectToBus(connectionspec.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_AllJoyn\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] diff --git a/crates/libs/windows/src/Windows/Win32/Devices/Bluetooth/mod.rs b/crates/libs/windows/src/Windows/Win32/Devices/Bluetooth/mod.rs index 0fd29f8313..57b11b28cd 100644 --- a/crates/libs/windows/src/Windows/Win32/Devices/Bluetooth/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Devices/Bluetooth/mod.rs @@ -91,7 +91,7 @@ where pub unsafe fn BluetoothFindFirstDevice(pbtsp: *const BLUETOOTH_DEVICE_SEARCH_PARAMS, pbtdi: *mut BLUETOOTH_DEVICE_INFO) -> ::windows_core::Result { ::windows_targets::link!("bluetoothapis.dll" "system" fn BluetoothFindFirstDevice(pbtsp : *const BLUETOOTH_DEVICE_SEARCH_PARAMS, pbtdi : *mut BLUETOOTH_DEVICE_INFO) -> HBLUETOOTH_DEVICE_FIND); let result__ = BluetoothFindFirstDevice(pbtsp, pbtdi); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_Bluetooth\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -99,7 +99,7 @@ pub unsafe fn BluetoothFindFirstDevice(pbtsp: *const BLUETOOTH_DEVICE_SEARCH_PAR pub unsafe fn BluetoothFindFirstRadio(pbtfrp: *const BLUETOOTH_FIND_RADIO_PARAMS, phradio: *mut super::super::Foundation::HANDLE) -> ::windows_core::Result { ::windows_targets::link!("bluetoothapis.dll" "system" fn BluetoothFindFirstRadio(pbtfrp : *const BLUETOOTH_FIND_RADIO_PARAMS, phradio : *mut super::super::Foundation:: HANDLE) -> HBLUETOOTH_RADIO_FIND); let result__ = BluetoothFindFirstRadio(pbtfrp, phradio); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_Bluetooth\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/Devices/DeviceAndDriverInstallation/mod.rs b/crates/libs/windows/src/Windows/Win32/Devices/DeviceAndDriverInstallation/mod.rs index 6bd537f5f9..56c6ed0f8b 100644 --- a/crates/libs/windows/src/Windows/Win32/Devices/DeviceAndDriverInstallation/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Devices/DeviceAndDriverInstallation/mod.rs @@ -2241,7 +2241,7 @@ where { ::windows_targets::link!("setupapi.dll" "system" fn SetupDiCreateDevRegKeyA(deviceinfoset : HDEVINFO, deviceinfodata : *const SP_DEVINFO_DATA, scope : u32, hwprofile : u32, keytype : u32, infhandle : *const ::core::ffi::c_void, infsectionname : ::windows_core::PCSTR) -> super::super::System::Registry:: HKEY); let result__ = SetupDiCreateDevRegKeyA(deviceinfoset.into_param().abi(), deviceinfodata, scope, hwprofile, keytype, ::core::mem::transmute(infhandle.unwrap_or(::std::ptr::null())), infsectionname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_System_Registry\"`*"] #[cfg(feature = "Win32_System_Registry")] @@ -2253,7 +2253,7 @@ where { ::windows_targets::link!("setupapi.dll" "system" fn SetupDiCreateDevRegKeyW(deviceinfoset : HDEVINFO, deviceinfodata : *const SP_DEVINFO_DATA, scope : u32, hwprofile : u32, keytype : u32, infhandle : *const ::core::ffi::c_void, infsectionname : ::windows_core::PCWSTR) -> super::super::System::Registry:: HKEY); let result__ = SetupDiCreateDevRegKeyW(deviceinfoset.into_param().abi(), deviceinfodata, scope, hwprofile, keytype, ::core::mem::transmute(infhandle.unwrap_or(::std::ptr::null())), infsectionname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2277,7 +2277,7 @@ where { ::windows_targets::link!("setupapi.dll" "system" fn SetupDiCreateDeviceInfoList(classguid : *const ::windows_core::GUID, hwndparent : super::super::Foundation:: HWND) -> HDEVINFO); let result__ = SetupDiCreateDeviceInfoList(::core::mem::transmute(classguid.unwrap_or(::std::ptr::null())), hwndparent.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2289,7 +2289,7 @@ where { ::windows_targets::link!("setupapi.dll" "system" fn SetupDiCreateDeviceInfoListExA(classguid : *const ::windows_core::GUID, hwndparent : super::super::Foundation:: HWND, machinename : ::windows_core::PCSTR, reserved : *const ::core::ffi::c_void) -> HDEVINFO); let result__ = SetupDiCreateDeviceInfoListExA(::core::mem::transmute(classguid.unwrap_or(::std::ptr::null())), hwndparent.into_param().abi(), machinename.into_param().abi(), ::core::mem::transmute(reserved.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2301,7 +2301,7 @@ where { ::windows_targets::link!("setupapi.dll" "system" fn SetupDiCreateDeviceInfoListExW(classguid : *const ::windows_core::GUID, hwndparent : super::super::Foundation:: HWND, machinename : ::windows_core::PCWSTR, reserved : *const ::core::ffi::c_void) -> HDEVINFO); let result__ = SetupDiCreateDeviceInfoListExW(::core::mem::transmute(classguid.unwrap_or(::std::ptr::null())), hwndparent.into_param().abi(), machinename.into_param().abi(), ::core::mem::transmute(reserved.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2337,7 +2337,7 @@ where { ::windows_targets::link!("setupapi.dll" "system" fn SetupDiCreateDeviceInterfaceRegKeyA(deviceinfoset : HDEVINFO, deviceinterfacedata : *const SP_DEVICE_INTERFACE_DATA, reserved : u32, samdesired : u32, infhandle : *const ::core::ffi::c_void, infsectionname : ::windows_core::PCSTR) -> super::super::System::Registry:: HKEY); let result__ = SetupDiCreateDeviceInterfaceRegKeyA(deviceinfoset.into_param().abi(), deviceinterfacedata, reserved, samdesired, ::core::mem::transmute(infhandle.unwrap_or(::std::ptr::null())), infsectionname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_System_Registry\"`*"] #[cfg(feature = "Win32_System_Registry")] @@ -2349,7 +2349,7 @@ where { ::windows_targets::link!("setupapi.dll" "system" fn SetupDiCreateDeviceInterfaceRegKeyW(deviceinfoset : HDEVINFO, deviceinterfacedata : *const SP_DEVICE_INTERFACE_DATA, reserved : u32, samdesired : u32, infhandle : *const ::core::ffi::c_void, infsectionname : ::windows_core::PCWSTR) -> super::super::System::Registry:: HKEY); let result__ = SetupDiCreateDeviceInterfaceRegKeyW(deviceinfoset.into_param().abi(), deviceinterfacedata, reserved, samdesired, ::core::mem::transmute(infhandle.unwrap_or(::std::ptr::null())), infsectionname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2624,7 +2624,7 @@ where { ::windows_targets::link!("setupapi.dll" "system" fn SetupDiGetClassDevsA(classguid : *const ::windows_core::GUID, enumerator : ::windows_core::PCSTR, hwndparent : super::super::Foundation:: HWND, flags : u32) -> HDEVINFO); let result__ = SetupDiGetClassDevsA(::core::mem::transmute(classguid.unwrap_or(::std::ptr::null())), enumerator.into_param().abi(), hwndparent.into_param().abi(), flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2638,7 +2638,7 @@ where { ::windows_targets::link!("setupapi.dll" "system" fn SetupDiGetClassDevsExA(classguid : *const ::windows_core::GUID, enumerator : ::windows_core::PCSTR, hwndparent : super::super::Foundation:: HWND, flags : u32, deviceinfoset : HDEVINFO, machinename : ::windows_core::PCSTR, reserved : *const ::core::ffi::c_void) -> HDEVINFO); let result__ = SetupDiGetClassDevsExA(::core::mem::transmute(classguid.unwrap_or(::std::ptr::null())), enumerator.into_param().abi(), hwndparent.into_param().abi(), flags, deviceinfoset.into_param().abi(), machinename.into_param().abi(), ::core::mem::transmute(reserved.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2652,7 +2652,7 @@ where { ::windows_targets::link!("setupapi.dll" "system" fn SetupDiGetClassDevsExW(classguid : *const ::windows_core::GUID, enumerator : ::windows_core::PCWSTR, hwndparent : super::super::Foundation:: HWND, flags : u32, deviceinfoset : HDEVINFO, machinename : ::windows_core::PCWSTR, reserved : *const ::core::ffi::c_void) -> HDEVINFO); let result__ = SetupDiGetClassDevsExW(::core::mem::transmute(classguid.unwrap_or(::std::ptr::null())), enumerator.into_param().abi(), hwndparent.into_param().abi(), flags, deviceinfoset.into_param().abi(), machinename.into_param().abi(), ::core::mem::transmute(reserved.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2664,7 +2664,7 @@ where { ::windows_targets::link!("setupapi.dll" "system" fn SetupDiGetClassDevsW(classguid : *const ::windows_core::GUID, enumerator : ::windows_core::PCWSTR, hwndparent : super::super::Foundation:: HWND, flags : u32) -> HDEVINFO); let result__ = SetupDiGetClassDevsW(::core::mem::transmute(classguid.unwrap_or(::std::ptr::null())), enumerator.into_param().abi(), hwndparent.into_param().abi(), flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_Foundation\"`, `\"Win32_UI_Controls\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Controls"))] @@ -3214,7 +3214,7 @@ where pub unsafe fn SetupDiOpenClassRegKey(classguid: ::core::option::Option<*const ::windows_core::GUID>, samdesired: u32) -> ::windows_core::Result { ::windows_targets::link!("setupapi.dll" "system" fn SetupDiOpenClassRegKey(classguid : *const ::windows_core::GUID, samdesired : u32) -> super::super::System::Registry:: HKEY); let result__ = SetupDiOpenClassRegKey(::core::mem::transmute(classguid.unwrap_or(::std::ptr::null())), samdesired); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_System_Registry\"`*"] #[cfg(feature = "Win32_System_Registry")] @@ -3225,7 +3225,7 @@ where { ::windows_targets::link!("setupapi.dll" "system" fn SetupDiOpenClassRegKeyExA(classguid : *const ::windows_core::GUID, samdesired : u32, flags : u32, machinename : ::windows_core::PCSTR, reserved : *const ::core::ffi::c_void) -> super::super::System::Registry:: HKEY); let result__ = SetupDiOpenClassRegKeyExA(::core::mem::transmute(classguid.unwrap_or(::std::ptr::null())), samdesired, flags, machinename.into_param().abi(), ::core::mem::transmute(reserved.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_System_Registry\"`*"] #[cfg(feature = "Win32_System_Registry")] @@ -3236,7 +3236,7 @@ where { ::windows_targets::link!("setupapi.dll" "system" fn SetupDiOpenClassRegKeyExW(classguid : *const ::windows_core::GUID, samdesired : u32, flags : u32, machinename : ::windows_core::PCWSTR, reserved : *const ::core::ffi::c_void) -> super::super::System::Registry:: HKEY); let result__ = SetupDiOpenClassRegKeyExW(::core::mem::transmute(classguid.unwrap_or(::std::ptr::null())), samdesired, flags, machinename.into_param().abi(), ::core::mem::transmute(reserved.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_System_Registry\"`*"] #[cfg(feature = "Win32_System_Registry")] @@ -3247,7 +3247,7 @@ where { ::windows_targets::link!("setupapi.dll" "system" fn SetupDiOpenDevRegKey(deviceinfoset : HDEVINFO, deviceinfodata : *const SP_DEVINFO_DATA, scope : u32, hwprofile : u32, keytype : u32, samdesired : u32) -> super::super::System::Registry:: HKEY); let result__ = SetupDiOpenDevRegKey(deviceinfoset.into_param().abi(), deviceinfodata, scope, hwprofile, keytype, samdesired); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -3293,7 +3293,7 @@ where { ::windows_targets::link!("setupapi.dll" "system" fn SetupDiOpenDeviceInterfaceRegKey(deviceinfoset : HDEVINFO, deviceinterfacedata : *const SP_DEVICE_INTERFACE_DATA, reserved : u32, samdesired : u32) -> super::super::System::Registry:: HKEY); let result__ = SetupDiOpenDeviceInterfaceRegKey(deviceinfoset.into_param().abi(), deviceinterfacedata, reserved, samdesired); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/Graphics/Gdi/mod.rs b/crates/libs/windows/src/Windows/Win32/Graphics/Gdi/mod.rs index f04a2d0c37..aa2bf62f2b 100644 --- a/crates/libs/windows/src/Windows/Win32/Graphics/Gdi/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Graphics/Gdi/mod.rs @@ -381,7 +381,7 @@ where { ::windows_targets::link!("gdi32.dll" "system" fn CreateDIBSection(hdc : HDC, pbmi : *const BITMAPINFO, usage : DIB_USAGE, ppvbits : *mut *mut ::core::ffi::c_void, hsection : super::super::Foundation:: HANDLE, offset : u32) -> HBITMAP); let result__ = CreateDIBSection(hdc.into_param().abi(), pbmi, usage, ppvbits, hsection.into_param().abi(), offset); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Graphics_Gdi\"`*"] #[inline] diff --git a/crates/libs/windows/src/Windows/Win32/Graphics/OpenGL/mod.rs b/crates/libs/windows/src/Windows/Win32/Graphics/OpenGL/mod.rs index 408b65102e..b9e6aac370 100644 --- a/crates/libs/windows/src/Windows/Win32/Graphics/OpenGL/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Graphics/OpenGL/mod.rs @@ -2408,7 +2408,7 @@ where { ::windows_targets::link!("opengl32.dll" "system" fn wglCreateContext(param0 : super::Gdi:: HDC) -> HGLRC); let result__ = wglCreateContext(param0.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Graphics_OpenGL\"`, `\"Win32_Graphics_Gdi\"`*"] #[cfg(feature = "Win32_Graphics_Gdi")] @@ -2419,7 +2419,7 @@ where { ::windows_targets::link!("opengl32.dll" "system" fn wglCreateLayerContext(param0 : super::Gdi:: HDC, param1 : i32) -> HGLRC); let result__ = wglCreateLayerContext(param0.into_param().abi(), param1); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Graphics_OpenGL\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/Graphics/Printing/mod.rs b/crates/libs/windows/src/Windows/Win32/Graphics/Printing/mod.rs index 64c3c226cb..ab82e2ad0f 100644 --- a/crates/libs/windows/src/Windows/Win32/Graphics/Printing/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Graphics/Printing/mod.rs @@ -162,7 +162,7 @@ where { ::windows_targets::link!("winspool.drv" "system" fn AddPrinterA(pname : ::windows_core::PCSTR, level : u32, pprinter : *const u8) -> super::super::Foundation:: HANDLE); let result__ = AddPrinterA(pname.into_param().abi(), level, pprinter); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Graphics_Printing\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -255,7 +255,7 @@ where { ::windows_targets::link!("winspool.drv" "system" fn AddPrinterW(pname : ::windows_core::PCWSTR, level : u32, pprinter : *const u8) -> super::super::Foundation:: HANDLE); let result__ = AddPrinterW(pname.into_param().abi(), level, pprinter); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Graphics_Printing\"`, `\"Win32_Foundation\"`, `\"Win32_Graphics_Gdi\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] @@ -1573,7 +1573,7 @@ where { ::windows_targets::link!("winspool.drv" "system" fn GetSpoolFileHandle(hprinter : super::super::Foundation:: HANDLE) -> super::super::Foundation:: HANDLE); let result__ = GetSpoolFileHandle(hprinter.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Graphics_Printing\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/NetworkManagement/IpHelper/mod.rs b/crates/libs/windows/src/Windows/Win32/NetworkManagement/IpHelper/mod.rs index 5518f2f958..8e08ed572c 100644 --- a/crates/libs/windows/src/Windows/Win32/NetworkManagement/IpHelper/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/NetworkManagement/IpHelper/mod.rs @@ -902,7 +902,7 @@ pub unsafe fn GetUnicastIpAddressTable(family: super::super::Networking::WinSock pub unsafe fn Icmp6CreateFile() -> ::windows_core::Result { ::windows_targets::link!("iphlpapi.dll" "system" fn Icmp6CreateFile() -> IcmpHandle); let result__ = Icmp6CreateFile(); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_NetworkManagement_IpHelper\"`*"] #[inline] @@ -936,7 +936,7 @@ where pub unsafe fn IcmpCreateFile() -> ::windows_core::Result { ::windows_targets::link!("iphlpapi.dll" "system" fn IcmpCreateFile() -> IcmpHandle); let result__ = IcmpCreateFile(); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_NetworkManagement_IpHelper\"`*"] #[inline] diff --git a/crates/libs/windows/src/Windows/Win32/Networking/Clustering/mod.rs b/crates/libs/windows/src/Windows/Win32/Networking/Clustering/mod.rs index 4da9fe79e5..5ebc5aaefc 100644 --- a/crates/libs/windows/src/Windows/Win32/Networking/Clustering/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Networking/Clustering/mod.rs @@ -1229,7 +1229,7 @@ pub unsafe fn GetClusterFromResource(hresource: *const _HRESOURCE) -> *mut _HCLU pub unsafe fn GetClusterGroupKey(hgroup: *const _HGROUP, samdesired: u32) -> ::windows_core::Result { ::windows_targets::link!("clusapi.dll" "system" fn GetClusterGroupKey(hgroup : *const _HGROUP, samdesired : u32) -> super::super::System::Registry:: HKEY); let result__ = GetClusterGroupKey(hgroup, samdesired); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"] #[inline] @@ -1249,7 +1249,7 @@ pub unsafe fn GetClusterInformation(hcluster: *const _HCLUSTER, lpszclustername: pub unsafe fn GetClusterKey(hcluster: *const _HCLUSTER, samdesired: u32) -> ::windows_core::Result { ::windows_targets::link!("clusapi.dll" "system" fn GetClusterKey(hcluster : *const _HCLUSTER, samdesired : u32) -> super::super::System::Registry:: HKEY); let result__ = GetClusterKey(hcluster, samdesired); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"] #[inline] @@ -1267,7 +1267,7 @@ where pub unsafe fn GetClusterNetInterfaceKey(hnetinterface: *const _HNETINTERFACE, samdesired: u32) -> ::windows_core::Result { ::windows_targets::link!("clusapi.dll" "system" fn GetClusterNetInterfaceKey(hnetinterface : *const _HNETINTERFACE, samdesired : u32) -> super::super::System::Registry:: HKEY); let result__ = GetClusterNetInterfaceKey(hnetinterface, samdesired); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"] #[inline] @@ -1287,7 +1287,7 @@ pub unsafe fn GetClusterNetworkId(hnetwork: *const _HNETWORK, lpsznetworkid: ::w pub unsafe fn GetClusterNetworkKey(hnetwork: *const _HNETWORK, samdesired: u32) -> ::windows_core::Result { ::windows_targets::link!("clusapi.dll" "system" fn GetClusterNetworkKey(hnetwork : *const _HNETWORK, samdesired : u32) -> super::super::System::Registry:: HKEY); let result__ = GetClusterNetworkKey(hnetwork, samdesired); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"] #[inline] @@ -1307,7 +1307,7 @@ pub unsafe fn GetClusterNodeId(hnode: ::core::option::Option<*const _HNODE>, lps pub unsafe fn GetClusterNodeKey(hnode: *const _HNODE, samdesired: u32) -> ::windows_core::Result { ::windows_targets::link!("clusapi.dll" "system" fn GetClusterNodeKey(hnode : *const _HNODE, samdesired : u32) -> super::super::System::Registry:: HKEY); let result__ = GetClusterNodeKey(hnode, samdesired); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"] #[inline] @@ -1360,7 +1360,7 @@ pub unsafe fn GetClusterResourceDependencyExpression(hresource: *const _HRESOURC pub unsafe fn GetClusterResourceKey(hresource: *const _HRESOURCE, samdesired: u32) -> ::windows_core::Result { ::windows_targets::link!("clusapi.dll" "system" fn GetClusterResourceKey(hresource : *const _HRESOURCE, samdesired : u32) -> super::super::System::Registry:: HKEY); let result__ = GetClusterResourceKey(hresource, samdesired); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_Clustering\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1384,7 +1384,7 @@ where { ::windows_targets::link!("clusapi.dll" "system" fn GetClusterResourceTypeKey(hcluster : *const _HCLUSTER, lpsztypename : ::windows_core::PCWSTR, samdesired : u32) -> super::super::System::Registry:: HKEY); let result__ = GetClusterResourceTypeKey(hcluster, lpsztypename.into_param().abi(), samdesired); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"] #[inline] diff --git a/crates/libs/windows/src/Windows/Win32/Networking/WinInet/mod.rs b/crates/libs/windows/src/Windows/Win32/Networking/WinInet/mod.rs index cec4eac1d1..6d806e7f22 100644 --- a/crates/libs/windows/src/Windows/Win32/Networking/WinInet/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Networking/WinInet/mod.rs @@ -391,7 +391,7 @@ where { ::windows_targets::link!("wininet.dll" "system" fn FindFirstUrlCacheEntryA(lpszurlsearchpattern : ::windows_core::PCSTR, lpfirstcacheentryinfo : *mut INTERNET_CACHE_ENTRY_INFOA, lpcbcacheentryinfo : *mut u32) -> super::super::Foundation:: HANDLE); let result__ = FindFirstUrlCacheEntryA(lpszurlsearchpattern.into_param().abi(), ::core::mem::transmute(lpfirstcacheentryinfo.unwrap_or(::std::ptr::null_mut())), lpcbcacheentryinfo); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_WinInet\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -402,7 +402,7 @@ where { ::windows_targets::link!("wininet.dll" "system" fn FindFirstUrlCacheEntryExA(lpszurlsearchpattern : ::windows_core::PCSTR, dwflags : u32, dwfilter : u32, groupid : i64, lpfirstcacheentryinfo : *mut INTERNET_CACHE_ENTRY_INFOA, lpcbcacheentryinfo : *mut u32, lpgroupattributes : *const ::core::ffi::c_void, lpcbgroupattributes : *const u32, lpreserved : *const ::core::ffi::c_void) -> super::super::Foundation:: HANDLE); let result__ = FindFirstUrlCacheEntryExA(lpszurlsearchpattern.into_param().abi(), dwflags, dwfilter, groupid, ::core::mem::transmute(lpfirstcacheentryinfo.unwrap_or(::std::ptr::null_mut())), lpcbcacheentryinfo, ::core::mem::transmute(lpgroupattributes.unwrap_or(::std::ptr::null())), ::core::mem::transmute(lpcbgroupattributes.unwrap_or(::std::ptr::null())), ::core::mem::transmute(lpreserved.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_WinInet\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -413,7 +413,7 @@ where { ::windows_targets::link!("wininet.dll" "system" fn FindFirstUrlCacheEntryExW(lpszurlsearchpattern : ::windows_core::PCWSTR, dwflags : u32, dwfilter : u32, groupid : i64, lpfirstcacheentryinfo : *mut INTERNET_CACHE_ENTRY_INFOW, lpcbcacheentryinfo : *mut u32, lpgroupattributes : *const ::core::ffi::c_void, lpcbgroupattributes : *const u32, lpreserved : *const ::core::ffi::c_void) -> super::super::Foundation:: HANDLE); let result__ = FindFirstUrlCacheEntryExW(lpszurlsearchpattern.into_param().abi(), dwflags, dwfilter, groupid, ::core::mem::transmute(lpfirstcacheentryinfo.unwrap_or(::std::ptr::null_mut())), lpcbcacheentryinfo, ::core::mem::transmute(lpgroupattributes.unwrap_or(::std::ptr::null())), ::core::mem::transmute(lpcbgroupattributes.unwrap_or(::std::ptr::null())), ::core::mem::transmute(lpreserved.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_WinInet\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -424,7 +424,7 @@ where { ::windows_targets::link!("wininet.dll" "system" fn FindFirstUrlCacheEntryW(lpszurlsearchpattern : ::windows_core::PCWSTR, lpfirstcacheentryinfo : *mut INTERNET_CACHE_ENTRY_INFOW, lpcbcacheentryinfo : *mut u32) -> super::super::Foundation:: HANDLE); let result__ = FindFirstUrlCacheEntryW(lpszurlsearchpattern.into_param().abi(), ::core::mem::transmute(lpfirstcacheentryinfo.unwrap_or(::std::ptr::null_mut())), lpcbcacheentryinfo); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_WinInet\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -432,7 +432,7 @@ where pub unsafe fn FindFirstUrlCacheGroup(dwflags: u32, dwfilter: u32, lpsearchcondition: ::core::option::Option<*const ::core::ffi::c_void>, dwsearchcondition: u32, lpgroupid: *mut i64, lpreserved: ::core::option::Option<*const ::core::ffi::c_void>) -> ::windows_core::Result { ::windows_targets::link!("wininet.dll" "system" fn FindFirstUrlCacheGroup(dwflags : u32, dwfilter : u32, lpsearchcondition : *const ::core::ffi::c_void, dwsearchcondition : u32, lpgroupid : *mut i64, lpreserved : *const ::core::ffi::c_void) -> super::super::Foundation:: HANDLE); let result__ = FindFirstUrlCacheGroup(dwflags, dwfilter, ::core::mem::transmute(lpsearchcondition.unwrap_or(::std::ptr::null())), dwsearchcondition, lpgroupid, ::core::mem::transmute(lpreserved.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_WinInet\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2321,7 +2321,7 @@ where { ::windows_targets::link!("wininet.dll" "system" fn RetrieveUrlCacheEntryStreamA(lpszurlname : ::windows_core::PCSTR, lpcacheentryinfo : *mut INTERNET_CACHE_ENTRY_INFOA, lpcbcacheentryinfo : *mut u32, frandomread : super::super::Foundation:: BOOL, dwreserved : u32) -> super::super::Foundation:: HANDLE); let result__ = RetrieveUrlCacheEntryStreamA(lpszurlname.into_param().abi(), ::core::mem::transmute(lpcacheentryinfo.unwrap_or(::std::ptr::null_mut())), lpcbcacheentryinfo, frandomread.into_param().abi(), dwreserved); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_WinInet\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2333,7 +2333,7 @@ where { ::windows_targets::link!("wininet.dll" "system" fn RetrieveUrlCacheEntryStreamW(lpszurlname : ::windows_core::PCWSTR, lpcacheentryinfo : *mut INTERNET_CACHE_ENTRY_INFOW, lpcbcacheentryinfo : *mut u32, frandomread : super::super::Foundation:: BOOL, dwreserved : u32) -> super::super::Foundation:: HANDLE); let result__ = RetrieveUrlCacheEntryStreamW(lpszurlname.into_param().abi(), ::core::mem::transmute(lpcacheentryinfo.unwrap_or(::std::ptr::null_mut())), lpcbcacheentryinfo, frandomread.into_param().abi(), dwreserved); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_WinInet\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/Security/Authorization/UI/mod.rs b/crates/libs/windows/src/Windows/Win32/Security/Authorization/UI/mod.rs index ddb34378d1..52f7de91d8 100644 --- a/crates/libs/windows/src/Windows/Win32/Security/Authorization/UI/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Security/Authorization/UI/mod.rs @@ -9,7 +9,7 @@ where { ::windows_targets::link!("aclui.dll" "system" fn CreateSecurityPage(psi : * mut::core::ffi::c_void) -> super::super::super::UI::Controls:: HPROPSHEETPAGE); let result__ = CreateSecurityPage(psi.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Security_Authorization_UI\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/Security/Credentials/mod.rs b/crates/libs/windows/src/Windows/Win32/Security/Credentials/mod.rs index 69b8a1b037..0cb6a7b9de 100644 --- a/crates/libs/windows/src/Windows/Win32/Security/Credentials/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Security/Credentials/mod.rs @@ -493,7 +493,7 @@ where pub unsafe fn SCardAccessStartedEvent() -> ::windows_core::Result { ::windows_targets::link!("winscard.dll" "system" fn SCardAccessStartedEvent() -> super::super::Foundation:: HANDLE); let result__ = SCardAccessStartedEvent(); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Security_Credentials\"`*"] #[inline] diff --git a/crates/libs/windows/src/Windows/Win32/Security/Cryptography/mod.rs b/crates/libs/windows/src/Windows/Win32/Security/Cryptography/mod.rs index b78e385f58..8ec31388e3 100644 --- a/crates/libs/windows/src/Windows/Win32/Security/Cryptography/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Security/Cryptography/mod.rs @@ -1298,7 +1298,7 @@ where { ::windows_targets::link!("crypt32.dll" "system" fn CertOpenStore(lpszstoreprovider : ::windows_core::PCSTR, dwencodingtype : CERT_QUERY_ENCODING_TYPE, hcryptprov : HCRYPTPROV_LEGACY, dwflags : CERT_OPEN_STORE_FLAGS, pvpara : *const ::core::ffi::c_void) -> HCERTSTORE); let result__ = CertOpenStore(lpszstoreprovider.into_param().abi(), dwencodingtype, hcryptprov.into_param().abi(), dwflags, ::core::mem::transmute(pvpara.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Security_Cryptography\"`*"] #[inline] @@ -1309,7 +1309,7 @@ where { ::windows_targets::link!("crypt32.dll" "system" fn CertOpenSystemStoreA(hprov : HCRYPTPROV_LEGACY, szsubsystemprotocol : ::windows_core::PCSTR) -> HCERTSTORE); let result__ = CertOpenSystemStoreA(hprov.into_param().abi(), szsubsystemprotocol.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Security_Cryptography\"`*"] #[inline] @@ -1320,7 +1320,7 @@ where { ::windows_targets::link!("crypt32.dll" "system" fn CertOpenSystemStoreW(hprov : HCRYPTPROV_LEGACY, szsubsystemprotocol : ::windows_core::PCWSTR) -> HCERTSTORE); let result__ = CertOpenSystemStoreW(hprov.into_param().abi(), szsubsystemprotocol.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Security_Cryptography\"`*"] #[inline] @@ -2033,7 +2033,7 @@ where { ::windows_targets::link!("crypt32.dll" "system" fn CryptGetMessageCertificates(dwmsgandcertencodingtype : u32, hcryptprov : HCRYPTPROV_LEGACY, dwflags : u32, pbsignedblob : *const u8, cbsignedblob : u32) -> HCERTSTORE); let result__ = CryptGetMessageCertificates(dwmsgandcertencodingtype, hcryptprov.into_param().abi(), dwflags, ::core::mem::transmute(pbsignedblob.as_ptr()), pbsignedblob.len() as _); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Security_Cryptography\"`*"] #[inline] @@ -3434,7 +3434,7 @@ where { ::windows_targets::link!("crypt32.dll" "system" fn PFXImportCertStore(ppfx : *const CRYPT_INTEGER_BLOB, szpassword : ::windows_core::PCWSTR, dwflags : CRYPT_KEY_FLAGS) -> HCERTSTORE); let result__ = PFXImportCertStore(ppfx, szpassword.into_param().abi(), dwflags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Security_Cryptography\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/Storage/FileSystem/mod.rs b/crates/libs/windows/src/Windows/Win32/Storage/FileSystem/mod.rs index e2402ac104..45619817e2 100644 --- a/crates/libs/windows/src/Windows/Win32/Storage/FileSystem/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Storage/FileSystem/mod.rs @@ -404,7 +404,7 @@ where { ::windows_targets::link!("ktmw32.dll" "system" fn CreateEnlistment(lpenlistmentattributes : *mut super::super::Security:: SECURITY_ATTRIBUTES, resourcemanagerhandle : super::super::Foundation:: HANDLE, transactionhandle : super::super::Foundation:: HANDLE, notificationmask : u32, createoptions : u32, enlistmentkey : *mut ::core::ffi::c_void) -> super::super::Foundation:: HANDLE); let result__ = CreateEnlistment(lpenlistmentattributes, resourcemanagerhandle.into_param().abi(), transactionhandle.into_param().abi(), notificationmask, createoptions, enlistmentkey); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -415,7 +415,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateFile2(lpfilename : ::windows_core::PCWSTR, dwdesiredaccess : u32, dwsharemode : FILE_SHARE_MODE, dwcreationdisposition : FILE_CREATION_DISPOSITION, pcreateexparams : *const CREATEFILE2_EXTENDED_PARAMETERS) -> super::super::Foundation:: HANDLE); let result__ = CreateFile2(lpfilename.into_param().abi(), dwdesiredaccess, dwsharemode, dwcreationdisposition, ::core::mem::transmute(pcreateexparams.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -437,7 +437,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateFileA(lpfilename : ::windows_core::PCSTR, dwdesiredaccess : u32, dwsharemode : FILE_SHARE_MODE, lpsecurityattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, dwcreationdisposition : FILE_CREATION_DISPOSITION, dwflagsandattributes : FILE_FLAGS_AND_ATTRIBUTES, htemplatefile : super::super::Foundation:: HANDLE) -> super::super::Foundation:: HANDLE); let result__ = CreateFileA(lpfilename.into_param().abi(), dwdesiredaccess, dwsharemode, ::core::mem::transmute(lpsecurityattributes.unwrap_or(::std::ptr::null())), dwcreationdisposition, dwflagsandattributes, htemplatefile.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -461,7 +461,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateFileTransactedA(lpfilename : ::windows_core::PCSTR, dwdesiredaccess : u32, dwsharemode : FILE_SHARE_MODE, lpsecurityattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, dwcreationdisposition : FILE_CREATION_DISPOSITION, dwflagsandattributes : FILE_FLAGS_AND_ATTRIBUTES, htemplatefile : super::super::Foundation:: HANDLE, htransaction : super::super::Foundation:: HANDLE, pusminiversion : *const TXFS_MINIVERSION, lpextendedparameter : *const ::core::ffi::c_void) -> super::super::Foundation:: HANDLE); let result__ = CreateFileTransactedA(lpfilename.into_param().abi(), dwdesiredaccess, dwsharemode, ::core::mem::transmute(lpsecurityattributes.unwrap_or(::std::ptr::null())), dwcreationdisposition, dwflagsandattributes, htemplatefile.into_param().abi(), htransaction.into_param().abi(), ::core::mem::transmute(pusminiversion.unwrap_or(::std::ptr::null())), ::core::mem::transmute(lpextendedparameter.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -474,7 +474,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateFileTransactedW(lpfilename : ::windows_core::PCWSTR, dwdesiredaccess : u32, dwsharemode : FILE_SHARE_MODE, lpsecurityattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, dwcreationdisposition : FILE_CREATION_DISPOSITION, dwflagsandattributes : FILE_FLAGS_AND_ATTRIBUTES, htemplatefile : super::super::Foundation:: HANDLE, htransaction : super::super::Foundation:: HANDLE, pusminiversion : *const TXFS_MINIVERSION, lpextendedparameter : *const ::core::ffi::c_void) -> super::super::Foundation:: HANDLE); let result__ = CreateFileTransactedW(lpfilename.into_param().abi(), dwdesiredaccess, dwsharemode, ::core::mem::transmute(lpsecurityattributes.unwrap_or(::std::ptr::null())), dwcreationdisposition, dwflagsandattributes, htemplatefile.into_param().abi(), htransaction.into_param().abi(), ::core::mem::transmute(pusminiversion.unwrap_or(::std::ptr::null())), ::core::mem::transmute(lpextendedparameter.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -486,7 +486,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateFileW(lpfilename : ::windows_core::PCWSTR, dwdesiredaccess : u32, dwsharemode : FILE_SHARE_MODE, lpsecurityattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, dwcreationdisposition : FILE_CREATION_DISPOSITION, dwflagsandattributes : FILE_FLAGS_AND_ATTRIBUTES, htemplatefile : super::super::Foundation:: HANDLE) -> super::super::Foundation:: HANDLE); let result__ = CreateFileW(lpfilename.into_param().abi(), dwdesiredaccess, dwsharemode, ::core::mem::transmute(lpsecurityattributes.unwrap_or(::std::ptr::null())), dwcreationdisposition, dwflagsandattributes, htemplatefile.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -560,7 +560,7 @@ where { ::windows_targets::link!("clfsw32.dll" "system" fn CreateLogFile(pszlogfilename : ::windows_core::PCWSTR, fdesiredaccess : u32, dwsharemode : FILE_SHARE_MODE, psalogfile : *mut super::super::Security:: SECURITY_ATTRIBUTES, fcreatedisposition : FILE_CREATION_DISPOSITION, fflagsandattributes : FILE_FLAGS_AND_ATTRIBUTES) -> super::super::Foundation:: HANDLE); let result__ = CreateLogFile(pszlogfilename.into_param().abi(), fdesiredaccess, dwsharemode, psalogfile, fcreatedisposition, fflagsandattributes); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -582,7 +582,7 @@ where { ::windows_targets::link!("ktmw32.dll" "system" fn CreateResourceManager(lpresourcemanagerattributes : *mut super::super::Security:: SECURITY_ATTRIBUTES, resourcemanagerid : *mut ::windows_core::GUID, createoptions : u32, tmhandle : super::super::Foundation:: HANDLE, description : ::windows_core::PCWSTR) -> super::super::Foundation:: HANDLE); let result__ = CreateResourceManager(lpresourcemanagerattributes, resourcemanagerid, createoptions, tmhandle.into_param().abi(), description.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -649,7 +649,7 @@ where { ::windows_targets::link!("ktmw32.dll" "system" fn CreateTransaction(lptransactionattributes : *mut super::super::Security:: SECURITY_ATTRIBUTES, uow : *mut ::windows_core::GUID, createoptions : u32, isolationlevel : u32, isolationflags : u32, timeout : u32, description : ::windows_core::PCWSTR) -> super::super::Foundation:: HANDLE); let result__ = CreateTransaction(lptransactionattributes, uow, createoptions, isolationlevel, isolationflags, timeout, description.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -660,7 +660,7 @@ where { ::windows_targets::link!("ktmw32.dll" "system" fn CreateTransactionManager(lptransactionattributes : *mut super::super::Security:: SECURITY_ATTRIBUTES, logfilename : ::windows_core::PCWSTR, createoptions : u32, commitstrength : u32) -> super::super::Foundation:: HANDLE); let result__ = CreateTransactionManager(lptransactionattributes, logfilename.into_param().abi(), createoptions, commitstrength); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -923,7 +923,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn FindFirstChangeNotificationA(lppathname : ::windows_core::PCSTR, bwatchsubtree : super::super::Foundation:: BOOL, dwnotifyfilter : FILE_NOTIFY_CHANGE) -> FindChangeNotificationHandle); let result__ = FindFirstChangeNotificationA(lppathname.into_param().abi(), bwatchsubtree.into_param().abi(), dwnotifyfilter); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -935,7 +935,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn FindFirstChangeNotificationW(lppathname : ::windows_core::PCWSTR, bwatchsubtree : super::super::Foundation:: BOOL, dwnotifyfilter : FILE_NOTIFY_CHANGE) -> FindChangeNotificationHandle); let result__ = FindFirstChangeNotificationW(lppathname.into_param().abi(), bwatchsubtree.into_param().abi(), dwnotifyfilter); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -946,7 +946,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn FindFirstFileA(lpfilename : ::windows_core::PCSTR, lpfindfiledata : *mut WIN32_FIND_DATAA) -> FindFileHandle); let result__ = FindFirstFileA(lpfilename.into_param().abi(), lpfindfiledata); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`*"] #[inline] @@ -956,7 +956,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn FindFirstFileExA(lpfilename : ::windows_core::PCSTR, finfolevelid : FINDEX_INFO_LEVELS, lpfindfiledata : *mut ::core::ffi::c_void, fsearchop : FINDEX_SEARCH_OPS, lpsearchfilter : *const ::core::ffi::c_void, dwadditionalflags : FIND_FIRST_EX_FLAGS) -> FindFileHandle); let result__ = FindFirstFileExA(lpfilename.into_param().abi(), finfolevelid, lpfindfiledata, fsearchop, ::core::mem::transmute(lpsearchfilter.unwrap_or(::std::ptr::null())), dwadditionalflags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -976,7 +976,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn FindFirstFileExW(lpfilename : ::windows_core::PCWSTR, finfolevelid : FINDEX_INFO_LEVELS, lpfindfiledata : *mut ::core::ffi::c_void, fsearchop : FINDEX_SEARCH_OPS, lpsearchfilter : *const ::core::ffi::c_void, dwadditionalflags : FIND_FIRST_EX_FLAGS) -> FindFileHandle); let result__ = FindFirstFileExW(lpfilename.into_param().abi(), finfolevelid, lpfindfiledata, fsearchop, ::core::mem::transmute(lpsearchfilter.unwrap_or(::std::ptr::null())), dwadditionalflags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -988,7 +988,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn FindFirstFileNameTransactedW(lpfilename : ::windows_core::PCWSTR, dwflags : u32, stringlength : *mut u32, linkname : ::windows_core::PWSTR, htransaction : super::super::Foundation:: HANDLE) -> FindFileNameHandle); let result__ = FindFirstFileNameTransactedW(lpfilename.into_param().abi(), dwflags, stringlength, ::core::mem::transmute(linkname), htransaction.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`*"] #[inline] @@ -998,7 +998,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn FindFirstFileNameW(lpfilename : ::windows_core::PCWSTR, dwflags : u32, stringlength : *mut u32, linkname : ::windows_core::PWSTR) -> FindFileNameHandle); let result__ = FindFirstFileNameW(lpfilename.into_param().abi(), dwflags, stringlength, ::core::mem::transmute(linkname)); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1010,7 +1010,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn FindFirstFileTransactedA(lpfilename : ::windows_core::PCSTR, finfolevelid : FINDEX_INFO_LEVELS, lpfindfiledata : *mut ::core::ffi::c_void, fsearchop : FINDEX_SEARCH_OPS, lpsearchfilter : *const ::core::ffi::c_void, dwadditionalflags : u32, htransaction : super::super::Foundation:: HANDLE) -> FindFileHandle); let result__ = FindFirstFileTransactedA(lpfilename.into_param().abi(), finfolevelid, lpfindfiledata, fsearchop, ::core::mem::transmute(lpsearchfilter.unwrap_or(::std::ptr::null())), dwadditionalflags, htransaction.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1022,7 +1022,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn FindFirstFileTransactedW(lpfilename : ::windows_core::PCWSTR, finfolevelid : FINDEX_INFO_LEVELS, lpfindfiledata : *mut ::core::ffi::c_void, fsearchop : FINDEX_SEARCH_OPS, lpsearchfilter : *const ::core::ffi::c_void, dwadditionalflags : u32, htransaction : super::super::Foundation:: HANDLE) -> FindFileHandle); let result__ = FindFirstFileTransactedW(lpfilename.into_param().abi(), finfolevelid, lpfindfiledata, fsearchop, ::core::mem::transmute(lpsearchfilter.unwrap_or(::std::ptr::null())), dwadditionalflags, htransaction.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1033,7 +1033,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn FindFirstFileW(lpfilename : ::windows_core::PCWSTR, lpfindfiledata : *mut WIN32_FIND_DATAW) -> FindFileHandle); let result__ = FindFirstFileW(lpfilename.into_param().abi(), lpfindfiledata); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1045,7 +1045,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn FindFirstStreamTransactedW(lpfilename : ::windows_core::PCWSTR, infolevel : STREAM_INFO_LEVELS, lpfindstreamdata : *mut ::core::ffi::c_void, dwflags : u32, htransaction : super::super::Foundation:: HANDLE) -> FindStreamHandle); let result__ = FindFirstStreamTransactedW(lpfilename.into_param().abi(), infolevel, lpfindstreamdata, dwflags, htransaction.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`*"] #[inline] @@ -1055,14 +1055,14 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn FindFirstStreamW(lpfilename : ::windows_core::PCWSTR, infolevel : STREAM_INFO_LEVELS, lpfindstreamdata : *mut ::core::ffi::c_void, dwflags : u32) -> FindStreamHandle); let result__ = FindFirstStreamW(lpfilename.into_param().abi(), infolevel, lpfindstreamdata, dwflags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`*"] #[inline] pub unsafe fn FindFirstVolumeA(lpszvolumename: &mut [u8]) -> ::windows_core::Result { ::windows_targets::link!("kernel32.dll" "system" fn FindFirstVolumeA(lpszvolumename : ::windows_core::PSTR, cchbufferlength : u32) -> FindVolumeHandle); let result__ = FindFirstVolumeA(::core::mem::transmute(lpszvolumename.as_ptr()), lpszvolumename.len() as _); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`*"] #[inline] @@ -1072,7 +1072,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn FindFirstVolumeMountPointA(lpszrootpathname : ::windows_core::PCSTR, lpszvolumemountpoint : ::windows_core::PSTR, cchbufferlength : u32) -> FindVolumeMountPointHandle); let result__ = FindFirstVolumeMountPointA(lpszrootpathname.into_param().abi(), ::core::mem::transmute(lpszvolumemountpoint.as_ptr()), lpszvolumemountpoint.len() as _); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`*"] #[inline] @@ -1082,14 +1082,14 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn FindFirstVolumeMountPointW(lpszrootpathname : ::windows_core::PCWSTR, lpszvolumemountpoint : ::windows_core::PWSTR, cchbufferlength : u32) -> FindVolumeMountPointHandle); let result__ = FindFirstVolumeMountPointW(lpszrootpathname.into_param().abi(), ::core::mem::transmute(lpszvolumemountpoint.as_ptr()), lpszvolumemountpoint.len() as _); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`*"] #[inline] pub unsafe fn FindFirstVolumeW(lpszvolumename: &mut [u16]) -> ::windows_core::Result { ::windows_targets::link!("kernel32.dll" "system" fn FindFirstVolumeW(lpszvolumename : ::windows_core::PWSTR, cchbufferlength : u32) -> FindVolumeHandle); let result__ = FindFirstVolumeW(::core::mem::transmute(lpszvolumename.as_ptr()), lpszvolumename.len() as _); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2593,7 +2593,7 @@ where { ::windows_targets::link!("ktmw32.dll" "system" fn OpenEnlistment(dwdesiredaccess : u32, resourcemanagerhandle : super::super::Foundation:: HANDLE, enlistmentid : *mut ::windows_core::GUID) -> super::super::Foundation:: HANDLE); let result__ = OpenEnlistment(dwdesiredaccess, resourcemanagerhandle.into_param().abi(), enlistmentid); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`*"] #[inline] @@ -2613,7 +2613,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn OpenFileById(hvolumehint : super::super::Foundation:: HANDLE, lpfileid : *const FILE_ID_DESCRIPTOR, dwdesiredaccess : u32, dwsharemode : FILE_SHARE_MODE, lpsecurityattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, dwflagsandattributes : FILE_FLAGS_AND_ATTRIBUTES) -> super::super::Foundation:: HANDLE); let result__ = OpenFileById(hvolumehint.into_param().abi(), lpfileid, dwdesiredaccess, dwsharemode, ::core::mem::transmute(lpsecurityattributes.unwrap_or(::std::ptr::null())), dwflagsandattributes); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2624,7 +2624,7 @@ where { ::windows_targets::link!("ktmw32.dll" "system" fn OpenResourceManager(dwdesiredaccess : u32, tmhandle : super::super::Foundation:: HANDLE, resourcemanagerid : *mut ::windows_core::GUID) -> super::super::Foundation:: HANDLE); let result__ = OpenResourceManager(dwdesiredaccess, tmhandle.into_param().abi(), resourcemanagerid); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2632,7 +2632,7 @@ where pub unsafe fn OpenTransaction(dwdesiredaccess: u32, transactionid: *mut ::windows_core::GUID) -> ::windows_core::Result { ::windows_targets::link!("ktmw32.dll" "system" fn OpenTransaction(dwdesiredaccess : u32, transactionid : *mut ::windows_core::GUID) -> super::super::Foundation:: HANDLE); let result__ = OpenTransaction(dwdesiredaccess, transactionid); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2643,7 +2643,7 @@ where { ::windows_targets::link!("ktmw32.dll" "system" fn OpenTransactionManager(logfilename : ::windows_core::PCWSTR, desiredaccess : u32, openoptions : u32) -> super::super::Foundation:: HANDLE); let result__ = OpenTransactionManager(logfilename.into_param().abi(), desiredaccess, openoptions); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2651,7 +2651,7 @@ where pub unsafe fn OpenTransactionManagerById(transactionmanagerid: *const ::windows_core::GUID, desiredaccess: u32, openoptions: u32) -> ::windows_core::Result { ::windows_targets::link!("ktmw32.dll" "system" fn OpenTransactionManagerById(transactionmanagerid : *const ::windows_core::GUID, desiredaccess : u32, openoptions : u32) -> super::super::Foundation:: HANDLE); let result__ = OpenTransactionManagerById(transactionmanagerid, desiredaccess, openoptions); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`*"] #[inline] @@ -2785,7 +2785,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn ReOpenFile(horiginalfile : super::super::Foundation:: HANDLE, dwdesiredaccess : u32, dwsharemode : FILE_SHARE_MODE, dwflagsandattributes : FILE_FLAGS_AND_ATTRIBUTES) -> super::super::Foundation:: HANDLE); let result__ = ReOpenFile(horiginalfile.into_param().abi(), dwdesiredaccess, dwsharemode, dwflagsandattributes); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`, `\"Win32_System_IO\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_IO"))] diff --git a/crates/libs/windows/src/Windows/Win32/System/ApplicationInstallationAndServicing/mod.rs b/crates/libs/windows/src/Windows/Win32/System/ApplicationInstallationAndServicing/mod.rs index 49789a8e6b..086819b909 100644 --- a/crates/libs/windows/src/Windows/Win32/System/ApplicationInstallationAndServicing/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/ApplicationInstallationAndServicing/mod.rs @@ -162,7 +162,7 @@ where pub unsafe fn CreateActCtxA(pactctx: *const ACTCTXA) -> ::windows_core::Result { ::windows_targets::link!("kernel32.dll" "system" fn CreateActCtxA(pactctx : *const ACTCTXA) -> super::super::Foundation:: HANDLE); let result__ = CreateActCtxA(pactctx); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_ApplicationInstallationAndServicing\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -170,7 +170,7 @@ pub unsafe fn CreateActCtxA(pactctx: *const ACTCTXA) -> ::windows_core::Result ::windows_core::Result { ::windows_targets::link!("kernel32.dll" "system" fn CreateActCtxW(pactctx : *const ACTCTXW) -> super::super::Foundation:: HANDLE); let result__ = CreateActCtxW(pactctx); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_ApplicationInstallationAndServicing\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/System/Console/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Console/mod.rs index 6f26b693df..1e6442dd6d 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Console/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Console/mod.rs @@ -53,7 +53,7 @@ where pub unsafe fn CreateConsoleScreenBuffer(dwdesiredaccess: u32, dwsharemode: u32, lpsecurityattributes: ::core::option::Option<*const super::super::Security::SECURITY_ATTRIBUTES>, dwflags: u32, lpscreenbufferdata: ::core::option::Option<*const ::core::ffi::c_void>) -> ::windows_core::Result { ::windows_targets::link!("kernel32.dll" "system" fn CreateConsoleScreenBuffer(dwdesiredaccess : u32, dwsharemode : u32, lpsecurityattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, dwflags : u32, lpscreenbufferdata : *const ::core::ffi::c_void) -> super::super::Foundation:: HANDLE); let result__ = CreateConsoleScreenBuffer(dwdesiredaccess, dwsharemode, ::core::mem::transmute(lpsecurityattributes.unwrap_or(::std::ptr::null())), dwflags, ::core::mem::transmute(lpscreenbufferdata.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Console\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -430,7 +430,7 @@ pub unsafe fn GetNumberOfConsoleMouseButtons(lpnumberofmousebuttons: *mut u32) - pub unsafe fn GetStdHandle(nstdhandle: STD_HANDLE) -> ::windows_core::Result { ::windows_targets::link!("kernel32.dll" "system" fn GetStdHandle(nstdhandle : STD_HANDLE) -> super::super::Foundation:: HANDLE); let result__ = GetStdHandle(nstdhandle); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Console\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/System/DataExchange/mod.rs b/crates/libs/windows/src/Windows/Win32/System/DataExchange/mod.rs index 721b2c9927..929899eb7e 100644 --- a/crates/libs/windows/src/Windows/Win32/System/DataExchange/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/DataExchange/mod.rs @@ -417,7 +417,7 @@ pub unsafe fn GetAtomNameW(natom: u16, lpbuffer: &mut [u16]) -> u32 { pub unsafe fn GetClipboardData(uformat: u32) -> ::windows_core::Result { ::windows_targets::link!("user32.dll" "system" fn GetClipboardData(uformat : u32) -> super::super::Foundation:: HANDLE); let result__ = GetClipboardData(uformat); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_DataExchange\"`*"] #[inline] @@ -632,7 +632,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn SetClipboardData(uformat : u32, hmem : super::super::Foundation:: HANDLE) -> super::super::Foundation:: HANDLE); let result__ = SetClipboardData(uformat, hmem.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_DataExchange\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/System/Diagnostics/Debug/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Diagnostics/Debug/mod.rs index f3583dc30b..4e01d831da 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Diagnostics/Debug/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Diagnostics/Debug/mod.rs @@ -311,7 +311,7 @@ where { ::windows_targets::link!("dbghelp.dll" "system" fn FindDebugInfoFile(filename : ::windows_core::PCSTR, symbolpath : ::windows_core::PCSTR, debugfilepath : ::windows_core::PSTR) -> super::super::super::Foundation:: HANDLE); let result__ = FindDebugInfoFile(filename.into_param().abi(), symbolpath.into_param().abi(), ::core::mem::transmute(debugfilepath)); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -323,7 +323,7 @@ where { ::windows_targets::link!("dbghelp.dll" "system" fn FindDebugInfoFileEx(filename : ::windows_core::PCSTR, symbolpath : ::windows_core::PCSTR, debugfilepath : ::windows_core::PSTR, callback : PFIND_DEBUG_FILE_CALLBACK, callerdata : *const ::core::ffi::c_void) -> super::super::super::Foundation:: HANDLE); let result__ = FindDebugInfoFileEx(filename.into_param().abi(), symbolpath.into_param().abi(), ::core::mem::transmute(debugfilepath), callback, ::core::mem::transmute(callerdata.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -335,7 +335,7 @@ where { ::windows_targets::link!("dbghelp.dll" "system" fn FindDebugInfoFileExW(filename : ::windows_core::PCWSTR, symbolpath : ::windows_core::PCWSTR, debugfilepath : ::windows_core::PWSTR, callback : PFIND_DEBUG_FILE_CALLBACKW, callerdata : *const ::core::ffi::c_void) -> super::super::super::Foundation:: HANDLE); let result__ = FindDebugInfoFileExW(filename.into_param().abi(), symbolpath.into_param().abi(), ::core::mem::transmute(debugfilepath), callback, ::core::mem::transmute(callerdata.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -347,7 +347,7 @@ where { ::windows_targets::link!("dbghelp.dll" "system" fn FindExecutableImage(filename : ::windows_core::PCSTR, symbolpath : ::windows_core::PCSTR, imagefilepath : ::windows_core::PSTR) -> super::super::super::Foundation:: HANDLE); let result__ = FindExecutableImage(filename.into_param().abi(), symbolpath.into_param().abi(), ::core::mem::transmute(imagefilepath)); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -359,7 +359,7 @@ where { ::windows_targets::link!("dbghelp.dll" "system" fn FindExecutableImageEx(filename : ::windows_core::PCSTR, symbolpath : ::windows_core::PCSTR, imagefilepath : ::windows_core::PSTR, callback : PFIND_EXE_FILE_CALLBACK, callerdata : *const ::core::ffi::c_void) -> super::super::super::Foundation:: HANDLE); let result__ = FindExecutableImageEx(filename.into_param().abi(), symbolpath.into_param().abi(), ::core::mem::transmute(imagefilepath), callback, ::core::mem::transmute(callerdata.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -371,7 +371,7 @@ where { ::windows_targets::link!("dbghelp.dll" "system" fn FindExecutableImageExW(filename : ::windows_core::PCWSTR, symbolpath : ::windows_core::PCWSTR, imagefilepath : ::windows_core::PWSTR, callback : PFIND_EXE_FILE_CALLBACKW, callerdata : *const ::core::ffi::c_void) -> super::super::super::Foundation:: HANDLE); let result__ = FindExecutableImageExW(filename.into_param().abi(), symbolpath.into_param().abi(), ::core::mem::transmute(imagefilepath), callback, callerdata); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1606,7 +1606,7 @@ where { ::windows_targets::link!("dbghelp.dll" "system" fn SymFindDebugInfoFile(hprocess : super::super::super::Foundation:: HANDLE, filename : ::windows_core::PCSTR, debugfilepath : ::windows_core::PSTR, callback : PFIND_DEBUG_FILE_CALLBACK, callerdata : *const ::core::ffi::c_void) -> super::super::super::Foundation:: HANDLE); let result__ = SymFindDebugInfoFile(hprocess.into_param().abi(), filename.into_param().abi(), ::core::mem::transmute(debugfilepath), callback, ::core::mem::transmute(callerdata.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1618,7 +1618,7 @@ where { ::windows_targets::link!("dbghelp.dll" "system" fn SymFindDebugInfoFileW(hprocess : super::super::super::Foundation:: HANDLE, filename : ::windows_core::PCWSTR, debugfilepath : ::windows_core::PWSTR, callback : PFIND_DEBUG_FILE_CALLBACKW, callerdata : *const ::core::ffi::c_void) -> super::super::super::Foundation:: HANDLE); let result__ = SymFindDebugInfoFileW(hprocess.into_param().abi(), filename.into_param().abi(), ::core::mem::transmute(debugfilepath), callback, ::core::mem::transmute(callerdata.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1630,7 +1630,7 @@ where { ::windows_targets::link!("dbghelp.dll" "system" fn SymFindExecutableImage(hprocess : super::super::super::Foundation:: HANDLE, filename : ::windows_core::PCSTR, imagefilepath : ::windows_core::PSTR, callback : PFIND_EXE_FILE_CALLBACK, callerdata : *const ::core::ffi::c_void) -> super::super::super::Foundation:: HANDLE); let result__ = SymFindExecutableImage(hprocess.into_param().abi(), filename.into_param().abi(), ::core::mem::transmute(imagefilepath), callback, callerdata); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1642,7 +1642,7 @@ where { ::windows_targets::link!("dbghelp.dll" "system" fn SymFindExecutableImageW(hprocess : super::super::super::Foundation:: HANDLE, filename : ::windows_core::PCWSTR, imagefilepath : ::windows_core::PWSTR, callback : PFIND_EXE_FILE_CALLBACKW, callerdata : *const ::core::ffi::c_void) -> super::super::super::Foundation:: HANDLE); let result__ = SymFindExecutableImageW(hprocess.into_param().abi(), filename.into_param().abi(), ::core::mem::transmute(imagefilepath), callback, callerdata); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/System/Diagnostics/ToolHelp/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Diagnostics/ToolHelp/mod.rs index 5fc5442a62..43fdd62359 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Diagnostics/ToolHelp/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Diagnostics/ToolHelp/mod.rs @@ -6,7 +6,7 @@ pub unsafe fn CreateToolhelp32Snapshot(dwflags: CREATE_TOOLHELP_SNAPSHOT_FLAGS, th32processid: u32) -> ::windows_core::Result { ::windows_targets::link!("kernel32.dll" "system" fn CreateToolhelp32Snapshot(dwflags : CREATE_TOOLHELP_SNAPSHOT_FLAGS, th32processid : u32) -> super::super::super::Foundation:: HANDLE); let result__ = CreateToolhelp32Snapshot(dwflags, th32processid); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Diagnostics_ToolHelp\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/System/EventLog/mod.rs b/crates/libs/windows/src/Windows/Win32/System/EventLog/mod.rs index 756db845fc..adbecd4f83 100644 --- a/crates/libs/windows/src/Windows/Win32/System/EventLog/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/EventLog/mod.rs @@ -115,14 +115,14 @@ where { ::windows_targets::link!("wevtapi.dll" "system" fn EvtCreateBookmark(bookmarkxml : ::windows_core::PCWSTR) -> EVT_HANDLE); let result__ = EvtCreateBookmark(bookmarkxml.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`*"] #[inline] pub unsafe fn EvtCreateRenderContext(valuepaths: ::core::option::Option<&[::windows_core::PCWSTR]>, flags: u32) -> ::windows_core::Result { ::windows_targets::link!("wevtapi.dll" "system" fn EvtCreateRenderContext(valuepathscount : u32, valuepaths : *const ::windows_core::PCWSTR, flags : u32) -> EVT_HANDLE); let result__ = EvtCreateRenderContext(valuepaths.as_deref().map_or(0, |slice| slice.len() as _), ::core::mem::transmute(valuepaths.as_deref().map_or(::core::ptr::null(), |slice| slice.as_ptr())), flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -256,7 +256,7 @@ where { ::windows_targets::link!("wevtapi.dll" "system" fn EvtNextEventMetadata(eventmetadataenum : EVT_HANDLE, flags : u32) -> EVT_HANDLE); let result__ = EvtNextEventMetadata(eventmetadataenum.into_param().abi(), flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -277,7 +277,7 @@ where { ::windows_targets::link!("wevtapi.dll" "system" fn EvtOpenChannelConfig(session : EVT_HANDLE, channelpath : ::windows_core::PCWSTR, flags : u32) -> EVT_HANDLE); let result__ = EvtOpenChannelConfig(session.into_param().abi(), channelpath.into_param().abi(), flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`*"] #[inline] @@ -287,7 +287,7 @@ where { ::windows_targets::link!("wevtapi.dll" "system" fn EvtOpenChannelEnum(session : EVT_HANDLE, flags : u32) -> EVT_HANDLE); let result__ = EvtOpenChannelEnum(session.into_param().abi(), flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`*"] #[inline] @@ -297,7 +297,7 @@ where { ::windows_targets::link!("wevtapi.dll" "system" fn EvtOpenEventMetadataEnum(publishermetadata : EVT_HANDLE, flags : u32) -> EVT_HANDLE); let result__ = EvtOpenEventMetadataEnum(publishermetadata.into_param().abi(), flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`*"] #[inline] @@ -308,7 +308,7 @@ where { ::windows_targets::link!("wevtapi.dll" "system" fn EvtOpenLog(session : EVT_HANDLE, path : ::windows_core::PCWSTR, flags : u32) -> EVT_HANDLE); let result__ = EvtOpenLog(session.into_param().abi(), path.into_param().abi(), flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`*"] #[inline] @@ -318,7 +318,7 @@ where { ::windows_targets::link!("wevtapi.dll" "system" fn EvtOpenPublisherEnum(session : EVT_HANDLE, flags : u32) -> EVT_HANDLE); let result__ = EvtOpenPublisherEnum(session.into_param().abi(), flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`*"] #[inline] @@ -330,14 +330,14 @@ where { ::windows_targets::link!("wevtapi.dll" "system" fn EvtOpenPublisherMetadata(session : EVT_HANDLE, publisherid : ::windows_core::PCWSTR, logfilepath : ::windows_core::PCWSTR, locale : u32, flags : u32) -> EVT_HANDLE); let result__ = EvtOpenPublisherMetadata(session.into_param().abi(), publisherid.into_param().abi(), logfilepath.into_param().abi(), locale, flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`*"] #[inline] pub unsafe fn EvtOpenSession(loginclass: EVT_LOGIN_CLASS, login: *const ::core::ffi::c_void, timeout: u32, flags: u32) -> ::windows_core::Result { ::windows_targets::link!("wevtapi.dll" "system" fn EvtOpenSession(loginclass : EVT_LOGIN_CLASS, login : *const ::core::ffi::c_void, timeout : u32, flags : u32) -> EVT_HANDLE); let result__ = EvtOpenSession(loginclass, login, timeout, flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`*"] #[inline] @@ -349,7 +349,7 @@ where { ::windows_targets::link!("wevtapi.dll" "system" fn EvtQuery(session : EVT_HANDLE, path : ::windows_core::PCWSTR, query : ::windows_core::PCWSTR, flags : u32) -> EVT_HANDLE); let result__ = EvtQuery(session.into_param().abi(), path.into_param().abi(), query.into_param().abi(), flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -406,7 +406,7 @@ where { ::windows_targets::link!("wevtapi.dll" "system" fn EvtSubscribe(session : EVT_HANDLE, signalevent : super::super::Foundation:: HANDLE, channelpath : ::windows_core::PCWSTR, query : ::windows_core::PCWSTR, bookmark : EVT_HANDLE, context : *const ::core::ffi::c_void, callback : EVT_SUBSCRIBE_CALLBACK, flags : u32) -> EVT_HANDLE); let result__ = EvtSubscribe(session.into_param().abi(), signalevent.into_param().abi(), channelpath.into_param().abi(), query.into_param().abi(), bookmark.into_param().abi(), ::core::mem::transmute(context.unwrap_or(::std::ptr::null())), callback, flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -469,7 +469,7 @@ where { ::windows_targets::link!("advapi32.dll" "system" fn OpenBackupEventLogA(lpuncservername : ::windows_core::PCSTR, lpfilename : ::windows_core::PCSTR) -> EventLogHandle); let result__ = OpenBackupEventLogA(lpuncservername.into_param().abi(), lpfilename.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`*"] #[inline] @@ -480,7 +480,7 @@ where { ::windows_targets::link!("advapi32.dll" "system" fn OpenBackupEventLogW(lpuncservername : ::windows_core::PCWSTR, lpfilename : ::windows_core::PCWSTR) -> EventLogHandle); let result__ = OpenBackupEventLogW(lpuncservername.into_param().abi(), lpfilename.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`*"] #[inline] @@ -491,7 +491,7 @@ where { ::windows_targets::link!("advapi32.dll" "system" fn OpenEventLogA(lpuncservername : ::windows_core::PCSTR, lpsourcename : ::windows_core::PCSTR) -> EventLogHandle); let result__ = OpenEventLogA(lpuncservername.into_param().abi(), lpsourcename.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`*"] #[inline] @@ -502,7 +502,7 @@ where { ::windows_targets::link!("advapi32.dll" "system" fn OpenEventLogW(lpuncservername : ::windows_core::PCWSTR, lpsourcename : ::windows_core::PCWSTR) -> EventLogHandle); let result__ = OpenEventLogW(lpuncservername.into_param().abi(), lpsourcename.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -533,7 +533,7 @@ where { ::windows_targets::link!("advapi32.dll" "system" fn RegisterEventSourceA(lpuncservername : ::windows_core::PCSTR, lpsourcename : ::windows_core::PCSTR) -> EventSourceHandle); let result__ = RegisterEventSourceA(lpuncservername.into_param().abi(), lpsourcename.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`*"] #[inline] @@ -544,7 +544,7 @@ where { ::windows_targets::link!("advapi32.dll" "system" fn RegisterEventSourceW(lpuncservername : ::windows_core::PCWSTR, lpsourcename : ::windows_core::PCWSTR) -> EventSourceHandle); let result__ = RegisterEventSourceW(lpuncservername.into_param().abi(), lpsourcename.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/System/GroupPolicy/mod.rs b/crates/libs/windows/src/Windows/Win32/System/GroupPolicy/mod.rs index c47e0032c7..25fbede1b5 100644 --- a/crates/libs/windows/src/Windows/Win32/System/GroupPolicy/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/GroupPolicy/mod.rs @@ -56,7 +56,7 @@ where { ::windows_targets::link!("userenv.dll" "system" fn EnterCriticalPolicySection(bmachine : super::super::Foundation:: BOOL) -> super::super::Foundation:: HANDLE); let result__ = EnterCriticalPolicySection(bmachine.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_GroupPolicy\"`*"] #[inline] diff --git a/crates/libs/windows/src/Windows/Win32/System/IO/mod.rs b/crates/libs/windows/src/Windows/Win32/System/IO/mod.rs index 921d5be7a7..fab10e73b2 100644 --- a/crates/libs/windows/src/Windows/Win32/System/IO/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/IO/mod.rs @@ -50,7 +50,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateIoCompletionPort(filehandle : super::super::Foundation:: HANDLE, existingcompletionport : super::super::Foundation:: HANDLE, completionkey : usize, numberofconcurrentthreads : u32) -> super::super::Foundation:: HANDLE); let result__ = CreateIoCompletionPort(filehandle.into_param().abi(), existingcompletionport.into_param().abi(), completionkey, numberofconcurrentthreads); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_IO\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/System/JobObjects/mod.rs b/crates/libs/windows/src/Windows/Win32/System/JobObjects/mod.rs index 12e37560fb..9e4c3241a0 100644 --- a/crates/libs/windows/src/Windows/Win32/System/JobObjects/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/JobObjects/mod.rs @@ -20,7 +20,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateJobObjectA(lpjobattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, lpname : ::windows_core::PCSTR) -> super::super::Foundation:: HANDLE); let result__ = CreateJobObjectA(::core::mem::transmute(lpjobattributes.unwrap_or(::std::ptr::null())), lpname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_JobObjects\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -31,7 +31,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateJobObjectW(lpjobattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, lpname : ::windows_core::PCWSTR) -> super::super::Foundation:: HANDLE); let result__ = CreateJobObjectW(::core::mem::transmute(lpjobattributes.unwrap_or(::std::ptr::null())), lpname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_JobObjects\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -67,7 +67,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn OpenJobObjectA(dwdesiredaccess : u32, binherithandle : super::super::Foundation:: BOOL, lpname : ::windows_core::PCSTR) -> super::super::Foundation:: HANDLE); let result__ = OpenJobObjectA(dwdesiredaccess, binherithandle.into_param().abi(), lpname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_JobObjects\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -79,7 +79,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn OpenJobObjectW(dwdesiredaccess : u32, binherithandle : super::super::Foundation:: BOOL, lpname : ::windows_core::PCWSTR) -> super::super::Foundation:: HANDLE); let result__ = OpenJobObjectW(dwdesiredaccess, binherithandle.into_param().abi(), lpname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_JobObjects\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/System/LibraryLoader/mod.rs b/crates/libs/windows/src/Windows/Win32/System/LibraryLoader/mod.rs index ec91b4abe1..26bed3c7fd 100644 --- a/crates/libs/windows/src/Windows/Win32/System/LibraryLoader/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/LibraryLoader/mod.rs @@ -19,7 +19,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn BeginUpdateResourceA(pfilename : ::windows_core::PCSTR, bdeleteexistingresources : super::super::Foundation:: BOOL) -> UPDATERESOURCE_HANDLE); let result__ = BeginUpdateResourceA(pfilename.into_param().abi(), bdeleteexistingresources.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_LibraryLoader\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -31,7 +31,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn BeginUpdateResourceW(pfilename : ::windows_core::PCWSTR, bdeleteexistingresources : super::super::Foundation:: BOOL) -> UPDATERESOURCE_HANDLE); let result__ = BeginUpdateResourceW(pfilename.into_param().abi(), bdeleteexistingresources.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_LibraryLoader\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -208,7 +208,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn FindResourceA(hmodule : super::super::Foundation:: HMODULE, lpname : ::windows_core::PCSTR, lptype : ::windows_core::PCSTR) -> super::super::Foundation:: HRSRC); let result__ = FindResourceA(hmodule.into_param().abi(), lpname.into_param().abi(), lptype.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_LibraryLoader\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -221,7 +221,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn FindResourceExA(hmodule : super::super::Foundation:: HMODULE, lptype : ::windows_core::PCSTR, lpname : ::windows_core::PCSTR, wlanguage : u16) -> super::super::Foundation:: HRSRC); let result__ = FindResourceExA(hmodule.into_param().abi(), lptype.into_param().abi(), lpname.into_param().abi(), wlanguage); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_LibraryLoader\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -318,7 +318,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn GetModuleHandleA(lpmodulename : ::windows_core::PCSTR) -> super::super::Foundation:: HMODULE); let result__ = GetModuleHandleA(lpmodulename.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_LibraryLoader\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -349,7 +349,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn GetModuleHandleW(lpmodulename : ::windows_core::PCWSTR) -> super::super::Foundation:: HMODULE); let result__ = GetModuleHandleW(lpmodulename.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_LibraryLoader\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -371,7 +371,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn LoadLibraryA(lplibfilename : ::windows_core::PCSTR) -> super::super::Foundation:: HMODULE); let result__ = LoadLibraryA(lplibfilename.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_LibraryLoader\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -383,7 +383,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn LoadLibraryExA(lplibfilename : ::windows_core::PCSTR, hfile : super::super::Foundation:: HANDLE, dwflags : LOAD_LIBRARY_FLAGS) -> super::super::Foundation:: HMODULE); let result__ = LoadLibraryExA(lplibfilename.into_param().abi(), hfile.into_param().abi(), dwflags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_LibraryLoader\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -395,7 +395,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn LoadLibraryExW(lplibfilename : ::windows_core::PCWSTR, hfile : super::super::Foundation:: HANDLE, dwflags : LOAD_LIBRARY_FLAGS) -> super::super::Foundation:: HMODULE); let result__ = LoadLibraryExW(lplibfilename.into_param().abi(), hfile.into_param().abi(), dwflags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_LibraryLoader\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -406,7 +406,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn LoadLibraryW(lplibfilename : ::windows_core::PCWSTR) -> super::super::Foundation:: HMODULE); let result__ = LoadLibraryW(lplibfilename.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_LibraryLoader\"`*"] #[inline] @@ -426,7 +426,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn LoadPackagedLibrary(lpwlibfilename : ::windows_core::PCWSTR, reserved : u32) -> super::super::Foundation:: HMODULE); let result__ = LoadPackagedLibrary(lpwlibfilename.into_param().abi(), reserved); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_LibraryLoader\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -438,7 +438,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn LoadResource(hmodule : super::super::Foundation:: HMODULE, hresinfo : super::super::Foundation:: HRSRC) -> super::super::Foundation:: HGLOBAL); let result__ = LoadResource(hmodule.into_param().abi(), hresinfo.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_LibraryLoader\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/System/Mailslots/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Mailslots/mod.rs index 034813b445..53fd550d85 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Mailslots/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Mailslots/mod.rs @@ -9,7 +9,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateMailslotA(lpname : ::windows_core::PCSTR, nmaxmessagesize : u32, lreadtimeout : u32, lpsecurityattributes : *const super::super::Security:: SECURITY_ATTRIBUTES) -> super::super::Foundation:: HANDLE); let result__ = CreateMailslotA(lpname.into_param().abi(), nmaxmessagesize, lreadtimeout, ::core::mem::transmute(lpsecurityattributes.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Mailslots\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -20,7 +20,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateMailslotW(lpname : ::windows_core::PCWSTR, nmaxmessagesize : u32, lreadtimeout : u32, lpsecurityattributes : *const super::super::Security:: SECURITY_ATTRIBUTES) -> super::super::Foundation:: HANDLE); let result__ = CreateMailslotW(lpname.into_param().abi(), nmaxmessagesize, lreadtimeout, ::core::mem::transmute(lpsecurityattributes.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Mailslots\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/System/Memory/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Memory/mod.rs index 2a019f7e45..966a56164b 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Memory/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Memory/mod.rs @@ -49,7 +49,7 @@ where { ::windows_targets::link!("api-ms-win-core-memory-l1-1-7.dll" "system" fn CreateFileMapping2(file : super::super::Foundation:: HANDLE, securityattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, desiredaccess : u32, pageprotection : PAGE_PROTECTION_FLAGS, allocationattributes : u32, maximumsize : u64, name : ::windows_core::PCWSTR, extendedparameters : *mut MEM_EXTENDED_PARAMETER, parametercount : u32) -> super::super::Foundation:: HANDLE); let result__ = CreateFileMapping2(file.into_param().abi(), ::core::mem::transmute(securityattributes.unwrap_or(::std::ptr::null())), desiredaccess, pageprotection, allocationattributes, maximumsize, name.into_param().abi(), ::core::mem::transmute(extendedparameters.as_deref().map_or(::core::ptr::null(), |slice| slice.as_ptr())), extendedparameters.as_deref().map_or(0, |slice| slice.len() as _)); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -61,7 +61,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateFileMappingA(hfile : super::super::Foundation:: HANDLE, lpfilemappingattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, flprotect : PAGE_PROTECTION_FLAGS, dwmaximumsizehigh : u32, dwmaximumsizelow : u32, lpname : ::windows_core::PCSTR) -> super::super::Foundation:: HANDLE); let result__ = CreateFileMappingA(hfile.into_param().abi(), ::core::mem::transmute(lpfilemappingattributes.unwrap_or(::std::ptr::null())), flprotect, dwmaximumsizehigh, dwmaximumsizelow, lpname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -73,7 +73,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateFileMappingFromApp(hfile : super::super::Foundation:: HANDLE, securityattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, pageprotection : PAGE_PROTECTION_FLAGS, maximumsize : u64, name : ::windows_core::PCWSTR) -> super::super::Foundation:: HANDLE); let result__ = CreateFileMappingFromApp(hfile.into_param().abi(), ::core::mem::transmute(securityattributes.unwrap_or(::std::ptr::null())), pageprotection, maximumsize, name.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -85,7 +85,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateFileMappingNumaA(hfile : super::super::Foundation:: HANDLE, lpfilemappingattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, flprotect : PAGE_PROTECTION_FLAGS, dwmaximumsizehigh : u32, dwmaximumsizelow : u32, lpname : ::windows_core::PCSTR, nndpreferred : u32) -> super::super::Foundation:: HANDLE); let result__ = CreateFileMappingNumaA(hfile.into_param().abi(), ::core::mem::transmute(lpfilemappingattributes.unwrap_or(::std::ptr::null())), flprotect, dwmaximumsizehigh, dwmaximumsizelow, lpname.into_param().abi(), nndpreferred); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -97,7 +97,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateFileMappingNumaW(hfile : super::super::Foundation:: HANDLE, lpfilemappingattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, flprotect : PAGE_PROTECTION_FLAGS, dwmaximumsizehigh : u32, dwmaximumsizelow : u32, lpname : ::windows_core::PCWSTR, nndpreferred : u32) -> super::super::Foundation:: HANDLE); let result__ = CreateFileMappingNumaW(hfile.into_param().abi(), ::core::mem::transmute(lpfilemappingattributes.unwrap_or(::std::ptr::null())), flprotect, dwmaximumsizehigh, dwmaximumsizelow, lpname.into_param().abi(), nndpreferred); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -109,7 +109,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateFileMappingW(hfile : super::super::Foundation:: HANDLE, lpfilemappingattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, flprotect : PAGE_PROTECTION_FLAGS, dwmaximumsizehigh : u32, dwmaximumsizelow : u32, lpname : ::windows_core::PCWSTR) -> super::super::Foundation:: HANDLE); let result__ = CreateFileMappingW(hfile.into_param().abi(), ::core::mem::transmute(lpfilemappingattributes.unwrap_or(::std::ptr::null())), flprotect, dwmaximumsizehigh, dwmaximumsizelow, lpname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -117,7 +117,7 @@ where pub unsafe fn CreateMemoryResourceNotification(notificationtype: MEMORY_RESOURCE_NOTIFICATION_TYPE) -> ::windows_core::Result { ::windows_targets::link!("kernel32.dll" "system" fn CreateMemoryResourceNotification(notificationtype : MEMORY_RESOURCE_NOTIFICATION_TYPE) -> super::super::Foundation:: HANDLE); let result__ = CreateMemoryResourceNotification(notificationtype); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`*"] #[inline] @@ -160,7 +160,7 @@ pub unsafe fn GetMemoryErrorHandlingCapabilities(capabilities: *mut u32) -> ::wi pub unsafe fn GetProcessHeap() -> ::windows_core::Result { ::windows_targets::link!("kernel32.dll" "system" fn GetProcessHeap() -> HeapHandle); let result__ = GetProcessHeap(); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`*"] #[inline] @@ -197,7 +197,7 @@ pub unsafe fn GetWriteWatch(dwflags: u32, lpbaseaddress: *const ::core::ffi::c_v pub unsafe fn GlobalAlloc(uflags: GLOBAL_ALLOC_FLAGS, dwbytes: usize) -> ::windows_core::Result { ::windows_targets::link!("kernel32.dll" "system" fn GlobalAlloc(uflags : GLOBAL_ALLOC_FLAGS, dwbytes : usize) -> super::super::Foundation:: HGLOBAL); let result__ = GlobalAlloc(uflags, dwbytes); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -218,7 +218,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn GlobalFree(hmem : super::super::Foundation:: HGLOBAL) -> super::super::Foundation:: HGLOBAL); let result__ = GlobalFree(hmem.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -226,7 +226,7 @@ where pub unsafe fn GlobalHandle(pmem: *const ::core::ffi::c_void) -> ::windows_core::Result { ::windows_targets::link!("kernel32.dll" "system" fn GlobalHandle(pmem : *const ::core::ffi::c_void) -> super::super::Foundation:: HGLOBAL); let result__ = GlobalHandle(pmem); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -247,7 +247,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn GlobalReAlloc(hmem : super::super::Foundation:: HGLOBAL, dwbytes : usize, uflags : u32) -> super::super::Foundation:: HGLOBAL); let result__ = GlobalReAlloc(hmem.into_param().abi(), dwbytes, uflags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -292,7 +292,7 @@ where pub unsafe fn HeapCreate(floptions: HEAP_FLAGS, dwinitialsize: usize, dwmaximumsize: usize) -> ::windows_core::Result { ::windows_targets::link!("kernel32.dll" "system" fn HeapCreate(floptions : HEAP_FLAGS, dwinitialsize : usize, dwmaximumsize : usize) -> HeapHandle); let result__ = HeapCreate(floptions, dwinitialsize, dwmaximumsize); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -449,7 +449,7 @@ pub unsafe fn IsBadWritePtr(lp: ::core::option::Option<*const ::core::ffi::c_voi pub unsafe fn LocalAlloc(uflags: LOCAL_ALLOC_FLAGS, ubytes: usize) -> ::windows_core::Result { ::windows_targets::link!("kernel32.dll" "system" fn LocalAlloc(uflags : LOCAL_ALLOC_FLAGS, ubytes : usize) -> super::super::Foundation:: HLOCAL); let result__ = LocalAlloc(uflags, ubytes); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -470,7 +470,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn LocalFree(hmem : super::super::Foundation:: HLOCAL) -> super::super::Foundation:: HLOCAL); let result__ = LocalFree(hmem.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -478,7 +478,7 @@ where pub unsafe fn LocalHandle(pmem: *const ::core::ffi::c_void) -> ::windows_core::Result { ::windows_targets::link!("kernel32.dll" "system" fn LocalHandle(pmem : *const ::core::ffi::c_void) -> super::super::Foundation:: HLOCAL); let result__ = LocalHandle(pmem); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -499,7 +499,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn LocalReAlloc(hmem : super::super::Foundation:: HLOCAL, ubytes : usize, uflags : u32) -> super::super::Foundation:: HLOCAL); let result__ = LocalReAlloc(hmem.into_param().abi(), ubytes, uflags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -635,7 +635,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn OpenFileMappingA(dwdesiredaccess : u32, binherithandle : super::super::Foundation:: BOOL, lpname : ::windows_core::PCSTR) -> super::super::Foundation:: HANDLE); let result__ = OpenFileMappingA(dwdesiredaccess, binherithandle.into_param().abi(), lpname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -647,7 +647,7 @@ where { ::windows_targets::link!("api-ms-win-core-memory-l1-1-3.dll" "system" fn OpenFileMappingFromApp(desiredaccess : u32, inherithandle : super::super::Foundation:: BOOL, name : ::windows_core::PCWSTR) -> super::super::Foundation:: HANDLE); let result__ = OpenFileMappingFromApp(desiredaccess, inherithandle.into_param().abi(), name.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -659,7 +659,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn OpenFileMappingW(dwdesiredaccess : u32, binherithandle : super::super::Foundation:: BOOL, lpname : ::windows_core::PCWSTR) -> super::super::Foundation:: HANDLE); let result__ = OpenFileMappingW(dwdesiredaccess, binherithandle.into_param().abi(), lpname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/System/Ole/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Ole/mod.rs index 4042950b36..38779ce5a4 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Ole/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Ole/mod.rs @@ -730,7 +730,7 @@ where { ::windows_targets::link!("ole32.dll" "system" fn OleMetafilePictFromIconAndLabel(hicon : super::super::UI::WindowsAndMessaging:: HICON, lpszlabel : ::windows_core::PCWSTR, lpszsourcefile : ::windows_core::PCWSTR, iiconindex : u32) -> super::super::Foundation:: HGLOBAL); let result__ = OleMetafilePictFromIconAndLabel(hicon.into_param().abi(), lpszlabel.into_param().abi(), lpszsourcefile.into_param().abi(), iiconindex); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Ole\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/System/Pipes/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Pipes/mod.rs index 345c24326f..778d43fcf9 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Pipes/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Pipes/mod.rs @@ -39,7 +39,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateNamedPipeA(lpname : ::windows_core::PCSTR, dwopenmode : super::super::Storage::FileSystem:: FILE_FLAGS_AND_ATTRIBUTES, dwpipemode : NAMED_PIPE_MODE, nmaxinstances : u32, noutbuffersize : u32, ninbuffersize : u32, ndefaulttimeout : u32, lpsecurityattributes : *const super::super::Security:: SECURITY_ATTRIBUTES) -> super::super::Foundation:: HANDLE); let result__ = CreateNamedPipeA(lpname.into_param().abi(), dwopenmode, dwpipemode, nmaxinstances, noutbuffersize, ninbuffersize, ndefaulttimeout, ::core::mem::transmute(lpsecurityattributes.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Pipes\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`, `\"Win32_Storage_FileSystem\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security", feature = "Win32_Storage_FileSystem"))] diff --git a/crates/libs/windows/src/Windows/Win32/System/Power/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Power/mod.rs index 52261e78c3..c6121ebc2f 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Power/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Power/mod.rs @@ -174,7 +174,7 @@ where pub unsafe fn PowerCreateRequest(context: *const super::Threading::REASON_CONTEXT) -> ::windows_core::Result { ::windows_targets::link!("kernel32.dll" "system" fn PowerCreateRequest(context : *const super::Threading:: REASON_CONTEXT) -> super::super::Foundation:: HANDLE); let result__ = PowerCreateRequest(context); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Power\"`, `\"Win32_Foundation\"`, `\"Win32_System_Registry\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Registry"))] @@ -739,7 +739,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn RegisterPowerSettingNotification(hrecipient : super::super::Foundation:: HANDLE, powersettingguid : *const ::windows_core::GUID, flags : u32) -> HPOWERNOTIFY); let result__ = RegisterPowerSettingNotification(hrecipient.into_param().abi(), powersettingguid, flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Power\"`, `\"Win32_Foundation\"`, `\"Win32_UI_WindowsAndMessaging\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] @@ -750,7 +750,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn RegisterSuspendResumeNotification(hrecipient : super::super::Foundation:: HANDLE, flags : super::super::UI::WindowsAndMessaging:: REGISTER_NOTIFICATION_FLAGS) -> HPOWERNOTIFY); let result__ = RegisterSuspendResumeNotification(hrecipient.into_param().abi(), flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Power\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/System/RemoteDesktop/mod.rs b/crates/libs/windows/src/Windows/Win32/System/RemoteDesktop/mod.rs index 9194cbaebe..1fdfb286d2 100644 --- a/crates/libs/windows/src/Windows/Win32/System/RemoteDesktop/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/RemoteDesktop/mod.rs @@ -576,7 +576,7 @@ where { ::windows_targets::link!("wtsapi32.dll" "system" fn WTSVirtualChannelOpen(hserver : super::super::Foundation:: HANDLE, sessionid : u32, pvirtualname : ::windows_core::PCSTR) -> HwtsVirtualChannelHandle); let result__ = WTSVirtualChannelOpen(hserver.into_param().abi(), sessionid, pvirtualname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_RemoteDesktop\"`*"] #[inline] @@ -586,7 +586,7 @@ where { ::windows_targets::link!("wtsapi32.dll" "system" fn WTSVirtualChannelOpenEx(sessionid : u32, pvirtualname : ::windows_core::PCSTR, flags : u32) -> HwtsVirtualChannelHandle); let result__ = WTSVirtualChannelOpenEx(sessionid, pvirtualname.into_param().abi(), flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_RemoteDesktop\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/System/Services/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Services/mod.rs index 6ea394b6eb..573f98c482 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Services/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Services/mod.rs @@ -108,7 +108,7 @@ where { ::windows_targets::link!("advapi32.dll" "system" fn CreateServiceA(hscmanager : super::super::Security:: SC_HANDLE, lpservicename : ::windows_core::PCSTR, lpdisplayname : ::windows_core::PCSTR, dwdesiredaccess : u32, dwservicetype : ENUM_SERVICE_TYPE, dwstarttype : SERVICE_START_TYPE, dwerrorcontrol : SERVICE_ERROR, lpbinarypathname : ::windows_core::PCSTR, lploadordergroup : ::windows_core::PCSTR, lpdwtagid : *mut u32, lpdependencies : ::windows_core::PCSTR, lpservicestartname : ::windows_core::PCSTR, lppassword : ::windows_core::PCSTR) -> super::super::Security:: SC_HANDLE); let result__ = CreateServiceA(hscmanager.into_param().abi(), lpservicename.into_param().abi(), lpdisplayname.into_param().abi(), dwdesiredaccess, dwservicetype, dwstarttype, dwerrorcontrol, lpbinarypathname.into_param().abi(), lploadordergroup.into_param().abi(), ::core::mem::transmute(lpdwtagid.unwrap_or(::std::ptr::null_mut())), lpdependencies.into_param().abi(), lpservicestartname.into_param().abi(), lppassword.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Services\"`, `\"Win32_Security\"`*"] #[cfg(feature = "Win32_Security")] @@ -126,7 +126,7 @@ where { ::windows_targets::link!("advapi32.dll" "system" fn CreateServiceW(hscmanager : super::super::Security:: SC_HANDLE, lpservicename : ::windows_core::PCWSTR, lpdisplayname : ::windows_core::PCWSTR, dwdesiredaccess : u32, dwservicetype : ENUM_SERVICE_TYPE, dwstarttype : SERVICE_START_TYPE, dwerrorcontrol : SERVICE_ERROR, lpbinarypathname : ::windows_core::PCWSTR, lploadordergroup : ::windows_core::PCWSTR, lpdwtagid : *mut u32, lpdependencies : ::windows_core::PCWSTR, lpservicestartname : ::windows_core::PCWSTR, lppassword : ::windows_core::PCWSTR) -> super::super::Security:: SC_HANDLE); let result__ = CreateServiceW(hscmanager.into_param().abi(), lpservicename.into_param().abi(), lpdisplayname.into_param().abi(), dwdesiredaccess, dwservicetype, dwstarttype, dwerrorcontrol, lpbinarypathname.into_param().abi(), lploadordergroup.into_param().abi(), ::core::mem::transmute(lpdwtagid.unwrap_or(::std::ptr::null_mut())), lpdependencies.into_param().abi(), lpservicestartname.into_param().abi(), lppassword.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Services\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -333,7 +333,7 @@ where { ::windows_targets::link!("advapi32.dll" "system" fn OpenSCManagerA(lpmachinename : ::windows_core::PCSTR, lpdatabasename : ::windows_core::PCSTR, dwdesiredaccess : u32) -> super::super::Security:: SC_HANDLE); let result__ = OpenSCManagerA(lpmachinename.into_param().abi(), lpdatabasename.into_param().abi(), dwdesiredaccess); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Services\"`, `\"Win32_Security\"`*"] #[cfg(feature = "Win32_Security")] @@ -345,7 +345,7 @@ where { ::windows_targets::link!("advapi32.dll" "system" fn OpenSCManagerW(lpmachinename : ::windows_core::PCWSTR, lpdatabasename : ::windows_core::PCWSTR, dwdesiredaccess : u32) -> super::super::Security:: SC_HANDLE); let result__ = OpenSCManagerW(lpmachinename.into_param().abi(), lpdatabasename.into_param().abi(), dwdesiredaccess); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Services\"`, `\"Win32_Security\"`*"] #[cfg(feature = "Win32_Security")] @@ -357,7 +357,7 @@ where { ::windows_targets::link!("advapi32.dll" "system" fn OpenServiceA(hscmanager : super::super::Security:: SC_HANDLE, lpservicename : ::windows_core::PCSTR, dwdesiredaccess : u32) -> super::super::Security:: SC_HANDLE); let result__ = OpenServiceA(hscmanager.into_param().abi(), lpservicename.into_param().abi(), dwdesiredaccess); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Services\"`, `\"Win32_Security\"`*"] #[cfg(feature = "Win32_Security")] @@ -369,7 +369,7 @@ where { ::windows_targets::link!("advapi32.dll" "system" fn OpenServiceW(hscmanager : super::super::Security:: SC_HANDLE, lpservicename : ::windows_core::PCWSTR, dwdesiredaccess : u32) -> super::super::Security:: SC_HANDLE); let result__ = OpenServiceW(hscmanager.into_param().abi(), lpservicename.into_param().abi(), dwdesiredaccess); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Services\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -479,7 +479,7 @@ where { ::windows_targets::link!("advapi32.dll" "system" fn RegisterServiceCtrlHandlerA(lpservicename : ::windows_core::PCSTR, lphandlerproc : LPHANDLER_FUNCTION) -> SERVICE_STATUS_HANDLE); let result__ = RegisterServiceCtrlHandlerA(lpservicename.into_param().abi(), lphandlerproc); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Services\"`*"] #[inline] @@ -489,7 +489,7 @@ where { ::windows_targets::link!("advapi32.dll" "system" fn RegisterServiceCtrlHandlerExA(lpservicename : ::windows_core::PCSTR, lphandlerproc : LPHANDLER_FUNCTION_EX, lpcontext : *const ::core::ffi::c_void) -> SERVICE_STATUS_HANDLE); let result__ = RegisterServiceCtrlHandlerExA(lpservicename.into_param().abi(), lphandlerproc, ::core::mem::transmute(lpcontext.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Services\"`*"] #[inline] @@ -499,7 +499,7 @@ where { ::windows_targets::link!("advapi32.dll" "system" fn RegisterServiceCtrlHandlerExW(lpservicename : ::windows_core::PCWSTR, lphandlerproc : LPHANDLER_FUNCTION_EX, lpcontext : *const ::core::ffi::c_void) -> SERVICE_STATUS_HANDLE); let result__ = RegisterServiceCtrlHandlerExW(lpservicename.into_param().abi(), lphandlerproc, ::core::mem::transmute(lpcontext.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Services\"`*"] #[inline] @@ -509,7 +509,7 @@ where { ::windows_targets::link!("advapi32.dll" "system" fn RegisterServiceCtrlHandlerW(lpservicename : ::windows_core::PCWSTR, lphandlerproc : LPHANDLER_FUNCTION) -> SERVICE_STATUS_HANDLE); let result__ = RegisterServiceCtrlHandlerW(lpservicename.into_param().abi(), lphandlerproc); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Services\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/System/StationsAndDesktops/mod.rs b/crates/libs/windows/src/Windows/Win32/System/StationsAndDesktops/mod.rs index 0e4fc11782..2dcc4faf3a 100644 --- a/crates/libs/windows/src/Windows/Win32/System/StationsAndDesktops/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/StationsAndDesktops/mod.rs @@ -74,7 +74,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn CreateDesktopA(lpszdesktop : ::windows_core::PCSTR, lpszdevice : ::windows_core::PCSTR, pdevmode : *const super::super::Graphics::Gdi:: DEVMODEA, dwflags : DESKTOP_CONTROL_FLAGS, dwdesiredaccess : u32, lpsa : *const super::super::Security:: SECURITY_ATTRIBUTES) -> HDESK); let result__ = CreateDesktopA(lpszdesktop.into_param().abi(), lpszdevice.into_param().abi(), ::core::mem::transmute(pdevmode.unwrap_or(::std::ptr::null())), dwflags, dwdesiredaccess, ::core::mem::transmute(lpsa.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_StationsAndDesktops\"`, `\"Win32_Foundation\"`, `\"Win32_Graphics_Gdi\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_Security"))] @@ -86,7 +86,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn CreateDesktopExA(lpszdesktop : ::windows_core::PCSTR, lpszdevice : ::windows_core::PCSTR, pdevmode : *const super::super::Graphics::Gdi:: DEVMODEA, dwflags : DESKTOP_CONTROL_FLAGS, dwdesiredaccess : u32, lpsa : *const super::super::Security:: SECURITY_ATTRIBUTES, ulheapsize : u32, pvoid : *const ::core::ffi::c_void) -> HDESK); let result__ = CreateDesktopExA(lpszdesktop.into_param().abi(), lpszdevice.into_param().abi(), ::core::mem::transmute(pdevmode.unwrap_or(::std::ptr::null())), dwflags, dwdesiredaccess, ::core::mem::transmute(lpsa.unwrap_or(::std::ptr::null())), ulheapsize, ::core::mem::transmute(pvoid.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_StationsAndDesktops\"`, `\"Win32_Foundation\"`, `\"Win32_Graphics_Gdi\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_Security"))] @@ -98,7 +98,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn CreateDesktopExW(lpszdesktop : ::windows_core::PCWSTR, lpszdevice : ::windows_core::PCWSTR, pdevmode : *const super::super::Graphics::Gdi:: DEVMODEW, dwflags : DESKTOP_CONTROL_FLAGS, dwdesiredaccess : u32, lpsa : *const super::super::Security:: SECURITY_ATTRIBUTES, ulheapsize : u32, pvoid : *const ::core::ffi::c_void) -> HDESK); let result__ = CreateDesktopExW(lpszdesktop.into_param().abi(), lpszdevice.into_param().abi(), ::core::mem::transmute(pdevmode.unwrap_or(::std::ptr::null())), dwflags, dwdesiredaccess, ::core::mem::transmute(lpsa.unwrap_or(::std::ptr::null())), ulheapsize, ::core::mem::transmute(pvoid.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_StationsAndDesktops\"`, `\"Win32_Foundation\"`, `\"Win32_Graphics_Gdi\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_Security"))] @@ -110,7 +110,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn CreateDesktopW(lpszdesktop : ::windows_core::PCWSTR, lpszdevice : ::windows_core::PCWSTR, pdevmode : *const super::super::Graphics::Gdi:: DEVMODEW, dwflags : DESKTOP_CONTROL_FLAGS, dwdesiredaccess : u32, lpsa : *const super::super::Security:: SECURITY_ATTRIBUTES) -> HDESK); let result__ = CreateDesktopW(lpszdesktop.into_param().abi(), lpszdevice.into_param().abi(), ::core::mem::transmute(pdevmode.unwrap_or(::std::ptr::null())), dwflags, dwdesiredaccess, ::core::mem::transmute(lpsa.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_StationsAndDesktops\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -121,7 +121,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn CreateWindowStationA(lpwinsta : ::windows_core::PCSTR, dwflags : u32, dwdesiredaccess : u32, lpsa : *const super::super::Security:: SECURITY_ATTRIBUTES) -> HWINSTA); let result__ = CreateWindowStationA(lpwinsta.into_param().abi(), dwflags, dwdesiredaccess, ::core::mem::transmute(lpsa.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_StationsAndDesktops\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -132,7 +132,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn CreateWindowStationW(lpwinsta : ::windows_core::PCWSTR, dwflags : u32, dwdesiredaccess : u32, lpsa : *const super::super::Security:: SECURITY_ATTRIBUTES) -> HWINSTA); let result__ = CreateWindowStationW(lpwinsta.into_param().abi(), dwflags, dwdesiredaccess, ::core::mem::transmute(lpsa.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_StationsAndDesktops\"`, `\"Win32_Foundation\"`, `\"Win32_UI_WindowsAndMessaging\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] @@ -192,14 +192,14 @@ where pub unsafe fn GetProcessWindowStation() -> ::windows_core::Result { ::windows_targets::link!("user32.dll" "system" fn GetProcessWindowStation() -> HWINSTA); let result__ = GetProcessWindowStation(); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_StationsAndDesktops\"`*"] #[inline] pub unsafe fn GetThreadDesktop(dwthreadid: u32) -> ::windows_core::Result { ::windows_targets::link!("user32.dll" "system" fn GetThreadDesktop(dwthreadid : u32) -> HDESK); let result__ = GetThreadDesktop(dwthreadid); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_StationsAndDesktops\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -231,7 +231,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn OpenDesktopA(lpszdesktop : ::windows_core::PCSTR, dwflags : DESKTOP_CONTROL_FLAGS, finherit : super::super::Foundation:: BOOL, dwdesiredaccess : u32) -> HDESK); let result__ = OpenDesktopA(lpszdesktop.into_param().abi(), dwflags, finherit.into_param().abi(), dwdesiredaccess); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_StationsAndDesktops\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -243,7 +243,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn OpenDesktopW(lpszdesktop : ::windows_core::PCWSTR, dwflags : DESKTOP_CONTROL_FLAGS, finherit : super::super::Foundation:: BOOL, dwdesiredaccess : u32) -> HDESK); let result__ = OpenDesktopW(lpszdesktop.into_param().abi(), dwflags, finherit.into_param().abi(), dwdesiredaccess); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_StationsAndDesktops\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -254,7 +254,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn OpenInputDesktop(dwflags : DESKTOP_CONTROL_FLAGS, finherit : super::super::Foundation:: BOOL, dwdesiredaccess : DESKTOP_ACCESS_FLAGS) -> HDESK); let result__ = OpenInputDesktop(dwflags, finherit.into_param().abi(), dwdesiredaccess); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_StationsAndDesktops\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -266,7 +266,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn OpenWindowStationA(lpszwinsta : ::windows_core::PCSTR, finherit : super::super::Foundation:: BOOL, dwdesiredaccess : u32) -> HWINSTA); let result__ = OpenWindowStationA(lpszwinsta.into_param().abi(), finherit.into_param().abi(), dwdesiredaccess); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_StationsAndDesktops\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -278,7 +278,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn OpenWindowStationW(lpszwinsta : ::windows_core::PCWSTR, finherit : super::super::Foundation:: BOOL, dwdesiredaccess : u32) -> HWINSTA); let result__ = OpenWindowStationW(lpszwinsta.into_param().abi(), finherit.into_param().abi(), dwdesiredaccess); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_StationsAndDesktops\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/System/Threading/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Threading/mod.rs index be5f2538cc..f2464a1a95 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Threading/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Threading/mod.rs @@ -139,7 +139,7 @@ where { ::windows_targets::link!("avrt.dll" "system" fn AvSetMmMaxThreadCharacteristicsA(firsttask : ::windows_core::PCSTR, secondtask : ::windows_core::PCSTR, taskindex : *mut u32) -> super::super::Foundation:: HANDLE); let result__ = AvSetMmMaxThreadCharacteristicsA(firsttask.into_param().abi(), secondtask.into_param().abi(), taskindex); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -151,7 +151,7 @@ where { ::windows_targets::link!("avrt.dll" "system" fn AvSetMmMaxThreadCharacteristicsW(firsttask : ::windows_core::PCWSTR, secondtask : ::windows_core::PCWSTR, taskindex : *mut u32) -> super::super::Foundation:: HANDLE); let result__ = AvSetMmMaxThreadCharacteristicsW(firsttask.into_param().abi(), secondtask.into_param().abi(), taskindex); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -162,7 +162,7 @@ where { ::windows_targets::link!("avrt.dll" "system" fn AvSetMmThreadCharacteristicsA(taskname : ::windows_core::PCSTR, taskindex : *mut u32) -> super::super::Foundation:: HANDLE); let result__ = AvSetMmThreadCharacteristicsA(taskname.into_param().abi(), taskindex); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -173,7 +173,7 @@ where { ::windows_targets::link!("avrt.dll" "system" fn AvSetMmThreadCharacteristicsW(taskname : ::windows_core::PCWSTR, taskindex : *mut u32) -> super::super::Foundation:: HANDLE); let result__ = AvSetMmThreadCharacteristicsW(taskname.into_param().abi(), taskindex); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -323,7 +323,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateBoundaryDescriptorA(name : ::windows_core::PCSTR, flags : u32) -> BoundaryDescriptorHandle); let result__ = CreateBoundaryDescriptorA(name.into_param().abi(), flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`*"] #[inline] @@ -345,7 +345,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateEventA(lpeventattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, bmanualreset : super::super::Foundation:: BOOL, binitialstate : super::super::Foundation:: BOOL, lpname : ::windows_core::PCSTR) -> super::super::Foundation:: HANDLE); let result__ = CreateEventA(::core::mem::transmute(lpeventattributes.unwrap_or(::std::ptr::null())), bmanualreset.into_param().abi(), binitialstate.into_param().abi(), lpname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -356,7 +356,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateEventExA(lpeventattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, lpname : ::windows_core::PCSTR, dwflags : CREATE_EVENT, dwdesiredaccess : u32) -> super::super::Foundation:: HANDLE); let result__ = CreateEventExA(::core::mem::transmute(lpeventattributes.unwrap_or(::std::ptr::null())), lpname.into_param().abi(), dwflags, dwdesiredaccess); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -367,7 +367,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateEventExW(lpeventattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, lpname : ::windows_core::PCWSTR, dwflags : CREATE_EVENT, dwdesiredaccess : u32) -> super::super::Foundation:: HANDLE); let result__ = CreateEventExW(::core::mem::transmute(lpeventattributes.unwrap_or(::std::ptr::null())), lpname.into_param().abi(), dwflags, dwdesiredaccess); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -380,7 +380,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateEventW(lpeventattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, bmanualreset : super::super::Foundation:: BOOL, binitialstate : super::super::Foundation:: BOOL, lpname : ::windows_core::PCWSTR) -> super::super::Foundation:: HANDLE); let result__ = CreateEventW(::core::mem::transmute(lpeventattributes.unwrap_or(::std::ptr::null())), bmanualreset.into_param().abi(), binitialstate.into_param().abi(), lpname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`*"] #[inline] @@ -404,7 +404,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateMutexA(lpmutexattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, binitialowner : super::super::Foundation:: BOOL, lpname : ::windows_core::PCSTR) -> super::super::Foundation:: HANDLE); let result__ = CreateMutexA(::core::mem::transmute(lpmutexattributes.unwrap_or(::std::ptr::null())), binitialowner.into_param().abi(), lpname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -415,7 +415,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateMutexExA(lpmutexattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, lpname : ::windows_core::PCSTR, dwflags : u32, dwdesiredaccess : u32) -> super::super::Foundation:: HANDLE); let result__ = CreateMutexExA(::core::mem::transmute(lpmutexattributes.unwrap_or(::std::ptr::null())), lpname.into_param().abi(), dwflags, dwdesiredaccess); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -426,7 +426,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateMutexExW(lpmutexattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, lpname : ::windows_core::PCWSTR, dwflags : u32, dwdesiredaccess : u32) -> super::super::Foundation:: HANDLE); let result__ = CreateMutexExW(::core::mem::transmute(lpmutexattributes.unwrap_or(::std::ptr::null())), lpname.into_param().abi(), dwflags, dwdesiredaccess); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -438,7 +438,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateMutexW(lpmutexattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, binitialowner : super::super::Foundation:: BOOL, lpname : ::windows_core::PCWSTR) -> super::super::Foundation:: HANDLE); let result__ = CreateMutexW(::core::mem::transmute(lpmutexattributes.unwrap_or(::std::ptr::null())), binitialowner.into_param().abi(), lpname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -449,7 +449,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreatePrivateNamespaceA(lpprivatenamespaceattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, lpboundarydescriptor : *const ::core::ffi::c_void, lpaliasprefix : ::windows_core::PCSTR) -> NamespaceHandle); let result__ = CreatePrivateNamespaceA(::core::mem::transmute(lpprivatenamespaceattributes.unwrap_or(::std::ptr::null())), lpboundarydescriptor, lpaliasprefix.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -546,7 +546,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateRemoteThread(hprocess : super::super::Foundation:: HANDLE, lpthreadattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, dwstacksize : usize, lpstartaddress : LPTHREAD_START_ROUTINE, lpparameter : *const ::core::ffi::c_void, dwcreationflags : u32, lpthreadid : *mut u32) -> super::super::Foundation:: HANDLE); let result__ = CreateRemoteThread(hprocess.into_param().abi(), ::core::mem::transmute(lpthreadattributes.unwrap_or(::std::ptr::null())), dwstacksize, lpstartaddress, ::core::mem::transmute(lpparameter.unwrap_or(::std::ptr::null())), dwcreationflags, ::core::mem::transmute(lpthreadid.unwrap_or(::std::ptr::null_mut()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -558,7 +558,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateRemoteThreadEx(hprocess : super::super::Foundation:: HANDLE, lpthreadattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, dwstacksize : usize, lpstartaddress : LPTHREAD_START_ROUTINE, lpparameter : *const ::core::ffi::c_void, dwcreationflags : u32, lpattributelist : LPPROC_THREAD_ATTRIBUTE_LIST, lpthreadid : *mut u32) -> super::super::Foundation:: HANDLE); let result__ = CreateRemoteThreadEx(hprocess.into_param().abi(), ::core::mem::transmute(lpthreadattributes.unwrap_or(::std::ptr::null())), dwstacksize, lpstartaddress, ::core::mem::transmute(lpparameter.unwrap_or(::std::ptr::null())), dwcreationflags, lpattributelist.into_param().abi(), ::core::mem::transmute(lpthreadid.unwrap_or(::std::ptr::null_mut()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -569,7 +569,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateSemaphoreA(lpsemaphoreattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, linitialcount : i32, lmaximumcount : i32, lpname : ::windows_core::PCSTR) -> super::super::Foundation:: HANDLE); let result__ = CreateSemaphoreA(::core::mem::transmute(lpsemaphoreattributes.unwrap_or(::std::ptr::null())), linitialcount, lmaximumcount, lpname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -580,7 +580,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateSemaphoreExA(lpsemaphoreattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, linitialcount : i32, lmaximumcount : i32, lpname : ::windows_core::PCSTR, dwflags : u32, dwdesiredaccess : u32) -> super::super::Foundation:: HANDLE); let result__ = CreateSemaphoreExA(::core::mem::transmute(lpsemaphoreattributes.unwrap_or(::std::ptr::null())), linitialcount, lmaximumcount, lpname.into_param().abi(), dwflags, dwdesiredaccess); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -591,7 +591,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateSemaphoreExW(lpsemaphoreattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, linitialcount : i32, lmaximumcount : i32, lpname : ::windows_core::PCWSTR, dwflags : u32, dwdesiredaccess : u32) -> super::super::Foundation:: HANDLE); let result__ = CreateSemaphoreExW(::core::mem::transmute(lpsemaphoreattributes.unwrap_or(::std::ptr::null())), linitialcount, lmaximumcount, lpname.into_param().abi(), dwflags, dwdesiredaccess); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -602,7 +602,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateSemaphoreW(lpsemaphoreattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, linitialcount : i32, lmaximumcount : i32, lpname : ::windows_core::PCWSTR) -> super::super::Foundation:: HANDLE); let result__ = CreateSemaphoreW(::core::mem::transmute(lpsemaphoreattributes.unwrap_or(::std::ptr::null())), linitialcount, lmaximumcount, lpname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -610,7 +610,7 @@ where pub unsafe fn CreateThread(lpthreadattributes: ::core::option::Option<*const super::super::Security::SECURITY_ATTRIBUTES>, dwstacksize: usize, lpstartaddress: LPTHREAD_START_ROUTINE, lpparameter: ::core::option::Option<*const ::core::ffi::c_void>, dwcreationflags: THREAD_CREATION_FLAGS, lpthreadid: ::core::option::Option<*mut u32>) -> ::windows_core::Result { ::windows_targets::link!("kernel32.dll" "system" fn CreateThread(lpthreadattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, dwstacksize : usize, lpstartaddress : LPTHREAD_START_ROUTINE, lpparameter : *const ::core::ffi::c_void, dwcreationflags : THREAD_CREATION_FLAGS, lpthreadid : *mut u32) -> super::super::Foundation:: HANDLE); let result__ = CreateThread(::core::mem::transmute(lpthreadattributes.unwrap_or(::std::ptr::null())), dwstacksize, lpstartaddress, ::core::mem::transmute(lpparameter.unwrap_or(::std::ptr::null())), dwcreationflags, ::core::mem::transmute(lpthreadid.unwrap_or(::std::ptr::null_mut()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`*"] #[inline] @@ -633,28 +633,28 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateThreadpoolIo(fl : super::super::Foundation:: HANDLE, pfnio : PTP_WIN32_IO_CALLBACK, pv : *mut ::core::ffi::c_void, pcbe : *const TP_CALLBACK_ENVIRON_V3) -> PTP_IO); let result__ = CreateThreadpoolIo(fl.into_param().abi(), pfnio, ::core::mem::transmute(pv.unwrap_or(::std::ptr::null_mut())), ::core::mem::transmute(pcbe.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`*"] #[inline] pub unsafe fn CreateThreadpoolTimer(pfnti: PTP_TIMER_CALLBACK, pv: ::core::option::Option<*mut ::core::ffi::c_void>, pcbe: ::core::option::Option<*const TP_CALLBACK_ENVIRON_V3>) -> ::windows_core::Result { ::windows_targets::link!("kernel32.dll" "system" fn CreateThreadpoolTimer(pfnti : PTP_TIMER_CALLBACK, pv : *mut ::core::ffi::c_void, pcbe : *const TP_CALLBACK_ENVIRON_V3) -> PTP_TIMER); let result__ = CreateThreadpoolTimer(pfnti, ::core::mem::transmute(pv.unwrap_or(::std::ptr::null_mut())), ::core::mem::transmute(pcbe.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`*"] #[inline] pub unsafe fn CreateThreadpoolWait(pfnwa: PTP_WAIT_CALLBACK, pv: ::core::option::Option<*mut ::core::ffi::c_void>, pcbe: ::core::option::Option<*const TP_CALLBACK_ENVIRON_V3>) -> ::windows_core::Result { ::windows_targets::link!("kernel32.dll" "system" fn CreateThreadpoolWait(pfnwa : PTP_WAIT_CALLBACK, pv : *mut ::core::ffi::c_void, pcbe : *const TP_CALLBACK_ENVIRON_V3) -> PTP_WAIT); let result__ = CreateThreadpoolWait(pfnwa, ::core::mem::transmute(pv.unwrap_or(::std::ptr::null_mut())), ::core::mem::transmute(pcbe.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`*"] #[inline] pub unsafe fn CreateThreadpoolWork(pfnwk: PTP_WORK_CALLBACK, pv: ::core::option::Option<*mut ::core::ffi::c_void>, pcbe: ::core::option::Option<*const TP_CALLBACK_ENVIRON_V3>) -> ::windows_core::Result { ::windows_targets::link!("kernel32.dll" "system" fn CreateThreadpoolWork(pfnwk : PTP_WORK_CALLBACK, pv : *mut ::core::ffi::c_void, pcbe : *const TP_CALLBACK_ENVIRON_V3) -> PTP_WORK); let result__ = CreateThreadpoolWork(pfnwk, ::core::mem::transmute(pv.unwrap_or(::std::ptr::null_mut())), ::core::mem::transmute(pcbe.unwrap_or(::std::ptr::null()))); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -662,7 +662,7 @@ pub unsafe fn CreateThreadpoolWork(pfnwk: PTP_WORK_CALLBACK, pv: ::core::option: pub unsafe fn CreateTimerQueue() -> ::windows_core::Result { ::windows_targets::link!("kernel32.dll" "system" fn CreateTimerQueue() -> super::super::Foundation:: HANDLE); let result__ = CreateTimerQueue(); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -697,7 +697,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateWaitableTimerExW(lptimerattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, lptimername : ::windows_core::PCWSTR, dwflags : u32, dwdesiredaccess : u32) -> super::super::Foundation:: HANDLE); let result__ = CreateWaitableTimerExW(::core::mem::transmute(lptimerattributes.unwrap_or(::std::ptr::null())), lptimername.into_param().abi(), dwflags, dwdesiredaccess); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -709,7 +709,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn CreateWaitableTimerW(lptimerattributes : *const super::super::Security:: SECURITY_ATTRIBUTES, bmanualreset : super::super::Foundation:: BOOL, lptimername : ::windows_core::PCWSTR) -> super::super::Foundation:: HANDLE); let result__ = CreateWaitableTimerW(::core::mem::transmute(lptimerattributes.unwrap_or(::std::ptr::null())), bmanualreset.into_param().abi(), lptimername.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`*"] #[inline] @@ -1642,7 +1642,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn OpenEventA(dwdesiredaccess : SYNCHRONIZATION_ACCESS_RIGHTS, binherithandle : super::super::Foundation:: BOOL, lpname : ::windows_core::PCSTR) -> super::super::Foundation:: HANDLE); let result__ = OpenEventA(dwdesiredaccess, binherithandle.into_param().abi(), lpname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1654,7 +1654,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn OpenEventW(dwdesiredaccess : SYNCHRONIZATION_ACCESS_RIGHTS, binherithandle : super::super::Foundation:: BOOL, lpname : ::windows_core::PCWSTR) -> super::super::Foundation:: HANDLE); let result__ = OpenEventW(dwdesiredaccess, binherithandle.into_param().abi(), lpname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1666,7 +1666,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn OpenMutexW(dwdesiredaccess : SYNCHRONIZATION_ACCESS_RIGHTS, binherithandle : super::super::Foundation:: BOOL, lpname : ::windows_core::PCWSTR) -> super::super::Foundation:: HANDLE); let result__ = OpenMutexW(dwdesiredaccess, binherithandle.into_param().abi(), lpname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`*"] #[inline] @@ -1695,7 +1695,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn OpenProcess(dwdesiredaccess : PROCESS_ACCESS_RIGHTS, binherithandle : super::super::Foundation:: BOOL, dwprocessid : u32) -> super::super::Foundation:: HANDLE); let result__ = OpenProcess(dwdesiredaccess, binherithandle.into_param().abi(), dwprocessid); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -1717,7 +1717,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn OpenSemaphoreW(dwdesiredaccess : SYNCHRONIZATION_ACCESS_RIGHTS, binherithandle : super::super::Foundation:: BOOL, lpname : ::windows_core::PCWSTR) -> super::super::Foundation:: HANDLE); let result__ = OpenSemaphoreW(dwdesiredaccess, binherithandle.into_param().abi(), lpname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1728,7 +1728,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn OpenThread(dwdesiredaccess : THREAD_ACCESS_RIGHTS, binherithandle : super::super::Foundation:: BOOL, dwthreadid : u32) -> super::super::Foundation:: HANDLE); let result__ = OpenThread(dwdesiredaccess, binherithandle.into_param().abi(), dwthreadid); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`, `\"Win32_Security\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] @@ -1751,7 +1751,7 @@ where { ::windows_targets::link!("kernel32.dll" "system" fn OpenWaitableTimerW(dwdesiredaccess : SYNCHRONIZATION_ACCESS_RIGHTS, binherithandle : super::super::Foundation:: BOOL, lptimername : ::windows_core::PCWSTR) -> super::super::Foundation:: HANDLE); let result__ = OpenWaitableTimerW(dwdesiredaccess, binherithandle.into_param().abi(), lptimername.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/UI/Controls/mod.rs b/crates/libs/windows/src/Windows/Win32/UI/Controls/mod.rs index e3ebe39ad8..3b060e3d9e 100644 --- a/crates/libs/windows/src/Windows/Win32/UI/Controls/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/UI/Controls/mod.rs @@ -120,7 +120,7 @@ where { ::windows_targets::link!("comctl32.dll" "system" fn CreateMappedBitmap(hinstance : super::super::Foundation:: HMODULE, idbitmap : isize, wflags : u32, lpcolormap : *const COLORMAP, inummaps : i32) -> super::super::Graphics::Gdi:: HBITMAP); let result__ = CreateMappedBitmap(hinstance.into_param().abi(), idbitmap, wflags, ::core::mem::transmute(lpcolormap.unwrap_or(::std::ptr::null())), inummaps); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_Controls\"`, `\"Win32_Foundation\"`, `\"Win32_Graphics_Gdi\"`, `\"Win32_UI_WindowsAndMessaging\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] @@ -164,7 +164,7 @@ where pub unsafe fn CreateSyntheticPointerDevice(pointertype: super::WindowsAndMessaging::POINTER_INPUT_TYPE, maxcount: u32, mode: POINTER_FEEDBACK_MODE) -> ::windows_core::Result { ::windows_targets::link!("user32.dll" "system" fn CreateSyntheticPointerDevice(pointertype : super::WindowsAndMessaging:: POINTER_INPUT_TYPE, maxcount : u32, mode : POINTER_FEEDBACK_MODE) -> HSYNTHETICPOINTERDEVICE); let result__ = CreateSyntheticPointerDevice(pointertype, maxcount, mode); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_Controls\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/libs/windows/src/Windows/Win32/UI/Input/KeyboardAndMouse/mod.rs b/crates/libs/windows/src/Windows/Win32/UI/Input/KeyboardAndMouse/mod.rs index 69f2362f2b..81dbfb217b 100644 --- a/crates/libs/windows/src/Windows/Win32/UI/Input/KeyboardAndMouse/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/UI/Input/KeyboardAndMouse/mod.rs @@ -9,7 +9,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn ActivateKeyboardLayout(hkl : super::super::TextServices:: HKL, flags : ACTIVATE_KEYBOARD_LAYOUT_FLAGS) -> super::super::TextServices:: HKL); let result__ = ActivateKeyboardLayout(hkl.into_param().abi(), flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_Input_KeyboardAndMouse\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -172,7 +172,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn LoadKeyboardLayoutA(pwszklid : ::windows_core::PCSTR, flags : ACTIVATE_KEYBOARD_LAYOUT_FLAGS) -> super::super::TextServices:: HKL); let result__ = LoadKeyboardLayoutA(pwszklid.into_param().abi(), flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_Input_KeyboardAndMouse\"`, `\"Win32_UI_TextServices\"`*"] #[cfg(feature = "Win32_UI_TextServices")] @@ -183,7 +183,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn LoadKeyboardLayoutW(pwszklid : ::windows_core::PCWSTR, flags : ACTIVATE_KEYBOARD_LAYOUT_FLAGS) -> super::super::TextServices:: HKL); let result__ = LoadKeyboardLayoutW(pwszklid.into_param().abi(), flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_Input_KeyboardAndMouse\"`*"] #[inline] diff --git a/crates/libs/windows/src/Windows/Win32/UI/WindowsAndMessaging/mod.rs b/crates/libs/windows/src/Windows/Win32/UI/WindowsAndMessaging/mod.rs index 9448b54ba0..f48ec3e034 100644 --- a/crates/libs/windows/src/Windows/Win32/UI/WindowsAndMessaging/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/UI/WindowsAndMessaging/mod.rs @@ -81,7 +81,7 @@ where pub unsafe fn BeginDeferWindowPos(nnumwindows: i32) -> ::windows_core::Result { ::windows_targets::link!("user32.dll" "system" fn BeginDeferWindowPos(nnumwindows : i32) -> HDWP); let result__ = BeginDeferWindowPos(nnumwindows); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -433,7 +433,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn CopyIcon(hicon : HICON) -> HICON); let result__ = CopyIcon(hicon.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -444,21 +444,21 @@ where { ::windows_targets::link!("user32.dll" "system" fn CopyImage(h : super::super::Foundation:: HANDLE, r#type : GDI_IMAGE_TYPE, cx : i32, cy : i32, flags : IMAGE_FLAGS) -> super::super::Foundation:: HANDLE); let result__ = CopyImage(h.into_param().abi(), r#type, cx, cy, flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`*"] #[inline] pub unsafe fn CreateAcceleratorTableA(paccel: &[ACCEL]) -> ::windows_core::Result { ::windows_targets::link!("user32.dll" "system" fn CreateAcceleratorTableA(paccel : *const ACCEL, caccel : i32) -> HACCEL); let result__ = CreateAcceleratorTableA(::core::mem::transmute(paccel.as_ptr()), paccel.len() as _); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`*"] #[inline] pub unsafe fn CreateAcceleratorTableW(paccel: &[ACCEL]) -> ::windows_core::Result { ::windows_targets::link!("user32.dll" "system" fn CreateAcceleratorTableW(paccel : *const ACCEL, caccel : i32) -> HACCEL); let result__ = CreateAcceleratorTableW(::core::mem::transmute(paccel.as_ptr()), paccel.len() as _); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`, `\"Win32_Graphics_Gdi\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] @@ -480,7 +480,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn CreateCursor(hinst : super::super::Foundation:: HMODULE, xhotspot : i32, yhotspot : i32, nwidth : i32, nheight : i32, pvandplane : *const ::core::ffi::c_void, pvxorplane : *const ::core::ffi::c_void) -> HCURSOR); let result__ = CreateCursor(hinst.into_param().abi(), xhotspot, yhotspot, nwidth, nheight, pvandplane, pvxorplane); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -541,7 +541,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn CreateIcon(hinstance : super::super::Foundation:: HMODULE, nwidth : i32, nheight : i32, cplanes : u8, cbitspixel : u8, lpbandbits : *const u8, lpbxorbits : *const u8) -> HICON); let result__ = CreateIcon(hinstance.into_param().abi(), nwidth, nheight, cplanes, cbitspixel, lpbandbits, lpbxorbits); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -552,7 +552,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn CreateIconFromResource(presbits : *const u8, dwressize : u32, ficon : super::super::Foundation:: BOOL, dwver : u32) -> HICON); let result__ = CreateIconFromResource(::core::mem::transmute(presbits.as_ptr()), presbits.len() as _, ficon.into_param().abi(), dwver); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -563,7 +563,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn CreateIconFromResourceEx(presbits : *const u8, dwressize : u32, ficon : super::super::Foundation:: BOOL, dwver : u32, cxdesired : i32, cydesired : i32, flags : IMAGE_FLAGS) -> HICON); let result__ = CreateIconFromResourceEx(::core::mem::transmute(presbits.as_ptr()), presbits.len() as _, ficon.into_param().abi(), dwver, cxdesired, cydesired, flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`, `\"Win32_Graphics_Gdi\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] @@ -571,7 +571,7 @@ where pub unsafe fn CreateIconIndirect(piconinfo: *const ICONINFO) -> ::windows_core::Result { ::windows_targets::link!("user32.dll" "system" fn CreateIconIndirect(piconinfo : *const ICONINFO) -> HICON); let result__ = CreateIconIndirect(piconinfo); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -606,14 +606,14 @@ where pub unsafe fn CreateMenu() -> ::windows_core::Result { ::windows_targets::link!("user32.dll" "system" fn CreateMenu() -> HMENU); let result__ = CreateMenu(); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`*"] #[inline] pub unsafe fn CreatePopupMenu() -> ::windows_core::Result { ::windows_targets::link!("user32.dll" "system" fn CreatePopupMenu() -> HMENU); let result__ = CreatePopupMenu(); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`*"] #[inline] @@ -762,7 +762,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn DeferWindowPos(hwinposinfo : HDWP, hwnd : super::super::Foundation:: HWND, hwndinsertafter : super::super::Foundation:: HWND, x : i32, y : i32, cx : i32, cy : i32, uflags : SET_WINDOW_POS_FLAGS) -> HDWP); let result__ = DeferWindowPos(hwinposinfo.into_param().abi(), hwnd.into_param().abi(), hwndinsertafter.into_param().abi(), x, y, cx, cy, uflags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2283,7 +2283,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn LoadAcceleratorsA(hinstance : super::super::Foundation:: HMODULE, lptablename : ::windows_core::PCSTR) -> HACCEL); let result__ = LoadAcceleratorsA(hinstance.into_param().abi(), lptablename.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2295,7 +2295,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn LoadAcceleratorsW(hinstance : super::super::Foundation:: HMODULE, lptablename : ::windows_core::PCWSTR) -> HACCEL); let result__ = LoadAcceleratorsW(hinstance.into_param().abi(), lptablename.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2307,7 +2307,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn LoadCursorA(hinstance : super::super::Foundation:: HMODULE, lpcursorname : ::windows_core::PCSTR) -> HCURSOR); let result__ = LoadCursorA(hinstance.into_param().abi(), lpcursorname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`*"] #[inline] @@ -2317,7 +2317,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn LoadCursorFromFileA(lpfilename : ::windows_core::PCSTR) -> HCURSOR); let result__ = LoadCursorFromFileA(lpfilename.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`*"] #[inline] @@ -2327,7 +2327,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn LoadCursorFromFileW(lpfilename : ::windows_core::PCWSTR) -> HCURSOR); let result__ = LoadCursorFromFileW(lpfilename.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2339,7 +2339,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn LoadCursorW(hinstance : super::super::Foundation:: HMODULE, lpcursorname : ::windows_core::PCWSTR) -> HCURSOR); let result__ = LoadCursorW(hinstance.into_param().abi(), lpcursorname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2351,7 +2351,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn LoadIconA(hinstance : super::super::Foundation:: HMODULE, lpiconname : ::windows_core::PCSTR) -> HICON); let result__ = LoadIconA(hinstance.into_param().abi(), lpiconname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2363,7 +2363,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn LoadIconW(hinstance : super::super::Foundation:: HMODULE, lpiconname : ::windows_core::PCWSTR) -> HICON); let result__ = LoadIconW(hinstance.into_param().abi(), lpiconname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2375,7 +2375,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn LoadImageA(hinst : super::super::Foundation:: HMODULE, name : ::windows_core::PCSTR, r#type : GDI_IMAGE_TYPE, cx : i32, cy : i32, fuload : IMAGE_FLAGS) -> LOADIMAGE_HANDLE); let result__ = LoadImageA(hinst.into_param().abi(), name.into_param().abi(), r#type, cx, cy, fuload); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2387,7 +2387,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn LoadImageW(hinst : super::super::Foundation:: HMODULE, name : ::windows_core::PCWSTR, r#type : GDI_IMAGE_TYPE, cx : i32, cy : i32, fuload : IMAGE_FLAGS) -> LOADIMAGE_HANDLE); let result__ = LoadImageW(hinst.into_param().abi(), name.into_param().abi(), r#type, cx, cy, fuload); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2399,21 +2399,21 @@ where { ::windows_targets::link!("user32.dll" "system" fn LoadMenuA(hinstance : super::super::Foundation:: HMODULE, lpmenuname : ::windows_core::PCSTR) -> HMENU); let result__ = LoadMenuA(hinstance.into_param().abi(), lpmenuname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`*"] #[inline] pub unsafe fn LoadMenuIndirectA(lpmenutemplate: *const ::core::ffi::c_void) -> ::windows_core::Result { ::windows_targets::link!("user32.dll" "system" fn LoadMenuIndirectA(lpmenutemplate : *const ::core::ffi::c_void) -> HMENU); let result__ = LoadMenuIndirectA(lpmenutemplate); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`*"] #[inline] pub unsafe fn LoadMenuIndirectW(lpmenutemplate: *const ::core::ffi::c_void) -> ::windows_core::Result { ::windows_targets::link!("user32.dll" "system" fn LoadMenuIndirectW(lpmenutemplate : *const ::core::ffi::c_void) -> HMENU); let result__ = LoadMenuIndirectW(lpmenutemplate); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2425,7 +2425,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn LoadMenuW(hinstance : super::super::Foundation:: HMODULE, lpmenuname : ::windows_core::PCWSTR) -> HMENU); let result__ = LoadMenuW(hinstance.into_param().abi(), lpmenuname.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -3040,7 +3040,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn RegisterDeviceNotificationA(hrecipient : super::super::Foundation:: HANDLE, notificationfilter : *const ::core::ffi::c_void, flags : REGISTER_NOTIFICATION_FLAGS) -> HDEVNOTIFY); let result__ = RegisterDeviceNotificationA(hrecipient.into_param().abi(), notificationfilter, flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -3051,7 +3051,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn RegisterDeviceNotificationW(hrecipient : super::super::Foundation:: HANDLE, notificationfilter : *const ::core::ffi::c_void, flags : REGISTER_NOTIFICATION_FLAGS) -> HDEVNOTIFY); let result__ = RegisterDeviceNotificationW(hrecipient.into_param().abi(), notificationfilter, flags); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -3101,7 +3101,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn RemovePropA(hwnd : super::super::Foundation:: HWND, lpstring : ::windows_core::PCSTR) -> super::super::Foundation:: HANDLE); let result__ = RemovePropA(hwnd.into_param().abi(), lpstring.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -3113,7 +3113,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn RemovePropW(hwnd : super::super::Foundation:: HWND, lpstring : ::windows_core::PCWSTR) -> super::super::Foundation:: HANDLE); let result__ = RemovePropW(hwnd.into_param().abi(), lpstring.into_param().abi()); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -3708,7 +3708,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn SetWindowsHookExA(idhook : WINDOWS_HOOK_ID, lpfn : HOOKPROC, hmod : super::super::Foundation:: HMODULE, dwthreadid : u32) -> HHOOK); let result__ = SetWindowsHookExA(idhook, lpfn, hmod.into_param().abi(), dwthreadid); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -3719,7 +3719,7 @@ where { ::windows_targets::link!("user32.dll" "system" fn SetWindowsHookExW(idhook : WINDOWS_HOOK_ID, lpfn : HOOKPROC, hmod : super::super::Foundation:: HMODULE, dwthreadid : u32) -> HHOOK); let result__ = SetWindowsHookExW(idhook, lpfn, hmod.into_param().abi(), dwthreadid); - ::windows_core::imp::then(!result__.is_invalid(), || result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] diff --git a/crates/samples/windows-sys/counter/Cargo.toml b/crates/samples/windows-sys/counter/Cargo.toml index b23cc7648b..f1ce4d7c4e 100644 --- a/crates/samples/windows-sys/counter/Cargo.toml +++ b/crates/samples/windows-sys/counter/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_counter_sys" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows-sys] diff --git a/crates/samples/windows-sys/create_window/Cargo.toml b/crates/samples/windows-sys/create_window/Cargo.toml index f83937c044..ca8ecbc37e 100644 --- a/crates/samples/windows-sys/create_window/Cargo.toml +++ b/crates/samples/windows-sys/create_window/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_create_window_sys" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows-sys] diff --git a/crates/samples/windows-sys/enum_windows/Cargo.toml b/crates/samples/windows-sys/enum_windows/Cargo.toml index 90f735a1bb..81612132a7 100644 --- a/crates/samples/windows-sys/enum_windows/Cargo.toml +++ b/crates/samples/windows-sys/enum_windows/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_enum_windows_sys" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows-sys] diff --git a/crates/samples/windows-sys/message_box/Cargo.toml b/crates/samples/windows-sys/message_box/Cargo.toml index 153a738bac..13f5c41137 100644 --- a/crates/samples/windows-sys/message_box/Cargo.toml +++ b/crates/samples/windows-sys/message_box/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_message_box_sys" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows-sys] diff --git a/crates/samples/windows-sys/privileges/Cargo.toml b/crates/samples/windows-sys/privileges/Cargo.toml index 83b98d9794..90b381d046 100644 --- a/crates/samples/windows-sys/privileges/Cargo.toml +++ b/crates/samples/windows-sys/privileges/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_privileges_sys" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows-sys] diff --git a/crates/samples/windows-sys/thread_pool_work/Cargo.toml b/crates/samples/windows-sys/thread_pool_work/Cargo.toml index 993daf8481..6c5fe881b3 100644 --- a/crates/samples/windows-sys/thread_pool_work/Cargo.toml +++ b/crates/samples/windows-sys/thread_pool_work/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_thread_pool_work_sys" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows-sys] diff --git a/crates/samples/windows/bits/Cargo.toml b/crates/samples/windows/bits/Cargo.toml index 51e4e5a46d..9d9866b46e 100644 --- a/crates/samples/windows/bits/Cargo.toml +++ b/crates/samples/windows/bits/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_bits" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/samples/windows/com_uri/Cargo.toml b/crates/samples/windows/com_uri/Cargo.toml index 241194d943..85a365c245 100644 --- a/crates/samples/windows/com_uri/Cargo.toml +++ b/crates/samples/windows/com_uri/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_com_uri" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/samples/windows/consent/Cargo.toml b/crates/samples/windows/consent/Cargo.toml index 5816fe987a..ff5a1b7a42 100644 --- a/crates/samples/windows/consent/Cargo.toml +++ b/crates/samples/windows/consent/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_consent" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/samples/windows/core_app/Cargo.toml b/crates/samples/windows/core_app/Cargo.toml index b4849b2b52..0520aabb94 100644 --- a/crates/samples/windows/core_app/Cargo.toml +++ b/crates/samples/windows/core_app/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_core_app" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/samples/windows/counter/Cargo.toml b/crates/samples/windows/counter/Cargo.toml index b85aeb27aa..42ef12772b 100644 --- a/crates/samples/windows/counter/Cargo.toml +++ b/crates/samples/windows/counter/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_counter" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/samples/windows/create_window/Cargo.toml b/crates/samples/windows/create_window/Cargo.toml index 3340af5392..a839315ca2 100644 --- a/crates/samples/windows/create_window/Cargo.toml +++ b/crates/samples/windows/create_window/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_create_window" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/samples/windows/credentials/Cargo.toml b/crates/samples/windows/credentials/Cargo.toml index bd4c84b041..23beabfb7b 100644 --- a/crates/samples/windows/credentials/Cargo.toml +++ b/crates/samples/windows/credentials/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_credentials" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/samples/windows/data_protection/Cargo.toml b/crates/samples/windows/data_protection/Cargo.toml index a42d804dd2..92d56c9121 100644 --- a/crates/samples/windows/data_protection/Cargo.toml +++ b/crates/samples/windows/data_protection/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_data_protection" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/samples/windows/dcomp/Cargo.toml b/crates/samples/windows/dcomp/Cargo.toml index 9d473eba16..999a07ceee 100644 --- a/crates/samples/windows/dcomp/Cargo.toml +++ b/crates/samples/windows/dcomp/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_dcomp" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies] diff --git a/crates/samples/windows/device_watcher/Cargo.toml b/crates/samples/windows/device_watcher/Cargo.toml index 038c94d4e5..91e4d5e852 100644 --- a/crates/samples/windows/device_watcher/Cargo.toml +++ b/crates/samples/windows/device_watcher/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_device_watcher" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/samples/windows/direct2d/Cargo.toml b/crates/samples/windows/direct2d/Cargo.toml index 49fc48f8bb..7328218d68 100644 --- a/crates/samples/windows/direct2d/Cargo.toml +++ b/crates/samples/windows/direct2d/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_direct2d" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/samples/windows/direct3d12/Cargo.toml b/crates/samples/windows/direct3d12/Cargo.toml index c3d97ee20b..a7fa9559f9 100644 --- a/crates/samples/windows/direct3d12/Cargo.toml +++ b/crates/samples/windows/direct3d12/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_direct3d12" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies] diff --git a/crates/samples/windows/enum_windows/Cargo.toml b/crates/samples/windows/enum_windows/Cargo.toml index a7d525d1f4..f23a46e647 100644 --- a/crates/samples/windows/enum_windows/Cargo.toml +++ b/crates/samples/windows/enum_windows/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_enum_windows" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/samples/windows/kernel_event/Cargo.toml b/crates/samples/windows/kernel_event/Cargo.toml index 439adf1cc3..2983b4f167 100644 --- a/crates/samples/windows/kernel_event/Cargo.toml +++ b/crates/samples/windows/kernel_event/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_kernel_event" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/samples/windows/memory_buffer/Cargo.toml b/crates/samples/windows/memory_buffer/Cargo.toml index 3eb8ed777f..38b2cc6688 100644 --- a/crates/samples/windows/memory_buffer/Cargo.toml +++ b/crates/samples/windows/memory_buffer/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_memory_buffer" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/samples/windows/message_box/Cargo.toml b/crates/samples/windows/message_box/Cargo.toml index 4a3d2e23eb..d6de5f8056 100644 --- a/crates/samples/windows/message_box/Cargo.toml +++ b/crates/samples/windows/message_box/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_message_box" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/samples/windows/ocr/Cargo.toml b/crates/samples/windows/ocr/Cargo.toml index 1f238559ac..96899a18a9 100644 --- a/crates/samples/windows/ocr/Cargo.toml +++ b/crates/samples/windows/ocr/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_ocr" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies] diff --git a/crates/samples/windows/overlapped/Cargo.toml b/crates/samples/windows/overlapped/Cargo.toml index 723bc175b9..ea541b76a7 100644 --- a/crates/samples/windows/overlapped/Cargo.toml +++ b/crates/samples/windows/overlapped/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_overlapped" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/samples/windows/privileges/Cargo.toml b/crates/samples/windows/privileges/Cargo.toml index 534999cf30..004b4be01a 100644 --- a/crates/samples/windows/privileges/Cargo.toml +++ b/crates/samples/windows/privileges/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_privileges" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/samples/windows/rss/Cargo.toml b/crates/samples/windows/rss/Cargo.toml index 155633f813..032b875cb2 100644 --- a/crates/samples/windows/rss/Cargo.toml +++ b/crates/samples/windows/rss/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_rss" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/samples/windows/simple/Cargo.toml b/crates/samples/windows/simple/Cargo.toml index 34bfd501c9..72a2541975 100644 --- a/crates/samples/windows/simple/Cargo.toml +++ b/crates/samples/windows/simple/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_simple" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/samples/windows/spellchecker/Cargo.toml b/crates/samples/windows/spellchecker/Cargo.toml index f9d51188e0..4ea0278298 100644 --- a/crates/samples/windows/spellchecker/Cargo.toml +++ b/crates/samples/windows/spellchecker/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_spellchecker" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/samples/windows/thread_pool_work/Cargo.toml b/crates/samples/windows/thread_pool_work/Cargo.toml index d5124173da..42c3feb992 100644 --- a/crates/samples/windows/thread_pool_work/Cargo.toml +++ b/crates/samples/windows/thread_pool_work/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_thread_pool_work" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/samples/windows/uiautomation/Cargo.toml b/crates/samples/windows/uiautomation/Cargo.toml index 69849b1df2..8886735a15 100644 --- a/crates/samples/windows/uiautomation/Cargo.toml +++ b/crates/samples/windows/uiautomation/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_uiautomation" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/samples/windows/wmi/Cargo.toml b/crates/samples/windows/wmi/Cargo.toml index bbbe5c8ab7..cfc2bde9f8 100644 --- a/crates/samples/windows/wmi/Cargo.toml +++ b/crates/samples/windows/wmi/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_wmi" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/samples/windows/xml/Cargo.toml b/crates/samples/windows/xml/Cargo.toml index 18e0ec47c7..8e1bc9df2e 100644 --- a/crates/samples/windows/xml/Cargo.toml +++ b/crates/samples/windows/xml/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "sample_xml" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/targets/aarch64_gnullvm/Cargo.toml b/crates/targets/aarch64_gnullvm/Cargo.toml index 19277b70f1..195f3712e6 100644 --- a/crates/targets/aarch64_gnullvm/Cargo.toml +++ b/crates/targets/aarch64_gnullvm/Cargo.toml @@ -2,7 +2,7 @@ name = "windows_aarch64_gnullvm" version = "0.48.0" authors = ["Microsoft"] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" description = "Import lib for Windows" repository = "https://github.com/microsoft/windows-rs" diff --git a/crates/targets/aarch64_msvc/Cargo.toml b/crates/targets/aarch64_msvc/Cargo.toml index 1d4954cdda..95c813e7d4 100644 --- a/crates/targets/aarch64_msvc/Cargo.toml +++ b/crates/targets/aarch64_msvc/Cargo.toml @@ -2,7 +2,7 @@ name = "windows_aarch64_msvc" version = "0.48.0" authors = ["Microsoft"] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" description = "Import lib for Windows" repository = "https://github.com/microsoft/windows-rs" diff --git a/crates/targets/i686_gnu/Cargo.toml b/crates/targets/i686_gnu/Cargo.toml index 6aa09fe6c9..14d1f1a4a1 100644 --- a/crates/targets/i686_gnu/Cargo.toml +++ b/crates/targets/i686_gnu/Cargo.toml @@ -2,7 +2,7 @@ name = "windows_i686_gnu" version = "0.48.0" authors = ["Microsoft"] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" description = "Import lib for Windows" repository = "https://github.com/microsoft/windows-rs" diff --git a/crates/targets/i686_msvc/Cargo.toml b/crates/targets/i686_msvc/Cargo.toml index 7ede8d4821..c7a74c94d6 100644 --- a/crates/targets/i686_msvc/Cargo.toml +++ b/crates/targets/i686_msvc/Cargo.toml @@ -2,7 +2,7 @@ name = "windows_i686_msvc" version = "0.48.0" authors = ["Microsoft"] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" description = "Import lib for Windows" repository = "https://github.com/microsoft/windows-rs" diff --git a/crates/targets/x86_64_gnu/Cargo.toml b/crates/targets/x86_64_gnu/Cargo.toml index 676480b934..9326bf84b6 100644 --- a/crates/targets/x86_64_gnu/Cargo.toml +++ b/crates/targets/x86_64_gnu/Cargo.toml @@ -2,7 +2,7 @@ name = "windows_x86_64_gnu" version = "0.48.0" authors = ["Microsoft"] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" description = "Import lib for Windows" repository = "https://github.com/microsoft/windows-rs" diff --git a/crates/targets/x86_64_gnullvm/Cargo.toml b/crates/targets/x86_64_gnullvm/Cargo.toml index 2e35887f93..2b184056c7 100644 --- a/crates/targets/x86_64_gnullvm/Cargo.toml +++ b/crates/targets/x86_64_gnullvm/Cargo.toml @@ -2,7 +2,7 @@ name = "windows_x86_64_gnullvm" version = "0.48.0" authors = ["Microsoft"] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" description = "Import lib for Windows" repository = "https://github.com/microsoft/windows-rs" diff --git a/crates/targets/x86_64_msvc/Cargo.toml b/crates/targets/x86_64_msvc/Cargo.toml index 0aad36e6ac..654cc2a591 100644 --- a/crates/targets/x86_64_msvc/Cargo.toml +++ b/crates/targets/x86_64_msvc/Cargo.toml @@ -2,7 +2,7 @@ name = "windows_x86_64_msvc" version = "0.48.0" authors = ["Microsoft"] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" description = "Import lib for Windows" repository = "https://github.com/microsoft/windows-rs" diff --git a/crates/tests/agile/Cargo.toml b/crates/tests/agile/Cargo.toml index 12857ee026..e9c3b99b4d 100644 --- a/crates/tests/agile/Cargo.toml +++ b/crates/tests/agile/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_agile" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/agile_reference/Cargo.toml b/crates/tests/agile_reference/Cargo.toml index 1c8e422223..cc52b4813f 100644 --- a/crates/tests/agile_reference/Cargo.toml +++ b/crates/tests/agile_reference/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_agile_reference" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/alternate_success_code/Cargo.toml b/crates/tests/alternate_success_code/Cargo.toml index 392cddd677..629a944e62 100644 --- a/crates/tests/alternate_success_code/Cargo.toml +++ b/crates/tests/alternate_success_code/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_alternate_success_code" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/arch/Cargo.toml b/crates/tests/arch/Cargo.toml index 5bd4e355e5..a64347b8d9 100644 --- a/crates/tests/arch/Cargo.toml +++ b/crates/tests/arch/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_arch" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/arch_feature/Cargo.toml b/crates/tests/arch_feature/Cargo.toml index 77605407c9..ca2ff163f1 100644 --- a/crates/tests/arch_feature/Cargo.toml +++ b/crates/tests/arch_feature/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_arch_feature" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/array/Cargo.toml b/crates/tests/array/Cargo.toml index 93c13315d6..31cda19746 100644 --- a/crates/tests/array/Cargo.toml +++ b/crates/tests/array/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_array" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/bcrypt/Cargo.toml b/crates/tests/bcrypt/Cargo.toml index cf822eed99..0e4f115fd7 100644 --- a/crates/tests/bcrypt/Cargo.toml +++ b/crates/tests/bcrypt/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_bcrypt" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/bstr/Cargo.toml b/crates/tests/bstr/Cargo.toml index 2b60553d01..aebb9605d0 100644 --- a/crates/tests/bstr/Cargo.toml +++ b/crates/tests/bstr/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_bstr" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/calling_convention/Cargo.toml b/crates/tests/calling_convention/Cargo.toml index 57d3fd0fed..875d6ac4cf 100644 --- a/crates/tests/calling_convention/Cargo.toml +++ b/crates/tests/calling_convention/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_calling_convention" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/cfg_generic/Cargo.toml b/crates/tests/cfg_generic/Cargo.toml index fbd9d4003f..30a960bbcd 100644 --- a/crates/tests/cfg_generic/Cargo.toml +++ b/crates/tests/cfg_generic/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_cfg_generic" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/collections/Cargo.toml b/crates/tests/collections/Cargo.toml index 7e213db002..2cbc01c857 100644 --- a/crates/tests/collections/Cargo.toml +++ b/crates/tests/collections/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_collections" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/component/Cargo.toml b/crates/tests/component/Cargo.toml index ee1967b891..f62a93f997 100644 --- a/crates/tests/component/Cargo.toml +++ b/crates/tests/component/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_component" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [lib] diff --git a/crates/tests/component_client/Cargo.toml b/crates/tests/component_client/Cargo.toml index 438d5d2fb8..cbdcbb9d0c 100644 --- a/crates/tests/component_client/Cargo.toml +++ b/crates/tests/component_client/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_component_client" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows-core] diff --git a/crates/tests/const_fields/Cargo.toml b/crates/tests/const_fields/Cargo.toml index 78b7de8965..3c80bf10b7 100644 --- a/crates/tests/const_fields/Cargo.toml +++ b/crates/tests/const_fields/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_const_fields" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/const_params/Cargo.toml b/crates/tests/const_params/Cargo.toml index 13d6c5295b..c0d0d094ef 100644 --- a/crates/tests/const_params/Cargo.toml +++ b/crates/tests/const_params/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_const_params" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/const_ptrs/Cargo.toml b/crates/tests/const_ptrs/Cargo.toml index f75d5e0299..4f7bd9b3a9 100644 --- a/crates/tests/const_ptrs/Cargo.toml +++ b/crates/tests/const_ptrs/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_const_ptrs" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/core/Cargo.toml b/crates/tests/core/Cargo.toml index 51352ffd69..8f36005f8e 100644 --- a/crates/tests/core/Cargo.toml +++ b/crates/tests/core/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_core" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/debug/Cargo.toml b/crates/tests/debug/Cargo.toml index 4f0850fdcd..19ee210c9c 100644 --- a/crates/tests/debug/Cargo.toml +++ b/crates/tests/debug/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_debug" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/debug_inspectable/Cargo.toml b/crates/tests/debug_inspectable/Cargo.toml index 0ef3566a6a..21dda1d869 100644 --- a/crates/tests/debug_inspectable/Cargo.toml +++ b/crates/tests/debug_inspectable/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_debug_inspectable" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/debugger_visualizer/Cargo.toml b/crates/tests/debugger_visualizer/Cargo.toml index 04e08d68dd..3a8b7e2211 100644 --- a/crates/tests/debugger_visualizer/Cargo.toml +++ b/crates/tests/debugger_visualizer/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_debugger_visualizer_x" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/deprecated/Cargo.toml b/crates/tests/deprecated/Cargo.toml index 5998fce35e..1fdc233515 100644 --- a/crates/tests/deprecated/Cargo.toml +++ b/crates/tests/deprecated/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_deprecated" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/dispatch/Cargo.toml b/crates/tests/dispatch/Cargo.toml index bdd9055a5b..27f7c9a20f 100644 --- a/crates/tests/dispatch/Cargo.toml +++ b/crates/tests/dispatch/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_dispatch" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/does_not_return/Cargo.toml b/crates/tests/does_not_return/Cargo.toml index e4ff7ca5e7..f98c7a4e45 100644 --- a/crates/tests/does_not_return/Cargo.toml +++ b/crates/tests/does_not_return/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_does_not_return" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/enums/Cargo.toml b/crates/tests/enums/Cargo.toml index bf4af00ef1..4e46d3df9c 100644 --- a/crates/tests/enums/Cargo.toml +++ b/crates/tests/enums/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_enums" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/error/Cargo.toml b/crates/tests/error/Cargo.toml index 268eaf55ae..6d5d9eedc3 100644 --- a/crates/tests/error/Cargo.toml +++ b/crates/tests/error/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_error" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/event/Cargo.toml b/crates/tests/event/Cargo.toml index e253c25981..f935705e0b 100644 --- a/crates/tests/event/Cargo.toml +++ b/crates/tests/event/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_event" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/extensions/Cargo.toml b/crates/tests/extensions/Cargo.toml index 8c694bd3b1..0d4282c6e4 100644 --- a/crates/tests/extensions/Cargo.toml +++ b/crates/tests/extensions/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_extensions" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/handles/Cargo.toml b/crates/tests/handles/Cargo.toml index 7f70aebdb1..e433e8bf91 100644 --- a/crates/tests/handles/Cargo.toml +++ b/crates/tests/handles/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_handles" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/helpers/Cargo.toml b/crates/tests/helpers/Cargo.toml index c45bf4a8cb..fd29670759 100644 --- a/crates/tests/helpers/Cargo.toml +++ b/crates/tests/helpers/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_helpers" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/implement/Cargo.toml b/crates/tests/implement/Cargo.toml index c9eca87e7c..b535c8917a 100644 --- a/crates/tests/implement/Cargo.toml +++ b/crates/tests/implement/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_implement" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/interface/Cargo.toml b/crates/tests/interface/Cargo.toml index 65289c472e..e358da5493 100644 --- a/crates/tests/interface/Cargo.toml +++ b/crates/tests/interface/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_interface" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/interop/Cargo.toml b/crates/tests/interop/Cargo.toml index ba3c25c102..7f55a9b5a9 100644 --- a/crates/tests/interop/Cargo.toml +++ b/crates/tests/interop/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_interop" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/lib/Cargo.toml b/crates/tests/lib/Cargo.toml index 3a87b9a04d..6c81870be9 100644 --- a/crates/tests/lib/Cargo.toml +++ b/crates/tests/lib/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_lib" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/literals/Cargo.toml b/crates/tests/literals/Cargo.toml index c50ceb012b..6ec5e0ec68 100644 --- a/crates/tests/literals/Cargo.toml +++ b/crates/tests/literals/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_literals" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/match/Cargo.toml b/crates/tests/match/Cargo.toml index 63b84d2f2b..9024dd84dd 100644 --- a/crates/tests/match/Cargo.toml +++ b/crates/tests/match/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_match" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/matrix3x2/Cargo.toml b/crates/tests/matrix3x2/Cargo.toml index 07b0ef12fe..a7d602bed4 100644 --- a/crates/tests/matrix3x2/Cargo.toml +++ b/crates/tests/matrix3x2/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_matrix3x2" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/metadata/Cargo.toml b/crates/tests/metadata/Cargo.toml index 8be7aa1f73..bc69c62c1b 100644 --- a/crates/tests/metadata/Cargo.toml +++ b/crates/tests/metadata/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_metadata" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies] diff --git a/crates/tests/msrv/Cargo.toml b/crates/tests/msrv/Cargo.toml index ecd2792b73..0a42d3ca63 100644 --- a/crates/tests/msrv/Cargo.toml +++ b/crates/tests/msrv/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_msrv" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/no_use/Cargo.toml b/crates/tests/no_use/Cargo.toml index f9e14ea42f..ec9e792824 100644 --- a/crates/tests/no_use/Cargo.toml +++ b/crates/tests/no_use/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_no_use" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/not_dll/Cargo.toml b/crates/tests/not_dll/Cargo.toml index 9b05273631..b52c8477cd 100644 --- a/crates/tests/not_dll/Cargo.toml +++ b/crates/tests/not_dll/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_not_dll" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/query_signature/Cargo.toml b/crates/tests/query_signature/Cargo.toml index 9879f710c3..4b4d4bfab9 100644 --- a/crates/tests/query_signature/Cargo.toml +++ b/crates/tests/query_signature/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_query_signature" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/readme/Cargo.toml b/crates/tests/readme/Cargo.toml index e2b8a9f062..a9976c8bd7 100644 --- a/crates/tests/readme/Cargo.toml +++ b/crates/tests/readme/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_readme" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/reserved/Cargo.toml b/crates/tests/reserved/Cargo.toml index bfb400b425..b064977c4f 100644 --- a/crates/tests/reserved/Cargo.toml +++ b/crates/tests/reserved/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_reserved" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/resources/Cargo.toml b/crates/tests/resources/Cargo.toml index 6624346ec0..de0ae09520 100644 --- a/crates/tests/resources/Cargo.toml +++ b/crates/tests/resources/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_resources" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/return_handle/Cargo.toml b/crates/tests/return_handle/Cargo.toml new file mode 100644 index 0000000000..d96e16d5a1 --- /dev/null +++ b/crates/tests/return_handle/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "test_return_handle" +version = "0.0.0" +edition = "2021" +publish = false + +[dependencies.windows] +path = "../../libs/windows" +features = [ + "Win32_System_Threading", + "Win32_Foundation", + "Win32_Security", +] diff --git a/crates/tests/return_handle/src/lib.rs b/crates/tests/return_handle/src/lib.rs new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/crates/tests/return_handle/src/lib.rs @@ -0,0 +1 @@ + diff --git a/crates/tests/return_handle/tests/win.rs b/crates/tests/return_handle/tests/win.rs new file mode 100644 index 0000000000..6141ec4734 --- /dev/null +++ b/crates/tests/return_handle/tests/win.rs @@ -0,0 +1,17 @@ +// This test validates the transformation of functions returning handles and are wrapped in a Result, +// returning the last Win32 error code on failure. +#[test] +fn test() { + unsafe { + use windows::{core::*, Win32::Foundation::*, Win32::System::Threading::*}; + + // This should succeed, creating a mutex with the given name. + let result = CreateMutexA(None, false, s!("test")); + assert!(result.is_ok()); + + // This should fail, since the event name collides with that of the mutex. + let result = CreateEventA(None, true, false, s!("test")); + let error = result.unwrap_err(); + assert_eq!(error.code(), ERROR_INVALID_HANDLE.into()); + } +} diff --git a/crates/tests/return_struct/Cargo.toml b/crates/tests/return_struct/Cargo.toml index e8428d5f69..42ed3f300c 100644 --- a/crates/tests/return_struct/Cargo.toml +++ b/crates/tests/return_struct/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_return_struct" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/riddle/Cargo.toml b/crates/tests/riddle/Cargo.toml index 1229dbf8d0..3d7d8e33a6 100644 --- a/crates/tests/riddle/Cargo.toml +++ b/crates/tests/riddle/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_riddle" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows-core] diff --git a/crates/tests/simple_component/Cargo.toml b/crates/tests/simple_component/Cargo.toml index 52ef7fd428..489720165f 100644 --- a/crates/tests/simple_component/Cargo.toml +++ b/crates/tests/simple_component/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_simple_component" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [lib] diff --git a/crates/tests/standalone/Cargo.toml b/crates/tests/standalone/Cargo.toml index 930d979dff..cd63405549 100644 --- a/crates/tests/standalone/Cargo.toml +++ b/crates/tests/standalone/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_standalone" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows-core] diff --git a/crates/tests/string_param/Cargo.toml b/crates/tests/string_param/Cargo.toml index e47694040f..87df5ff40a 100644 --- a/crates/tests/string_param/Cargo.toml +++ b/crates/tests/string_param/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_string_param" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/structs/Cargo.toml b/crates/tests/structs/Cargo.toml index 178e9a65a2..9d82a1ad72 100644 --- a/crates/tests/structs/Cargo.toml +++ b/crates/tests/structs/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_structs" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/sys/Cargo.toml b/crates/tests/sys/Cargo.toml index 3f4b7aaef2..02a95c17c8 100644 --- a/crates/tests/sys/Cargo.toml +++ b/crates/tests/sys/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_sys" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows-sys] diff --git a/crates/tests/targets/Cargo.toml b/crates/tests/targets/Cargo.toml index 0cd24232d4..31b18bf3ca 100644 --- a/crates/tests/targets/Cargo.toml +++ b/crates/tests/targets/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_targets" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows-targets] diff --git a/crates/tests/unions/Cargo.toml b/crates/tests/unions/Cargo.toml index c1c61c2a1a..e48f976bef 100644 --- a/crates/tests/unions/Cargo.toml +++ b/crates/tests/unions/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_unions" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/wdk/Cargo.toml b/crates/tests/wdk/Cargo.toml index c8f7c88e04..30c3450ccf 100644 --- a/crates/tests/wdk/Cargo.toml +++ b/crates/tests/wdk/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_wdk" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/weak/Cargo.toml b/crates/tests/weak/Cargo.toml index 0c6ab68b68..a0fdc7743d 100644 --- a/crates/tests/weak/Cargo.toml +++ b/crates/tests/weak/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_weak" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/weak_ref/Cargo.toml b/crates/tests/weak_ref/Cargo.toml index 9a0a6fdbbb..5f6a40b56b 100644 --- a/crates/tests/weak_ref/Cargo.toml +++ b/crates/tests/weak_ref/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_weak_ref" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/win32/Cargo.toml b/crates/tests/win32/Cargo.toml index f831decf61..32b7839765 100644 --- a/crates/tests/win32/Cargo.toml +++ b/crates/tests/win32/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_win32" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/win32_arrays/Cargo.toml b/crates/tests/win32_arrays/Cargo.toml index 400b5ce140..88c17bec08 100644 --- a/crates/tests/win32_arrays/Cargo.toml +++ b/crates/tests/win32_arrays/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_win32_arrays" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/window_long/Cargo.toml b/crates/tests/window_long/Cargo.toml index b09ce17dbf..9507ad945a 100644 --- a/crates/tests/window_long/Cargo.toml +++ b/crates/tests/window_long/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_window_long" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tests/winrt/Cargo.toml b/crates/tests/winrt/Cargo.toml index 266f2fe894..7a7972dd9c 100644 --- a/crates/tests/winrt/Cargo.toml +++ b/crates/tests/winrt/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "test_winrt" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies.windows] diff --git a/crates/tools/core/Cargo.toml b/crates/tools/core/Cargo.toml index e821efd76a..7873a2312d 100644 --- a/crates/tools/core/Cargo.toml +++ b/crates/tools/core/Cargo.toml @@ -1,5 +1,5 @@ [package] name = "tool_core" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false diff --git a/crates/tools/gnu/Cargo.toml b/crates/tools/gnu/Cargo.toml index a9100337a2..8aea5e0577 100644 --- a/crates/tools/gnu/Cargo.toml +++ b/crates/tools/gnu/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tool_gnu" version = "0.48.0" -edition = "2018" +edition = "2021" publish = false [dependencies] diff --git a/crates/tools/lib/Cargo.toml b/crates/tools/lib/Cargo.toml index ef5e6ba93d..57b926efdf 100644 --- a/crates/tools/lib/Cargo.toml +++ b/crates/tools/lib/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tool_lib" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies] diff --git a/crates/tools/license/Cargo.toml b/crates/tools/license/Cargo.toml index 611e16ec9e..7def0be43c 100644 --- a/crates/tools/license/Cargo.toml +++ b/crates/tools/license/Cargo.toml @@ -1,5 +1,5 @@ [package] name = "tool_license" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false diff --git a/crates/tools/metadata/Cargo.toml b/crates/tools/metadata/Cargo.toml index 537684c254..59d105ff4f 100644 --- a/crates/tools/metadata/Cargo.toml +++ b/crates/tools/metadata/Cargo.toml @@ -1,5 +1,5 @@ [package] name = "tool_metadata" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false diff --git a/crates/tools/msvc/Cargo.toml b/crates/tools/msvc/Cargo.toml index ec37e1738a..08d130d484 100644 --- a/crates/tools/msvc/Cargo.toml +++ b/crates/tools/msvc/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tool_msvc" version = "0.48.0" -edition = "2018" +edition = "2021" publish = false [dependencies] diff --git a/crates/tools/riddle/Cargo.toml b/crates/tools/riddle/Cargo.toml index 6e96bbe97e..74e850d28c 100644 --- a/crates/tools/riddle/Cargo.toml +++ b/crates/tools/riddle/Cargo.toml @@ -2,7 +2,7 @@ name = "riddle" version = "0.0.1" authors = ["Microsoft"] -edition = "2018" +edition = "2021" license = "MIT OR Apache-2.0" description = "Windows metadata compiler" repository = "https://github.com/microsoft/windows-rs" diff --git a/crates/tools/riddle/src/idl/to_idl.rs b/crates/tools/riddle/src/idl/to_idl.rs index 09f35f42fd..0f9aa36019 100644 --- a/crates/tools/riddle/src/idl/to_idl.rs +++ b/crates/tools/riddle/src/idl/to_idl.rs @@ -201,10 +201,10 @@ impl<'a> Writer<'a> { let namespace = self.namespace(self.reader.type_def_namespace(*def)); let name = to_ident(self.reader.type_def_name(*def)); if generics.is_empty() { - quote! { #namespace#name } + quote! { #namespace #name } } else { let generics = generics.iter().map(|ty| self.ty(ty)); - quote! { #namespace#name<#(#generics,)*> } + quote! { #namespace #name<#(#generics,)*> } } } rest => unimplemented!("{rest:?}"), diff --git a/crates/tools/riddle/src/rust/functions.rs b/crates/tools/riddle/src/rust/functions.rs index 99ca3dd03f..7bd06655ea 100644 --- a/crates/tools/riddle/src/rust/functions.rs +++ b/crates/tools/riddle/src/rust/functions.rs @@ -141,7 +141,7 @@ fn gen_win_function(writer: &Writer, def: MethodDef) -> TokenStream { pub unsafe fn #name<#generics>(#params) -> ::windows_core::Result<#return_type> #where_clause { #link let result__ = #name(#args); - ::windows_core::imp::then(!result__.is_invalid(), ||result__).ok_or_else(::windows_core::Error::from_win32) + (!result__.is_invalid()).then(|| result__).ok_or_else(::windows_core::Error::from_win32) } } } else { diff --git a/crates/tools/riddle/src/tokens/to_tokens.rs b/crates/tools/riddle/src/tokens/to_tokens.rs index 95150fced0..cb614f33d7 100644 --- a/crates/tools/riddle/src/tokens/to_tokens.rs +++ b/crates/tools/riddle/src/tokens/to_tokens.rs @@ -72,7 +72,7 @@ impl ToTokens for Option { impl ToTokens for str { fn to_tokens(&self, tokens: &mut TokenStream) { - tokens.push('"'); + tokens.push_str(" \""); tokens.push_str(self); tokens.push('"'); } diff --git a/crates/tools/sys/Cargo.toml b/crates/tools/sys/Cargo.toml index ca83803fc5..e82c2b0f18 100644 --- a/crates/tools/sys/Cargo.toml +++ b/crates/tools/sys/Cargo.toml @@ -1,5 +1,5 @@ [package] name = "tool_sys" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false diff --git a/crates/tools/windows/Cargo.toml b/crates/tools/windows/Cargo.toml index 98f4e3f045..c44909b5dc 100644 --- a/crates/tools/windows/Cargo.toml +++ b/crates/tools/windows/Cargo.toml @@ -1,5 +1,5 @@ [package] name = "tool_windows" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false diff --git a/crates/tools/yml/Cargo.toml b/crates/tools/yml/Cargo.toml index 5ec826c831..cc8047b5ae 100644 --- a/crates/tools/yml/Cargo.toml +++ b/crates/tools/yml/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tool_yml" version = "0.0.0" -edition = "2018" +edition = "2021" publish = false [dependencies]