| 1 | #![allow ( |
| 2 | non_snake_case, |
| 3 | non_upper_case_globals, |
| 4 | non_camel_case_types, |
| 5 | dead_code, |
| 6 | clippy::all |
| 7 | )] |
| 8 | |
| 9 | #[inline ] |
| 10 | pub unsafe fn CoCreateGuid() -> windows_core::Result<windows_core::GUID> { |
| 11 | windows_link::link!("ole32.dll" "system" fn CoCreateGuid(pguid : *mut windows_core::GUID) -> windows_core::HRESULT); |
| 12 | unsafe { |
| 13 | let mut result__: GUID = core::mem::zeroed(); |
| 14 | CoCreateGuid(&mut result__).map(|| result__) |
| 15 | } |
| 16 | } |
| 17 | #[inline ] |
| 18 | pub unsafe fn RoGetAgileReference<P2>( |
| 19 | options: AgileReferenceOptions, |
| 20 | riid: *const windows_core::GUID, |
| 21 | punk: P2, |
| 22 | ) -> windows_core::Result<IAgileReference> |
| 23 | where |
| 24 | P2: windows_core::Param<windows_core::IUnknown>, |
| 25 | { |
| 26 | windows_link::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); |
| 27 | unsafe { |
| 28 | let mut result__: *mut c_void = core::mem::zeroed(); |
| 29 | RoGetAgileReference(options, riid, punk.param().abi(), &mut result__) |
| 30 | .and_then(|| windows_core::Type::from_abi(result__)) |
| 31 | } |
| 32 | } |
| 33 | pub const AGILEREFERENCE_DEFAULT: AgileReferenceOptions = AgileReferenceOptions(0i32); |
| 34 | #[repr (transparent)] |
| 35 | #[derive (Clone, Copy, Debug, Default, Eq, PartialEq)] |
| 36 | pub struct AgileReferenceOptions(pub i32); |
| 37 | pub const CO_E_NOTINITIALIZED: windows_core::HRESULT = windows_core::HRESULT(0x800401F0_u32 as _); |
| 38 | pub const E_INVALIDARG: windows_core::HRESULT = windows_core::HRESULT(0x80070057_u32 as _); |
| 39 | pub const E_NOINTERFACE: windows_core::HRESULT = windows_core::HRESULT(0x80004002_u32 as _); |
| 40 | pub const E_POINTER: windows_core::HRESULT = windows_core::HRESULT(0x80004003_u32 as _); |
| 41 | windows_core::imp::define_interface!( |
| 42 | IAgileObject, |
| 43 | IAgileObject_Vtbl, |
| 44 | 0x94ea2b94_e9cc_49e0_c0ff_ee64ca8f5b90 |
| 45 | ); |
| 46 | windows_core::imp::interface_hierarchy!(IAgileObject, windows_core::IUnknown); |
| 47 | #[repr (C)] |
| 48 | #[doc (hidden)] |
| 49 | pub struct IAgileObject_Vtbl { |
| 50 | pub base__: windows_core::IUnknown_Vtbl, |
| 51 | } |
| 52 | pub trait IAgileObject_Impl: windows_core::IUnknownImpl {} |
| 53 | impl IAgileObject_Vtbl { |
| 54 | pub const fn new<Identity: IAgileObject_Impl, const OFFSET: isize>() -> Self { |
| 55 | Self { |
| 56 | base__: windows_core::IUnknown_Vtbl::new::<Identity, OFFSET>(), |
| 57 | } |
| 58 | } |
| 59 | pub fn matches(iid: &windows_core::GUID) -> bool { |
| 60 | iid == &<IAgileObject as windows_core::Interface>::IID |
| 61 | } |
| 62 | } |
| 63 | impl windows_core::RuntimeName for IAgileObject {} |
| 64 | windows_core::imp::define_interface!( |
| 65 | IAgileReference, |
| 66 | IAgileReference_Vtbl, |
| 67 | 0xc03f6a43_65a4_9818_987e_e0b810d2a6f2 |
| 68 | ); |
| 69 | windows_core::imp::interface_hierarchy!(IAgileReference, windows_core::IUnknown); |
| 70 | impl IAgileReference { |
| 71 | pub unsafe fn Resolve<T>(&self) -> windows_core::Result<T> |
| 72 | where |
| 73 | T: windows_core::Interface, |
| 74 | { |
| 75 | let mut result__: *mut c_void = core::ptr::null_mut(); |
| 76 | unsafe { |
| 77 | (windows_core::Interface::vtable(self).Resolve)( |
| 78 | windows_core::Interface::as_raw(self), |
| 79 | &T::IID, |
| 80 | &mut result__, |
| 81 | ) |
| 82 | .and_then(|| windows_core::Type::from_abi(result__)) |
| 83 | } |
| 84 | } |
| 85 | } |
| 86 | #[repr (C)] |
| 87 | #[doc (hidden)] |
| 88 | pub struct IAgileReference_Vtbl { |
| 89 | pub base__: windows_core::IUnknown_Vtbl, |
| 90 | pub Resolve: unsafe extern "system" fn( |
| 91 | *mut core::ffi::c_void, |
| 92 | *const windows_core::GUID, |
| 93 | *mut *mut core::ffi::c_void, |
| 94 | ) -> windows_core::HRESULT, |
| 95 | } |
| 96 | pub trait IAgileReference_Impl: windows_core::IUnknownImpl { |
| 97 | fn Resolve( |
| 98 | &self, |
| 99 | riid: *const windows_core::GUID, |
| 100 | ppvobjectreference: *mut *mut core::ffi::c_void, |
| 101 | ) -> windows_core::Result<()>; |
| 102 | } |
| 103 | impl IAgileReference_Vtbl { |
| 104 | pub const fn new<Identity: IAgileReference_Impl, const OFFSET: isize>() -> Self { |
| 105 | unsafe extern "system" fn Resolve<Identity: IAgileReference_Impl, const OFFSET: isize>( |
| 106 | this: *mut core::ffi::c_void, |
| 107 | riid: *const windows_core::GUID, |
| 108 | ppvobjectreference: *mut *mut core::ffi::c_void, |
| 109 | ) -> windows_core::HRESULT { |
| 110 | unsafe { |
| 111 | let this: &Identity = |
| 112 | &*((this as *const *const ()).offset(OFFSET) as *const Identity); |
| 113 | IAgileReference_Impl::Resolve( |
| 114 | this, |
| 115 | core::mem::transmute_copy(&riid), |
| 116 | core::mem::transmute_copy(&ppvobjectreference), |
| 117 | ) |
| 118 | .into() |
| 119 | } |
| 120 | } |
| 121 | Self { |
| 122 | base__: windows_core::IUnknown_Vtbl::new::<Identity, OFFSET>(), |
| 123 | Resolve: Resolve::<Identity, OFFSET>, |
| 124 | } |
| 125 | } |
| 126 | pub fn matches(iid: &windows_core::GUID) -> bool { |
| 127 | iid == &<IAgileReference as windows_core::Interface>::IID |
| 128 | } |
| 129 | } |
| 130 | impl windows_core::RuntimeName for IAgileReference {} |
| 131 | windows_core::imp::define_interface!( |
| 132 | IWeakReference, |
| 133 | IWeakReference_Vtbl, |
| 134 | 0x00000037_0000_0000_c000_000000000046 |
| 135 | ); |
| 136 | windows_core::imp::interface_hierarchy!(IWeakReference, windows_core::IUnknown); |
| 137 | impl IWeakReference { |
| 138 | pub unsafe fn Resolve<T>(&self) -> windows_core::Result<T> |
| 139 | where |
| 140 | T: windows_core::Interface, |
| 141 | { |
| 142 | let mut result__: *mut c_void = core::ptr::null_mut(); |
| 143 | unsafe { |
| 144 | (windows_core::Interface::vtable(self).Resolve)( |
| 145 | windows_core::Interface::as_raw(self), |
| 146 | &T::IID, |
| 147 | &mut result__, |
| 148 | ) |
| 149 | .and_then(|| windows_core::Type::from_abi(result__)) |
| 150 | } |
| 151 | } |
| 152 | } |
| 153 | #[repr (C)] |
| 154 | #[doc (hidden)] |
| 155 | pub struct IWeakReference_Vtbl { |
| 156 | pub base__: windows_core::IUnknown_Vtbl, |
| 157 | pub Resolve: unsafe extern "system" fn( |
| 158 | *mut core::ffi::c_void, |
| 159 | *const windows_core::GUID, |
| 160 | *mut *mut core::ffi::c_void, |
| 161 | ) -> windows_core::HRESULT, |
| 162 | } |
| 163 | pub trait IWeakReference_Impl: windows_core::IUnknownImpl { |
| 164 | fn Resolve( |
| 165 | &self, |
| 166 | riid: *const windows_core::GUID, |
| 167 | objectreference: *mut *mut core::ffi::c_void, |
| 168 | ) -> windows_core::Result<()>; |
| 169 | } |
| 170 | impl IWeakReference_Vtbl { |
| 171 | pub const fn new<Identity: IWeakReference_Impl, const OFFSET: isize>() -> Self { |
| 172 | unsafe extern "system" fn Resolve<Identity: IWeakReference_Impl, const OFFSET: isize>( |
| 173 | this: *mut core::ffi::c_void, |
| 174 | riid: *const windows_core::GUID, |
| 175 | objectreference: *mut *mut core::ffi::c_void, |
| 176 | ) -> windows_core::HRESULT { |
| 177 | unsafe { |
| 178 | let this: &Identity = |
| 179 | &*((this as *const *const ()).offset(OFFSET) as *const Identity); |
| 180 | IWeakReference_Impl::Resolve( |
| 181 | this, |
| 182 | core::mem::transmute_copy(&riid), |
| 183 | core::mem::transmute_copy(&objectreference), |
| 184 | ) |
| 185 | .into() |
| 186 | } |
| 187 | } |
| 188 | Self { |
| 189 | base__: windows_core::IUnknown_Vtbl::new::<Identity, OFFSET>(), |
| 190 | Resolve: Resolve::<Identity, OFFSET>, |
| 191 | } |
| 192 | } |
| 193 | pub fn matches(iid: &windows_core::GUID) -> bool { |
| 194 | iid == &<IWeakReference as windows_core::Interface>::IID |
| 195 | } |
| 196 | } |
| 197 | impl windows_core::RuntimeName for IWeakReference {} |
| 198 | windows_core::imp::define_interface!( |
| 199 | IWeakReferenceSource, |
| 200 | IWeakReferenceSource_Vtbl, |
| 201 | 0x00000038_0000_0000_c000_000000000046 |
| 202 | ); |
| 203 | windows_core::imp::interface_hierarchy!(IWeakReferenceSource, windows_core::IUnknown); |
| 204 | impl IWeakReferenceSource { |
| 205 | pub unsafe fn GetWeakReference(&self) -> windows_core::Result<IWeakReference> { |
| 206 | unsafe { |
| 207 | let mut result__: *mut c_void = core::mem::zeroed(); |
| 208 | (windows_core::Interface::vtable(self).GetWeakReference)( |
| 209 | windows_core::Interface::as_raw(self), |
| 210 | &mut result__, |
| 211 | ) |
| 212 | .and_then(|| windows_core::Type::from_abi(result__)) |
| 213 | } |
| 214 | } |
| 215 | } |
| 216 | #[repr (C)] |
| 217 | #[doc (hidden)] |
| 218 | pub struct IWeakReferenceSource_Vtbl { |
| 219 | pub base__: windows_core::IUnknown_Vtbl, |
| 220 | pub GetWeakReference: unsafe extern "system" fn( |
| 221 | *mut core::ffi::c_void, |
| 222 | *mut *mut core::ffi::c_void, |
| 223 | ) -> windows_core::HRESULT, |
| 224 | } |
| 225 | pub trait IWeakReferenceSource_Impl: windows_core::IUnknownImpl { |
| 226 | fn GetWeakReference(&self) -> windows_core::Result<IWeakReference>; |
| 227 | } |
| 228 | impl IWeakReferenceSource_Vtbl { |
| 229 | pub const fn new<Identity: IWeakReferenceSource_Impl, const OFFSET: isize>() -> Self { |
| 230 | unsafe extern "system" fn GetWeakReference< |
| 231 | Identity: IWeakReferenceSource_Impl, |
| 232 | const OFFSET: isize, |
| 233 | >( |
| 234 | this: *mut core::ffi::c_void, |
| 235 | weakreference: *mut *mut core::ffi::c_void, |
| 236 | ) -> windows_core::HRESULT { |
| 237 | unsafe { |
| 238 | let this: &Identity = |
| 239 | &*((this as *const *const ()).offset(OFFSET) as *const Identity); |
| 240 | match IWeakReferenceSource_Impl::GetWeakReference(this) { |
| 241 | Ok(ok__) => { |
| 242 | weakreference.write(core::mem::transmute(ok__)); |
| 243 | windows_core::HRESULT(0) |
| 244 | } |
| 245 | Err(err) => err.into(), |
| 246 | } |
| 247 | } |
| 248 | } |
| 249 | Self { |
| 250 | base__: windows_core::IUnknown_Vtbl::new::<Identity, OFFSET>(), |
| 251 | GetWeakReference: GetWeakReference::<Identity, OFFSET>, |
| 252 | } |
| 253 | } |
| 254 | pub fn matches(iid: &windows_core::GUID) -> bool { |
| 255 | iid == &<IWeakReferenceSource as windows_core::Interface>::IID |
| 256 | } |
| 257 | } |
| 258 | impl windows_core::RuntimeName for IWeakReferenceSource {} |
| 259 | pub const JSCRIPT_E_CANTEXECUTE: windows_core::HRESULT = windows_core::HRESULT(0x89020001_u32 as _); |
| 260 | pub const REGDB_E_CLASSNOTREG: windows_core::HRESULT = windows_core::HRESULT(0x80040154_u32 as _); |
| 261 | pub const RPC_E_DISCONNECTED: windows_core::HRESULT = windows_core::HRESULT(0x80010108_u32 as _); |
| 262 | pub const S_OK: windows_core::HRESULT = windows_core::HRESULT(0x0_u32 as _); |
| 263 | |