Skip to content

Commit

Permalink
AssociatedEnum on pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
MarijnS95 committed Dec 16, 2023
1 parent aec20ed commit ea1c327
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 70 deletions.
Binary file modified crates/libs/bindgen/default/Windows.Win32.winmd
Binary file not shown.
48 changes: 12 additions & 36 deletions crates/libs/windows/src/Windows/Win32/Graphics/Dxgi/impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1475,23 +1475,17 @@ impl IDXGIOutput2_Vtbl {
#[doc = "Required features: `\"Win32_Graphics_Dxgi_Common\"`, `\"Win32_Graphics_Gdi\"`"]
#[cfg(all(feature = "Win32_Graphics_Dxgi_Common", feature = "Win32_Graphics_Gdi"))]
pub trait IDXGIOutput3_Impl: Sized + IDXGIOutput2_Impl {
fn CheckOverlaySupport(&self, enumformat: Common::DXGI_FORMAT, pconcerneddevice: ::core::option::Option<&::windows_core::IUnknown>) -> ::windows_core::Result<DXGI_OVERLAY_SUPPORT_FLAG>;
fn CheckOverlaySupport(&self, enumformat: Common::DXGI_FORMAT, pconcerneddevice: ::core::option::Option<&::windows_core::IUnknown>, pflags: DXGI_OVERLAY_SUPPORT_FLAG) -> ::windows_core::Result<()>;
}
#[cfg(all(feature = "Win32_Graphics_Dxgi_Common", feature = "Win32_Graphics_Gdi"))]
impl ::windows_core::RuntimeName for IDXGIOutput3 {}
#[cfg(all(feature = "Win32_Graphics_Dxgi_Common", feature = "Win32_Graphics_Gdi"))]
impl IDXGIOutput3_Vtbl {
pub const fn new<Identity: ::windows_core::IUnknownImpl<Impl = Impl>, Impl: IDXGIOutput3_Impl, const OFFSET: isize>() -> IDXGIOutput3_Vtbl {
unsafe extern "system" fn CheckOverlaySupport<Identity: ::windows_core::IUnknownImpl<Impl = Impl>, Impl: IDXGIOutput3_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, enumformat: Common::DXGI_FORMAT, pconcerneddevice: *mut ::core::ffi::c_void, pflags: *mut DXGI_OVERLAY_SUPPORT_FLAG) -> ::windows_core::HRESULT {
unsafe extern "system" fn CheckOverlaySupport<Identity: ::windows_core::IUnknownImpl<Impl = Impl>, Impl: IDXGIOutput3_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, enumformat: Common::DXGI_FORMAT, pconcerneddevice: *mut ::core::ffi::c_void, pflags: *mut u32) -> ::windows_core::HRESULT {
let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
let this = (*this).get_impl();
match this.CheckOverlaySupport(::core::mem::transmute_copy(&enumformat), ::windows_core::from_raw_borrowed(&pconcerneddevice)) {
::core::result::Result::Ok(ok__) => {
::core::ptr::write(pflags, ::core::mem::transmute(ok__));
::windows_core::HRESULT(0)
}
::core::result::Result::Err(err) => err.into(),
}
this.CheckOverlaySupport(::core::mem::transmute_copy(&enumformat), ::windows_core::from_raw_borrowed(&pconcerneddevice), ::core::mem::transmute_copy(&pflags)).into()
}
Self { base__: IDXGIOutput2_Vtbl::new::<Identity, Impl, OFFSET>(), CheckOverlaySupport: CheckOverlaySupport::<Identity, Impl, OFFSET> }
}
Expand All @@ -1502,23 +1496,17 @@ impl IDXGIOutput3_Vtbl {
#[doc = "Required features: `\"Win32_Graphics_Dxgi_Common\"`, `\"Win32_Graphics_Gdi\"`"]
#[cfg(all(feature = "Win32_Graphics_Dxgi_Common", feature = "Win32_Graphics_Gdi"))]
pub trait IDXGIOutput4_Impl: Sized + IDXGIOutput3_Impl {
fn CheckOverlayColorSpaceSupport(&self, format: Common::DXGI_FORMAT, colorspace: Common::DXGI_COLOR_SPACE_TYPE, pconcerneddevice: ::core::option::Option<&::windows_core::IUnknown>) -> ::windows_core::Result<DXGI_OVERLAY_COLOR_SPACE_SUPPORT_FLAG>;
fn CheckOverlayColorSpaceSupport(&self, format: Common::DXGI_FORMAT, colorspace: Common::DXGI_COLOR_SPACE_TYPE, pconcerneddevice: ::core::option::Option<&::windows_core::IUnknown>, pflags: DXGI_OVERLAY_COLOR_SPACE_SUPPORT_FLAG) -> ::windows_core::Result<()>;
}
#[cfg(all(feature = "Win32_Graphics_Dxgi_Common", feature = "Win32_Graphics_Gdi"))]
impl ::windows_core::RuntimeName for IDXGIOutput4 {}
#[cfg(all(feature = "Win32_Graphics_Dxgi_Common", feature = "Win32_Graphics_Gdi"))]
impl IDXGIOutput4_Vtbl {
pub const fn new<Identity: ::windows_core::IUnknownImpl<Impl = Impl>, Impl: IDXGIOutput4_Impl, const OFFSET: isize>() -> IDXGIOutput4_Vtbl {
unsafe extern "system" fn CheckOverlayColorSpaceSupport<Identity: ::windows_core::IUnknownImpl<Impl = Impl>, Impl: IDXGIOutput4_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, format: Common::DXGI_FORMAT, colorspace: Common::DXGI_COLOR_SPACE_TYPE, pconcerneddevice: *mut ::core::ffi::c_void, pflags: *mut DXGI_OVERLAY_COLOR_SPACE_SUPPORT_FLAG) -> ::windows_core::HRESULT {
unsafe extern "system" fn CheckOverlayColorSpaceSupport<Identity: ::windows_core::IUnknownImpl<Impl = Impl>, Impl: IDXGIOutput4_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, format: Common::DXGI_FORMAT, colorspace: Common::DXGI_COLOR_SPACE_TYPE, pconcerneddevice: *mut ::core::ffi::c_void, pflags: *mut u32) -> ::windows_core::HRESULT {
let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
let this = (*this).get_impl();
match this.CheckOverlayColorSpaceSupport(::core::mem::transmute_copy(&format), ::core::mem::transmute_copy(&colorspace), ::windows_core::from_raw_borrowed(&pconcerneddevice)) {
::core::result::Result::Ok(ok__) => {
::core::ptr::write(pflags, ::core::mem::transmute(ok__));
::windows_core::HRESULT(0)
}
::core::result::Result::Err(err) => err.into(),
}
this.CheckOverlayColorSpaceSupport(::core::mem::transmute_copy(&format), ::core::mem::transmute_copy(&colorspace), ::windows_core::from_raw_borrowed(&pconcerneddevice), ::core::mem::transmute_copy(&pflags)).into()
}
Self {
base__: IDXGIOutput3_Vtbl::new::<Identity, Impl, OFFSET>(),
Expand Down Expand Up @@ -1560,7 +1548,7 @@ impl IDXGIOutput5_Vtbl {
#[cfg(all(feature = "Win32_Graphics_Dxgi_Common", feature = "Win32_Graphics_Gdi"))]
pub trait IDXGIOutput6_Impl: Sized + IDXGIOutput5_Impl {
fn GetDesc1(&self, pdesc: *mut DXGI_OUTPUT_DESC1) -> ::windows_core::Result<()>;
fn CheckHardwareCompositionSupport(&self) -> ::windows_core::Result<DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAGS>;
fn CheckHardwareCompositionSupport(&self, pflags: DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAGS) -> ::windows_core::Result<()>;
}
#[cfg(all(feature = "Win32_Graphics_Dxgi_Common", feature = "Win32_Graphics_Gdi"))]
impl ::windows_core::RuntimeName for IDXGIOutput6 {}
Expand All @@ -1572,16 +1560,10 @@ impl IDXGIOutput6_Vtbl {
let this = (*this).get_impl();
this.GetDesc1(::core::mem::transmute_copy(&pdesc)).into()
}
unsafe extern "system" fn CheckHardwareCompositionSupport<Identity: ::windows_core::IUnknownImpl<Impl = Impl>, Impl: IDXGIOutput6_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, pflags: *mut DXGI_HARDWARE_COMPOSITION_SUPPORT_FLAGS) -> ::windows_core::HRESULT {
unsafe extern "system" fn CheckHardwareCompositionSupport<Identity: ::windows_core::IUnknownImpl<Impl = Impl>, Impl: IDXGIOutput6_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, pflags: *mut u32) -> ::windows_core::HRESULT {
let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
let this = (*this).get_impl();
match this.CheckHardwareCompositionSupport() {
::core::result::Result::Ok(ok__) => {
::core::ptr::write(pflags, ::core::mem::transmute(ok__));
::windows_core::HRESULT(0)
}
::core::result::Result::Err(err) => err.into(),
}
this.CheckHardwareCompositionSupport(::core::mem::transmute_copy(&pflags)).into()
}
Self {
base__: IDXGIOutput5_Vtbl::new::<Identity, Impl, OFFSET>(),
Expand Down Expand Up @@ -2163,7 +2145,7 @@ impl IDXGISwapChain2_Vtbl {
#[cfg(feature = "Win32_Graphics_Dxgi_Common")]
pub trait IDXGISwapChain3_Impl: Sized + IDXGISwapChain2_Impl {
fn GetCurrentBackBufferIndex(&self) -> u32;
fn CheckColorSpaceSupport(&self, colorspace: Common::DXGI_COLOR_SPACE_TYPE) -> ::windows_core::Result<DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG>;
fn CheckColorSpaceSupport(&self, colorspace: Common::DXGI_COLOR_SPACE_TYPE, pcolorspacesupport: DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG) -> ::windows_core::Result<()>;
fn SetColorSpace1(&self, colorspace: Common::DXGI_COLOR_SPACE_TYPE) -> ::windows_core::Result<()>;
fn ResizeBuffers1(&self, buffercount: u32, width: u32, height: u32, format: Common::DXGI_FORMAT, swapchainflags: &DXGI_SWAP_CHAIN_FLAG, pcreationnodemask: *const u32, pppresentqueue: *const ::core::option::Option<::windows_core::IUnknown>) -> ::windows_core::Result<()>;
}
Expand All @@ -2177,16 +2159,10 @@ impl IDXGISwapChain3_Vtbl {
let this = (*this).get_impl();
this.GetCurrentBackBufferIndex()
}
unsafe extern "system" fn CheckColorSpaceSupport<Identity: ::windows_core::IUnknownImpl<Impl = Impl>, Impl: IDXGISwapChain3_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, colorspace: Common::DXGI_COLOR_SPACE_TYPE, pcolorspacesupport: *mut DXGI_SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG) -> ::windows_core::HRESULT {
unsafe extern "system" fn CheckColorSpaceSupport<Identity: ::windows_core::IUnknownImpl<Impl = Impl>, Impl: IDXGISwapChain3_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, colorspace: Common::DXGI_COLOR_SPACE_TYPE, pcolorspacesupport: *mut u32) -> ::windows_core::HRESULT {
let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
let this = (*this).get_impl();
match this.CheckColorSpaceSupport(::core::mem::transmute_copy(&colorspace)) {
::core::result::Result::Ok(ok__) => {
::core::ptr::write(pcolorspacesupport, ::core::mem::transmute(ok__));
::windows_core::HRESULT(0)
}
::core::result::Result::Err(err) => err.into(),
}
this.CheckColorSpaceSupport(::core::mem::transmute_copy(&colorspace), ::core::mem::transmute_copy(&pcolorspacesupport)).into()
}
unsafe extern "system" fn SetColorSpace1<Identity: ::windows_core::IUnknownImpl<Impl = Impl>, Impl: IDXGISwapChain3_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, colorspace: Common::DXGI_COLOR_SPACE_TYPE) -> ::windows_core::HRESULT {
let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
Expand Down
Loading

0 comments on commit ea1c327

Please sign in to comment.