| 1 |
#![allow( |
| 2 |
non_snake_case, |
| 3 |
non_upper_case_globals, |
| 4 |
non_camel_case_types, |
| 5 |
dead_code, |
| 6 |
clippy::all |
| 7 |
)] |
| 8 |
#[inline] |
| 9 |
pub unsafe fn CoCreateGuid() -> windows_core::Result<windows_core::GUID> { |
| 10 |
windows_targets::link!("ole32.dll" "system" fn CoCreateGuid(pguid : *mut windows_core::GUID) -> windows_core::HRESULT); |
| 11 |
let mut result__ = core::mem::zeroed(); |
| 12 |
CoCreateGuid(&mut result__).map(|| result__) |
| 13 |
} |
| 14 |
#[inline] |
| 15 |
pub unsafe fn RoGetAgileReference<P0>( |
| 16 |
options: AgileReferenceOptions, |
| 17 |
riid: *const windows_core::GUID, |
| 18 |
punk: P0, |
| 19 |
) -> windows_core::Result<IAgileReference> |
| 20 |
where |
| 21 |
P0: windows_core::Param<windows_core::IUnknown>, |
| 22 |
{ |
| 23 |
windows_targets::link!("ole32.dll" "system" fn RoGetAgileReference(options : AgileReferenceOptions, riid : *const windows_core::GUID, punk : * mut core::ffi::c_void, ppagilereference : *mut * mut core::ffi::c_void) -> windows_core::HRESULT); |
| 24 |
let mut result__ = core::mem::zeroed(); |
| 25 |
RoGetAgileReference(options, riid, punk.param().abi(), &mut result__) |
| 26 |
.and_then(|| windows_core::Type::from_abi(result__)) |
| 27 |
} |
| 28 |
pub const AGILEREFERENCE_DEFAULT: AgileReferenceOptions = AgileReferenceOptions(0i32); |
| 29 |
#[repr(transparent)] |
| 30 |
#[derive(PartialEq, Eq, Copy, Clone, Default)] |
| 31 |
pub struct AgileReferenceOptions(pub i32); |
| 32 |
impl windows_core::TypeKind for AgileReferenceOptions { |
| 33 |
type TypeKind = windows_core::CopyType; |
| 34 |
} |
| 35 |
impl core::fmt::Debug for AgileReferenceOptions { |
| 36 |
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { |
| 37 |
f.debug_tuple("AgileReferenceOptions") |
| 38 |
.field(&self.0) |
| 39 |
.finish() |
| 40 |
} |
| 41 |
} |
| 42 |
pub const CO_E_NOTINITIALIZED: windows_core::HRESULT = windows_core::HRESULT(0x800401F0_u32 as _); |
| 43 |
pub const E_BOUNDS: windows_core::HRESULT = windows_core::HRESULT(0x8000000B_u32 as _); |
| 44 |
pub const E_NOINTERFACE: windows_core::HRESULT = windows_core::HRESULT(0x80004002_u32 as _); |
| 45 |
pub const E_OUTOFMEMORY: windows_core::HRESULT = windows_core::HRESULT(0x8007000E_u32 as _); |
| 46 |
pub const E_POINTER: windows_core::HRESULT = windows_core::HRESULT(0x80004003_u32 as _); |
| 47 |
windows_core::imp::define_interface!( |
| 48 |
IAgileObject, |
| 49 |
IAgileObject_Vtbl, |
| 50 |
0x94ea2b94_e9cc_49e0_c0ff_ee64ca8f5b90 |
| 51 |
); |
| 52 |
impl core::ops::Deref for IAgileObject { |
| 53 |
type Target = windows_core::IUnknown; |
| 54 |
fn deref(&self) -> &Self::Target { |
| 55 |
unsafe { core::mem::transmute(self) } |
| 56 |
} |
| 57 |
} |
| 58 |
windows_core::imp::interface_hierarchy!(IAgileObject, windows_core::IUnknown); |
| 59 |
impl IAgileObject {} |
| 60 |
#[repr(C)] |
| 61 |
pub struct IAgileObject_Vtbl { |
| 62 |
pub base__: windows_core::IUnknown_Vtbl, |
| 63 |
} |
| 64 |
windows_core::imp::define_interface!( |
| 65 |
IAgileReference, |
| 66 |
IAgileReference_Vtbl, |
| 67 |
0xc03f6a43_65a4_9818_987e_e0b810d2a6f2 |
| 68 |
); |
| 69 |
impl core::ops::Deref for IAgileReference { |
| 70 |
type Target = windows_core::IUnknown; |
| 71 |
fn deref(&self) -> &Self::Target { |
| 72 |
unsafe { core::mem::transmute(self) } |
| 73 |
} |
| 74 |
} |
| 75 |
windows_core::imp::interface_hierarchy!(IAgileReference, windows_core::IUnknown); |
| 76 |
impl IAgileReference { |
| 77 |
pub unsafe fn Resolve<T>(&self) -> windows_core::Result<T> |
| 78 |
where |
| 79 |
T: windows_core::Interface, |
| 80 |
{ |
| 81 |
let mut result__ = core::ptr::null_mut(); |
| 82 |
(windows_core::Interface::vtable(self).Resolve)( |
| 83 |
windows_core::Interface::as_raw(self), |
| 84 |
&T::IID, |
| 85 |
&mut result__, |
| 86 |
) |
| 87 |
.and_then(|| windows_core::Type::from_abi(result__)) |
| 88 |
} |
| 89 |
} |
| 90 |
#[repr(C)] |
| 91 |
pub struct IAgileReference_Vtbl { |
| 92 |
pub base__: windows_core::IUnknown_Vtbl, |
| 93 |
pub Resolve: unsafe extern "system" fn( |
| 94 |
*mut core::ffi::c_void, |
| 95 |
*const windows_core::GUID, |
| 96 |
*mut *mut core::ffi::c_void, |
| 97 |
) -> windows_core::HRESULT, |
| 98 |
} |
| 99 |
windows_core::imp::define_interface!( |
| 100 |
IWeakReference, |
| 101 |
IWeakReference_Vtbl, |
| 102 |
0x00000037_0000_0000_c000_000000000046 |
| 103 |
); |
| 104 |
impl core::ops::Deref for IWeakReference { |
| 105 |
type Target = windows_core::IUnknown; |
| 106 |
fn deref(&self) -> &Self::Target { |
| 107 |
unsafe { core::mem::transmute(self) } |
| 108 |
} |
| 109 |
} |
| 110 |
windows_core::imp::interface_hierarchy!(IWeakReference, windows_core::IUnknown); |
| 111 |
impl IWeakReference { |
| 112 |
pub unsafe fn Resolve<T>(&self) -> windows_core::Result<T> |
| 113 |
where |
| 114 |
T: windows_core::Interface, |
| 115 |
{ |
| 116 |
let mut result__ = core::ptr::null_mut(); |
| 117 |
(windows_core::Interface::vtable(self).Resolve)( |
| 118 |
windows_core::Interface::as_raw(self), |
| 119 |
&T::IID, |
| 120 |
&mut result__, |
| 121 |
) |
| 122 |
.and_then(|| windows_core::Type::from_abi(result__)) |
| 123 |
} |
| 124 |
} |
| 125 |
#[repr(C)] |
| 126 |
pub struct IWeakReference_Vtbl { |
| 127 |
pub base__: windows_core::IUnknown_Vtbl, |
| 128 |
pub Resolve: unsafe extern "system" fn( |
| 129 |
*mut core::ffi::c_void, |
| 130 |
*const windows_core::GUID, |
| 131 |
*mut *mut core::ffi::c_void, |
| 132 |
) -> windows_core::HRESULT, |
| 133 |
} |
| 134 |
windows_core::imp::define_interface!( |
| 135 |
IWeakReferenceSource, |
| 136 |
IWeakReferenceSource_Vtbl, |
| 137 |
0x00000038_0000_0000_c000_000000000046 |
| 138 |
); |
| 139 |
impl core::ops::Deref for IWeakReferenceSource { |
| 140 |
type Target = windows_core::IUnknown; |
| 141 |
fn deref(&self) -> &Self::Target { |
| 142 |
unsafe { core::mem::transmute(self) } |
| 143 |
} |
| 144 |
} |
| 145 |
windows_core::imp::interface_hierarchy!(IWeakReferenceSource, windows_core::IUnknown); |
| 146 |
impl IWeakReferenceSource { |
| 147 |
pub unsafe fn GetWeakReference(&self) -> windows_core::Result<IWeakReference> { |
| 148 |
let mut result__ = core::mem::zeroed(); |
| 149 |
(windows_core::Interface::vtable(self).GetWeakReference)( |
| 150 |
windows_core::Interface::as_raw(self), |
| 151 |
&mut result__, |
| 152 |
) |
| 153 |
.and_then(|| windows_core::Type::from_abi(result__)) |
| 154 |
} |
| 155 |
} |
| 156 |
#[repr(C)] |
| 157 |
pub struct IWeakReferenceSource_Vtbl { |
| 158 |
pub base__: windows_core::IUnknown_Vtbl, |
| 159 |
pub GetWeakReference: unsafe extern "system" fn( |
| 160 |
*mut core::ffi::c_void, |
| 161 |
*mut *mut core::ffi::c_void, |
| 162 |
) -> windows_core::HRESULT, |
| 163 |
} |
| 164 |
pub const JSCRIPT_E_CANTEXECUTE: windows_core::HRESULT = windows_core::HRESULT(0x89020001_u32 as _); |
| 165 |
pub const RPC_E_DISCONNECTED: windows_core::HRESULT = windows_core::HRESULT(0x80010108_u32 as _); |
| 166 |
pub const TYPE_E_TYPEMISMATCH: windows_core::HRESULT = windows_core::HRESULT(0x80028CA0_u32 as _); |