From ad0da0107ee42700deb85a6c37c4e0c60de6b97a Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Mon, 30 Jan 2023 13:33:40 -0600 Subject: [PATCH] Support lower MSRV for the `windows` crate (#2318) --- .github/workflows/clippy.yml | 205 +++++++++--------- .github/workflows/test.yml | 3 +- .github/workflows/windows.yml | 4 +- crates/libs/bindgen/src/functions.rs | 2 +- crates/libs/bindgen/src/winrt_methods.rs | 2 +- crates/libs/implement/src/lib.rs | 2 +- crates/libs/interface/src/lib.rs | 8 +- crates/libs/sys/Cargo.toml | 1 - crates/libs/windows/Cargo.toml | 1 - .../src/Windows/ApplicationModel/mod.rs | 2 +- .../src/Windows/Devices/Display/mod.rs | 2 +- .../windows/src/Windows/Devices/Lights/mod.rs | 4 +- .../src/Windows/Devices/PointOfService/mod.rs | 2 +- .../windows/src/Windows/Devices/Sms/mod.rs | 4 +- .../windows/src/Windows/Foundation/mod.rs | 2 +- .../src/Windows/Graphics/Display/mod.rs | 2 +- .../src/Windows/Graphics/Holographic/mod.rs | 4 +- .../src/Windows/Graphics/Imaging/mod.rs | 2 +- .../windows/src/Windows/Media/Devices/mod.rs | 2 +- .../Windows/Media/Protection/PlayReady/mod.rs | 38 ++-- .../Networking/NetworkOperators/mod.rs | 4 +- .../src/Windows/Perception/Spatial/mod.rs | 2 +- .../Security/Cryptography/Certificates/mod.rs | 14 +- .../src/Windows/Win32/Devices/AllJoyn/mod.rs | 2 +- .../DeviceAndDriverInstallation/mod.rs | 32 +-- .../src/Windows/Win32/Graphics/Gdi/mod.rs | 2 +- .../src/Windows/Win32/Graphics/OpenGL/mod.rs | 4 +- .../Win32/NetworkManagement/IpHelper/mod.rs | 4 +- .../Win32/Networking/Clustering/mod.rs | 14 +- .../Windows/Win32/Networking/WinInet/mod.rs | 14 +- .../Win32/Security/Authorization/UI/mod.rs | 2 +- .../Windows/Win32/Security/Credentials/mod.rs | 2 +- .../Win32/Security/Cryptography/mod.rs | 10 +- .../Windows/Win32/Storage/FileSystem/mod.rs | 66 +++--- .../mod.rs | 4 +- .../src/Windows/Win32/System/Console/mod.rs | 4 +- .../Windows/Win32/System/DataExchange/mod.rs | 4 +- .../Win32/System/Diagnostics/Debug/mod.rs | 20 +- .../Win32/System/Diagnostics/ToolHelp/mod.rs | 2 +- .../src/Windows/Win32/System/EventLog/mod.rs | 36 +-- .../Windows/Win32/System/GroupPolicy/mod.rs | 2 +- .../src/Windows/Win32/System/IO/mod.rs | 2 +- .../Windows/Win32/System/JobObjects/mod.rs | 8 +- .../Windows/Win32/System/LibraryLoader/mod.rs | 22 +- .../src/Windows/Win32/System/Mailslots/mod.rs | 4 +- .../src/Windows/Win32/System/Memory/mod.rs | 24 +- .../src/Windows/Win32/System/Pipes/mod.rs | 2 +- .../src/Windows/Win32/System/Power/mod.rs | 6 +- .../Windows/Win32/System/RemoteDesktop/mod.rs | 4 +- .../src/Windows/Win32/System/Services/mod.rs | 20 +- .../Win32/System/StationsAndDesktops/mod.rs | 26 +-- .../src/Windows/Win32/System/Threading/mod.rs | 62 +++--- .../src/Windows/Win32/UI/Controls/mod.rs | 4 +- .../Win32/UI/Input/KeyboardAndMouse/mod.rs | 6 +- .../Win32/UI/WindowsAndMessaging/mod.rs | 62 +++--- crates/libs/windows/src/core/hresult.rs | 2 +- crates/libs/windows/src/core/inspectable.rs | 2 +- crates/libs/windows/src/core/mod.rs | 19 ++ crates/libs/windows/src/core/sha1.rs | 2 +- crates/libs/windows/src/core/strings/bstr.rs | 2 +- .../libs/windows/src/core/strings/hstring.rs | 10 +- .../libs/windows/src/core/weak_ref_count.rs | 6 +- crates/tests/component/src/bindings.rs | 4 +- crates/tests/component_client/src/bindings.rs | 4 +- crates/tests/msrv/Cargo.toml | 13 ++ crates/tests/msrv/src/lib.rs | 1 + crates/tools/sys/src/main.rs | 1 - crates/tools/windows/src/main.rs | 1 - crates/tools/yml/src/main.rs | 2 +- 69 files changed, 444 insertions(+), 413 deletions(-) create mode 100644 crates/tests/msrv/Cargo.toml create mode 100644 crates/tests/msrv/src/lib.rs diff --git a/.github/workflows/clippy.yml b/.github/workflows/clippy.yml index ed0b6bf2ac..938a2d319b 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/clippy.yml @@ -32,105 +32,106 @@ jobs: >> $env:GITHUB_ENV - name: Run cargo clippy run: | - cargo clippy -p sample_bits && - cargo clippy -p sample_com_uri && - cargo clippy -p sample_consent && - cargo clippy -p sample_core_app && - cargo clippy -p sample_counter && - cargo clippy -p sample_counter_sys && - cargo clippy -p sample_create_window && - cargo clippy -p sample_create_window_sys && - cargo clippy -p sample_data_protection && - cargo clippy -p sample_dcomp && - cargo clippy -p sample_device_watcher && - cargo clippy -p sample_direct2d && - cargo clippy -p sample_direct3d12 && - cargo clippy -p sample_enum_windows && - cargo clippy -p sample_enum_windows_sys && - cargo clippy -p sample_kernel_event && - cargo clippy -p sample_memory_buffer && - cargo clippy -p sample_message_box && - cargo clippy -p sample_message_box_sys && - cargo clippy -p sample_ocr && - cargo clippy -p sample_overlapped && - cargo clippy -p sample_rss && - cargo clippy -p sample_simple && - cargo clippy -p sample_spellchecker && - cargo clippy -p sample_thread_pool_work && - cargo clippy -p sample_thread_pool_work_sys && - cargo clippy -p sample_uiautomation && - cargo clippy -p sample_wmi && - cargo clippy -p sample_xml && - cargo clippy -p test_agile && - cargo clippy -p test_agile_reference && - cargo clippy -p test_alternate_success_code && - cargo clippy -p test_arch && - cargo clippy -p test_arch_feature && - cargo clippy -p test_bcrypt && - cargo clippy -p test_bstr && - cargo clippy -p test_calling_convention && - cargo clippy -p test_cfg_generic && - cargo clippy -p test_component && - cargo clippy -p test_component_client && - cargo clippy -p test_const_fields && - cargo clippy -p test_const_ptrs && - cargo clippy -p test_core && - cargo clippy -p test_debug && - cargo clippy -p test_debugger_visualizer_x && - cargo clippy -p test_deprecated && - cargo clippy -p test_dispatch && - cargo clippy -p test_does_not_return && - cargo clippy -p test_enums && - cargo clippy -p test_error && - cargo clippy -p test_event && - cargo clippy -p test_extensions && - cargo clippy -p test_handles && - cargo clippy -p test_helpers && - cargo clippy -p test_implement && - cargo clippy -p test_interface && - cargo clippy -p test_interop && - cargo clippy -p test_lib && - cargo clippy -p test_literals && - cargo clippy -p test_match && - cargo clippy -p test_matrix3x2 && - cargo clippy -p test_metadata && - cargo clippy -p test_no_use && - cargo clippy -p test_not_dll && - cargo clippy -p test_query_signature && - cargo clippy -p test_readme && - cargo clippy -p test_reserved && - cargo clippy -p test_resources && - cargo clippy -p test_return_struct && - cargo clippy -p test_simple_component && - cargo clippy -p test_string_param && - cargo clippy -p test_structs && - cargo clippy -p test_sys && - cargo clippy -p test_unions && - cargo clippy -p test_weak && - cargo clippy -p test_weak_ref && - cargo clippy -p test_win32 && - cargo clippy -p test_win32_arrays && - cargo clippy -p test_window_long && - cargo clippy -p test_winrt && - cargo clippy -p tool_gnu && - cargo clippy -p tool_lib && - cargo clippy -p tool_license && - cargo clippy -p tool_msvc && - cargo clippy -p tool_sys && - cargo clippy -p tool_windows && - cargo clippy -p tool_yml && - cargo clippy -p windows && - cargo clippy -p windows-bindgen && - cargo clippy -p windows-implement && - cargo clippy -p windows-interface && - cargo clippy -p windows-metadata && - cargo clippy -p windows-sys && - cargo clippy -p windows-targets && - cargo clippy -p windows-tokens && - cargo clippy -p windows_aarch64_gnullvm && - cargo clippy -p windows_aarch64_msvc && - cargo clippy -p windows_i686_gnu && - cargo clippy -p windows_i686_msvc && - cargo clippy -p windows_x86_64_gnu && - cargo clippy -p windows_x86_64_gnullvm && - cargo clippy -p windows_x86_64_msvc \ No newline at end of file + cargo clippy -p sample_bits -- -A clippy::uninlined_format_args && + cargo clippy -p sample_com_uri -- -A clippy::uninlined_format_args && + cargo clippy -p sample_consent -- -A clippy::uninlined_format_args && + cargo clippy -p sample_core_app -- -A clippy::uninlined_format_args && + cargo clippy -p sample_counter -- -A clippy::uninlined_format_args && + cargo clippy -p sample_counter_sys -- -A clippy::uninlined_format_args && + cargo clippy -p sample_create_window -- -A clippy::uninlined_format_args && + cargo clippy -p sample_create_window_sys -- -A clippy::uninlined_format_args && + cargo clippy -p sample_data_protection -- -A clippy::uninlined_format_args && + cargo clippy -p sample_dcomp -- -A clippy::uninlined_format_args && + cargo clippy -p sample_device_watcher -- -A clippy::uninlined_format_args && + cargo clippy -p sample_direct2d -- -A clippy::uninlined_format_args && + cargo clippy -p sample_direct3d12 -- -A clippy::uninlined_format_args && + cargo clippy -p sample_enum_windows -- -A clippy::uninlined_format_args && + cargo clippy -p sample_enum_windows_sys -- -A clippy::uninlined_format_args && + cargo clippy -p sample_kernel_event -- -A clippy::uninlined_format_args && + cargo clippy -p sample_memory_buffer -- -A clippy::uninlined_format_args && + cargo clippy -p sample_message_box -- -A clippy::uninlined_format_args && + cargo clippy -p sample_message_box_sys -- -A clippy::uninlined_format_args && + cargo clippy -p sample_ocr -- -A clippy::uninlined_format_args && + cargo clippy -p sample_overlapped -- -A clippy::uninlined_format_args && + cargo clippy -p sample_rss -- -A clippy::uninlined_format_args && + cargo clippy -p sample_simple -- -A clippy::uninlined_format_args && + cargo clippy -p sample_spellchecker -- -A clippy::uninlined_format_args && + cargo clippy -p sample_thread_pool_work -- -A clippy::uninlined_format_args && + cargo clippy -p sample_thread_pool_work_sys -- -A clippy::uninlined_format_args && + cargo clippy -p sample_uiautomation -- -A clippy::uninlined_format_args && + cargo clippy -p sample_wmi -- -A clippy::uninlined_format_args && + cargo clippy -p sample_xml -- -A clippy::uninlined_format_args && + cargo clippy -p test_agile -- -A clippy::uninlined_format_args && + cargo clippy -p test_agile_reference -- -A clippy::uninlined_format_args && + cargo clippy -p test_alternate_success_code -- -A clippy::uninlined_format_args && + cargo clippy -p test_arch -- -A clippy::uninlined_format_args && + cargo clippy -p test_arch_feature -- -A clippy::uninlined_format_args && + cargo clippy -p test_bcrypt -- -A clippy::uninlined_format_args && + cargo clippy -p test_bstr -- -A clippy::uninlined_format_args && + cargo clippy -p test_calling_convention -- -A clippy::uninlined_format_args && + cargo clippy -p test_cfg_generic -- -A clippy::uninlined_format_args && + cargo clippy -p test_component -- -A clippy::uninlined_format_args && + cargo clippy -p test_component_client -- -A clippy::uninlined_format_args && + cargo clippy -p test_const_fields -- -A clippy::uninlined_format_args && + cargo clippy -p test_const_ptrs -- -A clippy::uninlined_format_args && + cargo clippy -p test_core -- -A clippy::uninlined_format_args && + cargo clippy -p test_debug -- -A clippy::uninlined_format_args && + cargo clippy -p test_debugger_visualizer_x -- -A clippy::uninlined_format_args && + cargo clippy -p test_deprecated -- -A clippy::uninlined_format_args && + cargo clippy -p test_dispatch -- -A clippy::uninlined_format_args && + cargo clippy -p test_does_not_return -- -A clippy::uninlined_format_args && + cargo clippy -p test_enums -- -A clippy::uninlined_format_args && + cargo clippy -p test_error -- -A clippy::uninlined_format_args && + cargo clippy -p test_event -- -A clippy::uninlined_format_args && + cargo clippy -p test_extensions -- -A clippy::uninlined_format_args && + cargo clippy -p test_handles -- -A clippy::uninlined_format_args && + cargo clippy -p test_helpers -- -A clippy::uninlined_format_args && + cargo clippy -p test_implement -- -A clippy::uninlined_format_args && + cargo clippy -p test_interface -- -A clippy::uninlined_format_args && + cargo clippy -p test_interop -- -A clippy::uninlined_format_args && + cargo clippy -p test_lib -- -A clippy::uninlined_format_args && + cargo clippy -p test_literals -- -A clippy::uninlined_format_args && + cargo clippy -p test_match -- -A clippy::uninlined_format_args && + cargo clippy -p test_matrix3x2 -- -A clippy::uninlined_format_args && + cargo clippy -p test_metadata -- -A clippy::uninlined_format_args && + cargo clippy -p test_msrv -- -A clippy::uninlined_format_args && + cargo clippy -p test_no_use -- -A clippy::uninlined_format_args && + cargo clippy -p test_not_dll -- -A clippy::uninlined_format_args && + cargo clippy -p test_query_signature -- -A clippy::uninlined_format_args && + cargo clippy -p test_readme -- -A clippy::uninlined_format_args && + cargo clippy -p test_reserved -- -A clippy::uninlined_format_args && + cargo clippy -p test_resources -- -A clippy::uninlined_format_args && + cargo clippy -p test_return_struct -- -A clippy::uninlined_format_args && + cargo clippy -p test_simple_component -- -A clippy::uninlined_format_args && + cargo clippy -p test_string_param -- -A clippy::uninlined_format_args && + cargo clippy -p test_structs -- -A clippy::uninlined_format_args && + cargo clippy -p test_sys -- -A clippy::uninlined_format_args && + cargo clippy -p test_unions -- -A clippy::uninlined_format_args && + cargo clippy -p test_weak -- -A clippy::uninlined_format_args && + cargo clippy -p test_weak_ref -- -A clippy::uninlined_format_args && + cargo clippy -p test_win32 -- -A clippy::uninlined_format_args && + cargo clippy -p test_win32_arrays -- -A clippy::uninlined_format_args && + cargo clippy -p test_window_long -- -A clippy::uninlined_format_args && + cargo clippy -p test_winrt -- -A clippy::uninlined_format_args && + cargo clippy -p tool_gnu -- -A clippy::uninlined_format_args && + cargo clippy -p tool_lib -- -A clippy::uninlined_format_args && + cargo clippy -p tool_license -- -A clippy::uninlined_format_args && + cargo clippy -p tool_msvc -- -A clippy::uninlined_format_args && + cargo clippy -p tool_sys -- -A clippy::uninlined_format_args && + cargo clippy -p tool_windows -- -A clippy::uninlined_format_args && + cargo clippy -p tool_yml -- -A clippy::uninlined_format_args && + cargo clippy -p windows -- -A clippy::uninlined_format_args && + cargo clippy -p windows-bindgen -- -A clippy::uninlined_format_args && + cargo clippy -p windows-implement -- -A clippy::uninlined_format_args && + cargo clippy -p windows-interface -- -A clippy::uninlined_format_args && + cargo clippy -p windows-metadata -- -A clippy::uninlined_format_args && + cargo clippy -p windows-sys -- -A clippy::uninlined_format_args && + cargo clippy -p windows-targets -- -A clippy::uninlined_format_args && + cargo clippy -p windows-tokens -- -A clippy::uninlined_format_args && + cargo clippy -p windows_aarch64_gnullvm -- -A clippy::uninlined_format_args && + cargo clippy -p windows_aarch64_msvc -- -A clippy::uninlined_format_args && + cargo clippy -p windows_i686_gnu -- -A clippy::uninlined_format_args && + cargo clippy -p windows_i686_msvc -- -A clippy::uninlined_format_args && + cargo clippy -p windows_x86_64_gnu -- -A clippy::uninlined_format_args && + cargo clippy -p windows_x86_64_gnullvm -- -A clippy::uninlined_format_args && + cargo clippy -p windows_x86_64_msvc -- -A clippy::uninlined_format_args \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6c57a6b3c3..54454fe593 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -132,8 +132,8 @@ jobs: cargo test --target ${{ matrix.target }} -p test_enums && cargo test --target ${{ matrix.target }} -p test_error && cargo test --target ${{ matrix.target }} -p test_event && - cargo clean && cargo test --target ${{ matrix.target }} -p test_extensions && + cargo clean && cargo test --target ${{ matrix.target }} -p test_handles && cargo test --target ${{ matrix.target }} -p test_helpers && cargo test --target ${{ matrix.target }} -p test_implement && @@ -144,6 +144,7 @@ jobs: cargo test --target ${{ matrix.target }} -p test_match && cargo test --target ${{ matrix.target }} -p test_matrix3x2 && cargo test --target ${{ matrix.target }} -p test_metadata && + cargo test --target ${{ matrix.target }} -p test_msrv && cargo test --target ${{ matrix.target }} -p test_no_use && cargo test --target ${{ matrix.target }} -p test_not_dll && cargo test --target ${{ matrix.target }} -p test_query_signature && diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e9f81aac92..229631b654 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -14,7 +14,7 @@ jobs: name: Check strategy: matrix: - rust: [1.64.0, stable, nightly] + rust: [1.48.0, stable, nightly] runs-on: - windows-2019 - ubuntu-latest @@ -25,4 +25,4 @@ jobs: - name: Update toolchain run: rustup update --no-self-update ${{ matrix.rust }} && rustup default ${{ matrix.rust }} - name: Run cargo check - run: cargo check -p windows --features Foundation,Win32_Foundation,Win32_Graphics_Direct2D + run: cargo check -p test_msrv diff --git a/crates/libs/bindgen/src/functions.rs b/crates/libs/bindgen/src/functions.rs index cf1ccd3f4d..f6d026c0d7 100644 --- a/crates/libs/bindgen/src/functions.rs +++ b/crates/libs/bindgen/src/functions.rs @@ -198,7 +198,7 @@ fn gen_win_function(gen: &Gen, def: MethodDef) -> TokenStream { pub unsafe fn #name<#generics>(#params) -> ::windows::core::Result<#return_type> #where_clause { #link let result__ = #name(#args); - (!result__.is_invalid()).then(||result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), ||result__).ok_or_else(::windows::core::Error::from_win32) } } } else { diff --git a/crates/libs/bindgen/src/winrt_methods.rs b/crates/libs/bindgen/src/winrt_methods.rs index 9445560db4..1b6e6065f9 100644 --- a/crates/libs/bindgen/src/winrt_methods.rs +++ b/crates/libs/bindgen/src/winrt_methods.rs @@ -30,7 +30,7 @@ pub fn gen(gen: &Gen, def: TypeDef, generic_types: &[Type], kind: InterfaceKind, let return_arg = if let Some(return_type) = &signature.return_type { if return_type.is_winrt_array() { let return_type = gen.type_name(return_type); - quote! { ::windows::core::Array::<#return_type>::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _ } + quote! { ::windows::core::Array::<#return_type>::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _ } } else { quote! { result__.as_mut_ptr() } } diff --git a/crates/libs/implement/src/lib.rs b/crates/libs/implement/src/lib.rs index b7f2b6e116..43a4736f73 100644 --- a/crates/libs/implement/src/lib.rs +++ b/crates/libs/implement/src/lib.rs @@ -287,7 +287,7 @@ impl UseTree2 { let mut type_name = input.ident.to_string(); if !namespace.is_empty() { - type_name = format!("{namespace}::{type_name}"); + type_name = format!("{}::{}", namespace, type_name); } let mut generics = vec![]; diff --git a/crates/libs/interface/src/lib.rs b/crates/libs/interface/src/lib.rs index 9609566115..5ccac86e2c 100644 --- a/crates/libs/interface/src/lib.rs +++ b/crates/libs/interface/src/lib.rs @@ -280,7 +280,7 @@ impl Interface { /// Generates various conversions such as from and to `IUnknown` fn gen_conversions(&self) -> proc_macro2::TokenStream { let name = &self.name; - let name_string = format!("{name}"); + let name_string = format!("{}", name); quote! { impl ::core::convert::From<#name> for ::windows::core::IUnknown { fn from(value: #name) -> Self { @@ -401,17 +401,17 @@ struct Guid(Option); impl Guid { fn to_tokens(&self) -> syn::Result { fn hex_lit(num: &str) -> syn::LitInt { - syn::LitInt::new(&format!("0x{num}"), proc_macro2::Span::call_site()) + syn::LitInt::new(&format!("0x{}", num), proc_macro2::Span::call_site()) } fn ensure_length(part: Option<&str>, index: usize, length: usize, span: proc_macro2::Span) -> syn::Result { let part = match part { Some(p) => p, - None => return Err(syn::Error::new(span, format!("The IID missing part at index {index}",))), + None => return Err(syn::Error::new(span, format!("The IID missing part at index {}", index))), }; if part.len() != length { - return Err(syn::Error::new(span, format!("The IID part at index {index} must be {length} characters long but was {} characters", part.len()))); + return Err(syn::Error::new(span, format!("The IID part at index {} must be {} characters long but was {} characters", index, length, part.len()))); } Ok(part.to_owned()) diff --git a/crates/libs/sys/Cargo.toml b/crates/libs/sys/Cargo.toml index 238ad38cae..86ec0d91a2 100644 --- a/crates/libs/sys/Cargo.toml +++ b/crates/libs/sys/Cargo.toml @@ -8,7 +8,6 @@ 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" [package.metadata.docs.rs] default-target = "x86_64-pc-windows-msvc" diff --git a/crates/libs/windows/Cargo.toml b/crates/libs/windows/Cargo.toml index 337c69835c..3746569813 100644 --- a/crates/libs/windows/Cargo.toml +++ b/crates/libs/windows/Cargo.toml @@ -9,7 +9,6 @@ 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.64" [package.metadata.docs.rs] default-target = "x86_64-pc-windows-msvc" diff --git a/crates/libs/windows/src/Windows/ApplicationModel/mod.rs b/crates/libs/windows/src/Windows/ApplicationModel/mod.rs index 70b24da9fc..ba0a014a1a 100644 --- a/crates/libs/windows/src/Windows/ApplicationModel/mod.rs +++ b/crates/libs/windows/src/Windows/ApplicationModel/mod.rs @@ -1626,7 +1626,7 @@ impl AppInfo { let this = &::windows::core::Interface::cast::(self)?; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).SupportedFileExtensions)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::<::windows::core::HSTRING>::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).SupportedFileExtensions)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::<::windows::core::HSTRING>::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } pub fn Current() -> ::windows::core::Result { diff --git a/crates/libs/windows/src/Windows/Devices/Display/mod.rs b/crates/libs/windows/src/Windows/Devices/Display/mod.rs index 942d263b14..0956eac301 100644 --- a/crates/libs/windows/src/Windows/Devices/Display/mod.rs +++ b/crates/libs/windows/src/Windows/Devices/Display/mod.rs @@ -248,7 +248,7 @@ impl DisplayMonitor { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).GetDescriptor)(::windows::core::Vtable::as_raw(this), descriptorkind, ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).GetDescriptor)(::windows::core::Vtable::as_raw(this), descriptorkind, ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } pub fn IsDolbyVisionSupportedInHdrMode(&self) -> ::windows::core::Result { diff --git a/crates/libs/windows/src/Windows/Devices/Lights/mod.rs b/crates/libs/windows/src/Windows/Devices/Lights/mod.rs index 231e43341f..c91321840a 100644 --- a/crates/libs/windows/src/Windows/Devices/Lights/mod.rs +++ b/crates/libs/windows/src/Windows/Devices/Lights/mod.rs @@ -479,14 +479,14 @@ impl LampArray { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).GetIndicesForKey)(::windows::core::Vtable::as_raw(this), key, ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).GetIndicesForKey)(::windows::core::Vtable::as_raw(this), key, ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } pub fn GetIndicesForPurposes(&self, purposes: LampPurposes) -> ::windows::core::Result<::windows::core::Array> { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).GetIndicesForPurposes)(::windows::core::Vtable::as_raw(this), purposes, ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).GetIndicesForPurposes)(::windows::core::Vtable::as_raw(this), purposes, ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } #[doc = "*Required features: `\"UI\"`*"] diff --git a/crates/libs/windows/src/Windows/Devices/PointOfService/mod.rs b/crates/libs/windows/src/Windows/Devices/PointOfService/mod.rs index b4f38cd08f..26a47b4dbb 100644 --- a/crates/libs/windows/src/Windows/Devices/PointOfService/mod.rs +++ b/crates/libs/windows/src/Windows/Devices/PointOfService/mod.rs @@ -9211,7 +9211,7 @@ impl MagneticStripeReader { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).SupportedCardTypes)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).SupportedCardTypes)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } pub fn DeviceAuthenticationProtocol(&self) -> ::windows::core::Result { diff --git a/crates/libs/windows/src/Windows/Devices/Sms/mod.rs b/crates/libs/windows/src/Windows/Devices/Sms/mod.rs index b428338178..706c706da3 100644 --- a/crates/libs/windows/src/Windows/Devices/Sms/mod.rs +++ b/crates/libs/windows/src/Windows/Devices/Sms/mod.rs @@ -70,7 +70,7 @@ impl ISmsBinaryMessage { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).GetData)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).GetData)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } #[doc = "*Required features: `\"deprecated\"`*"] @@ -2719,7 +2719,7 @@ impl SmsBinaryMessage { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).GetData)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).GetData)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } #[doc = "*Required features: `\"deprecated\"`*"] diff --git a/crates/libs/windows/src/Windows/Foundation/mod.rs b/crates/libs/windows/src/Windows/Foundation/mod.rs index b326d29e48..72d4daba40 100644 --- a/crates/libs/windows/src/Windows/Foundation/mod.rs +++ b/crates/libs/windows/src/Windows/Foundation/mod.rs @@ -1754,7 +1754,7 @@ impl IReferenceArray { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).Value)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).Value)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } pub fn Type(&self) -> ::windows::core::Result { diff --git a/crates/libs/windows/src/Windows/Graphics/Display/mod.rs b/crates/libs/windows/src/Windows/Graphics/Display/mod.rs index 918006bbb8..015fd63719 100644 --- a/crates/libs/windows/src/Windows/Graphics/Display/mod.rs +++ b/crates/libs/windows/src/Windows/Graphics/Display/mod.rs @@ -1599,7 +1599,7 @@ impl DisplayServices { pub fn FindAll() -> ::windows::core::Result<::windows::core::Array> { Self::IDisplayServicesStatics(|this| unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).FindAll)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).FindAll)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) }) } #[doc(hidden)] diff --git a/crates/libs/windows/src/Windows/Graphics/Holographic/mod.rs b/crates/libs/windows/src/Windows/Graphics/Holographic/mod.rs index b2e9cc0321..b339836fb3 100644 --- a/crates/libs/windows/src/Windows/Graphics/Holographic/mod.rs +++ b/crates/libs/windows/src/Windows/Graphics/Holographic/mod.rs @@ -1316,7 +1316,7 @@ impl HolographicCameraViewportParameters { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).HiddenAreaMesh)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).HiddenAreaMesh)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } #[doc = "*Required features: `\"Foundation_Numerics\"`*"] @@ -1325,7 +1325,7 @@ impl HolographicCameraViewportParameters { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).VisibleAreaMesh)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).VisibleAreaMesh)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } } diff --git a/crates/libs/windows/src/Windows/Graphics/Imaging/mod.rs b/crates/libs/windows/src/Windows/Graphics/Imaging/mod.rs index 8fa73d1682..b4c0b60c0f 100644 --- a/crates/libs/windows/src/Windows/Graphics/Imaging/mod.rs +++ b/crates/libs/windows/src/Windows/Graphics/Imaging/mod.rs @@ -2596,7 +2596,7 @@ impl PixelDataProvider { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).DetachPixelData)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).DetachPixelData)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } } diff --git a/crates/libs/windows/src/Windows/Media/Devices/mod.rs b/crates/libs/windows/src/Windows/Media/Devices/mod.rs index 6403f92816..1c6d8134a9 100644 --- a/crates/libs/windows/src/Windows/Media/Devices/mod.rs +++ b/crates/libs/windows/src/Windows/Media/Devices/mod.rs @@ -2773,7 +2773,7 @@ impl DigitalWindowControl { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).SupportedModes)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).SupportedModes)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } pub fn CurrentMode(&self) -> ::windows::core::Result { diff --git a/crates/libs/windows/src/Windows/Media/Protection/PlayReady/mod.rs b/crates/libs/windows/src/Windows/Media/Protection/PlayReady/mod.rs index bbb84e39e9..c34daf8233 100644 --- a/crates/libs/windows/src/Windows/Media/Protection/PlayReady/mod.rs +++ b/crates/libs/windows/src/Windows/Media/Protection/PlayReady/mod.rs @@ -124,7 +124,7 @@ impl INDClosedCaptionDataReceivedEventArgs { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).ClosedCaptionData)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).ClosedCaptionData)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } } @@ -196,7 +196,7 @@ impl INDCustomData { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).CustomDataTypeID)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).CustomDataTypeID)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } #[doc = "*Required features: `\"deprecated\"`*"] @@ -205,7 +205,7 @@ impl INDCustomData { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).CustomData)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).CustomData)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } } @@ -636,7 +636,7 @@ impl INDLicenseFetchDescriptor { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).ContentID)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).ContentID)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } #[doc = "*Required features: `\"deprecated\"`*"] @@ -1084,7 +1084,7 @@ impl INDSendResult { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).Response)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).Response)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } } @@ -1536,7 +1536,7 @@ impl INDTransmitterProperties { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).SupportedFeatures)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).SupportedFeatures)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } #[doc = "*Required features: `\"deprecated\"`*"] @@ -1572,7 +1572,7 @@ impl INDTransmitterProperties { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).ClientID)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).ClientID)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } #[doc = "*Required features: `\"deprecated\"`*"] @@ -1581,7 +1581,7 @@ impl INDTransmitterProperties { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).ModelDigest)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).ModelDigest)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } #[doc = "*Required features: `\"deprecated\"`*"] @@ -2586,7 +2586,7 @@ impl IPlayReadySecureStopServiceRequest { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).PublisherCertificate)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).PublisherCertificate)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } pub fn ProtectionSystem(&self) -> ::windows::core::Result<::windows::core::GUID> { @@ -3241,7 +3241,7 @@ impl NDCustomData { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).CustomDataTypeID)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).CustomDataTypeID)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } #[doc = "*Required features: `\"deprecated\"`*"] @@ -3250,7 +3250,7 @@ impl NDCustomData { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).CustomData)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).CustomData)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } #[doc = "*Required features: `\"deprecated\"`*"] @@ -3471,7 +3471,7 @@ impl NDLicenseFetchDescriptor { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).ContentID)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).ContentID)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } #[doc = "*Required features: `\"deprecated\"`*"] @@ -3972,7 +3972,7 @@ impl PlayReadyContentHeader { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).GetSerializedHeader)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).GetSerializedHeader)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } pub fn HeaderWithEmbeddedUpdates(&self) -> ::windows::core::Result { @@ -3986,14 +3986,14 @@ impl PlayReadyContentHeader { let this = &::windows::core::Interface::cast::(self)?; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).KeyIds)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::<::windows::core::GUID>::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).KeyIds)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::<::windows::core::GUID>::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } pub fn KeyIdStrings(&self) -> ::windows::core::Result<::windows::core::Array<::windows::core::HSTRING>> { let this = &::windows::core::Interface::cast::(self)?; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).KeyIdStrings)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::<::windows::core::HSTRING>::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).KeyIdStrings)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::<::windows::core::HSTRING>::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } #[doc = "*Required features: `\"Foundation\"`*"] @@ -4794,7 +4794,7 @@ impl PlayReadyITADataGenerator { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).GenerateData)(::windows::core::Vtable::as_raw(this), guidcpsystemid, countofstreams, configuration.try_into().map_err(|e| e.into())?.abi(), format, ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).GenerateData)(::windows::core::Vtable::as_raw(this), guidcpsystemid, countofstreams, configuration.try_into().map_err(|e| e.into())?.abi(), format, ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } } @@ -5729,7 +5729,7 @@ impl PlayReadyMeteringReportServiceRequest { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).MeteringCertificate)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).MeteringCertificate)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } pub fn SetMeteringCertificate(&self, meteringcertbytes: &[u8]) -> ::windows::core::Result<()> { @@ -6301,7 +6301,7 @@ impl PlayReadySecureStopServiceRequest { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).PublisherCertificate)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).PublisherCertificate)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } pub fn CreateInstance(publishercertbytes: &[u8]) -> ::windows::core::Result { @@ -6483,7 +6483,7 @@ impl PlayReadySoapMessage { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).GetMessageBody)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).GetMessageBody)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } #[doc = "*Required features: `\"Foundation_Collections\"`*"] diff --git a/crates/libs/windows/src/Windows/Networking/NetworkOperators/mod.rs b/crates/libs/windows/src/Windows/Networking/NetworkOperators/mod.rs index 11c74eeb58..77445ceacd 100644 --- a/crates/libs/windows/src/Windows/Networking/NetworkOperators/mod.rs +++ b/crates/libs/windows/src/Windows/Networking/NetworkOperators/mod.rs @@ -3780,7 +3780,7 @@ impl HotspotAuthenticationContext { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).WirelessNetworkId)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).WirelessNetworkId)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } #[doc = "*Required features: `\"Networking_Connectivity\"`*"] @@ -8769,7 +8769,7 @@ impl UssdMessage { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).GetPayload)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).GetPayload)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } pub fn SetPayload(&self, value: &[u8]) -> ::windows::core::Result<()> { diff --git a/crates/libs/windows/src/Windows/Perception/Spatial/mod.rs b/crates/libs/windows/src/Windows/Perception/Spatial/mod.rs index 3087d2bd22..fcdbb79e8f 100644 --- a/crates/libs/windows/src/Windows/Perception/Spatial/mod.rs +++ b/crates/libs/windows/src/Windows/Perception/Spatial/mod.rs @@ -2125,7 +2125,7 @@ impl SpatialStageFrameOfReference { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).TryGetMovementBounds)(::windows::core::Vtable::as_raw(this), ::core::mem::transmute_copy(coordinatesystem), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).TryGetMovementBounds)(::windows::core::Vtable::as_raw(this), ::core::mem::transmute_copy(coordinatesystem), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } pub fn Current() -> ::windows::core::Result { diff --git a/crates/libs/windows/src/Windows/Security/Cryptography/Certificates/mod.rs b/crates/libs/windows/src/Windows/Security/Cryptography/Certificates/mod.rs index a0ebeb4e59..774f4dfaaf 100644 --- a/crates/libs/windows/src/Windows/Security/Cryptography/Certificates/mod.rs +++ b/crates/libs/windows/src/Windows/Security/Cryptography/Certificates/mod.rs @@ -1010,21 +1010,21 @@ impl Certificate { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).SerialNumber)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).SerialNumber)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } pub fn GetHashValue(&self) -> ::windows::core::Result<::windows::core::Array> { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).GetHashValue)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).GetHashValue)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } pub fn GetHashValueWithAlgorithm(&self, hashalgorithmname: &::windows::core::HSTRING) -> ::windows::core::Result<::windows::core::Array> { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).GetHashValueWithAlgorithm)(::windows::core::Vtable::as_raw(this), ::core::mem::transmute_copy(hashalgorithmname), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).GetHashValueWithAlgorithm)(::windows::core::Vtable::as_raw(this), ::core::mem::transmute_copy(hashalgorithmname), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } #[doc = "*Required features: `\"Storage_Streams\"`*"] @@ -1390,7 +1390,7 @@ impl CertificateExtension { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).Value)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).Value)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } pub fn SetValue(&self, value: &[u8]) -> ::windows::core::Result<()> { @@ -1614,7 +1614,7 @@ impl CertificateQuery { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).Thumbprint)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).Thumbprint)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } pub fn SetThumbprint(&self, value: &[u8]) -> ::windows::core::Result<()> { @@ -1859,7 +1859,7 @@ impl CertificateRequestProperties { let this = &::windows::core::Interface::cast::(self)?; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).CurveParameters)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).CurveParameters)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } pub fn SetCurveParameters(&self, value: &[u8]) -> ::windows::core::Result<()> { @@ -2286,7 +2286,7 @@ impl CmsAttachedSignature { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).Content)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).Content)(::windows::core::Vtable::as_raw(this), ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } #[doc = "*Required features: `\"Foundation_Collections\"`*"] 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 e8450b507d..6860442bb6 100644 --- a/crates/libs/windows/src/Windows/Win32/Devices/AllJoyn/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Devices/AllJoyn/mod.rs @@ -28,7 +28,7 @@ where { ::windows::core::link ! ( "msajapi.dll""system" fn AllJoynConnectToBus ( connectionspec : :: windows::core::PCWSTR ) -> super::super::Foundation:: HANDLE ); let result__ = AllJoynConnectToBus(connectionspec.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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/DeviceAndDriverInstallation/mod.rs b/crates/libs/windows/src/Windows/Win32/Devices/DeviceAndDriverInstallation/mod.rs index 83375df947..566cab5217 100644 --- a/crates/libs/windows/src/Windows/Win32/Devices/DeviceAndDriverInstallation/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Devices/DeviceAndDriverInstallation/mod.rs @@ -2242,7 +2242,7 @@ where { ::windows::core::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(), deviceinfodata, scope, hwprofile, keytype, ::core::mem::transmute(infhandle.unwrap_or(::std::ptr::null())), infsectionname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_System_Registry\"`*"] #[cfg(feature = "Win32_System_Registry")] @@ -2254,7 +2254,7 @@ where { ::windows::core::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(), deviceinfodata, scope, hwprofile, keytype, ::core::mem::transmute(infhandle.unwrap_or(::std::ptr::null())), infsectionname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2278,7 +2278,7 @@ where { ::windows::core::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()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2290,7 +2290,7 @@ where { ::windows::core::link ! ( "setupapi.dll""system" fn SetupDiCreateDeviceInfoListExA ( classguid : *const :: windows::core::GUID , hwndparent : super::super::Foundation:: HWND , machinename : :: windows::core::PCSTR , reserved : *mut ::core::ffi::c_void ) -> HDEVINFO ); let result__ = SetupDiCreateDeviceInfoListExA(::core::mem::transmute(classguid.unwrap_or(::std::ptr::null())), hwndparent.into(), machinename.into().abi(), ::core::mem::transmute(reserved.unwrap_or(::std::ptr::null_mut()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2302,7 +2302,7 @@ where { ::windows::core::link ! ( "setupapi.dll""system" fn SetupDiCreateDeviceInfoListExW ( classguid : *const :: windows::core::GUID , hwndparent : super::super::Foundation:: HWND , machinename : :: windows::core::PCWSTR , reserved : *mut ::core::ffi::c_void ) -> HDEVINFO ); let result__ = SetupDiCreateDeviceInfoListExW(::core::mem::transmute(classguid.unwrap_or(::std::ptr::null())), hwndparent.into(), machinename.into().abi(), ::core::mem::transmute(reserved.unwrap_or(::std::ptr::null_mut()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2338,7 +2338,7 @@ where { ::windows::core::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(), deviceinterfacedata, reserved, samdesired, ::core::mem::transmute(infhandle.unwrap_or(::std::ptr::null())), infsectionname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_System_Registry\"`*"] #[cfg(feature = "Win32_System_Registry")] @@ -2350,7 +2350,7 @@ where { ::windows::core::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(), deviceinterfacedata, reserved, samdesired, ::core::mem::transmute(infhandle.unwrap_or(::std::ptr::null())), infsectionname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2623,7 +2623,7 @@ where { ::windows::core::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().abi(), hwndparent.into(), flags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2637,7 +2637,7 @@ where { ::windows::core::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 : *mut ::core::ffi::c_void ) -> HDEVINFO ); let result__ = SetupDiGetClassDevsExA(::core::mem::transmute(classguid.unwrap_or(::std::ptr::null())), enumerator.into().abi(), hwndparent.into(), flags, deviceinfoset.into(), machinename.into().abi(), ::core::mem::transmute(reserved.unwrap_or(::std::ptr::null_mut()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2651,7 +2651,7 @@ where { ::windows::core::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 : *mut ::core::ffi::c_void ) -> HDEVINFO ); let result__ = SetupDiGetClassDevsExW(::core::mem::transmute(classguid.unwrap_or(::std::ptr::null())), enumerator.into().abi(), hwndparent.into(), flags, deviceinfoset.into(), machinename.into().abi(), ::core::mem::transmute(reserved.unwrap_or(::std::ptr::null_mut()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2663,7 +2663,7 @@ where { ::windows::core::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().abi(), hwndparent.into(), flags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -3213,7 +3213,7 @@ where pub unsafe fn SetupDiOpenClassRegKey(classguid: ::core::option::Option<*const ::windows::core::GUID>, samdesired: u32) -> ::windows::core::Result { ::windows::core::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); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_System_Registry\"`*"] #[cfg(feature = "Win32_System_Registry")] @@ -3224,7 +3224,7 @@ where { ::windows::core::link ! ( "setupapi.dll""system" fn SetupDiOpenClassRegKeyExA ( classguid : *const :: windows::core::GUID , samdesired : u32 , flags : u32 , machinename : :: windows::core::PCSTR , reserved : *mut ::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().abi(), ::core::mem::transmute(reserved.unwrap_or(::std::ptr::null_mut()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_System_Registry\"`*"] #[cfg(feature = "Win32_System_Registry")] @@ -3235,7 +3235,7 @@ where { ::windows::core::link ! ( "setupapi.dll""system" fn SetupDiOpenClassRegKeyExW ( classguid : *const :: windows::core::GUID , samdesired : u32 , flags : u32 , machinename : :: windows::core::PCWSTR , reserved : *mut ::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().abi(), ::core::mem::transmute(reserved.unwrap_or(::std::ptr::null_mut()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_System_Registry\"`*"] #[cfg(feature = "Win32_System_Registry")] @@ -3246,7 +3246,7 @@ where { ::windows::core::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(), deviceinfodata, scope, hwprofile, keytype, samdesired); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -3292,7 +3292,7 @@ where { ::windows::core::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(), deviceinterfacedata, reserved, samdesired); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 dc3392b90a..4c746f5e7d 100644 --- a/crates/libs/windows/src/Windows/Win32/Graphics/Gdi/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Graphics/Gdi/mod.rs @@ -375,7 +375,7 @@ where { ::windows::core::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(), pbmi, usage, ppvbits, hsection.into(), offset); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 324b8caf0a..541834054a 100644 --- a/crates/libs/windows/src/Windows/Win32/Graphics/OpenGL/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Graphics/OpenGL/mod.rs @@ -2406,7 +2406,7 @@ where { ::windows::core::link ! ( "opengl32.dll""system" fn wglCreateContext ( param0 : super::Gdi:: HDC ) -> HGLRC ); let result__ = wglCreateContext(param0.into()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Graphics_OpenGL\"`, `\"Win32_Graphics_Gdi\"`*"] #[cfg(feature = "Win32_Graphics_Gdi")] @@ -2417,7 +2417,7 @@ where { ::windows::core::link ! ( "opengl32.dll""system" fn wglCreateLayerContext ( param0 : super::Gdi:: HDC , param1 : i32 ) -> HGLRC ); let result__ = wglCreateLayerContext(param0.into(), param1); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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/NetworkManagement/IpHelper/mod.rs b/crates/libs/windows/src/Windows/Win32/NetworkManagement/IpHelper/mod.rs index 2aa5376eab..dd90c1f787 100644 --- a/crates/libs/windows/src/Windows/Win32/NetworkManagement/IpHelper/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/NetworkManagement/IpHelper/mod.rs @@ -896,7 +896,7 @@ pub unsafe fn GetUnicastIpAddressTable(family: super::super::Networking::WinSock pub unsafe fn Icmp6CreateFile() -> ::windows::core::Result { ::windows::core::link ! ( "iphlpapi.dll""system" fn Icmp6CreateFile ( ) -> IcmpHandle ); let result__ = Icmp6CreateFile(); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_NetworkManagement_IpHelper\"`*"] #[inline] @@ -930,7 +930,7 @@ where pub unsafe fn IcmpCreateFile() -> ::windows::core::Result { ::windows::core::link ! ( "iphlpapi.dll""system" fn IcmpCreateFile ( ) -> IcmpHandle ); let result__ = IcmpCreateFile(); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 420056e052..b12e337e8a 100644 --- a/crates/libs/windows/src/Windows/Win32/Networking/Clustering/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Networking/Clustering/mod.rs @@ -1227,7 +1227,7 @@ pub unsafe fn GetClusterFromResource(hresource: *const _HRESOURCE) -> *mut _HCLU pub unsafe fn GetClusterGroupKey(hgroup: *const _HGROUP, samdesired: u32) -> ::windows::core::Result { ::windows::core::link ! ( "clusapi.dll""system" fn GetClusterGroupKey ( hgroup : *const _HGROUP , samdesired : u32 ) -> super::super::System::Registry:: HKEY ); let result__ = GetClusterGroupKey(hgroup, samdesired); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"] #[inline] @@ -1247,7 +1247,7 @@ pub unsafe fn GetClusterInformation(hcluster: *const _HCLUSTER, lpszclustername: pub unsafe fn GetClusterKey(hcluster: *const _HCLUSTER, samdesired: u32) -> ::windows::core::Result { ::windows::core::link ! ( "clusapi.dll""system" fn GetClusterKey ( hcluster : *const _HCLUSTER , samdesired : u32 ) -> super::super::System::Registry:: HKEY ); let result__ = GetClusterKey(hcluster, samdesired); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"] #[inline] @@ -1265,7 +1265,7 @@ where pub unsafe fn GetClusterNetInterfaceKey(hnetinterface: *const _HNETINTERFACE, samdesired: u32) -> ::windows::core::Result { ::windows::core::link ! ( "clusapi.dll""system" fn GetClusterNetInterfaceKey ( hnetinterface : *const _HNETINTERFACE , samdesired : u32 ) -> super::super::System::Registry:: HKEY ); let result__ = GetClusterNetInterfaceKey(hnetinterface, samdesired); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"] #[inline] @@ -1285,7 +1285,7 @@ pub unsafe fn GetClusterNetworkId(hnetwork: *const _HNETWORK, lpsznetworkid: ::w pub unsafe fn GetClusterNetworkKey(hnetwork: *const _HNETWORK, samdesired: u32) -> ::windows::core::Result { ::windows::core::link ! ( "clusapi.dll""system" fn GetClusterNetworkKey ( hnetwork : *const _HNETWORK , samdesired : u32 ) -> super::super::System::Registry:: HKEY ); let result__ = GetClusterNetworkKey(hnetwork, samdesired); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"] #[inline] @@ -1305,7 +1305,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::core::link ! ( "clusapi.dll""system" fn GetClusterNodeKey ( hnode : *const _HNODE , samdesired : u32 ) -> super::super::System::Registry:: HKEY ); let result__ = GetClusterNodeKey(hnode, samdesired); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_Clustering\"`*"] #[inline] @@ -1358,7 +1358,7 @@ pub unsafe fn GetClusterResourceDependencyExpression(hresource: *const _HRESOURC pub unsafe fn GetClusterResourceKey(hresource: *const _HRESOURCE, samdesired: u32) -> ::windows::core::Result { ::windows::core::link ! ( "clusapi.dll""system" fn GetClusterResourceKey ( hresource : *const _HRESOURCE , samdesired : u32 ) -> super::super::System::Registry:: HKEY ); let result__ = GetClusterResourceKey(hresource, samdesired); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_Clustering\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1382,7 +1382,7 @@ where { ::windows::core::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().abi(), samdesired); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 05e85cdda3..5a6cc19214 100644 --- a/crates/libs/windows/src/Windows/Win32/Networking/WinInet/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Networking/WinInet/mod.rs @@ -389,7 +389,7 @@ where { ::windows::core::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().abi(), ::core::mem::transmute(lpfirstcacheentryinfo.unwrap_or(::std::ptr::null_mut())), lpcbcacheentryinfo); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_WinInet\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -400,7 +400,7 @@ where { ::windows::core::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 : *mut ::core::ffi::c_void , lpcbgroupattributes : *mut u32 , lpreserved : *mut ::core::ffi::c_void ) -> super::super::Foundation:: HANDLE ); let result__ = FindFirstUrlCacheEntryExA(lpszurlsearchpattern.into().abi(), dwflags, dwfilter, groupid, ::core::mem::transmute(lpfirstcacheentryinfo.unwrap_or(::std::ptr::null_mut())), lpcbcacheentryinfo, ::core::mem::transmute(lpgroupattributes.unwrap_or(::std::ptr::null_mut())), ::core::mem::transmute(lpcbgroupattributes.unwrap_or(::std::ptr::null_mut())), ::core::mem::transmute(lpreserved.unwrap_or(::std::ptr::null_mut()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_WinInet\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -411,7 +411,7 @@ where { ::windows::core::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 : *mut ::core::ffi::c_void , lpcbgroupattributes : *mut u32 , lpreserved : *mut ::core::ffi::c_void ) -> super::super::Foundation:: HANDLE ); let result__ = FindFirstUrlCacheEntryExW(lpszurlsearchpattern.into().abi(), dwflags, dwfilter, groupid, ::core::mem::transmute(lpfirstcacheentryinfo.unwrap_or(::std::ptr::null_mut())), lpcbcacheentryinfo, ::core::mem::transmute(lpgroupattributes.unwrap_or(::std::ptr::null_mut())), ::core::mem::transmute(lpcbgroupattributes.unwrap_or(::std::ptr::null_mut())), ::core::mem::transmute(lpreserved.unwrap_or(::std::ptr::null_mut()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_WinInet\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -422,7 +422,7 @@ where { ::windows::core::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().abi(), ::core::mem::transmute(lpfirstcacheentryinfo.unwrap_or(::std::ptr::null_mut())), lpcbcacheentryinfo); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_WinInet\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -430,7 +430,7 @@ where pub unsafe fn FindFirstUrlCacheGroup(dwflags: u32, dwfilter: u32, lpsearchcondition: ::core::option::Option<*mut ::core::ffi::c_void>, dwsearchcondition: u32, lpgroupid: *mut i64, lpreserved: ::core::option::Option<*mut ::core::ffi::c_void>) -> ::windows::core::Result { ::windows::core::link ! ( "wininet.dll""system" fn FindFirstUrlCacheGroup ( dwflags : u32 , dwfilter : u32 , lpsearchcondition : *mut ::core::ffi::c_void , dwsearchcondition : u32 , lpgroupid : *mut i64 , lpreserved : *mut ::core::ffi::c_void ) -> super::super::Foundation:: HANDLE ); let result__ = FindFirstUrlCacheGroup(dwflags, dwfilter, ::core::mem::transmute(lpsearchcondition.unwrap_or(::std::ptr::null_mut())), dwsearchcondition, lpgroupid, ::core::mem::transmute(lpreserved.unwrap_or(::std::ptr::null_mut()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_WinInet\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2319,7 +2319,7 @@ where { ::windows::core::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().abi(), ::core::mem::transmute(lpcacheentryinfo.unwrap_or(::std::ptr::null_mut())), lpcbcacheentryinfo, frandomread.into(), dwreserved); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Networking_WinInet\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2331,7 +2331,7 @@ where { ::windows::core::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().abi(), ::core::mem::transmute(lpcacheentryinfo.unwrap_or(::std::ptr::null_mut())), lpcbcacheentryinfo, frandomread.into(), dwreserved); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 9a60f86853..96c35800b9 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 @@ -7,7 +7,7 @@ where { ::windows::core::link ! ( "aclui.dll""system" fn CreateSecurityPage ( psi : * mut::core::ffi::c_void ) -> super::super::super::UI::Controls:: HPROPSHEETPAGE ); let result__ = CreateSecurityPage(psi.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 392fdc1d97..a71c36a513 100644 --- a/crates/libs/windows/src/Windows/Win32/Security/Credentials/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Security/Credentials/mod.rs @@ -491,7 +491,7 @@ where pub unsafe fn SCardAccessStartedEvent() -> ::windows::core::Result { ::windows::core::link ! ( "winscard.dll""system" fn SCardAccessStartedEvent ( ) -> super::super::Foundation:: HANDLE ); let result__ = SCardAccessStartedEvent(); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 c51338fbb6..43ac2bbd3e 100644 --- a/crates/libs/windows/src/Windows/Win32/Security/Cryptography/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Security/Cryptography/mod.rs @@ -1296,7 +1296,7 @@ where { ::windows::core::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().abi(), dwencodingtype, hcryptprov.into(), dwflags, ::core::mem::transmute(pvpara.unwrap_or(::std::ptr::null()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Security_Cryptography\"`*"] #[inline] @@ -1307,7 +1307,7 @@ where { ::windows::core::link ! ( "crypt32.dll""system" fn CertOpenSystemStoreA ( hprov : HCRYPTPROV_LEGACY , szsubsystemprotocol : :: windows::core::PCSTR ) -> HCERTSTORE ); let result__ = CertOpenSystemStoreA(hprov.into(), szsubsystemprotocol.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Security_Cryptography\"`*"] #[inline] @@ -1318,7 +1318,7 @@ where { ::windows::core::link ! ( "crypt32.dll""system" fn CertOpenSystemStoreW ( hprov : HCRYPTPROV_LEGACY , szsubsystemprotocol : :: windows::core::PCWSTR ) -> HCERTSTORE ); let result__ = CertOpenSystemStoreW(hprov.into(), szsubsystemprotocol.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Security_Cryptography\"`*"] #[inline] @@ -2030,7 +2030,7 @@ where { ::windows::core::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(), dwflags, ::core::mem::transmute(pbsignedblob.as_ptr()), pbsignedblob.len() as _); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Security_Cryptography\"`*"] #[inline] @@ -3430,7 +3430,7 @@ where { ::windows::core::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().abi(), dwflags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 77b5a48bf3..d5f33f872a 100644 --- a/crates/libs/windows/src/Windows/Win32/Storage/FileSystem/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Storage/FileSystem/mod.rs @@ -402,7 +402,7 @@ where { ::windows::core::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(), transactionhandle.into(), notificationmask, createoptions, enlistmentkey); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -413,7 +413,7 @@ where { ::windows::core::link ! ( "kernel32.dll""system" fn CreateFile2 ( lpfilename : :: windows::core::PCWSTR , dwdesiredaccess : FILE_ACCESS_FLAGS , dwsharemode : FILE_SHARE_MODE , dwcreationdisposition : FILE_CREATION_DISPOSITION , pcreateexparams : *const CREATEFILE2_EXTENDED_PARAMETERS ) -> super::super::Foundation:: HANDLE ); let result__ = CreateFile2(lpfilename.into().abi(), dwdesiredaccess, dwsharemode, dwcreationdisposition, ::core::mem::transmute(pcreateexparams.unwrap_or(::std::ptr::null()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -435,7 +435,7 @@ where { ::windows::core::link ! ( "kernel32.dll""system" fn CreateFileA ( lpfilename : :: windows::core::PCSTR , dwdesiredaccess : FILE_ACCESS_FLAGS , 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().abi(), dwdesiredaccess, dwsharemode, ::core::mem::transmute(lpsecurityattributes.unwrap_or(::std::ptr::null())), dwcreationdisposition, dwflagsandattributes, htemplatefile.into()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -459,7 +459,7 @@ where { ::windows::core::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 : *mut ::core::ffi::c_void ) -> super::super::Foundation:: HANDLE ); let result__ = CreateFileTransactedA(lpfilename.into().abi(), dwdesiredaccess, dwsharemode, ::core::mem::transmute(lpsecurityattributes.unwrap_or(::std::ptr::null())), dwcreationdisposition, dwflagsandattributes, htemplatefile.into(), htransaction.into(), ::core::mem::transmute(pusminiversion.unwrap_or(::std::ptr::null())), ::core::mem::transmute(lpextendedparameter.unwrap_or(::std::ptr::null_mut()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -472,7 +472,7 @@ where { ::windows::core::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 : *mut ::core::ffi::c_void ) -> super::super::Foundation:: HANDLE ); let result__ = CreateFileTransactedW(lpfilename.into().abi(), dwdesiredaccess, dwsharemode, ::core::mem::transmute(lpsecurityattributes.unwrap_or(::std::ptr::null())), dwcreationdisposition, dwflagsandattributes, htemplatefile.into(), htransaction.into(), ::core::mem::transmute(pusminiversion.unwrap_or(::std::ptr::null())), ::core::mem::transmute(lpextendedparameter.unwrap_or(::std::ptr::null_mut()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -484,7 +484,7 @@ where { ::windows::core::link ! ( "kernel32.dll""system" fn CreateFileW ( lpfilename : :: windows::core::PCWSTR , dwdesiredaccess : FILE_ACCESS_FLAGS , 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().abi(), dwdesiredaccess, dwsharemode, ::core::mem::transmute(lpsecurityattributes.unwrap_or(::std::ptr::null())), dwcreationdisposition, dwflagsandattributes, htemplatefile.into()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -558,7 +558,7 @@ where { ::windows::core::link ! ( "clfsw32.dll""system" fn CreateLogFile ( pszlogfilename : :: windows::core::PCWSTR , fdesiredaccess : FILE_ACCESS_FLAGS , 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().abi(), fdesiredaccess, dwsharemode, psalogfile, fcreatedisposition, fflagsandattributes); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -580,7 +580,7 @@ where { ::windows::core::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(), description.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -647,7 +647,7 @@ where { ::windows::core::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().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -658,7 +658,7 @@ where { ::windows::core::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().abi(), createoptions, commitstrength); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -921,7 +921,7 @@ where { ::windows::core::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().abi(), bwatchsubtree.into(), dwnotifyfilter); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -933,7 +933,7 @@ where { ::windows::core::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().abi(), bwatchsubtree.into(), dwnotifyfilter); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -944,7 +944,7 @@ where { ::windows::core::link ! ( "kernel32.dll""system" fn FindFirstFileA ( lpfilename : :: windows::core::PCSTR , lpfindfiledata : *mut WIN32_FIND_DATAA ) -> FindFileHandle ); let result__ = FindFirstFileA(lpfilename.into().abi(), lpfindfiledata); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`*"] #[inline] @@ -954,7 +954,7 @@ where { ::windows::core::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 : *mut ::core::ffi::c_void , dwadditionalflags : FIND_FIRST_EX_FLAGS ) -> FindFileHandle ); let result__ = FindFirstFileExA(lpfilename.into().abi(), finfolevelid, lpfindfiledata, fsearchop, ::core::mem::transmute(lpsearchfilter.unwrap_or(::std::ptr::null_mut())), dwadditionalflags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -974,7 +974,7 @@ where { ::windows::core::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 : *mut ::core::ffi::c_void , dwadditionalflags : FIND_FIRST_EX_FLAGS ) -> FindFileHandle ); let result__ = FindFirstFileExW(lpfilename.into().abi(), finfolevelid, lpfindfiledata, fsearchop, ::core::mem::transmute(lpsearchfilter.unwrap_or(::std::ptr::null_mut())), dwadditionalflags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -986,7 +986,7 @@ where { ::windows::core::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().abi(), dwflags, stringlength, ::core::mem::transmute(linkname), htransaction.into()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`*"] #[inline] @@ -996,7 +996,7 @@ where { ::windows::core::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().abi(), dwflags, stringlength, ::core::mem::transmute(linkname)); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1008,7 +1008,7 @@ where { ::windows::core::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 : *mut ::core::ffi::c_void , dwadditionalflags : u32 , htransaction : super::super::Foundation:: HANDLE ) -> FindFileHandle ); let result__ = FindFirstFileTransactedA(lpfilename.into().abi(), finfolevelid, lpfindfiledata, fsearchop, ::core::mem::transmute(lpsearchfilter.unwrap_or(::std::ptr::null_mut())), dwadditionalflags, htransaction.into()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1020,7 +1020,7 @@ where { ::windows::core::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 : *mut ::core::ffi::c_void , dwadditionalflags : u32 , htransaction : super::super::Foundation:: HANDLE ) -> FindFileHandle ); let result__ = FindFirstFileTransactedW(lpfilename.into().abi(), finfolevelid, lpfindfiledata, fsearchop, ::core::mem::transmute(lpsearchfilter.unwrap_or(::std::ptr::null_mut())), dwadditionalflags, htransaction.into()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1031,7 +1031,7 @@ where { ::windows::core::link ! ( "kernel32.dll""system" fn FindFirstFileW ( lpfilename : :: windows::core::PCWSTR , lpfindfiledata : *mut WIN32_FIND_DATAW ) -> FindFileHandle ); let result__ = FindFirstFileW(lpfilename.into().abi(), lpfindfiledata); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1043,7 +1043,7 @@ where { ::windows::core::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().abi(), infolevel, lpfindstreamdata, dwflags, htransaction.into()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`*"] #[inline] @@ -1053,14 +1053,14 @@ where { ::windows::core::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().abi(), infolevel, lpfindstreamdata, dwflags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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::core::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 _); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`*"] #[inline] @@ -1070,7 +1070,7 @@ where { ::windows::core::link ! ( "kernel32.dll""system" fn FindFirstVolumeMountPointA ( lpszrootpathname : :: windows::core::PCSTR , lpszvolumemountpoint : :: windows::core::PSTR , cchbufferlength : u32 ) -> FindVolumeMointPointHandle ); let result__ = FindFirstVolumeMountPointA(lpszrootpathname.into().abi(), ::core::mem::transmute(lpszvolumemountpoint.as_ptr()), lpszvolumemountpoint.len() as _); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`*"] #[inline] @@ -1080,14 +1080,14 @@ where { ::windows::core::link ! ( "kernel32.dll""system" fn FindFirstVolumeMountPointW ( lpszrootpathname : :: windows::core::PCWSTR , lpszvolumemountpoint : :: windows::core::PWSTR , cchbufferlength : u32 ) -> FindVolumeMointPointHandle ); let result__ = FindFirstVolumeMountPointW(lpszrootpathname.into().abi(), ::core::mem::transmute(lpszvolumemountpoint.as_ptr()), lpszvolumemountpoint.len() as _); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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::core::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 _); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2597,7 +2597,7 @@ where { ::windows::core::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(), enlistmentid); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2618,7 +2618,7 @@ where { ::windows::core::link ! ( "kernel32.dll""system" fn OpenFileById ( hvolumehint : super::super::Foundation:: HANDLE , lpfileid : *const FILE_ID_DESCRIPTOR , dwdesiredaccess : FILE_ACCESS_FLAGS , 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(), lpfileid, dwdesiredaccess, dwsharemode, ::core::mem::transmute(lpsecurityattributes.unwrap_or(::std::ptr::null())), dwflagsandattributes); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2629,7 +2629,7 @@ where { ::windows::core::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(), resourcemanagerid); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2637,7 +2637,7 @@ where pub unsafe fn OpenTransaction(dwdesiredaccess: u32, transactionid: *mut ::windows::core::GUID) -> ::windows::core::Result { ::windows::core::link ! ( "ktmw32.dll""system" fn OpenTransaction ( dwdesiredaccess : u32 , transactionid : *mut :: windows::core::GUID ) -> super::super::Foundation:: HANDLE ); let result__ = OpenTransaction(dwdesiredaccess, transactionid); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2648,7 +2648,7 @@ where { ::windows::core::link ! ( "ktmw32.dll""system" fn OpenTransactionManager ( logfilename : :: windows::core::PCWSTR , desiredaccess : u32 , openoptions : u32 ) -> super::super::Foundation:: HANDLE ); let result__ = OpenTransactionManager(logfilename.into().abi(), desiredaccess, openoptions); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2656,7 +2656,7 @@ where pub unsafe fn OpenTransactionManagerById(transactionmanagerid: *const ::windows::core::GUID, desiredaccess: u32, openoptions: u32) -> ::windows::core::Result { ::windows::core::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); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_Storage_FileSystem\"`*"] #[inline] @@ -2790,7 +2790,7 @@ where { ::windows::core::link ! ( "kernel32.dll""system" fn ReOpenFile ( horiginalfile : super::super::Foundation:: HANDLE , dwdesiredaccess : FILE_ACCESS_FLAGS , dwsharemode : FILE_SHARE_MODE , dwflagsandattributes : FILE_FLAGS_AND_ATTRIBUTES ) -> super::super::Foundation:: HANDLE ); let result__ = ReOpenFile(horiginalfile.into(), dwdesiredaccess, dwsharemode, dwflagsandattributes); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 171ee364fb..1e025af0a1 100644 --- a/crates/libs/windows/src/Windows/Win32/System/ApplicationInstallationAndServicing/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/ApplicationInstallationAndServicing/mod.rs @@ -160,7 +160,7 @@ where pub unsafe fn CreateActCtxA(pactctx: *const ACTCTXA) -> ::windows::core::Result { ::windows::core::link ! ( "kernel32.dll""system" fn CreateActCtxA ( pactctx : *const ACTCTXA ) -> super::super::Foundation:: HANDLE ); let result__ = CreateActCtxA(pactctx); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_ApplicationInstallationAndServicing\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -168,7 +168,7 @@ pub unsafe fn CreateActCtxA(pactctx: *const ACTCTXA) -> ::windows::core::Result< pub unsafe fn CreateActCtxW(pactctx: *const ACTCTXW) -> ::windows::core::Result { ::windows::core::link ! ( "kernel32.dll""system" fn CreateActCtxW ( pactctx : *const ACTCTXW ) -> super::super::Foundation:: HANDLE ); let result__ = CreateActCtxW(pactctx); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 8879fb1b4d..ecc59531d3 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Console/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Console/mod.rs @@ -51,7 +51,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<*mut ::core::ffi::c_void>) -> ::windows::core::Result { ::windows::core::link ! ( "kernel32.dll""system" fn CreateConsoleScreenBuffer ( dwdesiredaccess : u32 , dwsharemode : u32 , lpsecurityattributes : *const super::super::Security:: SECURITY_ATTRIBUTES , dwflags : u32 , lpscreenbufferdata : *mut ::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_mut()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Console\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -429,7 +429,7 @@ pub unsafe fn GetNumberOfConsoleMouseButtons(lpnumberofmousebuttons: *mut u32) - pub unsafe fn GetStdHandle(nstdhandle: STD_HANDLE) -> ::windows::core::Result { ::windows::core::link ! ( "kernel32.dll""system" fn GetStdHandle ( nstdhandle : STD_HANDLE ) -> super::super::Foundation:: HANDLE ); let result__ = GetStdHandle(nstdhandle); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 b87c6c5789..93aa708b8c 100644 --- a/crates/libs/windows/src/Windows/Win32/System/DataExchange/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/DataExchange/mod.rs @@ -415,7 +415,7 @@ pub unsafe fn GetAtomNameW(natom: u16, lpbuffer: &mut [u16]) -> u32 { pub unsafe fn GetClipboardData(uformat: u32) -> ::windows::core::Result { ::windows::core::link ! ( "user32.dll""system" fn GetClipboardData ( uformat : u32 ) -> super::super::Foundation:: HANDLE ); let result__ = GetClipboardData(uformat); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_DataExchange\"`*"] #[inline] @@ -630,7 +630,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn SetClipboardData ( uformat : u32 , hmem : super::super::Foundation:: HANDLE ) -> super::super::Foundation:: HANDLE ); let result__ = SetClipboardData(uformat, hmem.into()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 ed4794608b..866df8f8ca 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 @@ -353,7 +353,7 @@ where { ::windows::core::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().abi(), symbolpath.into().abi(), ::core::mem::transmute(debugfilepath)); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -365,7 +365,7 @@ where { ::windows::core::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().abi(), symbolpath.into().abi(), ::core::mem::transmute(debugfilepath), callback, ::core::mem::transmute(callerdata.unwrap_or(::std::ptr::null()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -377,7 +377,7 @@ where { ::windows::core::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().abi(), symbolpath.into().abi(), ::core::mem::transmute(debugfilepath), callback, ::core::mem::transmute(callerdata.unwrap_or(::std::ptr::null()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -389,7 +389,7 @@ where { ::windows::core::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().abi(), symbolpath.into().abi(), ::core::mem::transmute(imagefilepath)); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -401,7 +401,7 @@ where { ::windows::core::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().abi(), symbolpath.into().abi(), ::core::mem::transmute(imagefilepath), callback, ::core::mem::transmute(callerdata.unwrap_or(::std::ptr::null()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -413,7 +413,7 @@ where { ::windows::core::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().abi(), symbolpath.into().abi(), ::core::mem::transmute(imagefilepath), callback, callerdata); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1648,7 +1648,7 @@ where { ::windows::core::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(), filename.into().abi(), ::core::mem::transmute(debugfilepath), callback, ::core::mem::transmute(callerdata.unwrap_or(::std::ptr::null()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1660,7 +1660,7 @@ where { ::windows::core::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(), filename.into().abi(), ::core::mem::transmute(debugfilepath), callback, ::core::mem::transmute(callerdata.unwrap_or(::std::ptr::null()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1672,7 +1672,7 @@ where { ::windows::core::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(), filename.into().abi(), ::core::mem::transmute(imagefilepath), callback, callerdata); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1684,7 +1684,7 @@ where { ::windows::core::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(), filename.into().abi(), ::core::mem::transmute(imagefilepath), callback, callerdata); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 c68b1e735e..9c1788377e 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 @@ -4,7 +4,7 @@ pub unsafe fn CreateToolhelp32Snapshot(dwflags: CREATE_TOOLHELP_SNAPSHOT_FLAGS, th32processid: u32) -> ::windows::core::Result { ::windows::core::link ! ( "kernel32.dll""system" fn CreateToolhelp32Snapshot ( dwflags : CREATE_TOOLHELP_SNAPSHOT_FLAGS , th32processid : u32 ) -> super::super::super::Foundation:: HANDLE ); let result__ = CreateToolhelp32Snapshot(dwflags, th32processid); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 644532a766..062637f1ce 100644 --- a/crates/libs/windows/src/Windows/Win32/System/EventLog/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/EventLog/mod.rs @@ -113,14 +113,14 @@ where { ::windows::core::link ! ( "wevtapi.dll""system" fn EvtCreateBookmark ( bookmarkxml : :: windows::core::PCWSTR ) -> EVT_HANDLE ); let result__ = EvtCreateBookmark(bookmarkxml.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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::core::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); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -254,7 +254,7 @@ where { ::windows::core::link ! ( "wevtapi.dll""system" fn EvtNextEventMetadata ( eventmetadataenum : EVT_HANDLE , flags : u32 ) -> EVT_HANDLE ); let result__ = EvtNextEventMetadata(eventmetadataenum.into(), flags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -275,7 +275,7 @@ where { ::windows::core::link ! ( "wevtapi.dll""system" fn EvtOpenChannelConfig ( session : EVT_HANDLE , channelpath : :: windows::core::PCWSTR , flags : u32 ) -> EVT_HANDLE ); let result__ = EvtOpenChannelConfig(session.into(), channelpath.into().abi(), flags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`*"] #[inline] @@ -285,7 +285,7 @@ where { ::windows::core::link ! ( "wevtapi.dll""system" fn EvtOpenChannelEnum ( session : EVT_HANDLE , flags : u32 ) -> EVT_HANDLE ); let result__ = EvtOpenChannelEnum(session.into(), flags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`*"] #[inline] @@ -295,7 +295,7 @@ where { ::windows::core::link ! ( "wevtapi.dll""system" fn EvtOpenEventMetadataEnum ( publishermetadata : EVT_HANDLE , flags : u32 ) -> EVT_HANDLE ); let result__ = EvtOpenEventMetadataEnum(publishermetadata.into(), flags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`*"] #[inline] @@ -306,7 +306,7 @@ where { ::windows::core::link ! ( "wevtapi.dll""system" fn EvtOpenLog ( session : EVT_HANDLE , path : :: windows::core::PCWSTR , flags : u32 ) -> EVT_HANDLE ); let result__ = EvtOpenLog(session.into(), path.into().abi(), flags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`*"] #[inline] @@ -316,7 +316,7 @@ where { ::windows::core::link ! ( "wevtapi.dll""system" fn EvtOpenPublisherEnum ( session : EVT_HANDLE , flags : u32 ) -> EVT_HANDLE ); let result__ = EvtOpenPublisherEnum(session.into(), flags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`*"] #[inline] @@ -328,14 +328,14 @@ where { ::windows::core::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(), publisherid.into().abi(), logfilepath.into().abi(), locale, flags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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::core::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); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`*"] #[inline] @@ -347,7 +347,7 @@ where { ::windows::core::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(), path.into().abi(), query.into().abi(), flags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -404,7 +404,7 @@ where { ::windows::core::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(), signalevent.into(), channelpath.into().abi(), query.into().abi(), bookmark.into(), ::core::mem::transmute(context.unwrap_or(::std::ptr::null())), callback, flags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -467,7 +467,7 @@ where { ::windows::core::link ! ( "advapi32.dll""system" fn OpenBackupEventLogA ( lpuncservername : :: windows::core::PCSTR , lpfilename : :: windows::core::PCSTR ) -> EventLogHandle ); let result__ = OpenBackupEventLogA(lpuncservername.into().abi(), lpfilename.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`*"] #[inline] @@ -478,7 +478,7 @@ where { ::windows::core::link ! ( "advapi32.dll""system" fn OpenBackupEventLogW ( lpuncservername : :: windows::core::PCWSTR , lpfilename : :: windows::core::PCWSTR ) -> EventLogHandle ); let result__ = OpenBackupEventLogW(lpuncservername.into().abi(), lpfilename.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`*"] #[inline] @@ -489,7 +489,7 @@ where { ::windows::core::link ! ( "advapi32.dll""system" fn OpenEventLogA ( lpuncservername : :: windows::core::PCSTR , lpsourcename : :: windows::core::PCSTR ) -> EventLogHandle ); let result__ = OpenEventLogA(lpuncservername.into().abi(), lpsourcename.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`*"] #[inline] @@ -500,7 +500,7 @@ where { ::windows::core::link ! ( "advapi32.dll""system" fn OpenEventLogW ( lpuncservername : :: windows::core::PCWSTR , lpsourcename : :: windows::core::PCWSTR ) -> EventLogHandle ); let result__ = OpenEventLogW(lpuncservername.into().abi(), lpsourcename.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -531,7 +531,7 @@ where { ::windows::core::link ! ( "advapi32.dll""system" fn RegisterEventSourceA ( lpuncservername : :: windows::core::PCSTR , lpsourcename : :: windows::core::PCSTR ) -> EventSourceHandle ); let result__ = RegisterEventSourceA(lpuncservername.into().abi(), lpsourcename.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_EventLog\"`*"] #[inline] @@ -542,7 +542,7 @@ where { ::windows::core::link ! ( "advapi32.dll""system" fn RegisterEventSourceW ( lpuncservername : :: windows::core::PCWSTR , lpsourcename : :: windows::core::PCWSTR ) -> EventSourceHandle ); let result__ = RegisterEventSourceW(lpuncservername.into().abi(), lpsourcename.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 ce76ab0771..a5341e074c 100644 --- a/crates/libs/windows/src/Windows/Win32/System/GroupPolicy/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/GroupPolicy/mod.rs @@ -54,7 +54,7 @@ where { ::windows::core::link ! ( "userenv.dll""system" fn EnterCriticalPolicySection ( bmachine : super::super::Foundation:: BOOL ) -> super::super::Foundation:: HANDLE ); let result__ = EnterCriticalPolicySection(bmachine.into()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 c8bb790ca6..4dfda8beaa 100644 --- a/crates/libs/windows/src/Windows/Win32/System/IO/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/IO/mod.rs @@ -48,7 +48,7 @@ where { ::windows::core::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(), existingcompletionport.into(), completionkey, numberofconcurrentthreads); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 0f8b83d04c..f3d3deff82 100644 --- a/crates/libs/windows/src/Windows/Win32/System/JobObjects/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/JobObjects/mod.rs @@ -18,7 +18,7 @@ where { ::windows::core::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().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -29,7 +29,7 @@ where { ::windows::core::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().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_JobObjects\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -65,7 +65,7 @@ where { ::windows::core::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(), lpname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_JobObjects\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -77,7 +77,7 @@ where { ::windows::core::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(), lpname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 4e9bcc7b30..51ddc9c0b8 100644 --- a/crates/libs/windows/src/Windows/Win32/System/LibraryLoader/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/LibraryLoader/mod.rs @@ -17,7 +17,7 @@ where { ::windows::core::link ! ( "kernel32.dll""system" fn BeginUpdateResourceA ( pfilename : :: windows::core::PCSTR , bdeleteexistingresources : super::super::Foundation:: BOOL ) -> super::super::Foundation:: HANDLE ); let result__ = BeginUpdateResourceA(pfilename.into().abi(), bdeleteexistingresources.into()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_LibraryLoader\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -29,7 +29,7 @@ where { ::windows::core::link ! ( "kernel32.dll""system" fn BeginUpdateResourceW ( pfilename : :: windows::core::PCWSTR , bdeleteexistingresources : super::super::Foundation:: BOOL ) -> super::super::Foundation:: HANDLE ); let result__ = BeginUpdateResourceW(pfilename.into().abi(), bdeleteexistingresources.into()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_LibraryLoader\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -206,7 +206,7 @@ where { ::windows::core::link ! ( "kernel32.dll""system" fn FindResourceA ( hmodule : super::super::Foundation:: HINSTANCE , lpname : :: windows::core::PCSTR , lptype : :: windows::core::PCSTR ) -> super::super::Foundation:: HRSRC ); let result__ = FindResourceA(hmodule.into(), lpname.into().abi(), lptype.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_LibraryLoader\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -219,7 +219,7 @@ where { ::windows::core::link ! ( "kernel32.dll""system" fn FindResourceExA ( hmodule : super::super::Foundation:: HINSTANCE , lptype : :: windows::core::PCSTR , lpname : :: windows::core::PCSTR , wlanguage : u16 ) -> super::super::Foundation:: HRSRC ); let result__ = FindResourceExA(hmodule.into(), lptype.into().abi(), lpname.into().abi(), wlanguage); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_LibraryLoader\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -313,7 +313,7 @@ where { ::windows::core::link ! ( "kernel32.dll""system" fn GetModuleHandleA ( lpmodulename : :: windows::core::PCSTR ) -> super::super::Foundation:: HINSTANCE ); let result__ = GetModuleHandleA(lpmodulename.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_LibraryLoader\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -344,7 +344,7 @@ where { ::windows::core::link ! ( "kernel32.dll""system" fn GetModuleHandleW ( lpmodulename : :: windows::core::PCWSTR ) -> super::super::Foundation:: HINSTANCE ); let result__ = GetModuleHandleW(lpmodulename.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_LibraryLoader\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -366,7 +366,7 @@ where { ::windows::core::link ! ( "kernel32.dll""system" fn LoadLibraryA ( lplibfilename : :: windows::core::PCSTR ) -> super::super::Foundation:: HINSTANCE ); let result__ = LoadLibraryA(lplibfilename.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_LibraryLoader\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -378,7 +378,7 @@ where { ::windows::core::link ! ( "kernel32.dll""system" fn LoadLibraryExA ( lplibfilename : :: windows::core::PCSTR , hfile : super::super::Foundation:: HANDLE , dwflags : LOAD_LIBRARY_FLAGS ) -> super::super::Foundation:: HINSTANCE ); let result__ = LoadLibraryExA(lplibfilename.into().abi(), hfile.into(), dwflags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_LibraryLoader\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -390,7 +390,7 @@ where { ::windows::core::link ! ( "kernel32.dll""system" fn LoadLibraryExW ( lplibfilename : :: windows::core::PCWSTR , hfile : super::super::Foundation:: HANDLE , dwflags : LOAD_LIBRARY_FLAGS ) -> super::super::Foundation:: HINSTANCE ); let result__ = LoadLibraryExW(lplibfilename.into().abi(), hfile.into(), dwflags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_LibraryLoader\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -401,7 +401,7 @@ where { ::windows::core::link ! ( "kernel32.dll""system" fn LoadLibraryW ( lplibfilename : :: windows::core::PCWSTR ) -> super::super::Foundation:: HINSTANCE ); let result__ = LoadLibraryW(lplibfilename.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_LibraryLoader\"`*"] #[inline] @@ -421,7 +421,7 @@ where { ::windows::core::link ! ( "kernel32.dll""system" fn LoadPackagedLibrary ( lpwlibfilename : :: windows::core::PCWSTR , reserved : u32 ) -> super::super::Foundation:: HINSTANCE ); let result__ = LoadPackagedLibrary(lpwlibfilename.into().abi(), reserved); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 e247cbc1e9..bf66c0ddf0 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Mailslots/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Mailslots/mod.rs @@ -7,7 +7,7 @@ where { ::windows::core::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().abi(), nmaxmessagesize, lreadtimeout, ::core::mem::transmute(lpsecurityattributes.unwrap_or(::std::ptr::null()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -18,7 +18,7 @@ where { ::windows::core::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().abi(), nmaxmessagesize, lreadtimeout, ::core::mem::transmute(lpsecurityattributes.unwrap_or(::std::ptr::null()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 a4993d30b8..05b050e4e3 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Memory/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Memory/mod.rs @@ -47,7 +47,7 @@ where { ::windows::core::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(), ::core::mem::transmute(securityattributes.unwrap_or(::std::ptr::null())), desiredaccess, pageprotection, allocationattributes, maximumsize, name.into().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 _)); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -59,7 +59,7 @@ where { ::windows::core::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(), ::core::mem::transmute(lpfilemappingattributes.unwrap_or(::std::ptr::null())), flprotect, dwmaximumsizehigh, dwmaximumsizelow, lpname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -71,7 +71,7 @@ where { ::windows::core::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(), ::core::mem::transmute(securityattributes.unwrap_or(::std::ptr::null())), pageprotection, maximumsize, name.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -83,7 +83,7 @@ where { ::windows::core::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(), ::core::mem::transmute(lpfilemappingattributes.unwrap_or(::std::ptr::null())), flprotect, dwmaximumsizehigh, dwmaximumsizelow, lpname.into().abi(), nndpreferred); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -95,7 +95,7 @@ where { ::windows::core::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(), ::core::mem::transmute(lpfilemappingattributes.unwrap_or(::std::ptr::null())), flprotect, dwmaximumsizehigh, dwmaximumsizelow, lpname.into().abi(), nndpreferred); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -107,7 +107,7 @@ where { ::windows::core::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(), ::core::mem::transmute(lpfilemappingattributes.unwrap_or(::std::ptr::null())), flprotect, dwmaximumsizehigh, dwmaximumsizelow, lpname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -115,7 +115,7 @@ where pub unsafe fn CreateMemoryResourceNotification(notificationtype: MEMORY_RESOURCE_NOTIFICATION_TYPE) -> ::windows::core::Result { ::windows::core::link ! ( "kernel32.dll""system" fn CreateMemoryResourceNotification ( notificationtype : MEMORY_RESOURCE_NOTIFICATION_TYPE ) -> super::super::Foundation:: HANDLE ); let result__ = CreateMemoryResourceNotification(notificationtype); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`*"] #[inline] @@ -158,7 +158,7 @@ pub unsafe fn GetMemoryErrorHandlingCapabilities(capabilities: *mut u32) -> supe pub unsafe fn GetProcessHeap() -> ::windows::core::Result { ::windows::core::link ! ( "kernel32.dll""system" fn GetProcessHeap ( ) -> HeapHandle ); let result__ = GetProcessHeap(); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`*"] #[inline] @@ -261,7 +261,7 @@ where pub unsafe fn HeapCreate(floptions: HEAP_FLAGS, dwinitialsize: usize, dwmaximumsize: usize) -> ::windows::core::Result { ::windows::core::link ! ( "kernel32.dll""system" fn HeapCreate ( floptions : HEAP_FLAGS , dwinitialsize : usize , dwmaximumsize : usize ) -> HeapHandle ); let result__ = HeapCreate(floptions, dwinitialsize, dwmaximumsize); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -575,7 +575,7 @@ where { ::windows::core::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(), lpname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -587,7 +587,7 @@ where { ::windows::core::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(), name.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Memory\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -599,7 +599,7 @@ where { ::windows::core::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(), lpname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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/Pipes/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Pipes/mod.rs index 7b712341c3..e9442a4849 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Pipes/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Pipes/mod.rs @@ -37,7 +37,7 @@ where { ::windows::core::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().abi(), dwopenmode, dwpipemode, nmaxinstances, noutbuffersize, ninbuffersize, ndefaulttimeout, ::core::mem::transmute(lpsecurityattributes.unwrap_or(::std::ptr::null()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 13b0aa8e11..a809297285 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Power/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Power/mod.rs @@ -172,7 +172,7 @@ where pub unsafe fn PowerCreateRequest(context: *const super::Threading::REASON_CONTEXT) -> ::windows::core::Result { ::windows::core::link ! ( "kernel32.dll""system" fn PowerCreateRequest ( context : *const super::Threading:: REASON_CONTEXT ) -> super::super::Foundation:: HANDLE ); let result__ = PowerCreateRequest(context); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -737,7 +737,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn RegisterPowerSettingNotification ( hrecipient : super::super::Foundation:: HANDLE , powersettingguid : *const :: windows::core::GUID , flags : u32 ) -> HPOWERNOTIFY ); let result__ = RegisterPowerSettingNotification(hrecipient.into(), powersettingguid, flags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Power\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -748,7 +748,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn RegisterSuspendResumeNotification ( hrecipient : super::super::Foundation:: HANDLE , flags : u32 ) -> HPOWERNOTIFY ); let result__ = RegisterSuspendResumeNotification(hrecipient.into(), flags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 c89fa0fe2f..af43cddfda 100644 --- a/crates/libs/windows/src/Windows/Win32/System/RemoteDesktop/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/RemoteDesktop/mod.rs @@ -574,7 +574,7 @@ where { ::windows::core::link ! ( "wtsapi32.dll""system" fn WTSVirtualChannelOpen ( hserver : super::super::Foundation:: HANDLE , sessionid : u32 , pvirtualname : :: windows::core::PCSTR ) -> HwtsVirtualChannelHandle ); let result__ = WTSVirtualChannelOpen(hserver.into(), sessionid, pvirtualname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_RemoteDesktop\"`*"] #[inline] @@ -584,7 +584,7 @@ where { ::windows::core::link ! ( "wtsapi32.dll""system" fn WTSVirtualChannelOpenEx ( sessionid : u32 , pvirtualname : :: windows::core::PCSTR , flags : u32 ) -> HwtsVirtualChannelHandle ); let result__ = WTSVirtualChannelOpenEx(sessionid, pvirtualname.into().abi(), flags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 be4b61fe92..1ab9f78754 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Services/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Services/mod.rs @@ -106,7 +106,7 @@ where { ::windows::core::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(), lpservicename.into().abi(), lpdisplayname.into().abi(), dwdesiredaccess, dwservicetype, dwstarttype, dwerrorcontrol, lpbinarypathname.into().abi(), lploadordergroup.into().abi(), ::core::mem::transmute(lpdwtagid.unwrap_or(::std::ptr::null_mut())), lpdependencies.into().abi(), lpservicestartname.into().abi(), lppassword.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Services\"`, `\"Win32_Security\"`*"] #[cfg(feature = "Win32_Security")] @@ -124,7 +124,7 @@ where { ::windows::core::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(), lpservicename.into().abi(), lpdisplayname.into().abi(), dwdesiredaccess, dwservicetype, dwstarttype, dwerrorcontrol, lpbinarypathname.into().abi(), lploadordergroup.into().abi(), ::core::mem::transmute(lpdwtagid.unwrap_or(::std::ptr::null_mut())), lpdependencies.into().abi(), lpservicestartname.into().abi(), lppassword.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -331,7 +331,7 @@ where { ::windows::core::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().abi(), lpdatabasename.into().abi(), dwdesiredaccess); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Services\"`, `\"Win32_Security\"`*"] #[cfg(feature = "Win32_Security")] @@ -343,7 +343,7 @@ where { ::windows::core::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().abi(), lpdatabasename.into().abi(), dwdesiredaccess); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Services\"`, `\"Win32_Security\"`*"] #[cfg(feature = "Win32_Security")] @@ -355,7 +355,7 @@ where { ::windows::core::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(), lpservicename.into().abi(), dwdesiredaccess); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Services\"`, `\"Win32_Security\"`*"] #[cfg(feature = "Win32_Security")] @@ -367,7 +367,7 @@ where { ::windows::core::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(), lpservicename.into().abi(), dwdesiredaccess); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -477,7 +477,7 @@ where { ::windows::core::link ! ( "advapi32.dll""system" fn RegisterServiceCtrlHandlerA ( lpservicename : :: windows::core::PCSTR , lphandlerproc : LPHANDLER_FUNCTION ) -> SERVICE_STATUS_HANDLE ); let result__ = RegisterServiceCtrlHandlerA(lpservicename.into().abi(), lphandlerproc); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Services\"`*"] #[inline] @@ -487,7 +487,7 @@ where { ::windows::core::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().abi(), lphandlerproc, ::core::mem::transmute(lpcontext.unwrap_or(::std::ptr::null()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Services\"`*"] #[inline] @@ -497,7 +497,7 @@ where { ::windows::core::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().abi(), lphandlerproc, ::core::mem::transmute(lpcontext.unwrap_or(::std::ptr::null()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Services\"`*"] #[inline] @@ -507,7 +507,7 @@ where { ::windows::core::link ! ( "advapi32.dll""system" fn RegisterServiceCtrlHandlerW ( lpservicename : :: windows::core::PCWSTR , lphandlerproc : LPHANDLER_FUNCTION ) -> SERVICE_STATUS_HANDLE ); let result__ = RegisterServiceCtrlHandlerW(lpservicename.into().abi(), lphandlerproc); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 deafd8a5f7..c48e72520f 100644 --- a/crates/libs/windows/src/Windows/Win32/System/StationsAndDesktops/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/StationsAndDesktops/mod.rs @@ -72,7 +72,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn CreateDesktopA ( lpszdesktop : :: windows::core::PCSTR , lpszdevice : :: windows::core::PCSTR , pdevmode : *mut super::super::Graphics::Gdi:: DEVMODEA , dwflags : DESKTOP_CONTROL_FLAGS , dwdesiredaccess : u32 , lpsa : *const super::super::Security:: SECURITY_ATTRIBUTES ) -> HDESK ); let result__ = CreateDesktopA(lpszdesktop.into().abi(), lpszdevice.into().abi(), ::core::mem::transmute(pdevmode.unwrap_or(::std::ptr::null_mut())), dwflags, dwdesiredaccess, ::core::mem::transmute(lpsa.unwrap_or(::std::ptr::null()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -84,7 +84,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn CreateDesktopExA ( lpszdesktop : :: windows::core::PCSTR , lpszdevice : :: windows::core::PCSTR , pdevmode : *mut super::super::Graphics::Gdi:: DEVMODEA , dwflags : DESKTOP_CONTROL_FLAGS , dwdesiredaccess : u32 , lpsa : *const super::super::Security:: SECURITY_ATTRIBUTES , ulheapsize : u32 , pvoid : *mut ::core::ffi::c_void ) -> HDESK ); let result__ = CreateDesktopExA(lpszdesktop.into().abi(), lpszdevice.into().abi(), ::core::mem::transmute(pdevmode.unwrap_or(::std::ptr::null_mut())), dwflags, dwdesiredaccess, ::core::mem::transmute(lpsa.unwrap_or(::std::ptr::null())), ulheapsize, ::core::mem::transmute(pvoid.unwrap_or(::std::ptr::null_mut()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -96,7 +96,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn CreateDesktopExW ( lpszdesktop : :: windows::core::PCWSTR , lpszdevice : :: windows::core::PCWSTR , pdevmode : *mut super::super::Graphics::Gdi:: DEVMODEW , dwflags : DESKTOP_CONTROL_FLAGS , dwdesiredaccess : u32 , lpsa : *const super::super::Security:: SECURITY_ATTRIBUTES , ulheapsize : u32 , pvoid : *mut ::core::ffi::c_void ) -> HDESK ); let result__ = CreateDesktopExW(lpszdesktop.into().abi(), lpszdevice.into().abi(), ::core::mem::transmute(pdevmode.unwrap_or(::std::ptr::null_mut())), dwflags, dwdesiredaccess, ::core::mem::transmute(lpsa.unwrap_or(::std::ptr::null())), ulheapsize, ::core::mem::transmute(pvoid.unwrap_or(::std::ptr::null_mut()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -108,7 +108,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn CreateDesktopW ( lpszdesktop : :: windows::core::PCWSTR , lpszdevice : :: windows::core::PCWSTR , pdevmode : *mut super::super::Graphics::Gdi:: DEVMODEW , dwflags : DESKTOP_CONTROL_FLAGS , dwdesiredaccess : u32 , lpsa : *const super::super::Security:: SECURITY_ATTRIBUTES ) -> HDESK ); let result__ = CreateDesktopW(lpszdesktop.into().abi(), lpszdevice.into().abi(), ::core::mem::transmute(pdevmode.unwrap_or(::std::ptr::null_mut())), dwflags, dwdesiredaccess, ::core::mem::transmute(lpsa.unwrap_or(::std::ptr::null()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -119,7 +119,7 @@ where { ::windows::core::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().abi(), dwflags, dwdesiredaccess, ::core::mem::transmute(lpsa.unwrap_or(::std::ptr::null()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -130,7 +130,7 @@ where { ::windows::core::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().abi(), dwflags, dwdesiredaccess, ::core::mem::transmute(lpsa.unwrap_or(::std::ptr::null()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -190,14 +190,14 @@ where pub unsafe fn GetProcessWindowStation() -> ::windows::core::Result { ::windows::core::link ! ( "user32.dll""system" fn GetProcessWindowStation ( ) -> HWINSTA ); let result__ = GetProcessWindowStation(); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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::core::link ! ( "user32.dll""system" fn GetThreadDesktop ( dwthreadid : u32 ) -> HDESK ); let result__ = GetThreadDesktop(dwthreadid); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_StationsAndDesktops\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -229,7 +229,7 @@ where { ::windows::core::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().abi(), dwflags, finherit.into(), dwdesiredaccess); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_StationsAndDesktops\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -241,7 +241,7 @@ where { ::windows::core::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().abi(), dwflags, finherit.into(), dwdesiredaccess); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_StationsAndDesktops\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -252,7 +252,7 @@ where { ::windows::core::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(), dwdesiredaccess); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_StationsAndDesktops\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -264,7 +264,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn OpenWindowStationA ( lpszwinsta : :: windows::core::PCSTR , finherit : super::super::Foundation:: BOOL , dwdesiredaccess : u32 ) -> HWINSTA ); let result__ = OpenWindowStationA(lpszwinsta.into().abi(), finherit.into(), dwdesiredaccess); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_StationsAndDesktops\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -276,7 +276,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn OpenWindowStationW ( lpszwinsta : :: windows::core::PCWSTR , finherit : super::super::Foundation:: BOOL , dwdesiredaccess : u32 ) -> HWINSTA ); let result__ = OpenWindowStationW(lpszwinsta.into().abi(), finherit.into(), dwdesiredaccess); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 6066ff8d63..2274253d6a 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Threading/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Threading/mod.rs @@ -137,7 +137,7 @@ where { ::windows::core::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().abi(), secondtask.into().abi(), taskindex); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -149,7 +149,7 @@ where { ::windows::core::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().abi(), secondtask.into().abi(), taskindex); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -160,7 +160,7 @@ where { ::windows::core::link ! ( "avrt.dll""system" fn AvSetMmThreadCharacteristicsA ( taskname : :: windows::core::PCSTR , taskindex : *mut u32 ) -> super::super::Foundation:: HANDLE ); let result__ = AvSetMmThreadCharacteristicsA(taskname.into().abi(), taskindex); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -171,7 +171,7 @@ where { ::windows::core::link ! ( "avrt.dll""system" fn AvSetMmThreadCharacteristicsW ( taskname : :: windows::core::PCWSTR , taskindex : *mut u32 ) -> super::super::Foundation:: HANDLE ); let result__ = AvSetMmThreadCharacteristicsW(taskname.into().abi(), taskindex); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -303,7 +303,7 @@ where { ::windows::core::link ! ( "kernel32.dll""system" fn CreateBoundaryDescriptorA ( name : :: windows::core::PCSTR , flags : u32 ) -> BoundaryDescriptorHandle ); let result__ = CreateBoundaryDescriptorA(name.into().abi(), flags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`*"] #[inline] @@ -325,7 +325,7 @@ where { ::windows::core::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(), binitialstate.into(), lpname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -336,7 +336,7 @@ where { ::windows::core::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().abi(), dwflags, dwdesiredaccess); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -347,7 +347,7 @@ where { ::windows::core::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().abi(), dwflags, dwdesiredaccess); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -360,7 +360,7 @@ where { ::windows::core::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(), binitialstate.into(), lpname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`*"] #[inline] @@ -384,7 +384,7 @@ where { ::windows::core::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(), lpname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -395,7 +395,7 @@ where { ::windows::core::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().abi(), dwflags, dwdesiredaccess); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -406,7 +406,7 @@ where { ::windows::core::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().abi(), dwflags, dwdesiredaccess); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -418,7 +418,7 @@ where { ::windows::core::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(), lpname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -429,7 +429,7 @@ where { ::windows::core::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().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -526,7 +526,7 @@ where { ::windows::core::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(), ::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()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -538,7 +538,7 @@ where { ::windows::core::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(), ::core::mem::transmute(lpthreadattributes.unwrap_or(::std::ptr::null())), dwstacksize, lpstartaddress, ::core::mem::transmute(lpparameter.unwrap_or(::std::ptr::null())), dwcreationflags, lpattributelist.into(), ::core::mem::transmute(lpthreadid.unwrap_or(::std::ptr::null_mut()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -549,7 +549,7 @@ where { ::windows::core::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().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -560,7 +560,7 @@ where { ::windows::core::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().abi(), dwflags, dwdesiredaccess); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -571,7 +571,7 @@ where { ::windows::core::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().abi(), dwflags, dwdesiredaccess); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -582,7 +582,7 @@ where { ::windows::core::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().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -590,7 +590,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::core::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()))); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`*"] #[inline] @@ -638,7 +638,7 @@ pub unsafe fn CreateThreadpoolWork(pfnwk: PTP_WORK_CALLBACK, pv: ::core::option: pub unsafe fn CreateTimerQueue() -> ::windows::core::Result { ::windows::core::link ! ( "kernel32.dll""system" fn CreateTimerQueue ( ) -> super::super::Foundation:: HANDLE ); let result__ = CreateTimerQueue(); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -673,7 +673,7 @@ where { ::windows::core::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().abi(), dwflags, dwdesiredaccess); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -685,7 +685,7 @@ where { ::windows::core::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(), lptimername.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`*"] #[inline] @@ -1608,7 +1608,7 @@ where { ::windows::core::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(), lpname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1620,7 +1620,7 @@ where { ::windows::core::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(), lpname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1632,7 +1632,7 @@ where { ::windows::core::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(), lpname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`*"] #[inline] @@ -1661,7 +1661,7 @@ where { ::windows::core::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(), dwprocessid); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -1683,7 +1683,7 @@ where { ::windows::core::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(), lpname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_System_Threading\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -1694,7 +1694,7 @@ where { ::windows::core::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(), dwthreadid); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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::core::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(), lptimername.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 ecc1aa2a75..ee2115d3f3 100644 --- a/crates/libs/windows/src/Windows/Win32/UI/Controls/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/UI/Controls/mod.rs @@ -118,7 +118,7 @@ where { ::windows::core::link ! ( "comctl32.dll""system" fn CreateMappedBitmap ( hinstance : super::super::Foundation:: HINSTANCE , idbitmap : isize , wflags : u32 , lpcolormap : *const COLORMAP , inummaps : i32 ) -> super::super::Graphics::Gdi:: HBITMAP ); let result__ = CreateMappedBitmap(hinstance.into(), idbitmap, wflags, ::core::mem::transmute(lpcolormap.unwrap_or(::std::ptr::null())), inummaps); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -162,7 +162,7 @@ where pub unsafe fn CreateSyntheticPointerDevice(pointertype: super::WindowsAndMessaging::POINTER_INPUT_TYPE, maxcount: u32, mode: POINTER_FEEDBACK_MODE) -> ::windows::core::Result { ::windows::core::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); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 527dcb90b8..44eb208d4b 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 @@ -7,7 +7,7 @@ where { ::windows::core::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(), flags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_Input_KeyboardAndMouse\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -170,7 +170,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn LoadKeyboardLayoutA ( pwszklid : :: windows::core::PCSTR , flags : ACTIVATE_KEYBOARD_LAYOUT_FLAGS ) -> super::super::TextServices:: HKL ); let result__ = LoadKeyboardLayoutA(pwszklid.into().abi(), flags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_Input_KeyboardAndMouse\"`, `\"Win32_UI_TextServices\"`*"] #[cfg(feature = "Win32_UI_TextServices")] @@ -181,7 +181,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn LoadKeyboardLayoutW ( pwszklid : :: windows::core::PCWSTR , flags : ACTIVATE_KEYBOARD_LAYOUT_FLAGS ) -> super::super::TextServices:: HKL ); let result__ = LoadKeyboardLayoutW(pwszklid.into().abi(), flags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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 5573039dac..f38c315bff 100644 --- a/crates/libs/windows/src/Windows/Win32/UI/WindowsAndMessaging/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/UI/WindowsAndMessaging/mod.rs @@ -79,7 +79,7 @@ where pub unsafe fn BeginDeferWindowPos(nnumwindows: i32) -> ::windows::core::Result { ::windows::core::link ! ( "user32.dll""system" fn BeginDeferWindowPos ( nnumwindows : i32 ) -> HDWP ); let result__ = BeginDeferWindowPos(nnumwindows); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -431,7 +431,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn CopyIcon ( hicon : HICON ) -> HICON ); let result__ = CopyIcon(hicon.into()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -442,21 +442,21 @@ where { ::windows::core::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(), r#type, cx, cy, flags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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::core::link ! ( "user32.dll""system" fn CreateAcceleratorTableA ( paccel : *const ACCEL , caccel : i32 ) -> HACCEL ); let result__ = CreateAcceleratorTableA(::core::mem::transmute(paccel.as_ptr()), paccel.len() as _); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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::core::link ! ( "user32.dll""system" fn CreateAcceleratorTableW ( paccel : *const ACCEL , caccel : i32 ) -> HACCEL ); let result__ = CreateAcceleratorTableW(::core::mem::transmute(paccel.as_ptr()), paccel.len() as _); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -478,7 +478,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn CreateCursor ( hinst : super::super::Foundation:: HINSTANCE , 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(), xhotspot, yhotspot, nwidth, nheight, pvandplane, pvxorplane); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -539,7 +539,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn CreateIcon ( hinstance : super::super::Foundation:: HINSTANCE , nwidth : i32 , nheight : i32 , cplanes : u8 , cbitspixel : u8 , lpbandbits : *const u8 , lpbxorbits : *const u8 ) -> HICON ); let result__ = CreateIcon(hinstance.into(), nwidth, nheight, cplanes, cbitspixel, lpbandbits, lpbxorbits); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -550,7 +550,7 @@ where { ::windows::core::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(), dwver); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -561,7 +561,7 @@ where { ::windows::core::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(), dwver, cxdesired, cydesired, flags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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"))] @@ -569,7 +569,7 @@ where pub unsafe fn CreateIconIndirect(piconinfo: *const ICONINFO) -> ::windows::core::Result { ::windows::core::link ! ( "user32.dll""system" fn CreateIconIndirect ( piconinfo : *const ICONINFO ) -> HICON ); let result__ = CreateIconIndirect(piconinfo); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -604,14 +604,14 @@ where pub unsafe fn CreateMenu() -> ::windows::core::Result { ::windows::core::link ! ( "user32.dll""system" fn CreateMenu ( ) -> HMENU ); let result__ = CreateMenu(); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`*"] #[inline] pub unsafe fn CreatePopupMenu() -> ::windows::core::Result { ::windows::core::link ! ( "user32.dll""system" fn CreatePopupMenu ( ) -> HMENU ); let result__ = CreatePopupMenu(); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`*"] #[inline] @@ -760,7 +760,7 @@ where { ::windows::core::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(), hwnd.into(), hwndinsertafter.into(), x, y, cx, cy, uflags); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2293,7 +2293,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn LoadAcceleratorsA ( hinstance : super::super::Foundation:: HINSTANCE , lptablename : :: windows::core::PCSTR ) -> HACCEL ); let result__ = LoadAcceleratorsA(hinstance.into(), lptablename.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2305,7 +2305,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn LoadAcceleratorsW ( hinstance : super::super::Foundation:: HINSTANCE , lptablename : :: windows::core::PCWSTR ) -> HACCEL ); let result__ = LoadAcceleratorsW(hinstance.into(), lptablename.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2317,7 +2317,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn LoadCursorA ( hinstance : super::super::Foundation:: HINSTANCE , lpcursorname : :: windows::core::PCSTR ) -> HCURSOR ); let result__ = LoadCursorA(hinstance.into(), lpcursorname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`*"] #[inline] @@ -2327,7 +2327,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn LoadCursorFromFileA ( lpfilename : :: windows::core::PCSTR ) -> HCURSOR ); let result__ = LoadCursorFromFileA(lpfilename.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`*"] #[inline] @@ -2337,7 +2337,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn LoadCursorFromFileW ( lpfilename : :: windows::core::PCWSTR ) -> HCURSOR ); let result__ = LoadCursorFromFileW(lpfilename.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2349,7 +2349,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn LoadCursorW ( hinstance : super::super::Foundation:: HINSTANCE , lpcursorname : :: windows::core::PCWSTR ) -> HCURSOR ); let result__ = LoadCursorW(hinstance.into(), lpcursorname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2361,7 +2361,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn LoadIconA ( hinstance : super::super::Foundation:: HINSTANCE , lpiconname : :: windows::core::PCSTR ) -> HICON ); let result__ = LoadIconA(hinstance.into(), lpiconname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2373,7 +2373,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn LoadIconW ( hinstance : super::super::Foundation:: HINSTANCE , lpiconname : :: windows::core::PCWSTR ) -> HICON ); let result__ = LoadIconW(hinstance.into(), lpiconname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2385,7 +2385,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn LoadImageA ( hinst : super::super::Foundation:: HINSTANCE , name : :: windows::core::PCSTR , r#type : GDI_IMAGE_TYPE , cx : i32 , cy : i32 , fuload : IMAGE_FLAGS ) -> super::super::Foundation:: HANDLE ); let result__ = LoadImageA(hinst.into(), name.into().abi(), r#type, cx, cy, fuload); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2397,7 +2397,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn LoadImageW ( hinst : super::super::Foundation:: HINSTANCE , name : :: windows::core::PCWSTR , r#type : GDI_IMAGE_TYPE , cx : i32 , cy : i32 , fuload : IMAGE_FLAGS ) -> super::super::Foundation:: HANDLE ); let result__ = LoadImageW(hinst.into(), name.into().abi(), r#type, cx, cy, fuload); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2409,21 +2409,21 @@ where { ::windows::core::link ! ( "user32.dll""system" fn LoadMenuA ( hinstance : super::super::Foundation:: HINSTANCE , lpmenuname : :: windows::core::PCSTR ) -> HMENU ); let result__ = LoadMenuA(hinstance.into(), lpmenuname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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::core::link ! ( "user32.dll""system" fn LoadMenuIndirectA ( lpmenutemplate : *const ::core::ffi::c_void ) -> HMENU ); let result__ = LoadMenuIndirectA(lpmenutemplate); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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::core::link ! ( "user32.dll""system" fn LoadMenuIndirectW ( lpmenutemplate : *const ::core::ffi::c_void ) -> HMENU ); let result__ = LoadMenuIndirectW(lpmenutemplate); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -2435,7 +2435,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn LoadMenuW ( hinstance : super::super::Foundation:: HINSTANCE , lpmenuname : :: windows::core::PCWSTR ) -> HMENU ); let result__ = LoadMenuW(hinstance.into(), lpmenuname.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -3109,7 +3109,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn RemovePropA ( hwnd : super::super::Foundation:: HWND , lpstring : :: windows::core::PCSTR ) -> super::super::Foundation:: HANDLE ); let result__ = RemovePropA(hwnd.into(), lpstring.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -3121,7 +3121,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn RemovePropW ( hwnd : super::super::Foundation:: HWND , lpstring : :: windows::core::PCWSTR ) -> super::super::Foundation:: HANDLE ); let result__ = RemovePropW(hwnd.into(), lpstring.into().abi()); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -3716,7 +3716,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn SetWindowsHookExA ( idhook : WINDOWS_HOOK_ID , lpfn : HOOKPROC , hmod : super::super::Foundation:: HINSTANCE , dwthreadid : u32 ) -> HHOOK ); let result__ = SetWindowsHookExA(idhook, lpfn, hmod.into(), dwthreadid); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || result__).ok_or_else(::windows::core::Error::from_win32) } #[doc = "*Required features: `\"Win32_UI_WindowsAndMessaging\"`, `\"Win32_Foundation\"`*"] #[cfg(feature = "Win32_Foundation")] @@ -3727,7 +3727,7 @@ where { ::windows::core::link ! ( "user32.dll""system" fn SetWindowsHookExW ( idhook : WINDOWS_HOOK_ID , lpfn : HOOKPROC , hmod : super::super::Foundation:: HINSTANCE , dwthreadid : u32 ) -> HHOOK ); let result__ = SetWindowsHookExW(idhook, lpfn, hmod.into(), dwthreadid); - (!result__.is_invalid()).then(|| result__).ok_or_else(::windows::core::Error::from_win32) + ::windows::core::then(!result__.is_invalid(), || 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/libs/windows/src/core/hresult.rs b/crates/libs/windows/src/core/hresult.rs index 2adc79215f..0f3b23f100 100644 --- a/crates/libs/windows/src/core/hresult.rs +++ b/crates/libs/windows/src/core/hresult.rs @@ -128,7 +128,7 @@ impl std::fmt::Display for HRESULT { impl std::fmt::Debug for HRESULT { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.write_fmt(format_args!("HRESULT({self})")) + f.write_fmt(format_args!("HRESULT({})", self)) } } diff --git a/crates/libs/windows/src/core/inspectable.rs b/crates/libs/windows/src/core/inspectable.rs index 137ab271f4..4aefb7e0a7 100644 --- a/crates/libs/windows/src/core/inspectable.rs +++ b/crates/libs/windows/src/core/inspectable.rs @@ -57,7 +57,7 @@ impl std::fmt::Debug for IInspectable { let name = self.cast::().and_then(|s| s.ToString()).or_else(|_| self.GetRuntimeClassName()).unwrap_or_default(); - write!(f, "{:?} {name}", self.0) + write!(f, "{:?} {}", self.0, name) } } diff --git a/crates/libs/windows/src/core/mod.rs b/crates/libs/windows/src/core/mod.rs index b0f78e7c7a..5b8e103e89 100644 --- a/crates/libs/windows/src/core/mod.rs +++ b/crates/libs/windows/src/core/mod.rs @@ -169,3 +169,22 @@ macro_rules! link { #[doc(hidden)] pub use crate::link; + +// This is a workaround since 1.48 does not include `bool::then_some`. +fn then_some(value: bool, t: T) -> Option { + if value { + Some(t) + } else { + None + } +} + +// This is a workaround since 1.48 does not include `bool::then`. +#[doc(hidden)] +pub fn then T>(value: bool, f: F) -> Option { + if value { + Some(f()) + } else { + None + } +} diff --git a/crates/libs/windows/src/core/sha1.rs b/crates/libs/windows/src/core/sha1.rs index 2d38b0124e..5962a3d022 100644 --- a/crates/libs/windows/src/core/sha1.rs +++ b/crates/libs/windows/src/core/sha1.rs @@ -326,7 +326,7 @@ impl Digest { impl std::fmt::Display for Digest { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { for i in self.data.iter() { - write!(f, "{i:08x}")?; + write!(f, "{:08x}", i)?; } Ok(()) } diff --git a/crates/libs/windows/src/core/strings/bstr.rs b/crates/libs/windows/src/core/strings/bstr.rs index be5ecd83fd..a465f901e0 100644 --- a/crates/libs/windows/src/core/strings/bstr.rs +++ b/crates/libs/windows/src/core/strings/bstr.rs @@ -99,7 +99,7 @@ impl std::fmt::Display for BSTR { } impl std::fmt::Debug for BSTR { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - std::write!(f, "{self}") + std::write!(f, "{}", self) } } impl std::cmp::PartialEq for BSTR { diff --git a/crates/libs/windows/src/core/strings/hstring.rs b/crates/libs/windows/src/core/strings/hstring.rs index 81605c071e..52e1973f3d 100644 --- a/crates/libs/windows/src/core/strings/hstring.rs +++ b/crates/libs/windows/src/core/strings/hstring.rs @@ -20,7 +20,7 @@ impl HSTRING { } /// Returns the length of the string. - pub const fn len(&self) -> usize { + pub fn len(&self) -> usize { if let Some(header) = self.get_header() { header.len as usize } else { @@ -29,12 +29,12 @@ impl HSTRING { } /// Get the string as 16-bit wide characters (wchars). - pub const fn as_wide(&self) -> &[u16] { + pub fn as_wide(&self) -> &[u16] { unsafe { std::slice::from_raw_parts(self.as_ptr(), self.len()) } } /// Returns a raw pointer to the `HSTRING` buffer. - pub const fn as_ptr(&self) -> *const u16 { + pub fn as_ptr(&self) -> *const u16 { if let Some(header) = self.get_header() { header.data } else { @@ -82,7 +82,7 @@ impl HSTRING { Ok(Self(std::ptr::NonNull::new(ptr))) } - const fn get_header(&self) -> Option<&Header> { + 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)) } @@ -150,7 +150,7 @@ impl std::fmt::Display for HSTRING { impl std::fmt::Debug for HSTRING { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "\"{self}\"") + write!(f, "\"{}\"", self) } } diff --git a/crates/libs/windows/src/core/weak_ref_count.rs b/crates/libs/windows/src/core/weak_ref_count.rs index cf557bad02..4c18cd8f44 100644 --- a/crates/libs/windows/src/core/weak_ref_count.rs +++ b/crates/libs/windows/src/core/weak_ref_count.rs @@ -13,11 +13,11 @@ impl WeakRefCount { } pub fn add_ref(&self) -> u32 { - self.0.fetch_update(Ordering::Relaxed, Ordering::Relaxed, |count_or_pointer| (!is_weak_ref(count_or_pointer)).then_some(count_or_pointer + 1)).map(|u| u as u32 + 1).unwrap_or_else(|pointer| unsafe { TearOff::decode(pointer).strong_count.add_ref() }) + self.0.fetch_update(Ordering::Relaxed, Ordering::Relaxed, |count_or_pointer| then_some(!is_weak_ref(count_or_pointer), count_or_pointer + 1)).map(|u| u as u32 + 1).unwrap_or_else(|pointer| unsafe { TearOff::decode(pointer).strong_count.add_ref() }) } pub fn release(&self) -> u32 { - self.0.fetch_update(Ordering::Release, Ordering::Relaxed, |count_or_pointer| (!is_weak_ref(count_or_pointer)).then_some(count_or_pointer - 1)).map(|u| u as u32 - 1).unwrap_or_else(|pointer| unsafe { + self.0.fetch_update(Ordering::Release, Ordering::Relaxed, |count_or_pointer| then_some(!is_weak_ref(count_or_pointer), count_or_pointer - 1)).map(|u| u as u32 - 1).unwrap_or_else(|pointer| unsafe { let tear_off = TearOff::decode(pointer); let remaining = tear_off.strong_count.release(); @@ -214,7 +214,7 @@ impl TearOff { .fetch_update(Ordering::Acquire, Ordering::Relaxed, |count| { // Attempt to acquire a strong reference count to stabilize the object for the duration // of the `QueryInterface` call. - (count != 0).then_some(count + 1) + then_some(count != 0, count + 1) }) .map(|_| { // Let the object respond to the upgrade query. diff --git a/crates/tests/component/src/bindings.rs b/crates/tests/component/src/bindings.rs index 1fcb633184..f69554909c 100644 --- a/crates/tests/component/src/bindings.rs +++ b/crates/tests/component/src/bindings.rs @@ -50,14 +50,14 @@ impl Class { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).Int32Array)(::windows::core::Vtable::as_raw(this), a.len() as u32, a.as_ptr(), b.len() as u32, b.as_mut_ptr(), c.set_abi_len(), c as *mut _ as _, ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).Int32Array)(::windows::core::Vtable::as_raw(this), a.len() as u32, a.as_ptr(), b.len() as u32, b.as_mut_ptr(), c.set_abi_len(), c as *mut _ as _, ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } pub fn StringArray(&self, a: &[::windows::core::HSTRING], b: &mut [::windows::core::HSTRING], c: &mut ::windows::core::Array<::windows::core::HSTRING>) -> ::windows::core::Result<::windows::core::Array<::windows::core::HSTRING>> { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).StringArray)(::windows::core::Vtable::as_raw(this), a.len() as u32, ::core::mem::transmute(a.as_ptr()), b.len() as u32, ::core::mem::transmute_copy(&b), c.set_abi_len(), c as *mut _ as _, ::windows::core::Array::<::windows::core::HSTRING>::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).StringArray)(::windows::core::Vtable::as_raw(this), a.len() as u32, ::core::mem::transmute(a.as_ptr()), b.len() as u32, ::core::mem::transmute_copy(&b), c.set_abi_len(), c as *mut _ as _, ::windows::core::Array::<::windows::core::HSTRING>::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } } diff --git a/crates/tests/component_client/src/bindings.rs b/crates/tests/component_client/src/bindings.rs index 1fcb633184..f69554909c 100644 --- a/crates/tests/component_client/src/bindings.rs +++ b/crates/tests/component_client/src/bindings.rs @@ -50,14 +50,14 @@ impl Class { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).Int32Array)(::windows::core::Vtable::as_raw(this), a.len() as u32, a.as_ptr(), b.len() as u32, b.as_mut_ptr(), c.set_abi_len(), c as *mut _ as _, ::windows::core::Array::::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).Int32Array)(::windows::core::Vtable::as_raw(this), a.len() as u32, a.as_ptr(), b.len() as u32, b.as_mut_ptr(), c.set_abi_len(), c as *mut _ as _, ::windows::core::Array::::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } pub fn StringArray(&self, a: &[::windows::core::HSTRING], b: &mut [::windows::core::HSTRING], c: &mut ::windows::core::Array<::windows::core::HSTRING>) -> ::windows::core::Result<::windows::core::Array<::windows::core::HSTRING>> { let this = self; unsafe { let mut result__ = ::core::mem::MaybeUninit::zeroed(); - (::windows::core::Vtable::vtable(this).StringArray)(::windows::core::Vtable::as_raw(this), a.len() as u32, ::core::mem::transmute(a.as_ptr()), b.len() as u32, ::core::mem::transmute_copy(&b), c.set_abi_len(), c as *mut _ as _, ::windows::core::Array::<::windows::core::HSTRING>::set_abi_len(result__.assume_init_mut()), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) + (::windows::core::Vtable::vtable(this).StringArray)(::windows::core::Vtable::as_raw(this), a.len() as u32, ::core::mem::transmute(a.as_ptr()), b.len() as u32, ::core::mem::transmute_copy(&b), c.set_abi_len(), c as *mut _ as _, ::windows::core::Array::<::windows::core::HSTRING>::set_abi_len(::std::mem::transmute(&mut result__)), result__.as_mut_ptr() as *mut _ as _).and_then(|| result__.assume_init()) } } } diff --git a/crates/tests/msrv/Cargo.toml b/crates/tests/msrv/Cargo.toml new file mode 100644 index 0000000000..6335d34081 --- /dev/null +++ b/crates/tests/msrv/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "test_msrv" +version = "0.0.0" +edition = "2018" + +[dependencies.windows] +path = "../../libs/windows" +features = [ + "Foundation", + "Globalization", + "Win32_Foundation", + "Win32_Graphics_Direct2D", +] diff --git a/crates/tests/msrv/src/lib.rs b/crates/tests/msrv/src/lib.rs new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/crates/tests/msrv/src/lib.rs @@ -0,0 +1 @@ + diff --git a/crates/tools/sys/src/main.rs b/crates/tools/sys/src/main.rs index d8123f9239..92d66b00c0 100644 --- a/crates/tools/sys/src/main.rs +++ b/crates/tools/sys/src/main.rs @@ -80,7 +80,6 @@ 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" [package.metadata.docs.rs] default-target = "x86_64-pc-windows-msvc" diff --git a/crates/tools/windows/src/main.rs b/crates/tools/windows/src/main.rs index be0a01008d..4a33cf7ee3 100644 --- a/crates/tools/windows/src/main.rs +++ b/crates/tools/windows/src/main.rs @@ -50,7 +50,6 @@ 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.64" [package.metadata.docs.rs] default-target = "x86_64-pc-windows-msvc" diff --git a/crates/tools/yml/src/main.rs b/crates/tools/yml/src/main.rs index 7b08f950d5..10678050db 100644 --- a/crates/tools/yml/src/main.rs +++ b/crates/tools/yml/src/main.rs @@ -149,7 +149,7 @@ jobs: .to_string(); for name in crates(false) { - write!(&mut yml, "\n cargo clippy -p {name} &&").unwrap(); + write!(&mut yml, "\n cargo clippy -p {name} -- -A clippy::uninlined_format_args &&").unwrap(); } yml.truncate(yml.len() - 3);