-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
1,257 additions
and
333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,230 @@ | ||
#![allow( | ||
non_snake_case, | ||
non_upper_case_globals, | ||
non_camel_case_types, | ||
dead_code, | ||
clippy::all | ||
)] | ||
|
||
windows_core::imp::define_interface!( | ||
IAsyncAction, | ||
IAsyncAction_Vtbl, | ||
0x5a648006_843a_4da9_865b_9d26e5dfad7b | ||
); | ||
impl windows_core::RuntimeType for IAsyncAction { | ||
const SIGNATURE: windows_core::imp::ConstBuffer = | ||
windows_core::imp::ConstBuffer::for_interface::<Self>(); | ||
} | ||
windows_core::imp::interface_hierarchy!( | ||
IAsyncAction, | ||
windows_core::IUnknown, | ||
windows_core::IInspectable | ||
); | ||
windows_core::imp::required_hierarchy!(IAsyncAction, IAsyncInfo); | ||
impl IAsyncAction { | ||
pub fn GetResults(&self) -> windows_core::Result<()> { | ||
let this = self; | ||
unsafe { | ||
(windows_core::Interface::vtable(this).GetResults)(windows_core::Interface::as_raw( | ||
this, | ||
)) | ||
.ok() | ||
} | ||
} | ||
pub fn Id(&self) -> windows_core::Result<u32> { | ||
let this = &windows_core::Interface::cast::<IAsyncInfo>(self)?; | ||
unsafe { | ||
let mut result__ = core::mem::zeroed(); | ||
(windows_core::Interface::vtable(this).Id)( | ||
windows_core::Interface::as_raw(this), | ||
&mut result__, | ||
) | ||
.map(|| result__) | ||
} | ||
} | ||
pub fn ErrorCode(&self) -> windows_core::Result<windows_core::HRESULT> { | ||
let this = &windows_core::Interface::cast::<IAsyncInfo>(self)?; | ||
unsafe { | ||
let mut result__ = core::mem::zeroed(); | ||
(windows_core::Interface::vtable(this).ErrorCode)( | ||
windows_core::Interface::as_raw(this), | ||
&mut result__, | ||
) | ||
.map(|| result__) | ||
} | ||
} | ||
pub fn Cancel(&self) -> windows_core::Result<()> { | ||
let this = &windows_core::Interface::cast::<IAsyncInfo>(self)?; | ||
unsafe { | ||
(windows_core::Interface::vtable(this).Cancel)(windows_core::Interface::as_raw(this)) | ||
.ok() | ||
} | ||
} | ||
pub fn Close(&self) -> windows_core::Result<()> { | ||
let this = &windows_core::Interface::cast::<IAsyncInfo>(self)?; | ||
unsafe { | ||
(windows_core::Interface::vtable(this).Close)(windows_core::Interface::as_raw(this)) | ||
.ok() | ||
} | ||
} | ||
} | ||
unsafe impl Send for IAsyncAction {} | ||
unsafe impl Sync for IAsyncAction {} | ||
impl windows_core::RuntimeName for IAsyncAction { | ||
const NAME: &'static str = "Windows.Foundation.IAsyncAction"; | ||
} | ||
pub trait IAsyncAction_Impl: IAsyncInfo_Impl { | ||
fn GetResults(&self) -> windows_core::Result<()>; | ||
} | ||
impl IAsyncAction_Vtbl { | ||
pub const fn new<Identity: IAsyncAction_Impl, const OFFSET: isize>() -> Self { | ||
unsafe extern "system" fn GetResults<Identity: IAsyncAction_Impl, const OFFSET: isize>( | ||
this: *mut core::ffi::c_void, | ||
) -> windows_core::HRESULT { | ||
let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); | ||
IAsyncAction_Impl::GetResults(this).into() | ||
} | ||
Self { | ||
base__: windows_core::IInspectable_Vtbl::new::<Identity, IAsyncAction, OFFSET>(), | ||
put_Completed: 0, | ||
get_Completed: 0, | ||
GetResults: GetResults::<Identity, OFFSET>, | ||
} | ||
} | ||
pub fn matches(iid: &windows_core::GUID) -> bool { | ||
iid == &<IAsyncAction as windows_core::Interface>::IID | ||
} | ||
} | ||
#[repr(C)] | ||
pub struct IAsyncAction_Vtbl { | ||
pub base__: windows_core::IInspectable_Vtbl, | ||
put_Completed: usize, | ||
get_Completed: usize, | ||
pub GetResults: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, | ||
} | ||
windows_core::imp::define_interface!( | ||
IAsyncInfo, | ||
IAsyncInfo_Vtbl, | ||
0x00000036_0000_0000_c000_000000000046 | ||
); | ||
impl windows_core::RuntimeType for IAsyncInfo { | ||
const SIGNATURE: windows_core::imp::ConstBuffer = | ||
windows_core::imp::ConstBuffer::for_interface::<Self>(); | ||
} | ||
windows_core::imp::interface_hierarchy!( | ||
IAsyncInfo, | ||
windows_core::IUnknown, | ||
windows_core::IInspectable | ||
); | ||
impl IAsyncInfo { | ||
pub fn Id(&self) -> windows_core::Result<u32> { | ||
let this = self; | ||
unsafe { | ||
let mut result__ = core::mem::zeroed(); | ||
(windows_core::Interface::vtable(this).Id)( | ||
windows_core::Interface::as_raw(this), | ||
&mut result__, | ||
) | ||
.map(|| result__) | ||
} | ||
} | ||
pub fn ErrorCode(&self) -> windows_core::Result<windows_core::HRESULT> { | ||
let this = self; | ||
unsafe { | ||
let mut result__ = core::mem::zeroed(); | ||
(windows_core::Interface::vtable(this).ErrorCode)( | ||
windows_core::Interface::as_raw(this), | ||
&mut result__, | ||
) | ||
.map(|| result__) | ||
} | ||
} | ||
pub fn Cancel(&self) -> windows_core::Result<()> { | ||
let this = self; | ||
unsafe { | ||
(windows_core::Interface::vtable(this).Cancel)(windows_core::Interface::as_raw(this)) | ||
.ok() | ||
} | ||
} | ||
pub fn Close(&self) -> windows_core::Result<()> { | ||
let this = self; | ||
unsafe { | ||
(windows_core::Interface::vtable(this).Close)(windows_core::Interface::as_raw(this)) | ||
.ok() | ||
} | ||
} | ||
} | ||
impl windows_core::RuntimeName for IAsyncInfo { | ||
const NAME: &'static str = "Windows.Foundation.IAsyncInfo"; | ||
} | ||
pub trait IAsyncInfo_Impl: windows_core::IUnknownImpl { | ||
fn Id(&self) -> windows_core::Result<u32>; | ||
fn ErrorCode(&self) -> windows_core::Result<windows_core::HRESULT>; | ||
fn Cancel(&self) -> windows_core::Result<()>; | ||
fn Close(&self) -> windows_core::Result<()>; | ||
} | ||
impl IAsyncInfo_Vtbl { | ||
pub const fn new<Identity: IAsyncInfo_Impl, const OFFSET: isize>() -> Self { | ||
unsafe extern "system" fn Id<Identity: IAsyncInfo_Impl, const OFFSET: isize>( | ||
this: *mut core::ffi::c_void, | ||
result__: *mut u32, | ||
) -> windows_core::HRESULT { | ||
let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); | ||
match IAsyncInfo_Impl::Id(this) { | ||
Ok(ok__) => { | ||
result__.write(core::mem::transmute_copy(&ok__)); | ||
windows_core::HRESULT(0) | ||
} | ||
Err(err) => err.into(), | ||
} | ||
} | ||
unsafe extern "system" fn ErrorCode<Identity: IAsyncInfo_Impl, const OFFSET: isize>( | ||
this: *mut core::ffi::c_void, | ||
result__: *mut windows_core::HRESULT, | ||
) -> windows_core::HRESULT { | ||
let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); | ||
match IAsyncInfo_Impl::ErrorCode(this) { | ||
Ok(ok__) => { | ||
result__.write(core::mem::transmute_copy(&ok__)); | ||
windows_core::HRESULT(0) | ||
} | ||
Err(err) => err.into(), | ||
} | ||
} | ||
unsafe extern "system" fn Cancel<Identity: IAsyncInfo_Impl, const OFFSET: isize>( | ||
this: *mut core::ffi::c_void, | ||
) -> windows_core::HRESULT { | ||
let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); | ||
IAsyncInfo_Impl::Cancel(this).into() | ||
} | ||
unsafe extern "system" fn Close<Identity: IAsyncInfo_Impl, const OFFSET: isize>( | ||
this: *mut core::ffi::c_void, | ||
) -> windows_core::HRESULT { | ||
let this: &Identity = &*((this as *const *const ()).offset(OFFSET) as *const Identity); | ||
IAsyncInfo_Impl::Close(this).into() | ||
} | ||
Self { | ||
base__: windows_core::IInspectable_Vtbl::new::<Identity, IAsyncInfo, OFFSET>(), | ||
Id: Id::<Identity, OFFSET>, | ||
get_Status: 0, | ||
ErrorCode: ErrorCode::<Identity, OFFSET>, | ||
Cancel: Cancel::<Identity, OFFSET>, | ||
Close: Close::<Identity, OFFSET>, | ||
} | ||
} | ||
pub fn matches(iid: &windows_core::GUID) -> bool { | ||
iid == &<IAsyncInfo as windows_core::Interface>::IID | ||
} | ||
} | ||
#[repr(C)] | ||
pub struct IAsyncInfo_Vtbl { | ||
pub base__: windows_core::IInspectable_Vtbl, | ||
pub Id: unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT, | ||
get_Status: usize, | ||
pub ErrorCode: unsafe extern "system" fn( | ||
*mut core::ffi::c_void, | ||
*mut windows_core::HRESULT, | ||
) -> windows_core::HRESULT, | ||
pub Cancel: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, | ||
pub Close: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT, | ||
} |
Oops, something went wrong.