Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update API contracts #2745

Merged
merged 2 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified crates/libs/bindgen/default/Windows.winmd
Binary file not shown.
2 changes: 1 addition & 1 deletion crates/libs/bindgen/default/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ like [ILSpy](https://github.com/icsharpcode/ILSpy).

## Windows.winmd
- Source: https://www.nuget.org/packages/Microsoft.Windows.SDK.Contracts
- Version: 10.0.22621.755
- Version: 10.0.22621.2428

The `Windows.winmd` file was created by merging the .winmd files from the last nuget package as follows:

Expand Down
2 changes: 2 additions & 0 deletions crates/libs/windows/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ System_Profile = ["System"]
System_Profile_SystemManufacturers = ["System_Profile"]
System_RemoteDesktop = ["System"]
System_RemoteDesktop_Input = ["System_RemoteDesktop"]
System_RemoteDesktop_Provider = ["System_RemoteDesktop"]
System_RemoteSystems = ["System"]
System_Threading = ["System"]
System_Threading_Core = ["System_Threading"]
Expand Down Expand Up @@ -345,6 +346,7 @@ UI_Input_Preview_Injection = ["UI_Input_Preview"]
UI_Input_Spatial = ["UI_Input"]
UI_Notifications = ["UI"]
UI_Notifications_Management = ["UI_Notifications"]
UI_Notifications_Preview = ["UI_Notifications"]
UI_Popups = ["UI"]
UI_Shell = ["UI"]
UI_StartScreen = ["UI"]
Expand Down
40 changes: 40 additions & 0 deletions crates/libs/windows/src/Windows/Devices/Lights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,24 @@ pub struct ILampArray_Vtbl {
#[doc(hidden)]
#[repr(transparent)]
#[derive(::core::cmp::PartialEq, ::core::cmp::Eq, ::core::fmt::Debug, ::core::clone::Clone)]
pub struct ILampArray2(::windows_core::IUnknown);
unsafe impl ::windows_core::Interface for ILampArray2 {
type Vtable = ILampArray2_Vtbl;
}
unsafe impl ::windows_core::ComInterface for ILampArray2 {
const IID: ::windows_core::GUID = ::windows_core::GUID::from_u128(0x050c181f_60a8_4711_a1af_1b1b4c658ea2);
}
#[repr(C)]
#[doc(hidden)]
pub struct ILampArray2_Vtbl {
pub base__: ::windows_core::IInspectable_Vtbl,
pub IsAvailable: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut bool) -> ::windows_core::HRESULT,
pub AvailabilityChanged: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, handler: *mut ::core::ffi::c_void, result__: *mut super::super::Foundation::EventRegistrationToken) -> ::windows_core::HRESULT,
pub RemoveAvailabilityChanged: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, token: super::super::Foundation::EventRegistrationToken) -> ::windows_core::HRESULT,
}
#[doc(hidden)]
#[repr(transparent)]
#[derive(::core::cmp::PartialEq, ::core::cmp::Eq, ::core::fmt::Debug, ::core::clone::Clone)]
pub struct ILampArrayStatics(::windows_core::IUnknown);
unsafe impl ::windows_core::Interface for ILampArrayStatics {
type Vtable = ILampArrayStatics_Vtbl;
Expand Down Expand Up @@ -488,6 +506,27 @@ impl LampArray {
(::windows_core::Interface::vtable(this).RequestMessageAsync)(::windows_core::Interface::as_raw(this), messageid, &mut result__).from_abi(result__)
}
}
pub fn IsAvailable(&self) -> ::windows_core::Result<bool> {
let this = &::windows_core::ComInterface::cast::<ILampArray2>(self)?;
unsafe {
let mut result__ = ::std::mem::zeroed();
(::windows_core::Interface::vtable(this).IsAvailable)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
pub fn AvailabilityChanged<P0>(&self, handler: P0) -> ::windows_core::Result<super::super::Foundation::EventRegistrationToken>
where
P0: ::windows_core::IntoParam<super::super::Foundation::TypedEventHandler<LampArray, ::windows_core::IInspectable>>,
{
let this = &::windows_core::ComInterface::cast::<ILampArray2>(self)?;
unsafe {
let mut result__ = ::std::mem::zeroed();
(::windows_core::Interface::vtable(this).AvailabilityChanged)(::windows_core::Interface::as_raw(this), handler.into_param().abi(), &mut result__).from_abi(result__)
}
}
pub fn RemoveAvailabilityChanged(&self, token: super::super::Foundation::EventRegistrationToken) -> ::windows_core::Result<()> {
let this = &::windows_core::ComInterface::cast::<ILampArray2>(self)?;
unsafe { (::windows_core::Interface::vtable(this).RemoveAvailabilityChanged)(::windows_core::Interface::as_raw(this), token).ok() }
}
pub fn GetDeviceSelector() -> ::windows_core::Result<::windows_core::HSTRING> {
Self::ILampArrayStatics(|this| unsafe {
let mut result__ = ::std::mem::zeroed();
Expand Down Expand Up @@ -659,6 +698,7 @@ impl LampArrayKind {
pub const Wearable: Self = Self(8i32);
pub const Furniture: Self = Self(9i32);
pub const Art: Self = Self(10i32);
pub const Headset: Self = Self(11i32);
}
impl ::core::marker::Copy for LampArrayKind {}
impl ::core::clone::Clone for LampArrayKind {
Expand Down
71 changes: 71 additions & 0 deletions crates/libs/windows/src/Windows/Devices/Sensors/impl.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,74 @@
pub trait IHumanPresenceSensorExtension_Impl: Sized {
fn Initialize(&self, deviceinterface: &::windows_core::HSTRING) -> ::windows_core::Result<()>;
fn Start(&self) -> ::windows_core::Result<()>;
fn ProcessReading(&self, reading: ::core::option::Option<&HumanPresenceSensorReading>) -> ::windows_core::Result<HumanPresenceSensorReadingUpdate>;
fn ProcessReadingTimeoutExpired(&self, reading: ::core::option::Option<&HumanPresenceSensorReading>) -> ::windows_core::Result<()>;
fn Stop(&self) -> ::windows_core::Result<()>;
fn Uninitialize(&self) -> ::windows_core::Result<()>;
fn Reset(&self) -> ::windows_core::Result<()>;
}
impl ::windows_core::RuntimeName for IHumanPresenceSensorExtension {
const NAME: &'static str = "Windows.Devices.Sensors.IHumanPresenceSensorExtension";
}
impl IHumanPresenceSensorExtension_Vtbl {
pub const fn new<Identity: ::windows_core::IUnknownImpl<Impl = Impl>, Impl: IHumanPresenceSensorExtension_Impl, const OFFSET: isize>() -> IHumanPresenceSensorExtension_Vtbl {
unsafe extern "system" fn Initialize<Identity: ::windows_core::IUnknownImpl<Impl = Impl>, Impl: IHumanPresenceSensorExtension_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, deviceinterface: ::std::mem::MaybeUninit<::windows_core::HSTRING>) -> ::windows_core::HRESULT {
let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
let this = (*this).get_impl();
this.Initialize(::core::mem::transmute(&deviceinterface)).into()
}
unsafe extern "system" fn Start<Identity: ::windows_core::IUnknownImpl<Impl = Impl>, Impl: IHumanPresenceSensorExtension_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void) -> ::windows_core::HRESULT {
let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
let this = (*this).get_impl();
this.Start().into()
}
unsafe extern "system" fn ProcessReading<Identity: ::windows_core::IUnknownImpl<Impl = Impl>, Impl: IHumanPresenceSensorExtension_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, reading: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT {
let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
let this = (*this).get_impl();
match this.ProcessReading(::windows_core::from_raw_borrowed(&reading)) {
::core::result::Result::Ok(ok__) => {
::core::ptr::write(result__, ::core::mem::transmute_copy(&ok__));
::core::mem::forget(ok__);
::windows_core::HRESULT(0)
}
::core::result::Result::Err(err) => err.into(),
}
}
unsafe extern "system" fn ProcessReadingTimeoutExpired<Identity: ::windows_core::IUnknownImpl<Impl = Impl>, Impl: IHumanPresenceSensorExtension_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void, reading: *mut ::core::ffi::c_void) -> ::windows_core::HRESULT {
let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
let this = (*this).get_impl();
this.ProcessReadingTimeoutExpired(::windows_core::from_raw_borrowed(&reading)).into()
}
unsafe extern "system" fn Stop<Identity: ::windows_core::IUnknownImpl<Impl = Impl>, Impl: IHumanPresenceSensorExtension_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void) -> ::windows_core::HRESULT {
let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
let this = (*this).get_impl();
this.Stop().into()
}
unsafe extern "system" fn Uninitialize<Identity: ::windows_core::IUnknownImpl<Impl = Impl>, Impl: IHumanPresenceSensorExtension_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void) -> ::windows_core::HRESULT {
let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
let this = (*this).get_impl();
this.Uninitialize().into()
}
unsafe extern "system" fn Reset<Identity: ::windows_core::IUnknownImpl<Impl = Impl>, Impl: IHumanPresenceSensorExtension_Impl, const OFFSET: isize>(this: *mut ::core::ffi::c_void) -> ::windows_core::HRESULT {
let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
let this = (*this).get_impl();
this.Reset().into()
}
Self {
base__: ::windows_core::IInspectable_Vtbl::new::<Identity, IHumanPresenceSensorExtension, OFFSET>(),
Initialize: Initialize::<Identity, Impl, OFFSET>,
Start: Start::<Identity, Impl, OFFSET>,
ProcessReading: ProcessReading::<Identity, Impl, OFFSET>,
ProcessReadingTimeoutExpired: ProcessReadingTimeoutExpired::<Identity, Impl, OFFSET>,
Stop: Stop::<Identity, Impl, OFFSET>,
Uninitialize: Uninitialize::<Identity, Impl, OFFSET>,
Reset: Reset::<Identity, Impl, OFFSET>,
}
}
pub unsafe fn matches(iid: *const ::windows_core::GUID) -> bool {
*iid == <IHumanPresenceSensorExtension as ::windows_core::ComInterface>::IID
}
}
pub trait ISensorDataThreshold_Impl: Sized {}
impl ::windows_core::RuntimeName for ISensorDataThreshold {
const NAME: &'static str = "Windows.Devices.Sensors.ISensorDataThreshold";
Expand Down
Loading