Skip to content

Commit

Permalink
update bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
Arlie Davis committed May 17, 2024
1 parent b3f4357 commit e18384f
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 39 deletions.
16 changes: 8 additions & 8 deletions crates/samples/components/json_validator_winrt/src/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ pub struct IJsonValidator_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Validate: unsafe extern "system" fn(
*mut core::ffi::c_void,
std::mem::MaybeUninit<windows_core::HSTRING>,
*mut std::mem::MaybeUninit<windows_core::HSTRING>,
core::mem::MaybeUninit<windows_core::HSTRING>,
*mut core::mem::MaybeUninit<windows_core::HSTRING>,
) -> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
Expand All @@ -39,7 +39,7 @@ pub struct IJsonValidatorFactory_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub CreateInstance: unsafe extern "system" fn(
*mut core::ffi::c_void,
std::mem::MaybeUninit<windows_core::HSTRING>,
core::mem::MaybeUninit<windows_core::HSTRING>,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
Expand All @@ -58,7 +58,7 @@ impl JsonValidator {
) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = std::mem::zeroed();
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Validate)(
windows_core::Interface::as_raw(this),
core::mem::transmute_copy(value),
Expand All @@ -69,7 +69,7 @@ impl JsonValidator {
}
pub fn CreateInstance(schema: &windows_core::HSTRING) -> windows_core::Result<JsonValidator> {
Self::IJsonValidatorFactory(|this| unsafe {
let mut result__ = std::mem::zeroed();
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).CreateInstance)(
windows_core::Interface::as_raw(this),
core::mem::transmute_copy(schema),
Expand Down Expand Up @@ -124,8 +124,8 @@ impl IJsonValidator_Vtbl {
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
value: std::mem::MaybeUninit<windows_core::HSTRING>,
result__: *mut std::mem::MaybeUninit<windows_core::HSTRING>,
value: core::mem::MaybeUninit<windows_core::HSTRING>,
result__: *mut core::mem::MaybeUninit<windows_core::HSTRING>,
) -> windows_core::HRESULT {
let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
let this = (*this).get_impl();
Expand Down Expand Up @@ -166,7 +166,7 @@ impl IJsonValidatorFactory_Vtbl {
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
schema: std::mem::MaybeUninit<windows_core::HSTRING>,
schema: core::mem::MaybeUninit<windows_core::HSTRING>,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ pub struct IJsonValidator_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Validate: unsafe extern "system" fn(
*mut core::ffi::c_void,
std::mem::MaybeUninit<windows_core::HSTRING>,
*mut std::mem::MaybeUninit<windows_core::HSTRING>,
core::mem::MaybeUninit<windows_core::HSTRING>,
*mut core::mem::MaybeUninit<windows_core::HSTRING>,
) -> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
Expand All @@ -39,7 +39,7 @@ pub struct IJsonValidatorFactory_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub CreateInstance: unsafe extern "system" fn(
*mut core::ffi::c_void,
std::mem::MaybeUninit<windows_core::HSTRING>,
core::mem::MaybeUninit<windows_core::HSTRING>,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
Expand All @@ -58,7 +58,7 @@ impl JsonValidator {
) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = std::mem::zeroed();
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Validate)(
windows_core::Interface::as_raw(this),
core::mem::transmute_copy(value),
Expand All @@ -69,7 +69,7 @@ impl JsonValidator {
}
pub fn CreateInstance(schema: &windows_core::HSTRING) -> windows_core::Result<JsonValidator> {
Self::IJsonValidatorFactory(|this| unsafe {
let mut result__ = std::mem::zeroed();
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).CreateInstance)(
windows_core::Interface::as_raw(this),
core::mem::transmute_copy(schema),
Expand Down
30 changes: 15 additions & 15 deletions crates/tests/component/src/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ pub mod Nested {
IThing_Vtbl,
0x5448be22_9873_5ae6_9106_f6e8455d2fdd
);
impl std::ops::Deref for IThing {
impl core::ops::Deref for IThing {
type Target = windows_core::IInspectable;
fn deref(&self) -> &Self::Target {
unsafe { std::mem::transmute(self) }
unsafe { core::mem::transmute(self) }
}
}
windows_core::imp::interface_hierarchy!(
Expand Down Expand Up @@ -103,13 +103,13 @@ pub struct IClass_Vtbl {
pub StringArray: unsafe extern "system" fn(
*mut core::ffi::c_void,
u32,
*const std::mem::MaybeUninit<windows_core::HSTRING>,
*const core::mem::MaybeUninit<windows_core::HSTRING>,
u32,
*mut std::mem::MaybeUninit<windows_core::HSTRING>,
*mut core::mem::MaybeUninit<windows_core::HSTRING>,
*mut u32,
*mut *mut std::mem::MaybeUninit<windows_core::HSTRING>,
*mut *mut core::mem::MaybeUninit<windows_core::HSTRING>,
*mut u32,
*mut *mut std::mem::MaybeUninit<windows_core::HSTRING>,
*mut *mut core::mem::MaybeUninit<windows_core::HSTRING>,
) -> windows_core::HRESULT,
pub Input: unsafe extern "system" fn(
*mut core::ffi::c_void,
Expand Down Expand Up @@ -140,7 +140,7 @@ impl Class {
pub fn Property(&self) -> windows_core::Result<i32> {
let this = self;
unsafe {
let mut result__ = std::mem::zeroed();
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Property)(
windows_core::Interface::as_raw(this),
&mut result__,
Expand All @@ -161,7 +161,7 @@ impl Class {
pub fn Flags(&self) -> windows_core::Result<Flags> {
let this = self;
unsafe {
let mut result__ = std::mem::zeroed();
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Flags)(
windows_core::Interface::as_raw(this),
&mut result__,
Expand All @@ -186,7 +186,7 @@ impl Class {
b.as_mut_ptr(),
c.set_abi_len(),
c as *mut _ as _,
windows_core::Array::<i32>::set_abi_len(std::mem::transmute(&mut result__)),
windows_core::Array::<i32>::set_abi_len(core::mem::transmute(&mut result__)),
result__.as_mut_ptr() as *mut _ as _,
)
.map(|| result__.assume_init())
Expand All @@ -209,7 +209,7 @@ impl Class {
core::mem::transmute_copy(&b),
c.set_abi_len(),
c as *mut _ as _,
windows_core::Array::<windows_core::HSTRING>::set_abi_len(std::mem::transmute(
windows_core::Array::<windows_core::HSTRING>::set_abi_len(core::mem::transmute(
&mut result__,
)),
result__.as_mut_ptr() as *mut _ as _,
Expand Down Expand Up @@ -318,7 +318,7 @@ impl Callback {
pub fn Invoke(&self, a: i32) -> windows_core::Result<i32> {
let this = self;
unsafe {
let mut result__ = std::mem::zeroed();
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Invoke)(
windows_core::Interface::as_raw(this),
a,
Expand Down Expand Up @@ -531,13 +531,13 @@ impl IClass_Vtbl {
>(
this: *mut core::ffi::c_void,
a_array_size: u32,
a: *const std::mem::MaybeUninit<windows_core::HSTRING>,
a: *const core::mem::MaybeUninit<windows_core::HSTRING>,
b_array_size: u32,
b: *mut std::mem::MaybeUninit<windows_core::HSTRING>,
b: *mut core::mem::MaybeUninit<windows_core::HSTRING>,
c_array_size: *mut u32,
c: *mut *mut std::mem::MaybeUninit<windows_core::HSTRING>,
c: *mut *mut core::mem::MaybeUninit<windows_core::HSTRING>,
result_size__: *mut u32,
result__: *mut *mut std::mem::MaybeUninit<windows_core::HSTRING>,
result__: *mut *mut core::mem::MaybeUninit<windows_core::HSTRING>,
) -> windows_core::HRESULT {
let this = (this as *const *const ()).offset(OFFSET) as *const Identity;
let this = (*this).get_impl();
Expand Down
22 changes: 11 additions & 11 deletions crates/tests/component_client/src/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ pub mod Nested {
IThing_Vtbl,
0x5448be22_9873_5ae6_9106_f6e8455d2fdd
);
impl std::ops::Deref for IThing {
impl core::ops::Deref for IThing {
type Target = windows_core::IInspectable;
fn deref(&self) -> &Self::Target {
unsafe { std::mem::transmute(self) }
unsafe { core::mem::transmute(self) }
}
}
windows_core::imp::interface_hierarchy!(
Expand Down Expand Up @@ -71,13 +71,13 @@ pub struct IClass_Vtbl {
pub StringArray: unsafe extern "system" fn(
*mut core::ffi::c_void,
u32,
*const std::mem::MaybeUninit<windows_core::HSTRING>,
*const core::mem::MaybeUninit<windows_core::HSTRING>,
u32,
*mut std::mem::MaybeUninit<windows_core::HSTRING>,
*mut core::mem::MaybeUninit<windows_core::HSTRING>,
*mut u32,
*mut *mut std::mem::MaybeUninit<windows_core::HSTRING>,
*mut *mut core::mem::MaybeUninit<windows_core::HSTRING>,
*mut u32,
*mut *mut std::mem::MaybeUninit<windows_core::HSTRING>,
*mut *mut core::mem::MaybeUninit<windows_core::HSTRING>,
) -> windows_core::HRESULT,
pub Input: unsafe extern "system" fn(
*mut core::ffi::c_void,
Expand Down Expand Up @@ -108,7 +108,7 @@ impl Class {
pub fn Property(&self) -> windows_core::Result<i32> {
let this = self;
unsafe {
let mut result__ = std::mem::zeroed();
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Property)(
windows_core::Interface::as_raw(this),
&mut result__,
Expand All @@ -129,7 +129,7 @@ impl Class {
pub fn Flags(&self) -> windows_core::Result<Flags> {
let this = self;
unsafe {
let mut result__ = std::mem::zeroed();
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Flags)(
windows_core::Interface::as_raw(this),
&mut result__,
Expand All @@ -154,7 +154,7 @@ impl Class {
b.as_mut_ptr(),
c.set_abi_len(),
c as *mut _ as _,
windows_core::Array::<i32>::set_abi_len(std::mem::transmute(&mut result__)),
windows_core::Array::<i32>::set_abi_len(core::mem::transmute(&mut result__)),
result__.as_mut_ptr() as *mut _ as _,
)
.map(|| result__.assume_init())
Expand All @@ -177,7 +177,7 @@ impl Class {
core::mem::transmute_copy(&b),
c.set_abi_len(),
c as *mut _ as _,
windows_core::Array::<windows_core::HSTRING>::set_abi_len(std::mem::transmute(
windows_core::Array::<windows_core::HSTRING>::set_abi_len(core::mem::transmute(
&mut result__,
)),
result__.as_mut_ptr() as *mut _ as _,
Expand Down Expand Up @@ -286,7 +286,7 @@ impl Callback {
pub fn Invoke(&self, a: i32) -> windows_core::Result<i32> {
let this = self;
unsafe {
let mut result__ = std::mem::zeroed();
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Invoke)(
windows_core::Interface::as_raw(this),
a,
Expand Down

0 comments on commit e18384f

Please sign in to comment.