From 3c9db4d61f4b92f5a568a71fcafccdc0a4a285b9 Mon Sep 17 00:00:00 2001 From: iancormac84 Date: Sat, 21 Dec 2024 22:05:07 -0400 Subject: [PATCH 1/2] Fix and test for bindgen for methods and functions that have a trailing array parameter that is confused for a result value and returned as such. --- crates/libs/bindgen/src/types/cpp_method.rs | 2 +- .../bindgen/src/interface_array_return.rs | 129 ++++++++++++++++++ crates/tests/bindgen/src/lib.rs | 1 + crates/tools/bindgen/src/main.rs | 1 + 4 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 crates/tests/bindgen/src/interface_array_return.rs diff --git a/crates/libs/bindgen/src/types/cpp_method.rs b/crates/libs/bindgen/src/types/cpp_method.rs index 02e20f4aa0..8bd368a807 100644 --- a/crates/libs/bindgen/src/types/cpp_method.rs +++ b/crates/libs/bindgen/src/types/cpp_method.rs @@ -825,7 +825,7 @@ fn is_param_retval(ty: &Type, param: Param, hint: ParamHint) -> bool { { return false; } - if hint.is_array() { + if ParamHint::from_param(param).is_array() { return false; } diff --git a/crates/tests/bindgen/src/interface_array_return.rs b/crates/tests/bindgen/src/interface_array_return.rs new file mode 100644 index 0000000000..5869e0d508 --- /dev/null +++ b/crates/tests/bindgen/src/interface_array_return.rs @@ -0,0 +1,129 @@ +#![allow( + non_snake_case, + non_upper_case_globals, + non_camel_case_types, + dead_code, + clippy::all +)] + +windows_core::imp::define_interface!( + IDispatch, + IDispatch_Vtbl, + 0x00020400_0000_0000_c000_000000000046 +); +windows_core::imp::interface_hierarchy!(IDispatch, windows_core::IUnknown); +impl IDispatch { + pub unsafe fn GetTypeInfoCount(&self) -> windows_core::Result { + unsafe { + let mut result__ = core::mem::zeroed(); + (windows_core::Interface::vtable(self).GetTypeInfoCount)( + windows_core::Interface::as_raw(self), + &mut result__, + ) + .map(|| result__) + } + } + pub unsafe fn GetIDsOfNames( + &self, + riid: *const windows_core::GUID, + rgsznames: *const windows_core::PCWSTR, + cnames: u32, + lcid: u32, + rgdispid: *mut i32, + ) -> windows_core::Result<()> { + unsafe { + (windows_core::Interface::vtable(self).GetIDsOfNames)( + windows_core::Interface::as_raw(self), + riid, + rgsznames, + cnames, + lcid, + core::mem::transmute(rgdispid), + ) + .ok() + } + } +} +#[repr(C)] +pub struct IDispatch_Vtbl { + pub base__: windows_core::IUnknown_Vtbl, + pub GetTypeInfoCount: + unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, + GetTypeInfo: usize, + pub GetIDsOfNames: unsafe extern "system" fn( + *mut core::ffi::c_void, + *const windows_core::GUID, + *const windows_core::PCWSTR, + u32, + u32, + *mut i32, + ) -> windows_core::HRESULT, + Invoke: usize, +} +pub trait IDispatch_Impl: windows_core::IUnknownImpl { + fn GetTypeInfoCount(&self) -> windows_core::Result; + fn GetIDsOfNames( + &self, + riid: *const windows_core::GUID, + rgsznames: *const windows_core::PCWSTR, + cnames: u32, + lcid: u32, + rgdispid: *mut i32, + ) -> windows_core::Result<()>; +} +impl IDispatch_Vtbl { + pub const fn new() -> Self { + unsafe extern "system" fn GetTypeInfoCount< + Identity: IDispatch_Impl, + const OFFSET: isize, + >( + this: *mut core::ffi::c_void, + pctinfo: *mut u32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + match IDispatch_Impl::GetTypeInfoCount(this) { + Ok(ok__) => { + pctinfo.write(core::mem::transmute(ok__)); + windows_core::HRESULT(0) + } + Err(err) => err.into(), + } + } + } + unsafe extern "system" fn GetIDsOfNames( + this: *mut core::ffi::c_void, + riid: *const windows_core::GUID, + rgsznames: *const windows_core::PCWSTR, + cnames: u32, + lcid: u32, + rgdispid: *mut i32, + ) -> windows_core::HRESULT { + unsafe { + let this: &Identity = + &*((this as *const *const ()).offset(OFFSET) as *const Identity); + IDispatch_Impl::GetIDsOfNames( + this, + core::mem::transmute_copy(&riid), + core::mem::transmute_copy(&rgsznames), + core::mem::transmute_copy(&cnames), + core::mem::transmute_copy(&lcid), + core::mem::transmute_copy(&rgdispid), + ) + .into() + } + } + Self { + base__: windows_core::IUnknown_Vtbl::new::(), + GetTypeInfoCount: GetTypeInfoCount::, + GetTypeInfo: 0, + GetIDsOfNames: GetIDsOfNames::, + Invoke: 0, + } + } + pub fn matches(iid: &windows_core::GUID) -> bool { + iid == &::IID + } +} +impl windows_core::RuntimeName for IDispatch {} diff --git a/crates/tests/bindgen/src/lib.rs b/crates/tests/bindgen/src/lib.rs index 856a8c638d..a040b4abdf 100644 --- a/crates/tests/bindgen/src/lib.rs +++ b/crates/tests/bindgen/src/lib.rs @@ -45,6 +45,7 @@ pub mod fn_return_void_win; pub mod fn_sys; pub mod fn_win; pub mod interface; +pub mod interface_array_return; pub mod interface_cpp; pub mod interface_cpp_derive; pub mod interface_cpp_derive_sys; diff --git a/crates/tools/bindgen/src/main.rs b/crates/tools/bindgen/src/main.rs index cd60020028..28ada041ea 100644 --- a/crates/tools/bindgen/src/main.rs +++ b/crates/tools/bindgen/src/main.rs @@ -82,6 +82,7 @@ fn main() { test("--out interface_required_with_method.rs --filter IAsyncAction AsyncStatus"); test("--out interface_required_with_method_sys.rs --filter IAsyncAction AsyncStatus --sys"); test("--out interface_iterable.rs --filter IVector"); + test("--out interface_array_return.rs --filter IDispatch"); // Tests for functions test("--out fn_win.rs --filter GetTickCount"); From 28dbf2680f92053222989c849ca3ce921aac6e8e Mon Sep 17 00:00:00 2001 From: iancormac84 Date: Sun, 22 Dec 2024 01:06:49 -0400 Subject: [PATCH 2/2] Changed files. --- .../Win32/Devices/ImageAcquisition/mod.rs | 34 ++--- .../src/Windows/Win32/Globalization/mod.rs | 14 +- .../Windows/Win32/Graphics/DirectWrite/mod.rs | 102 ++++--------- .../src/Windows/Win32/Graphics/Dxgi/mod.rs | 17 +-- .../Win32/Storage/DataDeduplication/mod.rs | 17 +-- .../Win32/System/Com/StructuredStorage/mod.rs | 34 ++--- .../Windows/Win32/System/Com/Urlmon/mod.rs | 7 +- .../src/Windows/Win32/System/Com/mod.rs | 34 ++--- .../System/Diagnostics/ClrProfiling/mod.rs | 17 +-- .../Win32/System/Diagnostics/Debug/mod.rs | 17 +-- .../Windows/Win32/System/Hypervisor/mod.rs | 7 +- .../src/Windows/Win32/System/Ole/mod.rs | 7 +- .../src/Windows/Win32/System/Search/mod.rs | 136 +++++------------- .../src/Windows/Win32/UI/ColorSystem/mod.rs | 17 +-- .../Win32/UI/Shell/PropertiesSystem/mod.rs | 7 +- .../windows/src/Windows/Win32/UI/Shell/mod.rs | 17 +-- .../src/Windows/Win32/UI/TextServices/mod.rs | 34 ++--- 17 files changed, 124 insertions(+), 394 deletions(-) diff --git a/crates/libs/windows/src/Windows/Win32/Devices/ImageAcquisition/mod.rs b/crates/libs/windows/src/Windows/Win32/Devices/ImageAcquisition/mod.rs index c43935e870..57746b344f 100644 --- a/crates/libs/windows/src/Windows/Win32/Devices/ImageAcquisition/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Devices/ImageAcquisition/mod.rs @@ -2919,11 +2919,8 @@ windows_core::imp::define_interface!(IWiaPropertyStorage, IWiaPropertyStorage_Vt windows_core::imp::interface_hierarchy!(IWiaPropertyStorage, windows_core::IUnknown); impl IWiaPropertyStorage { #[cfg(all(feature = "Win32_System_Com_StructuredStorage", feature = "Win32_System_Variant"))] - pub unsafe fn ReadMultiple(&self, cpspec: u32, rgpspec: *const super::super::System::Com::StructuredStorage::PROPSPEC) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).ReadMultiple)(windows_core::Interface::as_raw(self), cpspec, rgpspec, &mut result__).map(|| core::mem::transmute(result__)) - } + pub unsafe fn ReadMultiple(&self, cpspec: u32, rgpspec: *const super::super::System::Com::StructuredStorage::PROPSPEC, rgpropvar: *mut super::super::System::Com::StructuredStorage::PROPVARIANT) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).ReadMultiple)(windows_core::Interface::as_raw(self), cpspec, rgpspec, core::mem::transmute(rgpropvar)).ok() } } #[cfg(all(feature = "Win32_System_Com_StructuredStorage", feature = "Win32_System_Variant"))] pub unsafe fn WriteMultiple(&self, cpspec: u32, rgpspec: *const super::super::System::Com::StructuredStorage::PROPSPEC, rgpropvar: *const super::super::System::Com::StructuredStorage::PROPVARIANT, propidnamefirst: u32) -> windows_core::Result<()> { @@ -2933,11 +2930,8 @@ impl IWiaPropertyStorage { pub unsafe fn DeleteMultiple(&self, rgpspec: &[super::super::System::Com::StructuredStorage::PROPSPEC]) -> windows_core::Result<()> { unsafe { (windows_core::Interface::vtable(self).DeleteMultiple)(windows_core::Interface::as_raw(self), rgpspec.len().try_into().unwrap(), core::mem::transmute(rgpspec.as_ptr())).ok() } } - pub unsafe fn ReadPropertyNames(&self, cpropid: u32, rgpropid: *const u32) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).ReadPropertyNames)(windows_core::Interface::as_raw(self), cpropid, rgpropid, &mut result__).map(|| result__) - } + pub unsafe fn ReadPropertyNames(&self, cpropid: u32, rgpropid: *const u32, rglpwstrname: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).ReadPropertyNames)(windows_core::Interface::as_raw(self), cpropid, rgpropid, core::mem::transmute(rglpwstrname)).ok() } } pub unsafe fn WritePropertyNames(&self, cpropid: u32, rgpropid: *const u32, rglpwstrname: *const windows_core::PCWSTR) -> windows_core::Result<()> { unsafe { (windows_core::Interface::vtable(self).WritePropertyNames)(windows_core::Interface::as_raw(self), cpropid, rgpropid, rglpwstrname).ok() } @@ -3036,10 +3030,10 @@ pub struct IWiaPropertyStorage_Vtbl { } #[cfg(all(feature = "Win32_System_Com_StructuredStorage", feature = "Win32_System_Variant"))] pub trait IWiaPropertyStorage_Impl: windows_core::IUnknownImpl { - fn ReadMultiple(&self, cpspec: u32, rgpspec: *const super::super::System::Com::StructuredStorage::PROPSPEC) -> windows_core::Result; + fn ReadMultiple(&self, cpspec: u32, rgpspec: *const super::super::System::Com::StructuredStorage::PROPSPEC, rgpropvar: *mut super::super::System::Com::StructuredStorage::PROPVARIANT) -> windows_core::Result<()>; fn WriteMultiple(&self, cpspec: u32, rgpspec: *const super::super::System::Com::StructuredStorage::PROPSPEC, rgpropvar: *const super::super::System::Com::StructuredStorage::PROPVARIANT, propidnamefirst: u32) -> windows_core::Result<()>; fn DeleteMultiple(&self, cpspec: u32, rgpspec: *const super::super::System::Com::StructuredStorage::PROPSPEC) -> windows_core::Result<()>; - fn ReadPropertyNames(&self, cpropid: u32, rgpropid: *const u32) -> windows_core::Result; + fn ReadPropertyNames(&self, cpropid: u32, rgpropid: *const u32, rglpwstrname: *mut windows_core::PWSTR) -> windows_core::Result<()>; fn WritePropertyNames(&self, cpropid: u32, rgpropid: *const u32, rglpwstrname: *const windows_core::PCWSTR) -> windows_core::Result<()>; fn DeletePropertyNames(&self, cpropid: u32, rgpropid: *const u32) -> windows_core::Result<()>; fn Commit(&self, grfcommitflags: u32) -> windows_core::Result<()>; @@ -3059,13 +3053,7 @@ impl IWiaPropertyStorage_Vtbl { unsafe extern "system" fn ReadMultiple(this: *mut core::ffi::c_void, cpspec: u32, rgpspec: *const super::super::System::Com::StructuredStorage::PROPSPEC, rgpropvar: *mut super::super::System::Com::StructuredStorage::PROPVARIANT) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match IWiaPropertyStorage_Impl::ReadMultiple(this, core::mem::transmute_copy(&cpspec), core::mem::transmute_copy(&rgpspec)) { - Ok(ok__) => { - rgpropvar.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + IWiaPropertyStorage_Impl::ReadMultiple(this, core::mem::transmute_copy(&cpspec), core::mem::transmute_copy(&rgpspec), core::mem::transmute_copy(&rgpropvar)).into() } } unsafe extern "system" fn WriteMultiple(this: *mut core::ffi::c_void, cpspec: u32, rgpspec: *const super::super::System::Com::StructuredStorage::PROPSPEC, rgpropvar: *const super::super::System::Com::StructuredStorage::PROPVARIANT, propidnamefirst: u32) -> windows_core::HRESULT { @@ -3083,13 +3071,7 @@ impl IWiaPropertyStorage_Vtbl { unsafe extern "system" fn ReadPropertyNames(this: *mut core::ffi::c_void, cpropid: u32, rgpropid: *const u32, rglpwstrname: *mut windows_core::PWSTR) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match IWiaPropertyStorage_Impl::ReadPropertyNames(this, core::mem::transmute_copy(&cpropid), core::mem::transmute_copy(&rgpropid)) { - Ok(ok__) => { - rglpwstrname.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + IWiaPropertyStorage_Impl::ReadPropertyNames(this, core::mem::transmute_copy(&cpropid), core::mem::transmute_copy(&rgpropid), core::mem::transmute_copy(&rglpwstrname)).into() } } unsafe extern "system" fn WritePropertyNames(this: *mut core::ffi::c_void, cpropid: u32, rgpropid: *const u32, rglpwstrname: *const windows_core::PCWSTR) -> windows_core::HRESULT { diff --git a/crates/libs/windows/src/Windows/Win32/Globalization/mod.rs b/crates/libs/windows/src/Windows/Win32/Globalization/mod.rs index 390d13ec7c..3b983c120b 100644 --- a/crates/libs/windows/src/Windows/Win32/Globalization/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Globalization/mod.rs @@ -783,15 +783,12 @@ pub unsafe fn ScriptApplyLogicalWidth(pidx: *const i32, cchars: i32, cglyphs: i3 unsafe { ScriptApplyLogicalWidth(pidx, cchars, cglyphs, pwlogclust, psva, piadvance, psa, core::mem::transmute(pabc.unwrap_or(core::mem::zeroed())), core::mem::transmute(pijustify)).ok() } } #[inline] -pub unsafe fn ScriptBreak(pwcchars: P0, cchars: i32, psa: *const SCRIPT_ANALYSIS) -> windows_core::Result +pub unsafe fn ScriptBreak(pwcchars: P0, cchars: i32, psa: *const SCRIPT_ANALYSIS, psla: *mut SCRIPT_LOGATTR) -> windows_core::Result<()> where P0: windows_core::Param, { windows_targets::link!("usp10.dll" "system" fn ScriptBreak(pwcchars : windows_core::PCWSTR, cchars : i32, psa : *const SCRIPT_ANALYSIS, psla : *mut SCRIPT_LOGATTR) -> windows_core::HRESULT); - unsafe { - let mut result__ = core::mem::zeroed(); - ScriptBreak(pwcchars.param().abi(), cchars, psa, &mut result__).map(|| core::mem::transmute(result__)) - } + unsafe { ScriptBreak(pwcchars.param().abi(), cchars, psa, core::mem::transmute(psla)).ok() } } #[inline] pub unsafe fn ScriptCPtoX(icp: i32, ftrailing: bool, cglyphs: i32, pwlogclust: &[u16], psva: *const SCRIPT_VISATTR, piadvance: *const i32, psa: *const SCRIPT_ANALYSIS, pix: *mut i32) -> windows_core::Result<()> { @@ -880,12 +877,9 @@ pub unsafe fn ScriptItemizeOpenType(pwcinchars: &[u16], cmaxitems: i32, pscontro unsafe { ScriptItemizeOpenType(core::mem::transmute(pwcinchars.as_ptr()), pwcinchars.len().try_into().unwrap(), cmaxitems, core::mem::transmute(pscontrol.unwrap_or(core::mem::zeroed())), core::mem::transmute(psstate.unwrap_or(core::mem::zeroed())), core::mem::transmute(pitems), core::mem::transmute(pscripttags), core::mem::transmute(pcitems)).ok() } } #[inline] -pub unsafe fn ScriptJustify(psva: *const SCRIPT_VISATTR, piadvance: *const i32, cglyphs: i32, idx: i32, iminkashida: i32) -> windows_core::Result { +pub unsafe fn ScriptJustify(psva: *const SCRIPT_VISATTR, piadvance: *const i32, cglyphs: i32, idx: i32, iminkashida: i32, pijustify: *mut i32) -> windows_core::Result<()> { windows_targets::link!("usp10.dll" "system" fn ScriptJustify(psva : *const SCRIPT_VISATTR, piadvance : *const i32, cglyphs : i32, idx : i32, iminkashida : i32, pijustify : *mut i32) -> windows_core::HRESULT); - unsafe { - let mut result__ = core::mem::zeroed(); - ScriptJustify(psva, piadvance, cglyphs, idx, iminkashida, &mut result__).map(|| core::mem::transmute(result__)) - } + unsafe { ScriptJustify(psva, piadvance, cglyphs, idx, iminkashida, core::mem::transmute(pijustify)).ok() } } #[inline] pub unsafe fn ScriptLayout(cruns: i32, pblevel: *const u8, pivisualtological: Option<*mut i32>, pilogicaltovisual: Option<*mut i32>) -> windows_core::Result<()> { diff --git a/crates/libs/windows/src/Windows/Win32/Graphics/DirectWrite/mod.rs b/crates/libs/windows/src/Windows/Win32/Graphics/DirectWrite/mod.rs index 336df656ba..81540dc628 100644 --- a/crates/libs/windows/src/Windows/Win32/Graphics/DirectWrite/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Graphics/DirectWrite/mod.rs @@ -4735,11 +4735,8 @@ impl IDWriteFontFace { pub unsafe fn GetDesignGlyphMetrics(&self, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: bool) -> windows_core::Result<()> { unsafe { (windows_core::Interface::vtable(self).GetDesignGlyphMetrics)(windows_core::Interface::as_raw(self), glyphindices, glyphcount, core::mem::transmute(glyphmetrics), issideways.into()).ok() } } - pub unsafe fn GetGlyphIndices(&self, codepoints: *const u32, codepointcount: u32) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).GetGlyphIndices)(windows_core::Interface::as_raw(self), codepoints, codepointcount, &mut result__).map(|| result__) - } + pub unsafe fn GetGlyphIndices(&self, codepoints: *const u32, codepointcount: u32, glyphindices: *mut u16) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).GetGlyphIndices)(windows_core::Interface::as_raw(self), codepoints, codepointcount, core::mem::transmute(glyphindices)).ok() } } pub unsafe fn TryGetFontTable(&self, opentypetabletag: u32, tabledata: *mut *mut core::ffi::c_void, tablesize: *mut u32, tablecontext: *mut *mut core::ffi::c_void, exists: *mut super::super::Foundation::BOOL) -> windows_core::Result<()> { unsafe { (windows_core::Interface::vtable(self).TryGetFontTable)(windows_core::Interface::as_raw(self), opentypetabletag, core::mem::transmute(tabledata), core::mem::transmute(tablesize), core::mem::transmute(tablecontext), core::mem::transmute(exists)).ok() } @@ -4802,7 +4799,7 @@ pub trait IDWriteFontFace_Impl: windows_core::IUnknownImpl { fn GetMetrics(&self, fontfacemetrics: *mut DWRITE_FONT_METRICS); fn GetGlyphCount(&self) -> u16; fn GetDesignGlyphMetrics(&self, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: super::super::Foundation::BOOL) -> windows_core::Result<()>; - fn GetGlyphIndices(&self, codepoints: *const u32, codepointcount: u32) -> windows_core::Result; + fn GetGlyphIndices(&self, codepoints: *const u32, codepointcount: u32, glyphindices: *mut u16) -> windows_core::Result<()>; fn TryGetFontTable(&self, opentypetabletag: u32, tabledata: *mut *mut core::ffi::c_void, tablesize: *mut u32, tablecontext: *mut *mut core::ffi::c_void, exists: *mut super::super::Foundation::BOOL) -> windows_core::Result<()>; fn ReleaseFontTable(&self, tablecontext: *const core::ffi::c_void); fn GetGlyphRunOutline(&self, emsize: f32, glyphindices: *const u16, glyphadvances: *const f32, glyphoffsets: *const DWRITE_GLYPH_OFFSET, glyphcount: u32, issideways: super::super::Foundation::BOOL, isrighttoleft: super::super::Foundation::BOOL, geometrysink: windows_core::Ref<'_, super::Direct2D::Common::ID2D1SimplifiedGeometrySink>) -> windows_core::Result<()>; @@ -4864,13 +4861,7 @@ impl IDWriteFontFace_Vtbl { unsafe extern "system" fn GetGlyphIndices(this: *mut core::ffi::c_void, codepoints: *const u32, codepointcount: u32, glyphindices: *mut u16) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match IDWriteFontFace_Impl::GetGlyphIndices(this, core::mem::transmute_copy(&codepoints), core::mem::transmute_copy(&codepointcount)) { - Ok(ok__) => { - glyphindices.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + IDWriteFontFace_Impl::GetGlyphIndices(this, core::mem::transmute_copy(&codepoints), core::mem::transmute_copy(&codepointcount), core::mem::transmute_copy(&glyphindices)).into() } } unsafe extern "system" fn TryGetFontTable(this: *mut core::ffi::c_void, opentypetabletag: u32, tabledata: *mut *mut core::ffi::c_void, tablesize: *mut u32, tablecontext: *mut *mut core::ffi::c_void, exists: *mut super::super::Foundation::BOOL) -> windows_core::HRESULT { @@ -4975,17 +4966,11 @@ impl IDWriteFontFace1 { pub unsafe fn GetDesignGlyphAdvances(&self, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32, issideways: bool) -> windows_core::Result<()> { unsafe { (windows_core::Interface::vtable(self).GetDesignGlyphAdvances)(windows_core::Interface::as_raw(self), glyphcount, glyphindices, core::mem::transmute(glyphadvances), issideways.into()).ok() } } - pub unsafe fn GetGdiCompatibleGlyphAdvances(&self, emsize: f32, pixelsperdip: f32, transform: Option<*const DWRITE_MATRIX>, usegdinatural: bool, issideways: bool, glyphcount: u32, glyphindices: *const u16) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).GetGdiCompatibleGlyphAdvances)(windows_core::Interface::as_raw(self), emsize, pixelsperdip, core::mem::transmute(transform.unwrap_or(core::mem::zeroed())), usegdinatural.into(), issideways.into(), glyphcount, glyphindices, &mut result__).map(|| result__) - } + pub unsafe fn GetGdiCompatibleGlyphAdvances(&self, emsize: f32, pixelsperdip: f32, transform: Option<*const DWRITE_MATRIX>, usegdinatural: bool, issideways: bool, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).GetGdiCompatibleGlyphAdvances)(windows_core::Interface::as_raw(self), emsize, pixelsperdip, core::mem::transmute(transform.unwrap_or(core::mem::zeroed())), usegdinatural.into(), issideways.into(), glyphcount, glyphindices, core::mem::transmute(glyphadvances)).ok() } } - pub unsafe fn GetKerningPairAdjustments(&self, glyphcount: u32, glyphindices: *const u16) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).GetKerningPairAdjustments)(windows_core::Interface::as_raw(self), glyphcount, glyphindices, &mut result__).map(|| result__) - } + pub unsafe fn GetKerningPairAdjustments(&self, glyphcount: u32, glyphindices: *const u16, glyphadvanceadjustments: *mut i32) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).GetKerningPairAdjustments)(windows_core::Interface::as_raw(self), glyphcount, glyphindices, core::mem::transmute(glyphadvanceadjustments)).ok() } } pub unsafe fn HasKerningPairs(&self) -> super::super::Foundation::BOOL { unsafe { (windows_core::Interface::vtable(self).HasKerningPairs)(windows_core::Interface::as_raw(self)) } @@ -4996,11 +4981,8 @@ impl IDWriteFontFace1 { (windows_core::Interface::vtable(self).GetRecommendedRenderingMode)(windows_core::Interface::as_raw(self), fontemsize, dpix, dpiy, core::mem::transmute(transform.unwrap_or(core::mem::zeroed())), issideways.into(), outlinethreshold, measuringmode, &mut result__).map(|| result__) } } - pub unsafe fn GetVerticalGlyphVariants(&self, glyphcount: u32, nominalglyphindices: *const u16) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).GetVerticalGlyphVariants)(windows_core::Interface::as_raw(self), glyphcount, nominalglyphindices, &mut result__).map(|| result__) - } + pub unsafe fn GetVerticalGlyphVariants(&self, glyphcount: u32, nominalglyphindices: *const u16, verticalglyphindices: *mut u16) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).GetVerticalGlyphVariants)(windows_core::Interface::as_raw(self), glyphcount, nominalglyphindices, core::mem::transmute(verticalglyphindices)).ok() } } pub unsafe fn HasVerticalGlyphVariants(&self) -> super::super::Foundation::BOOL { unsafe { (windows_core::Interface::vtable(self).HasVerticalGlyphVariants)(windows_core::Interface::as_raw(self)) } @@ -5030,11 +5012,11 @@ pub trait IDWriteFontFace1_Impl: IDWriteFontFace_Impl { fn GetUnicodeRanges(&self, maxrangecount: u32, unicoderanges: *mut DWRITE_UNICODE_RANGE, actualrangecount: *mut u32) -> windows_core::Result<()>; fn IsMonospacedFont(&self) -> super::super::Foundation::BOOL; fn GetDesignGlyphAdvances(&self, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32, issideways: super::super::Foundation::BOOL) -> windows_core::Result<()>; - fn GetGdiCompatibleGlyphAdvances(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, issideways: super::super::Foundation::BOOL, glyphcount: u32, glyphindices: *const u16) -> windows_core::Result; - fn GetKerningPairAdjustments(&self, glyphcount: u32, glyphindices: *const u16) -> windows_core::Result; + fn GetGdiCompatibleGlyphAdvances(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, issideways: super::super::Foundation::BOOL, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32) -> windows_core::Result<()>; + fn GetKerningPairAdjustments(&self, glyphcount: u32, glyphindices: *const u16, glyphadvanceadjustments: *mut i32) -> windows_core::Result<()>; fn HasKerningPairs(&self) -> super::super::Foundation::BOOL; fn GetRecommendedRenderingMode(&self, fontemsize: f32, dpix: f32, dpiy: f32, transform: *const DWRITE_MATRIX, issideways: super::super::Foundation::BOOL, outlinethreshold: DWRITE_OUTLINE_THRESHOLD, measuringmode: DWRITE_MEASURING_MODE) -> windows_core::Result; - fn GetVerticalGlyphVariants(&self, glyphcount: u32, nominalglyphindices: *const u16) -> windows_core::Result; + fn GetVerticalGlyphVariants(&self, glyphcount: u32, nominalglyphindices: *const u16, verticalglyphindices: *mut u16) -> windows_core::Result<()>; fn HasVerticalGlyphVariants(&self) -> super::super::Foundation::BOOL; } #[cfg(feature = "Win32_Graphics_Direct2D_Common")] @@ -5079,25 +5061,13 @@ impl IDWriteFontFace1_Vtbl { unsafe extern "system" fn GetGdiCompatibleGlyphAdvances(this: *mut core::ffi::c_void, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, issideways: super::super::Foundation::BOOL, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match IDWriteFontFace1_Impl::GetGdiCompatibleGlyphAdvances(this, core::mem::transmute_copy(&emsize), core::mem::transmute_copy(&pixelsperdip), core::mem::transmute_copy(&transform), core::mem::transmute_copy(&usegdinatural), core::mem::transmute_copy(&issideways), core::mem::transmute_copy(&glyphcount), core::mem::transmute_copy(&glyphindices)) { - Ok(ok__) => { - glyphadvances.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + IDWriteFontFace1_Impl::GetGdiCompatibleGlyphAdvances(this, core::mem::transmute_copy(&emsize), core::mem::transmute_copy(&pixelsperdip), core::mem::transmute_copy(&transform), core::mem::transmute_copy(&usegdinatural), core::mem::transmute_copy(&issideways), core::mem::transmute_copy(&glyphcount), core::mem::transmute_copy(&glyphindices), core::mem::transmute_copy(&glyphadvances)).into() } } unsafe extern "system" fn GetKerningPairAdjustments(this: *mut core::ffi::c_void, glyphcount: u32, glyphindices: *const u16, glyphadvanceadjustments: *mut i32) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match IDWriteFontFace1_Impl::GetKerningPairAdjustments(this, core::mem::transmute_copy(&glyphcount), core::mem::transmute_copy(&glyphindices)) { - Ok(ok__) => { - glyphadvanceadjustments.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + IDWriteFontFace1_Impl::GetKerningPairAdjustments(this, core::mem::transmute_copy(&glyphcount), core::mem::transmute_copy(&glyphindices), core::mem::transmute_copy(&glyphadvanceadjustments)).into() } } unsafe extern "system" fn HasKerningPairs(this: *mut core::ffi::c_void) -> super::super::Foundation::BOOL { @@ -5121,13 +5091,7 @@ impl IDWriteFontFace1_Vtbl { unsafe extern "system" fn GetVerticalGlyphVariants(this: *mut core::ffi::c_void, glyphcount: u32, nominalglyphindices: *const u16, verticalglyphindices: *mut u16) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match IDWriteFontFace1_Impl::GetVerticalGlyphVariants(this, core::mem::transmute_copy(&glyphcount), core::mem::transmute_copy(&nominalglyphindices)) { - Ok(ok__) => { - verticalglyphindices.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + IDWriteFontFace1_Impl::GetVerticalGlyphVariants(this, core::mem::transmute_copy(&glyphcount), core::mem::transmute_copy(&nominalglyphindices), core::mem::transmute_copy(&verticalglyphindices)).into() } } unsafe extern "system" fn HasVerticalGlyphVariants(this: *mut core::ffi::c_void) -> super::super::Foundation::BOOL { @@ -10087,15 +10051,12 @@ impl IDWriteTextAnalyzer1 { { unsafe { (windows_core::Interface::vtable(self).GetTextComplexity)(windows_core::Interface::as_raw(self), textstring.param().abi(), textlength, fontface.param().abi(), core::mem::transmute(istextsimple), core::mem::transmute(textlengthread), core::mem::transmute(glyphindices.unwrap_or(core::mem::zeroed()))).ok() } } - pub unsafe fn GetJustificationOpportunities(&self, fontface: P0, fontemsize: f32, scriptanalysis: DWRITE_SCRIPT_ANALYSIS, textlength: u32, glyphcount: u32, textstring: P5, clustermap: *const u16, glyphproperties: *const DWRITE_SHAPING_GLYPH_PROPERTIES) -> windows_core::Result + pub unsafe fn GetJustificationOpportunities(&self, fontface: P0, fontemsize: f32, scriptanalysis: DWRITE_SCRIPT_ANALYSIS, textlength: u32, glyphcount: u32, textstring: P5, clustermap: *const u16, glyphproperties: *const DWRITE_SHAPING_GLYPH_PROPERTIES, justificationopportunities: *mut DWRITE_JUSTIFICATION_OPPORTUNITY) -> windows_core::Result<()> where P0: windows_core::Param, P5: windows_core::Param, { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).GetJustificationOpportunities)(windows_core::Interface::as_raw(self), fontface.param().abi(), fontemsize, core::mem::transmute(scriptanalysis), textlength, glyphcount, textstring.param().abi(), clustermap, glyphproperties, &mut result__).map(|| result__) - } + unsafe { (windows_core::Interface::vtable(self).GetJustificationOpportunities)(windows_core::Interface::as_raw(self), fontface.param().abi(), fontemsize, core::mem::transmute(scriptanalysis), textlength, glyphcount, textstring.param().abi(), clustermap, glyphproperties, core::mem::transmute(justificationopportunities)).ok() } } pub unsafe fn JustifyGlyphAdvances(&self, linewidth: f32, glyphcount: u32, justificationopportunities: *const DWRITE_JUSTIFICATION_OPPORTUNITY, glyphadvances: *const f32, glyphoffsets: *const DWRITE_GLYPH_OFFSET, justifiedglyphadvances: *mut f32, justifiedglyphoffsets: Option<*mut DWRITE_GLYPH_OFFSET>) -> windows_core::Result<()> { unsafe { (windows_core::Interface::vtable(self).JustifyGlyphAdvances)(windows_core::Interface::as_raw(self), linewidth, glyphcount, justificationopportunities, glyphadvances, glyphoffsets, core::mem::transmute(justifiedglyphadvances), core::mem::transmute(justifiedglyphoffsets.unwrap_or(core::mem::zeroed()))).ok() } @@ -10149,7 +10110,7 @@ pub trait IDWriteTextAnalyzer1_Impl: IDWriteTextAnalyzer_Impl { fn GetGlyphOrientationTransform(&self, glyphorientationangle: DWRITE_GLYPH_ORIENTATION_ANGLE, issideways: super::super::Foundation::BOOL, transform: *mut DWRITE_MATRIX) -> windows_core::Result<()>; fn GetScriptProperties(&self, scriptanalysis: &DWRITE_SCRIPT_ANALYSIS, scriptproperties: *mut DWRITE_SCRIPT_PROPERTIES) -> windows_core::Result<()>; fn GetTextComplexity(&self, textstring: &windows_core::PCWSTR, textlength: u32, fontface: windows_core::Ref<'_, IDWriteFontFace>, istextsimple: *mut super::super::Foundation::BOOL, textlengthread: *mut u32, glyphindices: *mut u16) -> windows_core::Result<()>; - fn GetJustificationOpportunities(&self, fontface: windows_core::Ref<'_, IDWriteFontFace>, fontemsize: f32, scriptanalysis: &DWRITE_SCRIPT_ANALYSIS, textlength: u32, glyphcount: u32, textstring: &windows_core::PCWSTR, clustermap: *const u16, glyphproperties: *const DWRITE_SHAPING_GLYPH_PROPERTIES) -> windows_core::Result; + fn GetJustificationOpportunities(&self, fontface: windows_core::Ref<'_, IDWriteFontFace>, fontemsize: f32, scriptanalysis: &DWRITE_SCRIPT_ANALYSIS, textlength: u32, glyphcount: u32, textstring: &windows_core::PCWSTR, clustermap: *const u16, glyphproperties: *const DWRITE_SHAPING_GLYPH_PROPERTIES, justificationopportunities: *mut DWRITE_JUSTIFICATION_OPPORTUNITY) -> windows_core::Result<()>; fn JustifyGlyphAdvances(&self, linewidth: f32, glyphcount: u32, justificationopportunities: *const DWRITE_JUSTIFICATION_OPPORTUNITY, glyphadvances: *const f32, glyphoffsets: *const DWRITE_GLYPH_OFFSET, justifiedglyphadvances: *mut f32, justifiedglyphoffsets: *mut DWRITE_GLYPH_OFFSET) -> windows_core::Result<()>; fn GetJustifiedGlyphs(&self, fontface: windows_core::Ref<'_, IDWriteFontFace>, fontemsize: f32, scriptanalysis: &DWRITE_SCRIPT_ANALYSIS, textlength: u32, glyphcount: u32, maxglyphcount: u32, clustermap: *const u16, glyphindices: *const u16, glyphadvances: *const f32, justifiedglyphadvances: *const f32, justifiedglyphoffsets: *const DWRITE_GLYPH_OFFSET, glyphproperties: *const DWRITE_SHAPING_GLYPH_PROPERTIES, actualglyphcount: *mut u32, modifiedclustermap: *mut u16, modifiedglyphindices: *mut u16, modifiedglyphadvances: *mut f32, modifiedglyphoffsets: *mut DWRITE_GLYPH_OFFSET) -> windows_core::Result<()>; } @@ -10208,13 +10169,7 @@ impl IDWriteTextAnalyzer1_Vtbl { unsafe extern "system" fn GetJustificationOpportunities(this: *mut core::ffi::c_void, fontface: *mut core::ffi::c_void, fontemsize: f32, scriptanalysis: DWRITE_SCRIPT_ANALYSIS, textlength: u32, glyphcount: u32, textstring: windows_core::PCWSTR, clustermap: *const u16, glyphproperties: *const DWRITE_SHAPING_GLYPH_PROPERTIES, justificationopportunities: *mut DWRITE_JUSTIFICATION_OPPORTUNITY) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match IDWriteTextAnalyzer1_Impl::GetJustificationOpportunities(this, core::mem::transmute_copy(&fontface), core::mem::transmute_copy(&fontemsize), core::mem::transmute(&scriptanalysis), core::mem::transmute_copy(&textlength), core::mem::transmute_copy(&glyphcount), core::mem::transmute(&textstring), core::mem::transmute_copy(&clustermap), core::mem::transmute_copy(&glyphproperties)) { - Ok(ok__) => { - justificationopportunities.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + IDWriteTextAnalyzer1_Impl::GetJustificationOpportunities(this, core::mem::transmute_copy(&fontface), core::mem::transmute_copy(&fontemsize), core::mem::transmute(&scriptanalysis), core::mem::transmute_copy(&textlength), core::mem::transmute_copy(&glyphcount), core::mem::transmute(&textstring), core::mem::transmute_copy(&clustermap), core::mem::transmute_copy(&glyphproperties), core::mem::transmute_copy(&justificationopportunities)).into() } } unsafe extern "system" fn JustifyGlyphAdvances(this: *mut core::ffi::c_void, linewidth: f32, glyphcount: u32, justificationopportunities: *const DWRITE_JUSTIFICATION_OPPORTUNITY, glyphadvances: *const f32, glyphoffsets: *const DWRITE_GLYPH_OFFSET, justifiedglyphadvances: *mut f32, justifiedglyphoffsets: *mut DWRITE_GLYPH_OFFSET) -> windows_core::HRESULT { @@ -10288,15 +10243,12 @@ impl IDWriteTextAnalyzer2 { { unsafe { (windows_core::Interface::vtable(self).GetTypographicFeatures)(windows_core::Interface::as_raw(self), fontface.param().abi(), core::mem::transmute(scriptanalysis), localename.param().abi(), tags.len().try_into().unwrap(), core::mem::transmute(actualtagcount), core::mem::transmute(tags.as_ptr())).ok() } } - pub unsafe fn CheckTypographicFeature(&self, fontface: P0, scriptanalysis: DWRITE_SCRIPT_ANALYSIS, localename: P2, featuretag: DWRITE_FONT_FEATURE_TAG, glyphcount: u32, glyphindices: *const u16) -> windows_core::Result + pub unsafe fn CheckTypographicFeature(&self, fontface: P0, scriptanalysis: DWRITE_SCRIPT_ANALYSIS, localename: P2, featuretag: DWRITE_FONT_FEATURE_TAG, glyphcount: u32, glyphindices: *const u16, featureapplies: *mut u8) -> windows_core::Result<()> where P0: windows_core::Param, P2: windows_core::Param, { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).CheckTypographicFeature)(windows_core::Interface::as_raw(self), fontface.param().abi(), core::mem::transmute(scriptanalysis), localename.param().abi(), featuretag, glyphcount, glyphindices, &mut result__).map(|| result__) - } + unsafe { (windows_core::Interface::vtable(self).CheckTypographicFeature)(windows_core::Interface::as_raw(self), fontface.param().abi(), core::mem::transmute(scriptanalysis), localename.param().abi(), featuretag, glyphcount, glyphindices, core::mem::transmute(featureapplies)).ok() } } } #[repr(C)] @@ -10309,7 +10261,7 @@ pub struct IDWriteTextAnalyzer2_Vtbl { pub trait IDWriteTextAnalyzer2_Impl: IDWriteTextAnalyzer1_Impl { fn GetGlyphOrientationTransform(&self, glyphorientationangle: DWRITE_GLYPH_ORIENTATION_ANGLE, issideways: super::super::Foundation::BOOL, originx: f32, originy: f32, transform: *mut DWRITE_MATRIX) -> windows_core::Result<()>; fn GetTypographicFeatures(&self, fontface: windows_core::Ref<'_, IDWriteFontFace>, scriptanalysis: &DWRITE_SCRIPT_ANALYSIS, localename: &windows_core::PCWSTR, maxtagcount: u32, actualtagcount: *mut u32, tags: *mut DWRITE_FONT_FEATURE_TAG) -> windows_core::Result<()>; - fn CheckTypographicFeature(&self, fontface: windows_core::Ref<'_, IDWriteFontFace>, scriptanalysis: &DWRITE_SCRIPT_ANALYSIS, localename: &windows_core::PCWSTR, featuretag: DWRITE_FONT_FEATURE_TAG, glyphcount: u32, glyphindices: *const u16) -> windows_core::Result; + fn CheckTypographicFeature(&self, fontface: windows_core::Ref<'_, IDWriteFontFace>, scriptanalysis: &DWRITE_SCRIPT_ANALYSIS, localename: &windows_core::PCWSTR, featuretag: DWRITE_FONT_FEATURE_TAG, glyphcount: u32, glyphindices: *const u16, featureapplies: *mut u8) -> windows_core::Result<()>; } impl IDWriteTextAnalyzer2_Vtbl { pub const fn new() -> Self { @@ -10328,13 +10280,7 @@ impl IDWriteTextAnalyzer2_Vtbl { unsafe extern "system" fn CheckTypographicFeature(this: *mut core::ffi::c_void, fontface: *mut core::ffi::c_void, scriptanalysis: DWRITE_SCRIPT_ANALYSIS, localename: windows_core::PCWSTR, featuretag: DWRITE_FONT_FEATURE_TAG, glyphcount: u32, glyphindices: *const u16, featureapplies: *mut u8) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match IDWriteTextAnalyzer2_Impl::CheckTypographicFeature(this, core::mem::transmute_copy(&fontface), core::mem::transmute(&scriptanalysis), core::mem::transmute(&localename), core::mem::transmute_copy(&featuretag), core::mem::transmute_copy(&glyphcount), core::mem::transmute_copy(&glyphindices)) { - Ok(ok__) => { - featureapplies.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + IDWriteTextAnalyzer2_Impl::CheckTypographicFeature(this, core::mem::transmute_copy(&fontface), core::mem::transmute(&scriptanalysis), core::mem::transmute(&localename), core::mem::transmute_copy(&featuretag), core::mem::transmute_copy(&glyphcount), core::mem::transmute_copy(&glyphindices), core::mem::transmute_copy(&featureapplies)).into() } } Self { diff --git a/crates/libs/windows/src/Windows/Win32/Graphics/Dxgi/mod.rs b/crates/libs/windows/src/Windows/Win32/Graphics/Dxgi/mod.rs index b716915a57..d8c542792d 100644 --- a/crates/libs/windows/src/Windows/Win32/Graphics/Dxgi/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Graphics/Dxgi/mod.rs @@ -2626,11 +2626,8 @@ impl IDXGIDevice4 { pub unsafe fn OfferResources1(&self, ppresources: &[Option], priority: DXGI_OFFER_RESOURCE_PRIORITY, flags: DXGI_OFFER_RESOURCE_FLAGS) -> windows_core::Result<()> { unsafe { (windows_core::Interface::vtable(self).OfferResources1)(windows_core::Interface::as_raw(self), ppresources.len().try_into().unwrap(), core::mem::transmute(ppresources.as_ptr()), priority, flags.0 as _).ok() } } - pub unsafe fn ReclaimResources1(&self, numresources: u32, ppresources: *const Option) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).ReclaimResources1)(windows_core::Interface::as_raw(self), numresources, core::mem::transmute(ppresources), &mut result__).map(|| result__) - } + pub unsafe fn ReclaimResources1(&self, numresources: u32, ppresources: *const Option, presults: *mut DXGI_RECLAIM_RESOURCE_RESULTS) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).ReclaimResources1)(windows_core::Interface::as_raw(self), numresources, core::mem::transmute(ppresources), core::mem::transmute(presults)).ok() } } } #[repr(C)] @@ -2642,7 +2639,7 @@ pub struct IDXGIDevice4_Vtbl { #[cfg(feature = "Win32_Graphics_Dxgi_Common")] pub trait IDXGIDevice4_Impl: IDXGIDevice3_Impl { fn OfferResources1(&self, numresources: u32, ppresources: *const Option, priority: DXGI_OFFER_RESOURCE_PRIORITY, flags: &DXGI_OFFER_RESOURCE_FLAGS) -> windows_core::Result<()>; - fn ReclaimResources1(&self, numresources: u32, ppresources: *const Option) -> windows_core::Result; + fn ReclaimResources1(&self, numresources: u32, ppresources: *const Option, presults: *mut DXGI_RECLAIM_RESOURCE_RESULTS) -> windows_core::Result<()>; } #[cfg(feature = "Win32_Graphics_Dxgi_Common")] impl IDXGIDevice4_Vtbl { @@ -2656,13 +2653,7 @@ impl IDXGIDevice4_Vtbl { unsafe extern "system" fn ReclaimResources1(this: *mut core::ffi::c_void, numresources: u32, ppresources: *const *mut core::ffi::c_void, presults: *mut DXGI_RECLAIM_RESOURCE_RESULTS) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match IDXGIDevice4_Impl::ReclaimResources1(this, core::mem::transmute_copy(&numresources), core::mem::transmute_copy(&ppresources)) { - Ok(ok__) => { - presults.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + IDXGIDevice4_Impl::ReclaimResources1(this, core::mem::transmute_copy(&numresources), core::mem::transmute_copy(&ppresources), core::mem::transmute_copy(&presults)).into() } } Self { diff --git a/crates/libs/windows/src/Windows/Win32/Storage/DataDeduplication/mod.rs b/crates/libs/windows/src/Windows/Win32/Storage/DataDeduplication/mod.rs index 179814a915..02c3b19bc9 100644 --- a/crates/libs/windows/src/Windows/Win32/Storage/DataDeduplication/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/Storage/DataDeduplication/mod.rs @@ -146,14 +146,11 @@ impl Default for DedupStreamEntry { windows_core::imp::define_interface!(IDedupBackupSupport, IDedupBackupSupport_Vtbl, 0xc719d963_2b2d_415e_acf7_7eb7ca596ff4); windows_core::imp::interface_hierarchy!(IDedupBackupSupport, windows_core::IUnknown); impl IDedupBackupSupport { - pub unsafe fn RestoreFiles(&self, numberoffiles: u32, filefullpaths: *const windows_core::BSTR, store: P2, flags: u32) -> windows_core::Result + pub unsafe fn RestoreFiles(&self, numberoffiles: u32, filefullpaths: *const windows_core::BSTR, store: P2, flags: u32, fileresults: *mut windows_core::HRESULT) -> windows_core::Result<()> where P2: windows_core::Param, { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).RestoreFiles)(windows_core::Interface::as_raw(self), numberoffiles, core::mem::transmute(filefullpaths), store.param().abi(), flags, &mut result__).map(|| result__) - } + unsafe { (windows_core::Interface::vtable(self).RestoreFiles)(windows_core::Interface::as_raw(self), numberoffiles, core::mem::transmute(filefullpaths), store.param().abi(), flags, core::mem::transmute(fileresults)).ok() } } } #[repr(C)] @@ -162,20 +159,14 @@ pub struct IDedupBackupSupport_Vtbl { pub RestoreFiles: unsafe extern "system" fn(*mut core::ffi::c_void, u32, *const *mut core::ffi::c_void, *mut core::ffi::c_void, u32, *mut windows_core::HRESULT) -> windows_core::HRESULT, } pub trait IDedupBackupSupport_Impl: windows_core::IUnknownImpl { - fn RestoreFiles(&self, numberoffiles: u32, filefullpaths: *const windows_core::BSTR, store: windows_core::Ref<'_, IDedupReadFileCallback>, flags: u32) -> windows_core::Result; + fn RestoreFiles(&self, numberoffiles: u32, filefullpaths: *const windows_core::BSTR, store: windows_core::Ref<'_, IDedupReadFileCallback>, flags: u32, fileresults: *mut windows_core::HRESULT) -> windows_core::Result<()>; } impl IDedupBackupSupport_Vtbl { pub const fn new() -> Self { unsafe extern "system" fn RestoreFiles(this: *mut core::ffi::c_void, numberoffiles: u32, filefullpaths: *const *mut core::ffi::c_void, store: *mut core::ffi::c_void, flags: u32, fileresults: *mut windows_core::HRESULT) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match IDedupBackupSupport_Impl::RestoreFiles(this, core::mem::transmute_copy(&numberoffiles), core::mem::transmute_copy(&filefullpaths), core::mem::transmute_copy(&store), core::mem::transmute_copy(&flags)) { - Ok(ok__) => { - fileresults.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + IDedupBackupSupport_Impl::RestoreFiles(this, core::mem::transmute_copy(&numberoffiles), core::mem::transmute_copy(&filefullpaths), core::mem::transmute_copy(&store), core::mem::transmute_copy(&flags), core::mem::transmute_copy(&fileresults)).into() } } Self { base__: windows_core::IUnknown_Vtbl::new::(), RestoreFiles: RestoreFiles:: } diff --git a/crates/libs/windows/src/Windows/Win32/System/Com/StructuredStorage/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Com/StructuredStorage/mod.rs index cec08228db..d1e156bb98 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Com/StructuredStorage/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Com/StructuredStorage/mod.rs @@ -2302,11 +2302,8 @@ windows_core::imp::define_interface!(IPropertyStorage, IPropertyStorage_Vtbl, 0x windows_core::imp::interface_hierarchy!(IPropertyStorage, windows_core::IUnknown); impl IPropertyStorage { #[cfg(feature = "Win32_System_Variant")] - pub unsafe fn ReadMultiple(&self, cpspec: u32, rgpspec: *const PROPSPEC) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).ReadMultiple)(windows_core::Interface::as_raw(self), cpspec, rgpspec, &mut result__).map(|| core::mem::transmute(result__)) - } + pub unsafe fn ReadMultiple(&self, cpspec: u32, rgpspec: *const PROPSPEC, rgpropvar: *mut PROPVARIANT) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).ReadMultiple)(windows_core::Interface::as_raw(self), cpspec, rgpspec, core::mem::transmute(rgpropvar)).ok() } } #[cfg(feature = "Win32_System_Variant")] pub unsafe fn WriteMultiple(&self, cpspec: u32, rgpspec: *const PROPSPEC, rgpropvar: *const PROPVARIANT, propidnamefirst: u32) -> windows_core::Result<()> { @@ -2315,11 +2312,8 @@ impl IPropertyStorage { pub unsafe fn DeleteMultiple(&self, rgpspec: &[PROPSPEC]) -> windows_core::Result<()> { unsafe { (windows_core::Interface::vtable(self).DeleteMultiple)(windows_core::Interface::as_raw(self), rgpspec.len().try_into().unwrap(), core::mem::transmute(rgpspec.as_ptr())).ok() } } - pub unsafe fn ReadPropertyNames(&self, cpropid: u32, rgpropid: *const u32) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).ReadPropertyNames)(windows_core::Interface::as_raw(self), cpropid, rgpropid, &mut result__).map(|| result__) - } + pub unsafe fn ReadPropertyNames(&self, cpropid: u32, rgpropid: *const u32, rglpwstrname: *mut windows_core::PWSTR) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).ReadPropertyNames)(windows_core::Interface::as_raw(self), cpropid, rgpropid, core::mem::transmute(rglpwstrname)).ok() } } pub unsafe fn WritePropertyNames(&self, cpropid: u32, rgpropid: *const u32, rglpwstrname: *const windows_core::PCWSTR) -> windows_core::Result<()> { unsafe { (windows_core::Interface::vtable(self).WritePropertyNames)(windows_core::Interface::as_raw(self), cpropid, rgpropid, rglpwstrname).ok() } @@ -2373,10 +2367,10 @@ pub struct IPropertyStorage_Vtbl { } #[cfg(feature = "Win32_System_Variant")] pub trait IPropertyStorage_Impl: windows_core::IUnknownImpl { - fn ReadMultiple(&self, cpspec: u32, rgpspec: *const PROPSPEC) -> windows_core::Result; + fn ReadMultiple(&self, cpspec: u32, rgpspec: *const PROPSPEC, rgpropvar: *mut PROPVARIANT) -> windows_core::Result<()>; fn WriteMultiple(&self, cpspec: u32, rgpspec: *const PROPSPEC, rgpropvar: *const PROPVARIANT, propidnamefirst: u32) -> windows_core::Result<()>; fn DeleteMultiple(&self, cpspec: u32, rgpspec: *const PROPSPEC) -> windows_core::Result<()>; - fn ReadPropertyNames(&self, cpropid: u32, rgpropid: *const u32) -> windows_core::Result; + fn ReadPropertyNames(&self, cpropid: u32, rgpropid: *const u32, rglpwstrname: *mut windows_core::PWSTR) -> windows_core::Result<()>; fn WritePropertyNames(&self, cpropid: u32, rgpropid: *const u32, rglpwstrname: *const windows_core::PCWSTR) -> windows_core::Result<()>; fn DeletePropertyNames(&self, cpropid: u32, rgpropid: *const u32) -> windows_core::Result<()>; fn Commit(&self, grfcommitflags: u32) -> windows_core::Result<()>; @@ -2392,13 +2386,7 @@ impl IPropertyStorage_Vtbl { unsafe extern "system" fn ReadMultiple(this: *mut core::ffi::c_void, cpspec: u32, rgpspec: *const PROPSPEC, rgpropvar: *mut PROPVARIANT) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match IPropertyStorage_Impl::ReadMultiple(this, core::mem::transmute_copy(&cpspec), core::mem::transmute_copy(&rgpspec)) { - Ok(ok__) => { - rgpropvar.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + IPropertyStorage_Impl::ReadMultiple(this, core::mem::transmute_copy(&cpspec), core::mem::transmute_copy(&rgpspec), core::mem::transmute_copy(&rgpropvar)).into() } } unsafe extern "system" fn WriteMultiple(this: *mut core::ffi::c_void, cpspec: u32, rgpspec: *const PROPSPEC, rgpropvar: *const PROPVARIANT, propidnamefirst: u32) -> windows_core::HRESULT { @@ -2416,13 +2404,7 @@ impl IPropertyStorage_Vtbl { unsafe extern "system" fn ReadPropertyNames(this: *mut core::ffi::c_void, cpropid: u32, rgpropid: *const u32, rglpwstrname: *mut windows_core::PWSTR) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match IPropertyStorage_Impl::ReadPropertyNames(this, core::mem::transmute_copy(&cpropid), core::mem::transmute_copy(&rgpropid)) { - Ok(ok__) => { - rglpwstrname.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + IPropertyStorage_Impl::ReadPropertyNames(this, core::mem::transmute_copy(&cpropid), core::mem::transmute_copy(&rgpropid), core::mem::transmute_copy(&rglpwstrname)).into() } } unsafe extern "system" fn WritePropertyNames(this: *mut core::ffi::c_void, cpropid: u32, rgpropid: *const u32, rglpwstrname: *const windows_core::PCWSTR) -> windows_core::HRESULT { diff --git a/crates/libs/windows/src/Windows/Win32/System/Com/Urlmon/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Com/Urlmon/mod.rs index 64f6261fcd..029b968151 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Com/Urlmon/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Com/Urlmon/mod.rs @@ -458,12 +458,9 @@ where unsafe { RegisterMediaTypeClass(pbc.param().abi(), ctypes, rgsztypes, rgclsid, reserved).ok() } } #[inline] -pub unsafe fn RegisterMediaTypes(ctypes: u32, rgsztypes: *const windows_core::PCSTR) -> windows_core::Result { +pub unsafe fn RegisterMediaTypes(ctypes: u32, rgsztypes: *const windows_core::PCSTR, rgcftypes: *mut u16) -> windows_core::Result<()> { windows_targets::link!("urlmon.dll" "system" fn RegisterMediaTypes(ctypes : u32, rgsztypes : *const windows_core::PCSTR, rgcftypes : *mut u16) -> windows_core::HRESULT); - unsafe { - let mut result__ = core::mem::zeroed(); - RegisterMediaTypes(ctypes, rgsztypes, &mut result__).map(|| core::mem::transmute(result__)) - } + unsafe { RegisterMediaTypes(ctypes, rgsztypes, core::mem::transmute(rgcftypes)).ok() } } #[cfg(all(feature = "Win32_Graphics_Gdi", feature = "Win32_Security", feature = "Win32_System_Com_StructuredStorage"))] #[inline] diff --git a/crates/libs/windows/src/Windows/Win32/System/Com/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Com/mod.rs index f40f366632..7f15158d8e 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Com/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Com/mod.rs @@ -4883,11 +4883,8 @@ impl IDispatch { (windows_core::Interface::vtable(self).GetTypeInfo)(windows_core::Interface::as_raw(self), itinfo, lcid, &mut result__).and_then(|| windows_core::Type::from_abi(result__)) } } - pub unsafe fn GetIDsOfNames(&self, riid: *const windows_core::GUID, rgsznames: *const windows_core::PCWSTR, cnames: u32, lcid: u32) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).GetIDsOfNames)(windows_core::Interface::as_raw(self), riid, rgsznames, cnames, lcid, &mut result__).map(|| result__) - } + pub unsafe fn GetIDsOfNames(&self, riid: *const windows_core::GUID, rgsznames: *const windows_core::PCWSTR, cnames: u32, lcid: u32, rgdispid: *mut i32) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).GetIDsOfNames)(windows_core::Interface::as_raw(self), riid, rgsznames, cnames, lcid, core::mem::transmute(rgdispid)).ok() } } #[cfg(all(feature = "Win32_System_Ole", feature = "Win32_System_Variant"))] pub unsafe fn Invoke(&self, dispidmember: i32, riid: *const windows_core::GUID, lcid: u32, wflags: DISPATCH_FLAGS, pdispparams: *const DISPPARAMS, pvarresult: Option<*mut super::Variant::VARIANT>, pexcepinfo: Option<*mut EXCEPINFO>, puargerr: Option<*mut u32>) -> windows_core::Result<()> { @@ -4909,7 +4906,7 @@ pub struct IDispatch_Vtbl { pub trait IDispatch_Impl: windows_core::IUnknownImpl { fn GetTypeInfoCount(&self) -> windows_core::Result; fn GetTypeInfo(&self, itinfo: u32, lcid: u32) -> windows_core::Result; - fn GetIDsOfNames(&self, riid: *const windows_core::GUID, rgsznames: *const windows_core::PCWSTR, cnames: u32, lcid: u32) -> windows_core::Result; + fn GetIDsOfNames(&self, riid: *const windows_core::GUID, rgsznames: *const windows_core::PCWSTR, cnames: u32, lcid: u32, rgdispid: *mut i32) -> windows_core::Result<()>; fn Invoke(&self, dispidmember: i32, riid: *const windows_core::GUID, lcid: u32, wflags: DISPATCH_FLAGS, pdispparams: *const DISPPARAMS, pvarresult: *mut super::Variant::VARIANT, pexcepinfo: *mut EXCEPINFO, puargerr: *mut u32) -> windows_core::Result<()>; } #[cfg(all(feature = "Win32_System_Ole", feature = "Win32_System_Variant"))] @@ -4942,13 +4939,7 @@ impl IDispatch_Vtbl { unsafe extern "system" fn GetIDsOfNames(this: *mut core::ffi::c_void, riid: *const windows_core::GUID, rgsznames: *const windows_core::PCWSTR, cnames: u32, lcid: u32, rgdispid: *mut i32) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match IDispatch_Impl::GetIDsOfNames(this, core::mem::transmute_copy(&riid), core::mem::transmute_copy(&rgsznames), core::mem::transmute_copy(&cnames), core::mem::transmute_copy(&lcid)) { - Ok(ok__) => { - rgdispid.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + IDispatch_Impl::GetIDsOfNames(this, core::mem::transmute_copy(&riid), core::mem::transmute_copy(&rgsznames), core::mem::transmute_copy(&cnames), core::mem::transmute_copy(&lcid), core::mem::transmute_copy(&rgdispid)).into() } } unsafe extern "system" fn Invoke(this: *mut core::ffi::c_void, dispidmember: i32, riid: *const windows_core::GUID, lcid: u32, wflags: DISPATCH_FLAGS, pdispparams: *const DISPPARAMS, pvarresult: *mut super::Variant::VARIANT, pexcepinfo: *mut EXCEPINFO, puargerr: *mut u32) -> windows_core::HRESULT { @@ -9517,11 +9508,8 @@ impl ITypeInfo { (windows_core::Interface::vtable(self).GetImplTypeFlags)(windows_core::Interface::as_raw(self), index, &mut result__).map(|| result__) } } - pub unsafe fn GetIDsOfNames(&self, rgsznames: *const windows_core::PCWSTR, cnames: u32) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).GetIDsOfNames)(windows_core::Interface::as_raw(self), rgsznames, cnames, &mut result__).map(|| result__) - } + pub unsafe fn GetIDsOfNames(&self, rgsznames: *const windows_core::PCWSTR, cnames: u32, pmemid: *mut i32) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).GetIDsOfNames)(windows_core::Interface::as_raw(self), rgsznames, cnames, core::mem::transmute(pmemid)).ok() } } #[cfg(all(feature = "Win32_System_Ole", feature = "Win32_System_Variant"))] pub unsafe fn Invoke(&self, pvinstance: *const core::ffi::c_void, memid: i32, wflags: DISPATCH_FLAGS, pdispparams: *mut DISPPARAMS, pvarresult: *mut super::Variant::VARIANT, pexcepinfo: *mut EXCEPINFO, puargerr: *mut u32) -> windows_core::Result<()> { @@ -9625,7 +9613,7 @@ pub trait ITypeInfo_Impl: windows_core::IUnknownImpl { fn GetNames(&self, memid: i32, rgbstrnames: *mut windows_core::BSTR, cmaxnames: u32, pcnames: *mut u32) -> windows_core::Result<()>; fn GetRefTypeOfImplType(&self, index: u32) -> windows_core::Result; fn GetImplTypeFlags(&self, index: u32) -> windows_core::Result; - fn GetIDsOfNames(&self, rgsznames: *const windows_core::PCWSTR, cnames: u32) -> windows_core::Result; + fn GetIDsOfNames(&self, rgsznames: *const windows_core::PCWSTR, cnames: u32, pmemid: *mut i32) -> windows_core::Result<()>; fn Invoke(&self, pvinstance: *const core::ffi::c_void, memid: i32, wflags: DISPATCH_FLAGS, pdispparams: *mut DISPPARAMS, pvarresult: *mut super::Variant::VARIANT, pexcepinfo: *mut EXCEPINFO, puargerr: *mut u32) -> windows_core::Result<()>; fn GetDocumentation(&self, memid: i32, pbstrname: *mut windows_core::BSTR, pbstrdocstring: *mut windows_core::BSTR, pdwhelpcontext: *mut u32, pbstrhelpfile: *mut windows_core::BSTR) -> windows_core::Result<()>; fn GetDllEntry(&self, memid: i32, invkind: INVOKEKIND, pbstrdllname: *mut windows_core::BSTR, pbstrname: *mut windows_core::BSTR, pwordinal: *mut u16) -> windows_core::Result<()>; @@ -9722,13 +9710,7 @@ impl ITypeInfo_Vtbl { unsafe extern "system" fn GetIDsOfNames(this: *mut core::ffi::c_void, rgsznames: *const windows_core::PCWSTR, cnames: u32, pmemid: *mut i32) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match ITypeInfo_Impl::GetIDsOfNames(this, core::mem::transmute_copy(&rgsznames), core::mem::transmute_copy(&cnames)) { - Ok(ok__) => { - pmemid.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + ITypeInfo_Impl::GetIDsOfNames(this, core::mem::transmute_copy(&rgsznames), core::mem::transmute_copy(&cnames), core::mem::transmute_copy(&pmemid)).into() } } unsafe extern "system" fn Invoke(this: *mut core::ffi::c_void, pvinstance: *const core::ffi::c_void, memid: i32, wflags: DISPATCH_FLAGS, pdispparams: *mut DISPPARAMS, pvarresult: *mut super::Variant::VARIANT, pexcepinfo: *mut EXCEPINFO, puargerr: *mut u32) -> windows_core::HRESULT { diff --git a/crates/libs/windows/src/Windows/Win32/System/Diagnostics/ClrProfiling/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Diagnostics/ClrProfiling/mod.rs index 7e0df99a7e..bb59812d96 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Diagnostics/ClrProfiling/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Diagnostics/ClrProfiling/mod.rs @@ -3728,11 +3728,8 @@ impl ICorProfilerInfo4 { pub unsafe fn RequestReJIT(&self, cfunctions: u32, moduleids: *const usize, methodids: *const u32) -> windows_core::Result<()> { unsafe { (windows_core::Interface::vtable(self).RequestReJIT)(windows_core::Interface::as_raw(self), cfunctions, moduleids, methodids).ok() } } - pub unsafe fn RequestRevert(&self, cfunctions: u32, moduleids: *const usize, methodids: *const u32) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).RequestRevert)(windows_core::Interface::as_raw(self), cfunctions, moduleids, methodids, &mut result__).map(|| result__) - } + pub unsafe fn RequestRevert(&self, cfunctions: u32, moduleids: *const usize, methodids: *const u32, status: *mut windows_core::HRESULT) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).RequestRevert)(windows_core::Interface::as_raw(self), cfunctions, moduleids, methodids, core::mem::transmute(status)).ok() } } pub unsafe fn GetCodeInfo3(&self, functionid: usize, rejitid: usize, pccodeinfos: *mut u32, codeinfos: &mut [COR_PRF_CODE_INFO]) -> windows_core::Result<()> { unsafe { (windows_core::Interface::vtable(self).GetCodeInfo3)(windows_core::Interface::as_raw(self), functionid, rejitid, codeinfos.len().try_into().unwrap(), core::mem::transmute(pccodeinfos), core::mem::transmute(codeinfos.as_ptr())).ok() } @@ -3778,7 +3775,7 @@ pub trait ICorProfilerInfo4_Impl: ICorProfilerInfo3_Impl { fn EnumThreads(&self) -> windows_core::Result; fn InitializeCurrentThread(&self) -> windows_core::Result<()>; fn RequestReJIT(&self, cfunctions: u32, moduleids: *const usize, methodids: *const u32) -> windows_core::Result<()>; - fn RequestRevert(&self, cfunctions: u32, moduleids: *const usize, methodids: *const u32) -> windows_core::Result; + fn RequestRevert(&self, cfunctions: u32, moduleids: *const usize, methodids: *const u32, status: *mut windows_core::HRESULT) -> windows_core::Result<()>; fn GetCodeInfo3(&self, functionid: usize, rejitid: usize, ccodeinfos: u32, pccodeinfos: *mut u32, codeinfos: *mut COR_PRF_CODE_INFO) -> windows_core::Result<()>; fn GetFunctionFromIP2(&self, ip: *const u8, pfunctionid: *mut usize, prejitid: *mut usize) -> windows_core::Result<()>; fn GetReJITIDs(&self, functionid: usize, crejitids: u32, pcrejitids: *mut u32, rejitids: *mut usize) -> windows_core::Result<()>; @@ -3816,13 +3813,7 @@ impl ICorProfilerInfo4_Vtbl { unsafe extern "system" fn RequestRevert(this: *mut core::ffi::c_void, cfunctions: u32, moduleids: *const usize, methodids: *const u32, status: *mut windows_core::HRESULT) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match ICorProfilerInfo4_Impl::RequestRevert(this, core::mem::transmute_copy(&cfunctions), core::mem::transmute_copy(&moduleids), core::mem::transmute_copy(&methodids)) { - Ok(ok__) => { - status.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + ICorProfilerInfo4_Impl::RequestRevert(this, core::mem::transmute_copy(&cfunctions), core::mem::transmute_copy(&moduleids), core::mem::transmute_copy(&methodids), core::mem::transmute_copy(&status)).into() } } unsafe extern "system" fn GetCodeInfo3(this: *mut core::ffi::c_void, functionid: usize, rejitid: usize, ccodeinfos: u32, pccodeinfos: *mut u32, codeinfos: *mut COR_PRF_CODE_INFO) -> windows_core::HRESULT { 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 cf6445e7d8..402d8cb1bc 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 @@ -3837,11 +3837,8 @@ impl IDebugProperty { unsafe { (windows_core::Interface::vtable(self).GetPropertyInfo)(windows_core::Interface::as_raw(self), dwfieldspec, nradix, core::mem::transmute(ppropertyinfo)).ok() } } #[cfg(all(feature = "Win32_System_Com", feature = "Win32_System_Ole", feature = "Win32_System_Variant"))] - pub unsafe fn GetExtendedInfo(&self, cinfos: u32, rgguidextendedinfo: *const windows_core::GUID) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).GetExtendedInfo)(windows_core::Interface::as_raw(self), cinfos, rgguidextendedinfo, &mut result__).map(|| core::mem::transmute(result__)) - } + pub unsafe fn GetExtendedInfo(&self, cinfos: u32, rgguidextendedinfo: *const windows_core::GUID, rgvar: *mut super::super::Variant::VARIANT) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).GetExtendedInfo)(windows_core::Interface::as_raw(self), cinfos, rgguidextendedinfo, core::mem::transmute(rgvar)).ok() } } pub unsafe fn SetValueAsString(&self, pszvalue: P0, nradix: u32) -> windows_core::Result<()> where @@ -3877,7 +3874,7 @@ pub struct IDebugProperty_Vtbl { #[cfg(all(feature = "Win32_System_Com", feature = "Win32_System_Ole", feature = "Win32_System_Variant"))] pub trait IDebugProperty_Impl: windows_core::IUnknownImpl { fn GetPropertyInfo(&self, dwfieldspec: u32, nradix: u32, ppropertyinfo: *mut DebugPropertyInfo) -> windows_core::Result<()>; - fn GetExtendedInfo(&self, cinfos: u32, rgguidextendedinfo: *const windows_core::GUID) -> windows_core::Result; + fn GetExtendedInfo(&self, cinfos: u32, rgguidextendedinfo: *const windows_core::GUID, rgvar: *mut super::super::Variant::VARIANT) -> windows_core::Result<()>; fn SetValueAsString(&self, pszvalue: &windows_core::PCWSTR, nradix: u32) -> windows_core::Result<()>; fn EnumMembers(&self, dwfieldspec: u32, nradix: u32, refiid: *const windows_core::GUID) -> windows_core::Result; fn GetParent(&self) -> windows_core::Result; @@ -3894,13 +3891,7 @@ impl IDebugProperty_Vtbl { unsafe extern "system" fn GetExtendedInfo(this: *mut core::ffi::c_void, cinfos: u32, rgguidextendedinfo: *const windows_core::GUID, rgvar: *mut super::super::Variant::VARIANT) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match IDebugProperty_Impl::GetExtendedInfo(this, core::mem::transmute_copy(&cinfos), core::mem::transmute_copy(&rgguidextendedinfo)) { - Ok(ok__) => { - rgvar.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + IDebugProperty_Impl::GetExtendedInfo(this, core::mem::transmute_copy(&cinfos), core::mem::transmute_copy(&rgguidextendedinfo), core::mem::transmute_copy(&rgvar)).into() } } unsafe extern "system" fn SetValueAsString(this: *mut core::ffi::c_void, pszvalue: windows_core::PCWSTR, nradix: u32) -> windows_core::HRESULT { diff --git a/crates/libs/windows/src/Windows/Win32/System/Hypervisor/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Hypervisor/mod.rs index af6c764a7f..d9b5fea174 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Hypervisor/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Hypervisor/mod.rs @@ -485,12 +485,9 @@ pub unsafe fn WHvGetVirtualProcessorInterruptControllerState2(partition: WHV_PAR unsafe { WHvGetVirtualProcessorInterruptControllerState2(partition, vpindex, core::mem::transmute(state), statesize, core::mem::transmute(writtensize.unwrap_or(core::mem::zeroed()))).ok() } } #[inline] -pub unsafe fn WHvGetVirtualProcessorRegisters(partition: WHV_PARTITION_HANDLE, vpindex: u32, registernames: *const WHV_REGISTER_NAME, registercount: u32) -> windows_core::Result { +pub unsafe fn WHvGetVirtualProcessorRegisters(partition: WHV_PARTITION_HANDLE, vpindex: u32, registernames: *const WHV_REGISTER_NAME, registercount: u32, registervalues: *mut WHV_REGISTER_VALUE) -> windows_core::Result<()> { windows_targets::link!("winhvplatform.dll" "system" fn WHvGetVirtualProcessorRegisters(partition : WHV_PARTITION_HANDLE, vpindex : u32, registernames : *const WHV_REGISTER_NAME, registercount : u32, registervalues : *mut WHV_REGISTER_VALUE) -> windows_core::HRESULT); - unsafe { - let mut result__ = core::mem::zeroed(); - WHvGetVirtualProcessorRegisters(partition, vpindex, registernames, registercount, &mut result__).map(|| core::mem::transmute(result__)) - } + unsafe { WHvGetVirtualProcessorRegisters(partition, vpindex, registernames, registercount, core::mem::transmute(registervalues)).ok() } } #[inline] pub unsafe fn WHvGetVirtualProcessorState(partition: WHV_PARTITION_HANDLE, vpindex: u32, statetype: WHV_VIRTUAL_PROCESSOR_STATE_TYPE, buffer: *mut core::ffi::c_void, buffersizeinbytes: u32, byteswritten: Option<*mut u32>) -> windows_core::Result<()> { diff --git a/crates/libs/windows/src/Windows/Win32/System/Ole/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Ole/mod.rs index 87679289d7..2b3a861ec5 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Ole/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Ole/mod.rs @@ -80,15 +80,12 @@ pub unsafe fn DispCallFunc(pvinstance: Option<*const core::ffi::c_void>, ovft: u } #[cfg(feature = "Win32_System_Com")] #[inline] -pub unsafe fn DispGetIDsOfNames(ptinfo: P0, rgsznames: *const windows_core::PCWSTR, cnames: u32) -> windows_core::Result +pub unsafe fn DispGetIDsOfNames(ptinfo: P0, rgsznames: *const windows_core::PCWSTR, cnames: u32, rgdispid: *mut i32) -> windows_core::Result<()> where P0: windows_core::Param, { windows_targets::link!("oleaut32.dll" "system" fn DispGetIDsOfNames(ptinfo : * mut core::ffi::c_void, rgsznames : *const windows_core::PCWSTR, cnames : u32, rgdispid : *mut i32) -> windows_core::HRESULT); - unsafe { - let mut result__ = core::mem::zeroed(); - DispGetIDsOfNames(ptinfo.param().abi(), rgsznames, cnames, &mut result__).map(|| core::mem::transmute(result__)) - } + unsafe { DispGetIDsOfNames(ptinfo.param().abi(), rgsznames, cnames, core::mem::transmute(rgdispid)).ok() } } #[cfg(all(feature = "Win32_System_Com", feature = "Win32_System_Variant"))] #[inline] diff --git a/crates/libs/windows/src/Windows/Win32/System/Search/mod.rs b/crates/libs/windows/src/Windows/Win32/System/Search/mod.rs index 150fd8170d..b81282a4c6 100644 --- a/crates/libs/windows/src/Windows/Win32/System/Search/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/System/Search/mod.rs @@ -6290,11 +6290,8 @@ impl ICommandWithParameters { pub unsafe fn GetParameterInfo(&self, pcparams: *mut usize, prgparaminfo: *mut *mut DBPARAMINFO, ppnamesbuffer: Option<*mut *mut u16>) -> windows_core::Result<()> { unsafe { (windows_core::Interface::vtable(self).GetParameterInfo)(windows_core::Interface::as_raw(self), core::mem::transmute(pcparams), core::mem::transmute(prgparaminfo), core::mem::transmute(ppnamesbuffer.unwrap_or(core::mem::zeroed()))).ok() } } - pub unsafe fn MapParameterNames(&self, cparamnames: usize, rgparamnames: *const windows_core::PCWSTR) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).MapParameterNames)(windows_core::Interface::as_raw(self), cparamnames, rgparamnames, &mut result__).map(|| result__) - } + pub unsafe fn MapParameterNames(&self, cparamnames: usize, rgparamnames: *const windows_core::PCWSTR, rgparamordinals: *mut isize) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).MapParameterNames)(windows_core::Interface::as_raw(self), cparamnames, rgparamnames, core::mem::transmute(rgparamordinals)).ok() } } pub unsafe fn SetParameterInfo(&self, cparams: usize, rgparamordinals: Option<*const usize>, rgparambindinfo: Option<*const DBPARAMBINDINFO>) -> windows_core::Result<()> { unsafe { (windows_core::Interface::vtable(self).SetParameterInfo)(windows_core::Interface::as_raw(self), cparams, core::mem::transmute(rgparamordinals.unwrap_or(core::mem::zeroed())), core::mem::transmute(rgparambindinfo.unwrap_or(core::mem::zeroed()))).ok() } @@ -6313,7 +6310,7 @@ pub struct ICommandWithParameters_Vtbl { #[cfg(feature = "Win32_System_Com")] pub trait ICommandWithParameters_Impl: windows_core::IUnknownImpl { fn GetParameterInfo(&self, pcparams: *mut usize, prgparaminfo: *mut *mut DBPARAMINFO, ppnamesbuffer: *mut *mut u16) -> windows_core::Result<()>; - fn MapParameterNames(&self, cparamnames: usize, rgparamnames: *const windows_core::PCWSTR) -> windows_core::Result; + fn MapParameterNames(&self, cparamnames: usize, rgparamnames: *const windows_core::PCWSTR, rgparamordinals: *mut isize) -> windows_core::Result<()>; fn SetParameterInfo(&self, cparams: usize, rgparamordinals: *const usize, rgparambindinfo: *const DBPARAMBINDINFO) -> windows_core::Result<()>; } #[cfg(feature = "Win32_System_Com")] @@ -6328,13 +6325,7 @@ impl ICommandWithParameters_Vtbl { unsafe extern "system" fn MapParameterNames(this: *mut core::ffi::c_void, cparamnames: usize, rgparamnames: *const windows_core::PCWSTR, rgparamordinals: *mut isize) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match ICommandWithParameters_Impl::MapParameterNames(this, core::mem::transmute_copy(&cparamnames), core::mem::transmute_copy(&rgparamnames)) { - Ok(ok__) => { - rgparamordinals.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + ICommandWithParameters_Impl::MapParameterNames(this, core::mem::transmute_copy(&cparamnames), core::mem::transmute_copy(&rgparamnames), core::mem::transmute_copy(&rgparamordinals)).into() } } unsafe extern "system" fn SetParameterInfo(this: *mut core::ffi::c_void, cparams: usize, rgparamordinals: *const usize, rgparambindinfo: *const DBPARAMBINDINFO) -> windows_core::HRESULT { @@ -7796,11 +7787,8 @@ windows_core::imp::define_interface!(IDCInfo, IDCInfo_Vtbl, 0x0c733a9c_2a1c_11ce windows_core::imp::interface_hierarchy!(IDCInfo, windows_core::IUnknown); impl IDCInfo { #[cfg(all(feature = "Win32_System_Com", feature = "Win32_System_Ole", feature = "Win32_System_Variant"))] - pub unsafe fn GetInfo(&self, cinfo: u32, rgeinfotype: *const u32) -> windows_core::Result<*mut DCINFO> { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).GetInfo)(windows_core::Interface::as_raw(self), cinfo, rgeinfotype, &mut result__).map(|| result__) - } + pub unsafe fn GetInfo(&self, cinfo: u32, rgeinfotype: *const u32, prginfo: *mut *mut DCINFO) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).GetInfo)(windows_core::Interface::as_raw(self), cinfo, rgeinfotype, core::mem::transmute(prginfo)).ok() } } #[cfg(all(feature = "Win32_System_Com", feature = "Win32_System_Ole", feature = "Win32_System_Variant"))] pub unsafe fn SetInfo(&self, rginfo: &[DCINFO]) -> windows_core::Result<()> { @@ -7821,7 +7809,7 @@ pub struct IDCInfo_Vtbl { } #[cfg(all(feature = "Win32_System_Com", feature = "Win32_System_Ole", feature = "Win32_System_Variant"))] pub trait IDCInfo_Impl: windows_core::IUnknownImpl { - fn GetInfo(&self, cinfo: u32, rgeinfotype: *const u32) -> windows_core::Result<*mut DCINFO>; + fn GetInfo(&self, cinfo: u32, rgeinfotype: *const u32, prginfo: *mut *mut DCINFO) -> windows_core::Result<()>; fn SetInfo(&self, cinfo: u32, rginfo: *const DCINFO) -> windows_core::Result<()>; } #[cfg(all(feature = "Win32_System_Com", feature = "Win32_System_Ole", feature = "Win32_System_Variant"))] @@ -7830,13 +7818,7 @@ impl IDCInfo_Vtbl { unsafe extern "system" fn GetInfo(this: *mut core::ffi::c_void, cinfo: u32, rgeinfotype: *const u32, prginfo: *mut *mut DCINFO) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match IDCInfo_Impl::GetInfo(this, core::mem::transmute_copy(&cinfo), core::mem::transmute_copy(&rgeinfotype)) { - Ok(ok__) => { - prginfo.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + IDCInfo_Impl::GetInfo(this, core::mem::transmute_copy(&cinfo), core::mem::transmute_copy(&rgeinfotype), core::mem::transmute_copy(&prginfo)).into() } } unsafe extern "system" fn SetInfo(this: *mut core::ffi::c_void, cinfo: u32, rginfo: *const DCINFO) -> windows_core::HRESULT { @@ -11177,11 +11159,8 @@ impl windows_core::RuntimeName for IRowsetBookmark {} windows_core::imp::define_interface!(IRowsetChange, IRowsetChange_Vtbl, 0x0c733a05_2a1c_11ce_ade5_00aa0044773d); windows_core::imp::interface_hierarchy!(IRowsetChange, windows_core::IUnknown); impl IRowsetChange { - pub unsafe fn DeleteRows(&self, hreserved: usize, crows: usize, rghrows: *const usize) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).DeleteRows)(windows_core::Interface::as_raw(self), hreserved, crows, rghrows, &mut result__).map(|| result__) - } + pub unsafe fn DeleteRows(&self, hreserved: usize, crows: usize, rghrows: *const usize, rgrowstatus: *mut u32) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).DeleteRows)(windows_core::Interface::as_raw(self), hreserved, crows, rghrows, core::mem::transmute(rgrowstatus)).ok() } } pub unsafe fn SetData(&self, hrow: usize, haccessor: HACCESSOR, pdata: *const core::ffi::c_void) -> windows_core::Result<()> { unsafe { (windows_core::Interface::vtable(self).SetData)(windows_core::Interface::as_raw(self), hrow, haccessor, pdata).ok() } @@ -11201,7 +11180,7 @@ pub struct IRowsetChange_Vtbl { pub InsertRow: unsafe extern "system" fn(*mut core::ffi::c_void, usize, HACCESSOR, *const core::ffi::c_void, *mut usize) -> windows_core::HRESULT, } pub trait IRowsetChange_Impl: windows_core::IUnknownImpl { - fn DeleteRows(&self, hreserved: usize, crows: usize, rghrows: *const usize) -> windows_core::Result; + fn DeleteRows(&self, hreserved: usize, crows: usize, rghrows: *const usize, rgrowstatus: *mut u32) -> windows_core::Result<()>; fn SetData(&self, hrow: usize, haccessor: HACCESSOR, pdata: *const core::ffi::c_void) -> windows_core::Result<()>; fn InsertRow(&self, hreserved: usize, haccessor: HACCESSOR, pdata: *const core::ffi::c_void) -> windows_core::Result; } @@ -11210,13 +11189,7 @@ impl IRowsetChange_Vtbl { unsafe extern "system" fn DeleteRows(this: *mut core::ffi::c_void, hreserved: usize, crows: usize, rghrows: *const usize, rgrowstatus: *mut u32) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match IRowsetChange_Impl::DeleteRows(this, core::mem::transmute_copy(&hreserved), core::mem::transmute_copy(&crows), core::mem::transmute_copy(&rghrows)) { - Ok(ok__) => { - rgrowstatus.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + IRowsetChange_Impl::DeleteRows(this, core::mem::transmute_copy(&hreserved), core::mem::transmute_copy(&crows), core::mem::transmute_copy(&rghrows), core::mem::transmute_copy(&rgrowstatus)).into() } } unsafe extern "system" fn SetData(this: *mut core::ffi::c_void, hrow: usize, haccessor: HACCESSOR, pdata: *const core::ffi::c_void) -> windows_core::HRESULT { @@ -12371,11 +12344,8 @@ impl IRowsetUpdate { pub unsafe fn GetPendingRows(&self, hreserved: usize, dwrowstatus: u32, pcpendingrows: *mut usize, prgpendingrows: *mut *mut usize, prgpendingstatus: *mut *mut u32) -> windows_core::Result<()> { unsafe { (windows_core::Interface::vtable(self).GetPendingRows)(windows_core::Interface::as_raw(self), hreserved, dwrowstatus, core::mem::transmute(pcpendingrows), core::mem::transmute(prgpendingrows), core::mem::transmute(prgpendingstatus)).ok() } } - pub unsafe fn GetRowStatus(&self, hreserved: usize, crows: usize, rghrows: *const usize) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).GetRowStatus)(windows_core::Interface::as_raw(self), hreserved, crows, rghrows, &mut result__).map(|| result__) - } + pub unsafe fn GetRowStatus(&self, hreserved: usize, crows: usize, rghrows: *const usize, rgpendingstatus: *mut u32) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).GetRowStatus)(windows_core::Interface::as_raw(self), hreserved, crows, rghrows, core::mem::transmute(rgpendingstatus)).ok() } } pub unsafe fn Undo(&self, hreserved: usize, rghrows: &[usize], pcrowsundone: *mut usize, prgrowsundone: *mut *mut usize, prgrowstatus: *mut *mut u32) -> windows_core::Result<()> { unsafe { (windows_core::Interface::vtable(self).Undo)(windows_core::Interface::as_raw(self), hreserved, rghrows.len().try_into().unwrap(), core::mem::transmute(rghrows.as_ptr()), core::mem::transmute(pcrowsundone), core::mem::transmute(prgrowsundone), core::mem::transmute(prgrowstatus)).ok() } @@ -12396,7 +12366,7 @@ pub struct IRowsetUpdate_Vtbl { pub trait IRowsetUpdate_Impl: IRowsetChange_Impl { fn GetOriginalData(&self, hrow: usize, haccessor: HACCESSOR, pdata: *mut core::ffi::c_void) -> windows_core::Result<()>; fn GetPendingRows(&self, hreserved: usize, dwrowstatus: u32, pcpendingrows: *mut usize, prgpendingrows: *mut *mut usize, prgpendingstatus: *mut *mut u32) -> windows_core::Result<()>; - fn GetRowStatus(&self, hreserved: usize, crows: usize, rghrows: *const usize) -> windows_core::Result; + fn GetRowStatus(&self, hreserved: usize, crows: usize, rghrows: *const usize, rgpendingstatus: *mut u32) -> windows_core::Result<()>; fn Undo(&self, hreserved: usize, crows: usize, rghrows: *const usize, pcrowsundone: *mut usize, prgrowsundone: *mut *mut usize, prgrowstatus: *mut *mut u32) -> windows_core::Result<()>; fn Update(&self, hreserved: usize, crows: usize, rghrows: *const usize, pcrows: *mut usize, prgrows: *mut *mut usize, prgrowstatus: *mut *mut u32) -> windows_core::Result<()>; } @@ -12417,13 +12387,7 @@ impl IRowsetUpdate_Vtbl { unsafe extern "system" fn GetRowStatus(this: *mut core::ffi::c_void, hreserved: usize, crows: usize, rghrows: *const usize, rgpendingstatus: *mut u32) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match IRowsetUpdate_Impl::GetRowStatus(this, core::mem::transmute_copy(&hreserved), core::mem::transmute_copy(&crows), core::mem::transmute_copy(&rghrows)) { - Ok(ok__) => { - rgpendingstatus.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + IRowsetUpdate_Impl::GetRowStatus(this, core::mem::transmute_copy(&hreserved), core::mem::transmute_copy(&crows), core::mem::transmute_copy(&rghrows), core::mem::transmute_copy(&rgpendingstatus)).into() } } unsafe extern "system" fn Undo(this: *mut core::ffi::c_void, hreserved: usize, crows: usize, rghrows: *const usize, pcrowsundone: *mut usize, prgrowsundone: *mut *mut usize, prgrowstatus: *mut *mut u32) -> windows_core::HRESULT { @@ -13151,11 +13115,8 @@ impl IScopedOperations { { unsafe { (windows_core::Interface::vtable(self).Move)(windows_core::Interface::as_raw(self), crows, core::mem::transmute(rgpwszsourceurls.unwrap_or(core::mem::zeroed())), rgpwszdesturls, dwmoveflags, pauthenticate.param().abi(), core::mem::transmute(rgdwstatus), core::mem::transmute(rgpwsznewurls.unwrap_or(core::mem::zeroed())), core::mem::transmute(ppstringsbuffer.unwrap_or(core::mem::zeroed()))).ok() } } - pub unsafe fn Delete(&self, crows: usize, rgpwszurls: *const windows_core::PCWSTR, dwdeleteflags: u32) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).Delete)(windows_core::Interface::as_raw(self), crows, rgpwszurls, dwdeleteflags, &mut result__).map(|| result__) - } + pub unsafe fn Delete(&self, crows: usize, rgpwszurls: *const windows_core::PCWSTR, dwdeleteflags: u32, rgdwstatus: *mut u32) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).Delete)(windows_core::Interface::as_raw(self), crows, rgpwszurls, dwdeleteflags, core::mem::transmute(rgdwstatus)).ok() } } #[cfg(all(feature = "Win32_Storage_IndexServer", feature = "Win32_System_Com", feature = "Win32_System_Ole", feature = "Win32_System_Variant"))] pub unsafe fn OpenRowset(&self, punkouter: P0, ptableid: Option<*const super::super::Storage::IndexServer::DBID>, pindexid: Option<*const super::super::Storage::IndexServer::DBID>, riid: *const windows_core::GUID, rgpropertysets: &mut [DBPROPSET], pprowset: Option<*mut Option>) -> windows_core::Result<()> @@ -13186,7 +13147,7 @@ pub struct IScopedOperations_Vtbl { pub trait IScopedOperations_Impl: IBindResource_Impl { fn Copy(&self, crows: usize, rgpwszsourceurls: *const windows_core::PCWSTR, rgpwszdesturls: *const windows_core::PCWSTR, dwcopyflags: u32, pauthenticate: windows_core::Ref<'_, super::Com::IAuthenticate>, rgdwstatus: *mut u32, rgpwsznewurls: *mut windows_core::PWSTR, ppstringsbuffer: *mut *mut u16) -> windows_core::Result<()>; fn Move(&self, crows: usize, rgpwszsourceurls: *const windows_core::PCWSTR, rgpwszdesturls: *const windows_core::PCWSTR, dwmoveflags: u32, pauthenticate: windows_core::Ref<'_, super::Com::IAuthenticate>, rgdwstatus: *mut u32, rgpwsznewurls: *mut windows_core::PWSTR, ppstringsbuffer: *mut *mut u16) -> windows_core::Result<()>; - fn Delete(&self, crows: usize, rgpwszurls: *const windows_core::PCWSTR, dwdeleteflags: u32) -> windows_core::Result; + fn Delete(&self, crows: usize, rgpwszurls: *const windows_core::PCWSTR, dwdeleteflags: u32, rgdwstatus: *mut u32) -> windows_core::Result<()>; fn OpenRowset(&self, punkouter: windows_core::Ref<'_, windows_core::IUnknown>, ptableid: *const super::super::Storage::IndexServer::DBID, pindexid: *const super::super::Storage::IndexServer::DBID, riid: *const windows_core::GUID, cpropertysets: u32, rgpropertysets: *mut DBPROPSET, pprowset: windows_core::OutRef<'_, windows_core::IUnknown>) -> windows_core::Result<()>; } #[cfg(all(feature = "Win32_Storage_IndexServer", feature = "Win32_System_Com", feature = "Win32_System_Ole", feature = "Win32_System_Variant"))] @@ -13207,13 +13168,7 @@ impl IScopedOperations_Vtbl { unsafe extern "system" fn Delete(this: *mut core::ffi::c_void, crows: usize, rgpwszurls: *const windows_core::PCWSTR, dwdeleteflags: u32, rgdwstatus: *mut u32) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match IScopedOperations_Impl::Delete(this, core::mem::transmute_copy(&crows), core::mem::transmute_copy(&rgpwszurls), core::mem::transmute_copy(&dwdeleteflags)) { - Ok(ok__) => { - rgdwstatus.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + IScopedOperations_Impl::Delete(this, core::mem::transmute_copy(&crows), core::mem::transmute_copy(&rgpwszurls), core::mem::transmute_copy(&dwdeleteflags), core::mem::transmute_copy(&rgdwstatus)).into() } } unsafe extern "system" fn OpenRowset(this: *mut core::ffi::c_void, punkouter: *mut core::ffi::c_void, ptableid: *const super::super::Storage::IndexServer::DBID, pindexid: *const super::super::Storage::IndexServer::DBID, riid: *const windows_core::GUID, cpropertysets: u32, rgpropertysets: *mut DBPROPSET, pprowset: *mut *mut core::ffi::c_void) -> windows_core::HRESULT { @@ -14700,11 +14655,8 @@ impl ISearchPersistentItemsChangedSink { { unsafe { (windows_core::Interface::vtable(self).StoppedMonitoringScope)(windows_core::Interface::as_raw(self), pszurl.param().abi()).ok() } } - pub unsafe fn OnItemsChanged(&self, dwnumberofchanges: u32, datachangeentries: *const SEARCH_ITEM_PERSISTENT_CHANGE) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).OnItemsChanged)(windows_core::Interface::as_raw(self), dwnumberofchanges, datachangeentries, &mut result__).map(|| result__) - } + pub unsafe fn OnItemsChanged(&self, dwnumberofchanges: u32, datachangeentries: *const SEARCH_ITEM_PERSISTENT_CHANGE, hrcompletioncodes: *mut windows_core::HRESULT) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).OnItemsChanged)(windows_core::Interface::as_raw(self), dwnumberofchanges, datachangeentries, core::mem::transmute(hrcompletioncodes)).ok() } } } #[repr(C)] @@ -14717,7 +14669,7 @@ pub struct ISearchPersistentItemsChangedSink_Vtbl { pub trait ISearchPersistentItemsChangedSink_Impl: windows_core::IUnknownImpl { fn StartedMonitoringScope(&self, pszurl: &windows_core::PCWSTR) -> windows_core::Result<()>; fn StoppedMonitoringScope(&self, pszurl: &windows_core::PCWSTR) -> windows_core::Result<()>; - fn OnItemsChanged(&self, dwnumberofchanges: u32, datachangeentries: *const SEARCH_ITEM_PERSISTENT_CHANGE) -> windows_core::Result; + fn OnItemsChanged(&self, dwnumberofchanges: u32, datachangeentries: *const SEARCH_ITEM_PERSISTENT_CHANGE, hrcompletioncodes: *mut windows_core::HRESULT) -> windows_core::Result<()>; } impl ISearchPersistentItemsChangedSink_Vtbl { pub const fn new() -> Self { @@ -14736,13 +14688,7 @@ impl ISearchPersistentItemsChangedSink_Vtbl { unsafe extern "system" fn OnItemsChanged(this: *mut core::ffi::c_void, dwnumberofchanges: u32, datachangeentries: *const SEARCH_ITEM_PERSISTENT_CHANGE, hrcompletioncodes: *mut windows_core::HRESULT) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match ISearchPersistentItemsChangedSink_Impl::OnItemsChanged(this, core::mem::transmute_copy(&dwnumberofchanges), core::mem::transmute_copy(&datachangeentries)) { - Ok(ok__) => { - hrcompletioncodes.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + ISearchPersistentItemsChangedSink_Impl::OnItemsChanged(this, core::mem::transmute_copy(&dwnumberofchanges), core::mem::transmute_copy(&datachangeentries), core::mem::transmute_copy(&hrcompletioncodes)).into() } } Self { @@ -16318,11 +16264,8 @@ impl ISubscriptionItem { unsafe { (windows_core::Interface::vtable(self).SetSubscriptionItemInfo)(windows_core::Interface::as_raw(self), psubscriptioniteminfo).ok() } } #[cfg(all(feature = "Win32_System_Com", feature = "Win32_System_Ole", feature = "Win32_System_Variant"))] - pub unsafe fn ReadProperties(&self, ncount: u32, rgwszname: *const windows_core::PCWSTR) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).ReadProperties)(windows_core::Interface::as_raw(self), ncount, rgwszname, &mut result__).map(|| core::mem::transmute(result__)) - } + pub unsafe fn ReadProperties(&self, ncount: u32, rgwszname: *const windows_core::PCWSTR, rgvalue: *mut super::Variant::VARIANT) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).ReadProperties)(windows_core::Interface::as_raw(self), ncount, rgwszname, core::mem::transmute(rgvalue)).ok() } } #[cfg(all(feature = "Win32_System_Com", feature = "Win32_System_Ole", feature = "Win32_System_Variant"))] pub unsafe fn WriteProperties(&self, ncount: u32, rgwszname: *const windows_core::PCWSTR, rgvalue: *const super::Variant::VARIANT) -> windows_core::Result<()> { @@ -16360,7 +16303,7 @@ pub trait ISubscriptionItem_Impl: windows_core::IUnknownImpl { fn GetCookie(&self) -> windows_core::Result; fn GetSubscriptionItemInfo(&self, psubscriptioniteminfo: *mut SUBSCRIPTIONITEMINFO) -> windows_core::Result<()>; fn SetSubscriptionItemInfo(&self, psubscriptioniteminfo: *const SUBSCRIPTIONITEMINFO) -> windows_core::Result<()>; - fn ReadProperties(&self, ncount: u32, rgwszname: *const windows_core::PCWSTR) -> windows_core::Result; + fn ReadProperties(&self, ncount: u32, rgwszname: *const windows_core::PCWSTR, rgvalue: *mut super::Variant::VARIANT) -> windows_core::Result<()>; fn WriteProperties(&self, ncount: u32, rgwszname: *const windows_core::PCWSTR, rgvalue: *const super::Variant::VARIANT) -> windows_core::Result<()>; fn EnumProperties(&self) -> windows_core::Result; fn NotifyChanged(&self) -> windows_core::Result<()>; @@ -16395,13 +16338,7 @@ impl ISubscriptionItem_Vtbl { unsafe extern "system" fn ReadProperties(this: *mut core::ffi::c_void, ncount: u32, rgwszname: *const windows_core::PCWSTR, rgvalue: *mut super::Variant::VARIANT) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match ISubscriptionItem_Impl::ReadProperties(this, core::mem::transmute_copy(&ncount), core::mem::transmute_copy(&rgwszname)) { - Ok(ok__) => { - rgvalue.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + ISubscriptionItem_Impl::ReadProperties(this, core::mem::transmute_copy(&ncount), core::mem::transmute_copy(&rgwszname), core::mem::transmute_copy(&rgvalue)).into() } } unsafe extern "system" fn WriteProperties(this: *mut core::ffi::c_void, ncount: u32, rgwszname: *const windows_core::PCWSTR, rgvalue: *const super::Variant::VARIANT) -> windows_core::HRESULT { @@ -16614,11 +16551,8 @@ impl ISubscriptionMgr2 { (windows_core::Interface::vtable(self).GetItemFromCookie)(windows_core::Interface::as_raw(self), psubscriptioncookie, &mut result__).and_then(|| windows_core::Type::from_abi(result__)) } } - pub unsafe fn GetSubscriptionRunState(&self, dwnumcookies: u32, pcookies: *const windows_core::GUID) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).GetSubscriptionRunState)(windows_core::Interface::as_raw(self), dwnumcookies, pcookies, &mut result__).map(|| result__) - } + pub unsafe fn GetSubscriptionRunState(&self, dwnumcookies: u32, pcookies: *const windows_core::GUID, pdwrunstate: *mut u32) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).GetSubscriptionRunState)(windows_core::Interface::as_raw(self), dwnumcookies, pcookies, core::mem::transmute(pdwrunstate)).ok() } } pub unsafe fn EnumSubscriptions(&self, dwflags: u32) -> windows_core::Result { unsafe { @@ -16650,7 +16584,7 @@ pub struct ISubscriptionMgr2_Vtbl { pub trait ISubscriptionMgr2_Impl: ISubscriptionMgr_Impl { fn GetItemFromURL(&self, pwszurl: &windows_core::PCWSTR) -> windows_core::Result; fn GetItemFromCookie(&self, psubscriptioncookie: *const windows_core::GUID) -> windows_core::Result; - fn GetSubscriptionRunState(&self, dwnumcookies: u32, pcookies: *const windows_core::GUID) -> windows_core::Result; + fn GetSubscriptionRunState(&self, dwnumcookies: u32, pcookies: *const windows_core::GUID, pdwrunstate: *mut u32) -> windows_core::Result<()>; fn EnumSubscriptions(&self, dwflags: u32) -> windows_core::Result; fn UpdateItems(&self, dwflags: u32, dwnumcookies: u32, pcookies: *const windows_core::GUID) -> windows_core::Result<()>; fn AbortItems(&self, dwnumcookies: u32, pcookies: *const windows_core::GUID) -> windows_core::Result<()>; @@ -16685,13 +16619,7 @@ impl ISubscriptionMgr2_Vtbl { unsafe extern "system" fn GetSubscriptionRunState(this: *mut core::ffi::c_void, dwnumcookies: u32, pcookies: *const windows_core::GUID, pdwrunstate: *mut u32) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match ISubscriptionMgr2_Impl::GetSubscriptionRunState(this, core::mem::transmute_copy(&dwnumcookies), core::mem::transmute_copy(&pcookies)) { - Ok(ok__) => { - pdwrunstate.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + ISubscriptionMgr2_Impl::GetSubscriptionRunState(this, core::mem::transmute_copy(&dwnumcookies), core::mem::transmute_copy(&pcookies), core::mem::transmute_copy(&pdwrunstate)).into() } } unsafe extern "system" fn EnumSubscriptions(this: *mut core::ffi::c_void, dwflags: u32, ppenumsubscriptions: *mut *mut core::ffi::c_void) -> windows_core::HRESULT { diff --git a/crates/libs/windows/src/Windows/Win32/UI/ColorSystem/mod.rs b/crates/libs/windows/src/Windows/Win32/UI/ColorSystem/mod.rs index c4adc89f32..a34ff748d8 100644 --- a/crates/libs/windows/src/Windows/Win32/UI/ColorSystem/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/UI/ColorSystem/mod.rs @@ -1443,11 +1443,8 @@ impl IGamutMapModelPlugIn { { unsafe { (windows_core::Interface::vtable(self).Initialize)(windows_core::Interface::as_raw(self), core::mem::transmute_copy(bstrxml), psrcplugin.param().abi(), pdestplugin.param().abi(), psrcgbd, pdestgbd).ok() } } - pub unsafe fn SourceToDestinationAppearanceColors(&self, ccolors: u32, pinputcolors: *const JChColorF) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).SourceToDestinationAppearanceColors)(windows_core::Interface::as_raw(self), ccolors, pinputcolors, &mut result__).map(|| result__) - } + pub unsafe fn SourceToDestinationAppearanceColors(&self, ccolors: u32, pinputcolors: *const JChColorF, poutputcolors: *mut JChColorF) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).SourceToDestinationAppearanceColors)(windows_core::Interface::as_raw(self), ccolors, pinputcolors, core::mem::transmute(poutputcolors)).ok() } } } #[repr(C)] @@ -1458,7 +1455,7 @@ pub struct IGamutMapModelPlugIn_Vtbl { } pub trait IGamutMapModelPlugIn_Impl: windows_core::IUnknownImpl { fn Initialize(&self, bstrxml: &windows_core::BSTR, psrcplugin: windows_core::Ref<'_, IDeviceModelPlugIn>, pdestplugin: windows_core::Ref<'_, IDeviceModelPlugIn>, psrcgbd: *const GamutBoundaryDescription, pdestgbd: *const GamutBoundaryDescription) -> windows_core::Result<()>; - fn SourceToDestinationAppearanceColors(&self, ccolors: u32, pinputcolors: *const JChColorF) -> windows_core::Result; + fn SourceToDestinationAppearanceColors(&self, ccolors: u32, pinputcolors: *const JChColorF, poutputcolors: *mut JChColorF) -> windows_core::Result<()>; } impl IGamutMapModelPlugIn_Vtbl { pub const fn new() -> Self { @@ -1471,13 +1468,7 @@ impl IGamutMapModelPlugIn_Vtbl { unsafe extern "system" fn SourceToDestinationAppearanceColors(this: *mut core::ffi::c_void, ccolors: u32, pinputcolors: *const JChColorF, poutputcolors: *mut JChColorF) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match IGamutMapModelPlugIn_Impl::SourceToDestinationAppearanceColors(this, core::mem::transmute_copy(&ccolors), core::mem::transmute_copy(&pinputcolors)) { - Ok(ok__) => { - poutputcolors.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + IGamutMapModelPlugIn_Impl::SourceToDestinationAppearanceColors(this, core::mem::transmute_copy(&ccolors), core::mem::transmute_copy(&pinputcolors), core::mem::transmute_copy(&poutputcolors)).into() } } Self { diff --git a/crates/libs/windows/src/Windows/Win32/UI/Shell/PropertiesSystem/mod.rs b/crates/libs/windows/src/Windows/Win32/UI/Shell/PropertiesSystem/mod.rs index ae98baeb53..73ba7ce9b5 100644 --- a/crates/libs/windows/src/Windows/Win32/UI/Shell/PropertiesSystem/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/UI/Shell/PropertiesSystem/mod.rs @@ -697,15 +697,12 @@ where } #[cfg(all(feature = "Win32_System_Com_StructuredStorage", feature = "Win32_System_Variant"))] #[inline] -pub unsafe fn SHPropStgReadMultiple(pps: P0, ucodepage: u32, cpspec: u32, rgpspec: *const super::super::super::System::Com::StructuredStorage::PROPSPEC) -> windows_core::Result +pub unsafe fn SHPropStgReadMultiple(pps: P0, ucodepage: u32, cpspec: u32, rgpspec: *const super::super::super::System::Com::StructuredStorage::PROPSPEC, rgvar: *mut super::super::super::System::Com::StructuredStorage::PROPVARIANT) -> windows_core::Result<()> where P0: windows_core::Param, { windows_targets::link!("shell32.dll" "system" fn SHPropStgReadMultiple(pps : * mut core::ffi::c_void, ucodepage : u32, cpspec : u32, rgpspec : *const super::super::super::System::Com::StructuredStorage:: PROPSPEC, rgvar : *mut super::super::super::System::Com::StructuredStorage:: PROPVARIANT) -> windows_core::HRESULT); - unsafe { - let mut result__ = core::mem::zeroed(); - SHPropStgReadMultiple(pps.param().abi(), ucodepage, cpspec, rgpspec, &mut result__).map(|| core::mem::transmute(result__)) - } + unsafe { SHPropStgReadMultiple(pps.param().abi(), ucodepage, cpspec, rgpspec, core::mem::transmute(rgvar)).ok() } } #[cfg(all(feature = "Win32_System_Com_StructuredStorage", feature = "Win32_System_Variant"))] #[inline] diff --git a/crates/libs/windows/src/Windows/Win32/UI/Shell/mod.rs b/crates/libs/windows/src/Windows/Win32/UI/Shell/mod.rs index b2df242c9d..f0932b57b1 100644 --- a/crates/libs/windows/src/Windows/Win32/UI/Shell/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/UI/Shell/mod.rs @@ -15057,11 +15057,8 @@ impl ICategorizer { unsafe { (windows_core::Interface::vtable(self).GetDescription)(windows_core::Interface::as_raw(self), core::mem::transmute(pszdesc.as_ptr()), pszdesc.len().try_into().unwrap()).ok() } } #[cfg(feature = "Win32_UI_Shell_Common")] - pub unsafe fn GetCategory(&self, cidl: u32, apidl: *const *const Common::ITEMIDLIST) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).GetCategory)(windows_core::Interface::as_raw(self), cidl, apidl, &mut result__).map(|| result__) - } + pub unsafe fn GetCategory(&self, cidl: u32, apidl: *const *const Common::ITEMIDLIST, rgcategoryids: *mut u32) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).GetCategory)(windows_core::Interface::as_raw(self), cidl, apidl, core::mem::transmute(rgcategoryids)).ok() } } pub unsafe fn GetCategoryInfo(&self, dwcategoryid: u32, pci: *mut CATEGORY_INFO) -> windows_core::Result<()> { unsafe { (windows_core::Interface::vtable(self).GetCategoryInfo)(windows_core::Interface::as_raw(self), dwcategoryid, core::mem::transmute(pci)).ok() } @@ -15084,7 +15081,7 @@ pub struct ICategorizer_Vtbl { #[cfg(feature = "Win32_UI_Shell_Common")] pub trait ICategorizer_Impl: windows_core::IUnknownImpl { fn GetDescription(&self, pszdesc: windows_core::PWSTR, cch: u32) -> windows_core::Result<()>; - fn GetCategory(&self, cidl: u32, apidl: *const *const Common::ITEMIDLIST) -> windows_core::Result; + fn GetCategory(&self, cidl: u32, apidl: *const *const Common::ITEMIDLIST, rgcategoryids: *mut u32) -> windows_core::Result<()>; fn GetCategoryInfo(&self, dwcategoryid: u32, pci: *mut CATEGORY_INFO) -> windows_core::Result<()>; fn CompareCategory(&self, csfflags: CATSORT_FLAGS, dwcategoryid1: u32, dwcategoryid2: u32) -> windows_core::Result<()>; } @@ -15100,13 +15097,7 @@ impl ICategorizer_Vtbl { unsafe extern "system" fn GetCategory(this: *mut core::ffi::c_void, cidl: u32, apidl: *const *const Common::ITEMIDLIST, rgcategoryids: *mut u32) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match ICategorizer_Impl::GetCategory(this, core::mem::transmute_copy(&cidl), core::mem::transmute_copy(&apidl)) { - Ok(ok__) => { - rgcategoryids.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + ICategorizer_Impl::GetCategory(this, core::mem::transmute_copy(&cidl), core::mem::transmute_copy(&apidl), core::mem::transmute_copy(&rgcategoryids)).into() } } unsafe extern "system" fn GetCategoryInfo(this: *mut core::ffi::c_void, dwcategoryid: u32, pci: *mut CATEGORY_INFO) -> windows_core::HRESULT { diff --git a/crates/libs/windows/src/Windows/Win32/UI/TextServices/mod.rs b/crates/libs/windows/src/Windows/Win32/UI/TextServices/mod.rs index ebfe73ce1c..27902e1088 100644 --- a/crates/libs/windows/src/Windows/Win32/UI/TextServices/mod.rs +++ b/crates/libs/windows/src/Windows/Win32/UI/TextServices/mod.rs @@ -10329,11 +10329,8 @@ impl ITfLangBarItemMgr { (windows_core::Interface::vtable(self).GetItemFloatingRect)(windows_core::Interface::as_raw(self), dwthreadid, rguid, &mut result__).map(|| result__) } } - pub unsafe fn GetItemsStatus(&self, ulcount: u32, prgguid: *const windows_core::GUID) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).GetItemsStatus)(windows_core::Interface::as_raw(self), ulcount, prgguid, &mut result__).map(|| result__) - } + pub unsafe fn GetItemsStatus(&self, ulcount: u32, prgguid: *const windows_core::GUID, pdwstatus: *mut u32) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).GetItemsStatus)(windows_core::Interface::as_raw(self), ulcount, prgguid, core::mem::transmute(pdwstatus)).ok() } } pub unsafe fn GetItemNum(&self) -> windows_core::Result { unsafe { @@ -10344,11 +10341,8 @@ impl ITfLangBarItemMgr { pub unsafe fn GetItems(&self, ulcount: u32, ppitem: *mut Option, pinfo: *mut TF_LANGBARITEMINFO, pdwstatus: *mut u32, pcfetched: *mut u32) -> windows_core::Result<()> { unsafe { (windows_core::Interface::vtable(self).GetItems)(windows_core::Interface::as_raw(self), ulcount, core::mem::transmute(ppitem), core::mem::transmute(pinfo), core::mem::transmute(pdwstatus), core::mem::transmute(pcfetched)).ok() } } - pub unsafe fn AdviseItemsSink(&self, ulcount: u32, ppunk: *const Option, pguiditem: *const windows_core::GUID) -> windows_core::Result { - unsafe { - let mut result__ = core::mem::zeroed(); - (windows_core::Interface::vtable(self).AdviseItemsSink)(windows_core::Interface::as_raw(self), ulcount, core::mem::transmute(ppunk), pguiditem, &mut result__).map(|| result__) - } + pub unsafe fn AdviseItemsSink(&self, ulcount: u32, ppunk: *const Option, pguiditem: *const windows_core::GUID, pdwcookie: *mut u32) -> windows_core::Result<()> { + unsafe { (windows_core::Interface::vtable(self).AdviseItemsSink)(windows_core::Interface::as_raw(self), ulcount, core::mem::transmute(ppunk), pguiditem, core::mem::transmute(pdwcookie)).ok() } } pub unsafe fn UnadviseItemsSink(&self, pdwcookie: &[u32]) -> windows_core::Result<()> { unsafe { (windows_core::Interface::vtable(self).UnadviseItemsSink)(windows_core::Interface::as_raw(self), pdwcookie.len().try_into().unwrap(), core::mem::transmute(pdwcookie.as_ptr())).ok() } @@ -10378,10 +10372,10 @@ pub trait ITfLangBarItemMgr_Impl: windows_core::IUnknownImpl { fn AdviseItemSink(&self, punk: windows_core::Ref<'_, ITfLangBarItemSink>, pdwcookie: *mut u32, rguiditem: *const windows_core::GUID) -> windows_core::Result<()>; fn UnadviseItemSink(&self, dwcookie: u32) -> windows_core::Result<()>; fn GetItemFloatingRect(&self, dwthreadid: u32, rguid: *const windows_core::GUID) -> windows_core::Result; - fn GetItemsStatus(&self, ulcount: u32, prgguid: *const windows_core::GUID) -> windows_core::Result; + fn GetItemsStatus(&self, ulcount: u32, prgguid: *const windows_core::GUID, pdwstatus: *mut u32) -> windows_core::Result<()>; fn GetItemNum(&self) -> windows_core::Result; fn GetItems(&self, ulcount: u32, ppitem: windows_core::OutRef<'_, ITfLangBarItem>, pinfo: *mut TF_LANGBARITEMINFO, pdwstatus: *mut u32, pcfetched: *mut u32) -> windows_core::Result<()>; - fn AdviseItemsSink(&self, ulcount: u32, ppunk: *const Option, pguiditem: *const windows_core::GUID) -> windows_core::Result; + fn AdviseItemsSink(&self, ulcount: u32, ppunk: *const Option, pguiditem: *const windows_core::GUID, pdwcookie: *mut u32) -> windows_core::Result<()>; fn UnadviseItemsSink(&self, ulcount: u32, pdwcookie: *const u32) -> windows_core::Result<()>; } impl ITfLangBarItemMgr_Vtbl { @@ -10449,13 +10443,7 @@ impl ITfLangBarItemMgr_Vtbl { unsafe extern "system" fn GetItemsStatus(this: *mut core::ffi::c_void, ulcount: u32, prgguid: *const windows_core::GUID, pdwstatus: *mut u32) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match ITfLangBarItemMgr_Impl::GetItemsStatus(this, core::mem::transmute_copy(&ulcount), core::mem::transmute_copy(&prgguid)) { - Ok(ok__) => { - pdwstatus.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + ITfLangBarItemMgr_Impl::GetItemsStatus(this, core::mem::transmute_copy(&ulcount), core::mem::transmute_copy(&prgguid), core::mem::transmute_copy(&pdwstatus)).into() } } unsafe extern "system" fn GetItemNum(this: *mut core::ffi::c_void, pulcount: *mut u32) -> windows_core::HRESULT { @@ -10479,13 +10467,7 @@ impl ITfLangBarItemMgr_Vtbl { unsafe extern "system" fn AdviseItemsSink(this: *mut core::ffi::c_void, ulcount: u32, ppunk: *const *mut core::ffi::c_void, pguiditem: *const windows_core::GUID, pdwcookie: *mut u32) -> windows_core::HRESULT { unsafe { let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); - match ITfLangBarItemMgr_Impl::AdviseItemsSink(this, core::mem::transmute_copy(&ulcount), core::mem::transmute_copy(&ppunk), core::mem::transmute_copy(&pguiditem)) { - Ok(ok__) => { - pdwcookie.write(core::mem::transmute(ok__)); - windows_core::HRESULT(0) - } - Err(err) => err.into(), - } + ITfLangBarItemMgr_Impl::AdviseItemsSink(this, core::mem::transmute_copy(&ulcount), core::mem::transmute_copy(&ppunk), core::mem::transmute_copy(&pguiditem), core::mem::transmute_copy(&pdwcookie)).into() } } unsafe extern "system" fn UnadviseItemsSink(this: *mut core::ffi::c_void, ulcount: u32, pdwcookie: *const u32) -> windows_core::HRESULT {